An Introduction To Graphs

There are many types of graphs. However, certain characteristics allow us to describe graphs.

There are directed and undirected graphs. These types of graphs are useful for describing traffic flow (i.e. of some kind of a system in which movement is not bi-directional).

A good way to think about an undirected graph is to think of it as a highway between two cities where you can go back and forth. On the other hand, directed will be a one way street where you can only go one way.

Another way to think about it is Facebook. What kind of graph do you think Facebook has? Well, it has an undirected graph because when I’m connected to a friend, that friend is also connected to me. It’s not one way.

What about Twitter? Twitter is more directed because if I have my profile, people can follow me and I can follow people. But if someone follows me I don’t necessarily follow them.

So Twitter is more directed. Another way to describe graphs is the idea of weighted graphs. Also, unweighted graphs. You might be going on a trip and trying to find the most efficient way to visit sites that interest you. In that case, Google Maps would use a weighted graph to decide what is the shortest path for you to get there. And these sort of graphs are used a lot in calculating optimal paths.

Another way to describe a graph is cyclic or acyclic. When you have vertices connected in a circular fashion, it’s called a cycle. So you can go from one node to another and back to the original node. With acyclic, you can’t do that. Cyclic graphs are common in weighted graphs such as Google Maps, because most of the time, there is a way to get back.

Now that we have gained some exposure to understand a way to describe graphs, consider doing some additional research on this topic.

As always, I highly recommend the Zero to Mastery Academy to improve your own personal skills as a programmer as this is where all this information was drawn from and Andrei Neagoie, the founder and lead instructor, has been a true mentor to me.

Photo credit:

Excited to learn, and even happier to teach.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Linear Algebra Explained Through Graph Theory

Extreme Probability: Kakegurui’s Double Memory

How Much String Would You Need To Wrap The Earth?

How much string would you need to wrap the Earth? A picture of the planet earth surrounded by dotted pink cicle. A purple measuring line wraps around this circule with two question marks indicating that the circumference of the pink circle is unknown.

Pick a number between 1 and 99 …

Our Mathematical Universe

General Relativity notes pages 6 and 7.

What’s P = NP Problem?

Alan M. Turing: Decoding A Legend

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Excited to learn, and even happier to teach.

More from Medium

Algorithm Practice — getting greedy with Codeforces #790 question D) X_SUMS

Breadth-first search

Amazon’s EMR Spark

What is Encryption vs Hashing vs Encoding vs Compression?