This is a very short introduction to graph theory. We will be talking about directed and undirected graphs, the formulas to find the maximum possible edges for them and the mathematical proofs that underlie the philosophy of why they work. This is my first use of LaTeX on Mr. Geek.
Graph Theory
Graph theory is a branch of mathematics and computer science that is concerned with the modeling of relationships between objects. A graph is a network of vertices and edges. In an ideal example, a social network is a graph of connections between people. A vertex hereby would be a person and an edge the relationship between vertices. Here’s an example.
Directed Graphs
A directed graph is a graph with directions. For instance, Twitter is a directed graph. Everyone you follow doesn’t necessarily mean they follow you back. A follow can be represented as a directed edge, using an arrow. An example of a directed graph is shown below.
Maximum edges in a Directed Graph
The formula for finding the maximum number of edges in a directed graph is trivial. This would happen if every vertex in the graph is connected with every other vertex, in both directions. Although not possible in a practical social network like Twitter, it is an interesting mathematical property that we can prove by mathematical induction.
Undirected Graphs
Undirected graphs are pretty interesting. Think of Facebook. Every person you add makes it a 2 way connection by default. Facebook is an undirected graph, where the edges don’t have any orientation. Here’s an image of an undirected graph. Note the lack of arrows.
Maximum edges in a Undirected Graph
The formula for finding the maximum number of edges in an undirected graph is trivial. This would happen if every vertex is connected with every other vertex in the graph. Imagine your core family, consisting of your brother, sister, mother and father. The graph is complete because every member (node) is connected (edge) with everyone else. Like before, we will use mathematical induction to prove why the formula works.
About Ali Gajani
Hi. I am Ali Gajani. I started Mr. Geek in early 2012 as a result of my growing enthusiasm and passion for technology. I love sharing my knowledge and helping out the community by creating useful, engaging and compelling content. If you want to write for Mr. Geek, just PM me on my Facebook profile.