Graph Theory Reading
Graph Theory Reading
Fiona Abney-McPeek, Serena An, Sophia Benjamin, Arushi Mantri, Jakin Ng, Olivia Xu
July 8, 2023
1 What is a Graph?
Today, we’re going to talk about graph theory.1 Mathematical graphs are a way to show some type of relationships
between objects, and because of this, they are widely applied and come in many different variations.
Definition 1.1. A graph is informally just a bunch of dots connected with some lines. More formally, we say that a
simple graph2 G consists of two sets of information: V, called the vertex set, and E, a set of two-element subsets of
V , called the edge set, since we can say there is an edge between two vertices a and b if {a, b} is in E. We can write
G = (V, E).
This definition might seem a little nebulous, so let’s give a concrete example of a graph.
Example 1.2. In this example, we have a graph on 9 vertices (also called nodes). The vertex set is V = {a, b, c, d, e, f, g, h, i},
and the edge set is E = {{a, b}, {a, c}, {b, d}, {c, d}, {c, e}, {e, f }, {e, g}, {h, i}}. We can see that since {a, b} is in the edge
set, there is an edge connecting a and b in the visual representation of the graph.
This graph is a mathematical object, and the edges can represent some connections between different objects represented
by the vertices. For example, if each vertex represented a person in a book club, say a was Alice, b was Bartók, c was
Carly Rae Jepsen, and so on, the edges could represent friendships. So in this scenario Bartók would be friends with Alice
and Carly, but Alice and Carly wouldn’t be friends, because there is no edge connecting them. Or, the same graph could
represent locations and bus routes between them. So as we can see, a graph is a very flexible and useful concept.
Definition 1.3. Two vertices are called adjacent if they are joined by an edge. An edge is called incident to the vertices
it joins. The degree of a vertex is the number of adjacent vertices, which is the same as the number of edges that are
attached to it.
Example 1.4. For our graph above, the vertex a has degree 2, since it’s connected to b and c, and the vertex i has degree
1, since it’s only connected to h.
A vertex can have degree zero, if it is just a floating dot with no friends.
Definition 1.5. A graph is connected if you can get from any vertex to any other vertex by traveling along the edges.
Example 1.6. The graph above is not connected, because for example you can never get from vertex h to vertex g by
just traveling along the edges.
Exercise 1.7. Let the vertex set of a graph be {a, b, c, d, e} and the edge set be {{a, b}, {a, c}, {d, e}}. Draw the graph!
Is it connected?
Exercise 1.8. Prove that the sum of the degrees of all the vertices in a graph is equal to twice the number of edges.
1 In
this context, the graphs that we’ll talk about will be different from ”graphs” such as line plots or ”the graph of y = x”.
2 It’s
called a simple graph because there are more complicated variations on graphs that people might use in different scenarios. For example,
we might let edges join a vertex to itself in a ”self-loop,” or we might put arrows on edges to make a directed graph, or a digraph, or we might
allow multiple edges between two vertices. There are lots of possibilities!
1
2 Common Families of Graphs
Some graphs or types of graphs are very common, so mathematicians have come up with names for these families of
graphs.
Definition 2.1. The empty graph, as expected, doesn’t have any edges, so the edge set E is the empty set, denoted ∅.
The empty graph on five nodes looks like this:
Definition 2.3. The line graph is also exactly what it sounds like: a line! More precisely, we say the line graph on n
vertices Ln has vertex set
V = {v1 , v2 , . . . , vn }
and edge set
E = {{v1 , v2 }, {v2 , v3 }, . . . , {vn−1 , vn }}.
Here is L5 :
Exercise 2.4. For the following exercises, draw the graph on six nodes. What are the vertex sets and edge sets of each
graph? What are the degrees of each vertex? Which of the graphs are connected? Give an example of a physical scenario
each graph could represent.
2
1. The empty graph
2. The complete graph K6
3. The line graph L6
4. The cycle graph C6
Definition 2.5. A bipartite graph is a graph whose vertices can be partitioned into two disjoint sets V1 and V2 of
vertices such that every edge has exactly one vertex in V1 . and exactly one vertex in V2 .
A complete bipartite graph is a bipartite graph with m and n vertices such that every vertex in V1 is connected
with every vertex in V2 by an edge and is denoted by Km,n . Observe that Km,n has mn edges.
An example of this is the utility graph, or K3,3 , which we will investigate in more detail when we discuss planarity.
3 Trees
We will start by defining trees, a very important family of graphs that we will be exploring in this reading.
Definition 3.1. A tree is a connected graph that does not contain any cycles as subgraphs.
1 2
Exercise 3.3. Convince yourself that line graphs are trees, but empty graphs, cycle graphs, and complete graphs are not
trees.
Exercise 3.4. Convince yourself (at least intuitively) that if a tree has n vertices, it has n − 1 edges. (Bonus: prove it
rigorously!)
Definition 3.5. In a tree, a leaf is any vertex with degree 1.
3
Example 3.6. In the above graph, vertices 3, 4 and 5 are leaves.
Exercise 3.7. Convince yourself that every tree with at least 2 vertices has at least 2 leaves. (Again, bonus: prove it
rigorously!)
One thing to notice is that in the above tree we labeled the vertices. Oftentimes (and in particular, in the next section)
we consider labeled trees - i.e. trees with labeled vertices like the above graph. The reason that this matters is because it
means we sort of stop thinking about isomorphism - if two graphs are isomorphic but they have different labels, we can
say they are different labeled trees.
Example 3.8. The two graphs pictured below are isomorphic, but they are different labeled trees. For instance, the first
tree has an edge between 2 and 3, while the second does not.
3
1 2
3
1 2
Exercise 3.9. How many different labeled trees are there on 4 vertices? Can you spot which ones are isomorphic?
4 Isomorphism
In our discussion of graphs, we see that the way two people draw a graph with the same vertex set and edge set might be
different. For example, depending on how I label the vertices, I might draw C5 in the first way, but you might draw C5 in
the second way. (If the vertex set were {a, b, c, d, e}, I could have the dots going in order in a circle, but you could have
them mixed up.) However, we would still consider both graphs the same graph, since the vertex set and edge set are the
same.
In the same way, if I called the vertices {a, b, c, d}, but you called them {1, 2, 3, 4}, and our edges had the same
relationships, we would still consider them the same graph in some way. We say that they are the same up to isomorphism.
4
Definition 4.1. More formally, if we have two graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ), they are isomorphic if there is
some bijection between the vertex sets (and thus the graphs) f : V1 7→ V2 such that for any two vertices u and v in the
first graph,
{f (u), f (v)} ∈ E2 if and only if {u, v} ∈ E1 .
Basically, this bijection is a way to correspond the vertices in the first graph G1 to the vertices in the second graph
G2 . The “if” condition states that if there’s an edge between two vertices u, v in the first graph G1 , then there has to be
an edge between the corresponding vertices f (u) and f (v) in the second graph G2 , and the “only if” condition says that
if there is an edge connecting two vertices in G2 , the corresponding vertices in G1 have to be connected. So in total, “if
and only if” tells us that the two graphs have the same edges between corresponding vertices under the bijection f.
Example 4.2. In our above example of two graphs isomorphic to C4 , the bijection would be f (a) = v1 , f (b) = v2 ,
f (c) = v3 , and f (d) = v4 . Essentially, two graphs are isomorphic if you can relabel one of them to get the other one.
Exercise 4.3. Are these two graphs isomorphic? If so, label the vertices and provide a bijection. If not, why not?
5
6 Planarity
Consider three houses that each need access to water, gas, and electricity, but for safety reasons, the lines connecting
the utilities and houses cannot cross. Is it possible to connect all three houses to all three utilities without any two lines
crossing? We will learn the answer later in this section.
Definition 6.1. A planar graph is a graph that can be drawn on the plane with its edges intersecting only at vertices.
Planar graphs are important in real life, such as when constructing utilities pipelines or subway systems. In particular,
the above question of whether it is possible to connect all three houses to all three utilities can be rephrased as ”Is the
graph K3,3 planar?” since the situation can be represented by the utility graph K3,3 .
Example 6.2. K4 can be drawn with no intersecting edges, as shown by the rightmost two drawings. Thus, K4 is planar.
Exercise 6.9. Prove that the graphs in a) and b) below are nonplanar.
Exercise 6.10. Decide whether graphs a) and b) below are planar or nonplanar and then prove that your choice is correct.
Exercise 6.11. Decide whether graphs a) and b) below are planar or nonplanar and then prove that your choice is correct.
1 2
3
1 2
3
1 2
Here we see that the number of labeled trees is 33−2 = 3.
We will now try to understand why this formula is true in general. Similarly to last time, we will use a bijection to
show why it is true! The first thing to figure out is: what does nn−2 count? We start with another example, where this
time n = 4.
Exercise 7.3. Suppose we have the numbers 1, 2, 3, 4, and we want to make a sequence of length 4 − 2 = 2 out of them,
where we can repeat a number if we want. For example, valid sequences include 21 and 33 and 14,etc. How many different
sequences can we make?
We now move on to the general case.
Exercise 7.4. Suppose that we have the numbers 1, 2, . . . n, and we want to make a sequence of length n − 2 out of them,
where we can repeat a number if we want. Show that the number of different sequences we can make is nn−2 .
Thus, to show that the number of labeled trees on n vertices is nn−2 , we just need to show a bijection between the
number of labeled trees on n vertices and the number of sequences of length n − 2 made out of n numbers! Like in the last
reading, we will first give a set of instructions for taking a labeled tree on n vertices and using it to produce a sequence
of length n − 2 made of n numbers. Here are the instructions (note that they refer to the tree as “T”, and when they say
“with the minimal possible label”, they are referring to the vertex corresponding to the lowest number).
• Find the leaf (vertex with degree 1) v with the minimal possible label. Any tree with at least 1 vertex contains a
leaf.
• Record (in the code) the label that v is attached to in our tree.
• Remove v (and the adjacent edge) from T .
8
• Repeat these three steps a total of n − 2 times!
Note that at the end we get a sequence of n − 2 numbers; we call this sequence the Prüfer code of the labeled tree.
For instance, here is one example:
9
So the code we get out at the end is (8, 1, 5, 5, 1, 8).
Exercise 7.5. Consider the following labeled tree:
4 5
1 2
Using the same process, what Prüfer code do you get at the end?
So now we’ve shown one part of our bijection: we have shown that every labeled tree on n vertices gives us instructions
for how to make a sequence of n − 2 numbers made out of n total numbers. We now need to prove the other direction:
every sequence of n − 2 numbers made out of n total numbers gives us instructions for how to make a labeled tree on n
vertices. In other words, we need to show that for any sequence of n − 2 numbers made out of n total numbers, we can
figure out what labeled tree it came from.
Exercise 7.6. For n = 3, the possible sequences are (1) and (2) and (3).
1. What labeled tree did (1) come from?
So this set of instructions gives us a way to take any sequence of length n − 2 made out of n letters and use it to create
a labeled tree on n vertices. This therefore shows the other side of the bijection! Therefore the number of labeled trees on
n vertices is the same as the number of sequences of length n − 2 made out of n letters, which is equal to nn−2 , proving
Cayley’s Formula!
11
You begin at the top of the graph. At each point, you have at most two choices for how to answer. Each choice takes
you further down the graph. When you reach a point with no more choices, you stop. We now formally describe graphs
with this kind of structure, called binary trees. The definition works recursively, defining a binary tree of a given size in
terms of smaller binary trees. In general, it is not required that there are exactly two choices at each vertex. Binary trees
with this property are called full binary trees. Recall that a graph is a set of points, called vertices, and line segments
between them, called edges.
Definition 8.1. A binary tree is a member of a family of graphs defined recursively as follows:
• A nonempty binary tree consists of a root vertex v0 , a left-subtree TL , and a right subtree TR such that both TL
and TR are binary trees, and v0 has an edge to the roots of both.
Exercise 8.2. Explain in the definition above why TL is itself a binary tree. Where is its root? Why are its left and right
subtrees binary trees?
Here are the five binary trees on 3 vertices:
Exercise 8.3. Let T be a binary tree, and fix a vertex v in T . The vertices that have an edge with v and are farther
away from the root vertex of T are called the children of v. Convince yourself (or prove that) in a binary tree, each vertex
has 0, 1, or 2 children.
Definition 8.4. A full binary tree is a binary tree where each vertex has either zero or two children.
Example 8.5. Here is a full binary tree on 7 vertices:
12
Exercise 8.6. Find all full binary trees on 7 vertices. (Hint: There are 5 in total.)
Exercise 8.7. Find a bijection between the full binary trees on 7 vertices and the parenthesizations of 3 letters, i.e. the
number of valid sequences of 3 pairs of parentheses. (Before you peek at the next example, try to find a logical way of
pairing them up! This might take some thinking.)
We generalize this below.
Example 8.8. For each n, we proceed to find a bijection between the full binary trees on 2n + 1 vertices and the
parenthesizations of n + 1 letters.
If given a full binary tree:
Starting at the top node (label 0), follow the algorithm below. Label nodes in the order you visit them. For every left
child visited, write down an open parenthesis. For every right child, write down a closed parenthesis.
1. Visit as many left children as possible, without traveling right.
2. Once there are no more left children, visit the sibling of the maximum node (provided it is unvisited).
3. Repeat steps 1 and 2.
This algorithm is also known as depth-first search, and it has important applications in computer science. (Note that this
is not the only algorithm that may work! Feel free to come up with your own ways to traverse a tree.)
An example is found below.
It is left as an exercise to the reader to complete the other direction of the bijection (if given a sequence of parentheses,
how would you create the corresponding full binary tree?)
Thus, our bijection is complete! It turns out that there are Cn full binary trees on 2n + 1 vertices for each n: a
connection to the Catalan numbers!
Exercise 8.9. * Find a bijection between the full binary trees on 2n + 1 vertices and the binary trees on n vertices.
Exercise 8.10. * Find a bijection between triangulations of n-gons and either binary trees on n vertices or full binary
trees on 2n + 1 vertices. Conclude that there are Cn−2 triangulations of an n-gon.
9 References
Alexander Postnikov. 18.212 Algebraic Combinatorics. Spring 2019. Massachusetts Institute of Technology: MIT Open-
CourseWare, https://ocw.mit.edu. License: Creative Commons BY-NC-SA.
13
Richard J. Trudeau. Introduction to Graph Theory. Dover Publications, New York, 1993.
ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/resources/mit6_042jf10_chap05/
cmsc-27100.cs.uchicago.edu/2017-winter/Lectures/lecture-26.php
mathonline.wikidot.com/graphs-and-subgraphs
mathworld.wolfram.com/BipartiteGraph.html
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-sc
readings/MIT6$_$042JF10$_$chap05.pdf
http://pi.math.cornell.edu/~karola/dimex/catalan.pdf
14