An Introduction To Graph Theory: Darij Grinberg Spring 2023 Edition, August 2, 2023
An Introduction To Graph Theory: Darij Grinberg Spring 2023 Edition, August 2, 2023
An Introduction To Graph Theory: Darij Grinberg Spring 2023 Edition, August 2, 2023
Darij Grinberg*
Spring 2023 edition, August 2, 2023
arXiv:2308.04512v1 [math.HO] 2 Aug 2023
Contents
1. Preface 6
1.1. What is this? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1. Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2. Simple graphs 9
2.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2. Drawing graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3. A first fact: The Ramsey number R (3, 3) = 6 . . . . . . . . . . . . 13
2.4. Degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5. Graph isomorphism . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6. Some families of graphs . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.1. Complete and empty graphs . . . . . . . . . . . . . . . . . 26
* Drexel
University, Korman Center, 15 S 33rd Street, Office #263, Philadelphia, PA 19104
(USA). // [email protected] // http://www.cip.ifi.lmu.de/~grinberg/
1
An introduction to graph theory, version August 2, 2023 page 2
3. Multigraphs 74
3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.2. Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.3. Generalizing from simple graphs to multigraphs . . . . . . . . . . 79
3.3.1. The Ramsey number R (3, 3) . . . . . . . . . . . . . . . . . 80
3.3.2. Degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.3.3. Graph isomorphisms . . . . . . . . . . . . . . . . . . . . . . 82
3.3.4. Complete graphs, paths, cycles . . . . . . . . . . . . . . . . 83
3.3.5. Induced submultigraphs . . . . . . . . . . . . . . . . . . . . 83
3.3.6. Disjoint unions . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.3.7. Walks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.3.8. Path-connectedness . . . . . . . . . . . . . . . . . . . . . . . 85
3.3.9. G \ e, bridges and cut-edges . . . . . . . . . . . . . . . . . . 87
3.3.10. Dominating sets . . . . . . . . . . . . . . . . . . . . . . . . 88
3.3.11. Hamiltonian paths and cycles . . . . . . . . . . . . . . . . . 88
3.3.12. Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
An introduction to graph theory, version August 2, 2023 page 3
6. Colorings 273
6.1. Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
6.2. 2-colorings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.3. The Brooks theorems . . . . . . . . . . . . . . . . . . . . . . . . . . 283
6.4. Exercises on proper colorings . . . . . . . . . . . . . . . . . . . . . 284
6.5. The chromatic polynomial . . . . . . . . . . . . . . . . . . . . . . . 285
6.6. Vizing’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
6.7. Further exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
8. Matchings 307
8.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
8.2. Bipartite graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
8.3. Hall’s marriage theorem . . . . . . . . . . . . . . . . . . . . . . . . 314
8.4. König and Hall–König . . . . . . . . . . . . . . . . . . . . . . . . . 317
8.5. Systems of representatives . . . . . . . . . . . . . . . . . . . . . . . 322
8.6. Regular bipartite graphs . . . . . . . . . . . . . . . . . . . . . . . . 324
8.7. Latin squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.8. Magic matrices and the Birkhoff–von Neumann theorem . . . . . 329
8.9. Further uses of Hall’s marriage theorem . . . . . . . . . . . . . . . 335
8.10. Further exercises on matchings . . . . . . . . . . . . . . . . . . . . 337
1. Preface
1.1. What is this?
This is a course on graphs – a rather elementary concept (actually a cluster of
closely related concepts) that can be seen all over mathematics. We will discuss
several kinds of graphs (simple graphs, multigraphs, directed graphs, etc.) and
study their features and properties. In particular, we will encounter walks on
graphs, matchings of graphs, flows on networks (networks are graphs with
extra data), and take a closer look at certain types of graphs such as trees and
tournaments.
The theory of graphs goes back at least to Leonhard Euler, who in a 1736
paper [Euler36] (see [Euler53] for an English translation) solved a puzzle about
an optimal tour of the town of Königsberg. It saw some more developments in
the 19th century and straight-up exploded in the 20th; now it is one of the most
active fields of mathematics. There are now dozens (if not hundreds) textbooks
available on the subject, such as
These texts are written at different levels of sophistication, rigor and detail, are
tailored to different audiences, and (beyond the absolute basics) often cover
An introduction to graph theory, version August 2, 2023 page 7
1.1.1. Remarks
Prerequisites. These notes target a graduate-level (or advanced undergraduate)
reader. A certain mathematical sophistication and willingness to think along
(as well as invent one’s own examples) is expected. Beyond that, the main
prerequisites are the basic properties of determinants, polynomials and finite
sums. Rings and fields are occasionally mentioned, but the reader can make do
with just the most basic examples thereof (Q, R, polynomial rings and matrix
rings; also the finite field F2 in a few places). No analysis (or even calculus) is
required anywhere in this text.
Course websites. These notes were written for my Math 530 course at Drexel
University in Spring 2022. The website of this course can be found at
https://www.cip.ifi.lmu.de/~grinberg/t/22s .
An older, but similarly structured course is my Spring 2017 course at the Uni-
versity of Minnesota. Its website is available at
https://www.cip.ifi.lmu.de/~grinberg/t/17s ,
1.2. Notations
The following notations will be used throughout these notes:
• If S is a set, then the powerset of S means the set of all subsets of S. This
powerset will be denoted by P (S).
Moreover, if S is a set, and k is an integer, then Pk (S) will mean the set of
all k-element subsets of S. For instance,
2. Simple graphs
2.1. Definitions
The first type of graphs that we will consider are the “simple graphs”, named
so because of their very simple definition:
Definition 2.1.1. A simple graph is a pair (V, E), where V is a finite set, and
where E is a subset of P2 (V ).
Example 2.1.3. For any n ∈ N, we can define a simple graph Copn to be the
pair (V, E), where V = {1, 2, . . . , n} and
(b) The set E is called the edge set of G; it is denoted by E (G ). (Again, the
letter “E” in “E ( G )” is upright, and stands for a different thing than
the “E”.)
The elements of E are called the edges of G. When u and v are two
elements of V, we shall often use the notation uv for {u, v}; thus, each
edge of G has the form uv for two distinct elements u and v of V. Of
course, we always have uv = vu.
Notice that each simple graph G satisfies G = (V ( G ) , E ( G )).
(c) Two vertices u and v of G are said to be adjacent (to each other) if
uv ∈ E (that is, if uv is an edge of G). In this case, the edge uv is said
to join u with v (or connect u and v); the vertices u and v are called
the endpoints of this edge. When the graph G is not obvious from the
context, we shall often say “adjacent in G” instead of just “adjacent”.
Two vertices u and v of G are said to be non-adjacent (to each other) if
they are not adjacent (i.e., if uv ∈
/ E).
(d) Let v be a vertex of G (that is, v ∈ V). Then, the neighbors of v (in
G) are the vertices u of G that satisfy vu ∈ E. In other words, the
neighbors of v are the vertices of G that are adjacent to v.
from Example 2.1.2. Then, its vertex set and its edge set are
(using our notation uv for {u, v}). The vertices 1 and 3 are adjacent (since
13 ∈ E ( G )), but the vertices 1 and 2 are not (since 12 ∈
/ E (G )). The neighbors
of 1 are 3 and 4. The endpoints of the edge 34 are 3 and 4.
An introduction to graph theory, version August 2, 2023 page 11
1 2 3
.
This is (in a sense) the simplest way to draw this graph: The edges are
represented by straight lines. But we can draw it in several other ways as
well – e.g., as follows:
1 3 2
.
Here, we have placed the points representing the vertices 1, 2, 3 differently.
As a consequence, we were not able to draw the edge 12 as a straight line,
because it would then have overlapped with the vertex 3, which would make
the graph ambiguous (the edge 12 could be mistaken for two edges 13 and
32).
Here are three further drawings of the same graph ({1, 2, 3} , {12, 23}):
2 2
1 3 2 .
1 3 1 3
(b) Consider the 5-th coprimality graph Cop5 defined in Example 2.1.3.
An introduction to graph theory, version August 2, 2023 page 12
2
3
4
5
.
Here is another way to draw the same graph Cop5 , with fewer intersections
between edges:
2
3
4
5
.
By appropriately repositioning the points corresponding to the five vertices
of Cop5 , we can actually get rid of all intersections and make all the edges
straight (as opposed to curved). Can you find out how?
(c) Let us draw one further graph: the simple graph
({1, 2, 3, 4, 5} , P2 ({1, 2, 3, 4, 5})). This is the simple graph whose ver-
tices are 1, 2, 3, 4, 5, and whose edges are all possible two-element sets
consisting of its vertices (i.e., each pair of two distinct vertices is adjacent).
We shall later call this graph the “complete graph K5 ”. Here is a simple way
to draw this graph:
2
3
4
5
.
This drawing is useful for many purposes; for example, it makes the ab-
stract symmetry of this graph (i.e., the fact that, roughly speaking, its vertices
An introduction to graph theory, version August 2, 2023 page 13
3
1
4
5
.
In this drawing, we have only one intersection between two curves left. Can
we get rid of all intersections?
This is a question of topology, not of combinatorics, since it really is about
curves in the plane rather than about finite sets and graphs. The answer is
“no”. (That is, no matter how you draw this graph in the plane, you will
always have at least one pair of curves intersect.) This is a classical result
(one of the first theorems in the theory of planar graphs), and proofs of it
can be found in various textbooks (e.g., [FriFri98, Theorem 4.1.2], which is
generally a good introduction to planar graph theory even if it uses termi-
nology somewhat different from ours). Note that any proof must use some
analysis or topology, since the result relies on the notion of a (continuous)
curve in the plane (if curves were allowed to be non-continuous, then they
could “jump over” one another, so they could easily avoid intersecting!).
In other words, Proposition 2.3.1 says that if a graph G has at least 6 vertices,
An introduction to graph theory, version August 2, 2023 page 14
then we can either find three distinct vertices that are mutually adjacent2 or find
three distinct vertices that are mutually non-adjacent (i.e., no two of them are
adjacent), or both. Often, this is restated as follows: “In any group of at least
six people, you can always find three that are (pairwise) friends to each other,
or three no two of whom are friends” (provided that friendship is a symmetric
relation).
We will give some examples in a moment, but first let us introduce some
convenient terminology:
Definition 2.3.2. Let G be a simple graph.
Thus, Proposition 2.3.1 says that every simple graph with at least 6 vertices
contains a triangle or an anti-triangle (or both).
Example 2.3.3. Let us show two examples of graphs G to which Proposi-
tion 2.3.1 applies, as well as an example to which it does not:
V = {1, 2, 3, 4, 5, 6} and
E = {{1, 2} , {2, 3} , {3, 4} , {4, 5} , {5, 6} , {6, 1}} .
3 2
4 1
5 6
.
V = {1, 2, 3, 4, 5, 6} and
E = {{1, 2} , {2, 3} , {3, 4} , {4, 5} , {5, 6} , {6, 1} , {1, 3} , {4, 6}} .
(This graph can be drawn in such a way as to look like a hexagon with
two extra diagonals:
3 2
4 1
5 6
.
V = {1, 2, 3, 4, 5} and
E = {{1, 2} , {2, 3} , {3, 4} , {4, 5} , {5, 1}} .
2
3
4
5
.
) Proposition 2.3.1 says nothing about this graph, since this graph does
not satisfy the assumption of Proposition 2.3.1 (in fact, its number of
vertices |V (G )| fails to be ≥ 6). By itself, this does not yield that the
claim of Proposition 2.3.1 is false for this graph. However, it is easy
to check that the claim actually is false for this graph: It has neither a
triangle nor an anti-triangle.
Remark 2.3.4. Proposition 2.3.1 could also be proved by brute force as well
(using a computer). Indeed, it clearly suffices to prove it for all simple graphs
with 6 vertices (as opposed to ≥ 6 vertices), because if a graph has more than
6 vertices, then we can just throw away some of them until we have only 6
left. However, there are only finitely many simple graphs with 6 vertices (up
to relabeling of their vertices), and the validity of Proposition 2.3.1 can be
checked for each of them. This is, of course, cumbersome (even a computer
would take a moment checking all the 215 possible graphs for triangles and
anti-triangles) and unenlightening.
Proposition 2.3.1 is the first result in a field of graph theory known as Ramsey
theory. I shall not dwell on this field in this course, but let me make a few more
remarks. The first step beyond Proposition 2.3.1 is the following generalization:
(We are only considering the cases r ≤ s, since it is easy to see that R (r, s) =
R (s, r ) for all r and s. Also, the trivial values R (1, s) = 1 and R (2, s) = s + 1
for s ≥ 2 are omitted.) The Ramsey number R (5, 5) is still unknown (although
it is known that 43 ≤ R (5, 5) ≤ 48).
Proposition 2.3.5 can be further generalized to a result called Ramsey’s theo-
rem. The idea behind the generalization is to slightly change the point of view,
and replace the simple graph G by a complete graph (i.e., a simple graph in
which every two distinct vertices are adjacent) whose edges are colored in two
colors (say, blue and red). This is a completely equivalent concept, because
the concepts of “adjacent” and “non-adjacent” in G can be identified with the
concepts of “adjacent through a blue edge” (i.e., the edge connecting them is
colored blue) and “adjacent through a red edge”, respectively. Statements 1
and 2 then turn into “there exist r distinct vertices that are mutually adjacent
through blue edges” and “there exist s distinct vertices that are mutually adja-
cent through red edges”, respectively. From this point of view, it is only logical
4 Indeed, we saw in Example 2.3.3 (c) that 5 vertices would not suffice.
An introduction to graph theory, version August 2, 2023 page 18
to generalize Proposition 2.3.5 further to the case when the edges of a complete
graph are colored in k (rather than two) colors. The corresponding generaliza-
tion is known as Ramsey’s theorem. We refer to the well-written Wikipedia
page https://en.wikipedia.org/wiki/Ramsey’s_theorem for a treatment of
this generalization with proof, as well as a table of known Ramsey numbers
R (r, s) and a self-contained (if somewhat terse) proof of Proposition 2.3.5. Ram-
sey’s theorem can be generalized and varied further; this usually goes under
the name “Ramsey theory”. For elementary introductions, see the Cut-the-knot
page http://www.cut-the-knot.org/Curriculum/Combinatorics/ThreeOrThree.shtml
, the above-mentioned Wikipedia article, as well as the texts by Harju [Harju14],
Bollobas [Bollob98] and West [West01].
There is one more direction in which Proposition 2.3.1 can be improved a bit:
A graph G with at least 6 vertices has not only one triangle or anti-triangle, but
at least two of them (this can include having one triangle and one anti-triangle).
Proving this makes for a nice exercise:
2.4. Degrees
The degree of a vertex in a simple graph just counts how many edges contain
this vertex:
(These equalities are pretty easy to check: Each edge e ∈ E that contains v
contains exactly one neighbor of v, and conversely, each neighbor of v belongs
to exactly one edge that contains v. However, these equalities are specific to
simple graphs, and won’t hold any more once we move on to multigraphs.)
For example, in the graph
3 2
4 1 5
,
Proposition 2.4.3 (Euler 1736). Let G be a simple graph. Then, the sum of
the degrees of all vertices of G equals twice the number of edges of G. In
other words,
∑ deg v = 2 · |E (G)| .
v ∈V( G )
Since these two results must be equal (because they both equal N), we thus
see that ∑ deg v = 2 · | E|. But this is the claim of Proposition 2.4.3.
v ∈V
Proposition 2.4.5. Let G be a simple graph with at least two vertices. Then,
there exist two distinct vertices v and w of G that have the same degree.
Proof. Assume the contrary. So the degrees of all n vertices of G are distinct,
where n = |V (G )|.
In other words, the map
deg : V ( G ) → {0, 1, . . . , n − 1} ,
v 7→ deg v
is injective. But this is a map between two finite sets of the same size (n). When
such a map is injective, it has to be bijective (by the pigeonhole principle).
Therefore, in particular, it takes both 0 and n − 1 as values.
In other words, there are a vertex u with degree 0 and a vertex v with degree
n − 1. Are these two vertices adjacent or not? Yes because of deg v = n − 1; no
because of deg u = 0. Contradiction!
(Fine print: The two vertices u and v must be distinct, since 0 6= n − 1. It is
here that we are using the “at least two vertices” assumption!)
V = {1, 2, 3, 4, 5, 6} ;
E = {12, 23, 34, 45, 56, 61, 14, 25, 36} .
Here is a drawing:
3 2
4 1
5 6
.
This graph has no triangle (which, by the way, is easy to verify without
checking all possibilities: just observe that every edge of G joins two vertices
of different parity, but a triangle would necessarily have two vertices of equal
parity). Thus, by the contrapositive of Mantel’s theorem, it satisfies e ≤ n2 /4
with n = 6 and e = 9. This is indeed true because 9 = 62 /4. But this also
entails that if we add any further edge to G, then we obtain a triangle.
w 4
5
.
• How many red edges can there be? I claim that there are at most n − 2.
Indeed, each vertex other than v and w is connected to at most one of v
and w by a red edge, since otherwise it would form a triangle with v and
w.
• How many blue edges can there be? The vertices other than v and w,
along with the blue edges that join them, form a graph with n − 2 vertices;
this graph has no triangles (since G has no triangles). By the induction
hypothesis, however, if this graph had more than (n − 2)2 /4 edges, then
it would have a triangle. Thus, it has ≤ (n − 2)2 /4 edges. In other words,
there are ≤ (n − 2)2 /4 blue edges.
≤ 1 + (n − 2) + (n − 2)2 /4 = n2 /4.
In other words, e ≤ n2 /4. This contradicts e > n2 /4. This is the contradiction
we were looking for, so the induction is complete.
Quick question: What about equality? Can a graph with n vertices and
exactly n2 /4 edges have no triangles? Yes (for even n). Indeed, for any even n,
we can take the graph
(keep in mind that ij means the 2-element set {i, j} here, notthe product i · j).
We can also do this for odd n, and obtain a graph with n2 − 1 /4 edges (which
is as close to n2 /4 as we can get when n is odd – after all, the number of edges
has to be an integer). So the bound in Mantel’s theorem is optimal (as far as
integers are concerned).
The following exercise can be regarded as a “mirror version” of Mantel’s
theorem:
Exercise 2.2. Let G be a simple graph with n vertices and e edges. Assume
that e < n (n − 2) /4. Prove that G has an anti-triangle (i.e., three distinct
vertices that are pairwise non-adjacent).
[Solution: This is Exercise 2 on homework set #1 from my Spring 2017
course; see the course page for solutions.]
r − 1 n2
e> · .
r 2
Then, there exist r + 1 distinct vertices of G that are mutually adjacent.
Exercise 2.4. Let G be a simple graph with n vertices and k edges, where
k
n > 0. Prove that G has at least 4k − n2 triangles.
3n
[Hint: First argue that for any edge vw of G, the total number of triangles
that contain v and w is at least deg v + deg w − n. Then, use the inequal-
ity n a21 + a22 + · · · + a2n ≥ (a1 + a2 + · · · + an )2 , which holds for any n real
numbers a1 , a2 , . . . , an . (This is a particular case of the Cauchy–Schwarz in-
equality or the Chebyshev inequality or the Jensen inequality – pick your
favorite!)]
Remark 2.4.11. Exercise 2.6 has a converse (the so-called Erdös–Gallai theo-
rem): If d1 , d2 , . . . , dn are n nonnegative integers such that d1 + d2 + · · · + dn
is even and such that d1 ≥ d2 ≥ · · · ≥ dn and such that each k ∈ {1, 2, . . . , n}
satisfies
k n
∑ di ≤ k ( k − 1) + ∑ min {di , k} ,
i =1 i = k+1
then there exists a simple graph with vertex set {1, 2, . . . , n} whose vertices
have degrees d1 , d2 , . . . , dn .
An introduction to graph theory, version August 2, 2023 page 25
1 2 3 1 3 2
and .
1 2 3 1 3 2
and
are isomorphic, because the bijection between their vertex sets that sends
1, 2, 3 to 1, 3, 2 is an isomorphism. Another isomorphism between the
same two graphs sends 1, 2, 3 to 2, 3, 1.
3 2
1 2 3
4 1
5 6 A B C
and
are isomorphic, because the bijection between their vertex sets that sends
1, 2, 3, 4, 5, 6 to 1, B, 3, A, 2, C is an isomorphism.
An introduction to graph theory, version August 2, 2023 page 26
Here are some basic properties of isomorphisms (the proofs are straightfor-
ward):
Proposition 2.5.2. Let G and H be two graphs. The inverse of a graph iso-
morphism φ from G to H is a graph isomorphism from H to G.
Proposition 2.5.4. Let G and H be two simple graphs, and φ a graph isomor-
phism from G to H. Then:
Proposition 2.5.5. Let G be a simple graph. Let S be a finite set such that
|S| = |V ( G)|. Then, there exists a simple graph H that is isomorphic to G
and has vertex set V ( H ) = S.
Proof. Straightforward.
(a) The complete graph on V means the simple graph (V, P2 (V )). It is
the simple graph with vertex set V in which every two distinct vertices
are adjacent.
If V = {1, 2, . . . , n} for some n ∈ N, then the complete graph on V is
denoted Kn .
(b) The empty graph on V means the simple graph (V, ∅). It is the simple
graph with vertex set V and no edges.
The following pictures show the complete graph and the empty graph on the
set {1, 2, 3, 4, 5}:
2 2
3 3
1 1
4 4
5 5
K0 K1 K2 K3 K4
1 2
2
3 1
1
1 2 3 4
Question: Given two finite sets V and W, what are the isomorphisms from
the complete graph on V to the complete graph on W ?
Answer: If |V | 6= |W |, then there are none. If |V | = |W |, then any bijection
from V to W is an isomorphism. The same holds for empty graphs.
This graph has n vertices and n − 1 edges (unless n = 0, in which case it has
0 edges).
Definition 2.6.3. For each n > 1, we define the n-th cycle graph Cn to be the
simple graph
This graph has n vertices and n edges (unless n = 2, in which case it has 1
edge only). (We will later modify the definition of the 2-nd cycle graph C2
somewhat, in order to force it to have 2 edges. But we cannot do this yet,
since a simple graph with 2 vertices cannot have 2 edges.)
The following pictures show the path graph P5 and the cycle graph C5 :
2 2
3 3
1 1
4 4
5 5
Of course, it is more common to draw the path graph stretched out horizontally:
1 2 3 4 5
An introduction to graph theory, version August 2, 2023 page 29
Note that the cycle graph C3 is identical with the complete graph K3 .
Question: What are the graph isomorphisms from Pn to itself?
Answer: One such isomorphism is the identity map id : {1, 2, . . . , n} →
{1, 2, . . . , n}. Another is the “reversal” map
{1, 2, . . . , n} → {1, 2, . . . , n} ,
i 7→ n + 1 − i.
{1, 2, . . . , n} → {1, 2, . . . , n} ,
i 7→ (i + k reduced modulo n to an element of {1, 2, . . . , n}) .
Thus we get n rotations (one for each k ∈ {1, 2, . . . , n}); all of them are graph
isomorphisms.
There are also the reflections, which are the maps
{1, 2, . . . , n} → {1, 2, . . . , n} ,
i 7→ (k − i reduced modulo n to an element of {1, 2, . . . , n})
for k ∈ Z. There are n of them, too, and they are isomorphisms as well.
Altogether we obtain 2n isomorphisms (for n > 2), and there are no others.
(The group they form is the n-th dihedral group.)
Example 2.6.4. If S is a finite set, and if k ∈ N, then we define the k-th Kneser
graph of S to be the simple graph
The vertices of KS,k are the k-element subsets of S, and two such subsets are
adjacent if they are disjoint.
An introduction to graph theory, version August 2, 2023 page 30
The graph K{1,2,...,5},2 is called the Petersen graph; here is how it looks like:
{1, 4}
{2, 5}
{2, 3}
{3, 4}
{1, 2} {3, 5}
{4, 5}
{1, 5}
{1, 3}
{2, 4}
2.7. Subgraphs
Definition 2.7.1. Let G = (V, E) be a simple graph.
(a) A subgraph of G means a simple graph of the form H = (W, F), where
W ⊆ V and F ⊆ E. In other words, a subgraph of G means a simple
graph whose vertices are vertices of G and whose edges are edges of G.
(c) Assume that n > 3. Is Cn−1 a subgraph of Cn ? No, because the edge
(n − 1) 1 belongs to Cn−1 but not to Cn .
Proof. This follows from Proposition 2.7.2, since the completeness of H means
that each 2-element subset {u, v} of the vertex set of H is an edge of H.
We note that triangles in a graph can be characterized in terms of complete
subgraphs. Namely, a triangle “is” the same as a complete subgraph (or, equiv-
alently, induced complete subgraph) with three vertices:
Remark 2.7.6. The situations in Exercise 2.8 are, in a sense, exceptional. Typ-
ically, the degrees of the vertices of a graph do not uniquely determine the
graph up to isomorphism. For example, the two graphs
3 2 2
1 4
4 1 3
5 6 6
and
are not isomorphic5 , but have the same degrees (namely, each vertex of either
graph has degree 3).
5 The easiest way to see this is to observe that the second graph has a triangle (i.e., three
distinct vertices that are mutually adjacent), while the first graph does not.
An introduction to graph theory, version August 2, 2023 page 33
2
2 3
1 4
3
(which makes no sense, because there are two points labelled 1 in this picture,
but a graph can have only one vertex 1), but rather should be
(1, 2)
(2, 2) (2, 3)
(1, 1)
(2, 1) (2, 4)
(1, 3)
.
So here is the formal definition:
Definition 2.8.1. Let G1 , G2 , . . . , Gk be simple graphs, where Gi = (Vi , Ei ) for
each i ∈ {1, 2, . . . , k}. The disjoint union of these k graphs G1 , G2 , . . . , Gk is
defined to be the simple graph (V, E), where
2.9.1. Definitions
Imagine a graph as a road network, where each vertex is a town and each edge
is a (bidirectional) road. By successively walking along several edges, you can
often get from a town to another even if they are not adjacent. This is made
formal in the concept of a “walk”:
Definition 2.9.1. Let G be a simple graph. Then:
(c) A path (in G) means a walk (in G) whose vertices are distinct. In other
words, a path means a walk (v0 , v1 , . . . , vk ) such that v0 , v1 , . . . , vk are
distinct.
(d) Let p and q be two vertices of G. A walk from p to q means a walk that
starts at p and ends at q. A path from p to q means a path that starts at
p and ends at q.
3 2
4 1
5 6
Then:
• A path is a walk whose vertices are distinct (i.e., each vertex appears at
most once in the walk).
Exercise 2.9. Let G be a simple graph. Let w be a path in G. Prove that the
edges of w are distinct. (This may look obvious when you can point to a
picture; but we ask you to give a rigorous proof!)
[Solution: This is Exercise 3 on homework set #1 from my Spring 2017
course; see the course page for solutions.]
An introduction to graph theory, version August 2, 2023 page 36
( a0 , a1 , . . . , ak , b1 , b2 , . . . , bℓ ) = (a0 , a1 , . . . , ak−1 , b0 , b1 , . . . , bℓ )
= (a0 , a1 , . . . , ak−1 , v, b1 , b2 , . . . , bℓ )
Proof. Since a is not a path, two of its vertices are equal. In other words, there
exist i < j such that ai = a j . Consider these i and j. Now, consider the tuple
a , a , . . . , ai , a j +1 , a j +2 , . . . , ak
|0 1{z } | {z }
the first i +1 vertices of a the last k− j vertices of a
(this is just a with the part between ai and a j cut out). This tuple is a walk from u
i + (k − j) < j + (k − j) = k. So we have found a walk
to v, and its length is |{z}
<j
from u to v whose length is smaller than k. This proves the proposition.
An introduction to graph theory, version August 2, 2023 page 37
Proof. Proposition 2.9.5 says that if there is a walk from u to v that is not a path,
then there is a walk from u to v having shorter length. Apply this repeatedly,
until you get a path. (You will eventually get a path, because the length cannot
keep decreasing forever.)
Corollary 2.9.7 reveals that Questions 1 and 2 are equivalent (indeed, the
existence of a walk from u to v entails the existence of a path from u to v
by Corollary 2.9.7, whereas the converse is obvious). Question 3 is clearly a
stronger version of Question 2 (in the sense that any answer to Question 3 will
automatically answer Question 2 as well).
With a bit more thought, it is easily seen that Question 4 is a stronger version
of Question 3. Indeed, Corollary 2.9.7 shows that a shortest walk from u to v (if
it exists) must also be a shortest path from u to v. However, any path from u to
v must have length ≤ n − 1, where n is the number of vertices of G (since a path
An introduction to graph theory, version August 2, 2023 page 38
of length k has k + 1 distinct vertices, but G has only n vertices to spare). Hence,
if there is no walk of length ≤ n − 1 from u to v, then there is no path from u to
v whatsoever. Thus, if we answer Question 4 for all values k ∈ {0, 1, . . . , n − 1},
then we obtain either a shortest path from u to v (by taking the smallest k for
which the answer is positive, and then picking the resulting walk, which must
be a shortest path by what we previously said), or proof positive that no path
from u to v exists (if the answer for each k ∈ {0, 1, . . . , n − 1} is negative).
Thus, answering Question 4 will yield answers to Questions 1, 2 and 3.
Let us now outline a way how Question 4 can be answered using a recursive
algorithm. Specifically, we recurse on k. The base case (k = 0) is easy: A walk
from u to v having length 0 exists if u = v and does not exist otherwise. The
interesting part is the recursion step: Assume that the integer k is positive, and
that we already know how to answer Question 4 for k − 1 instead of k. Now,
let us answer it for k. To do so, we observe that any walk from u to v having
length k must have the form (u, . . . , w, v), where the penultimate vertex w is
some neighbor of v. Moreover, if we remove the last vertex v from our walk
(u, . . . , w, v), then we obtain a walk (u, . . . , w) of length k − 1. Hence, we can
find a walk from u to v having length k as follows:
Thus, a simple graph G is connected if and only if it has at least one compo-
nent (i.e., it has at least one vertex) and it has at most one component (i.e., each
two of its vertices are path-connected).
Example 2.9.13. Let G be the graph with vertex set {1, 2, . . . , 9} and such
that two vertices i and j are adjacent if and only if |i − j| = 3. What are the
components of G ?
The graph G looks like this:
3
4
2
5
1
6
9
7
8
.
This looks like a jumbled mess, so you might think that all vertices are mu-
tually path-connected. But this is not the case, because edges that cross in
a drawing do not necessarily have endpoints in common. Walks can only
move from one edge to another at a common endpoint. Thus, there are
much fewer walks than the picture might suggest. We have 1 ≃ G 4 ≃ G 7
and 2 ≃ G 5 ≃ G 8 and 3 ≃ G 6 ≃ G 9, but there are no further ≃ G -relations. In
fact, two vertices of G are adjacent only if they are congruent modulo 3 (as
numbers), and therefore you cannot move from one modulo-3 congruence
class to another by walking along edges of G. So the components of G are
{1, 4, 7} and {2, 5, 8} and {3, 6, 9}. The graph G is not connected.
Example 2.9.14. Let G be the graph with vertex set {1, 2, . . . , 9} and such that
two vertices i and j are adjacent if and only if |i − j| = 6. This graph looks
An introduction to graph theory, version August 2, 2023 page 41
like this:
3
4
2
5
1
6
9
7
8
.
What are the components of G ? They are {1, 7} and {2, 8} and {3, 9} and
{4} and {5} and {6}. Note that three of these six components are singleton
sets. The graph G is not connected.
Example 2.9.15. Let G be the graph with vertex set {1, 2, . . . , 9} and such that
two vertices i and j are adjacent if and only if |i − j| = 3 or |i − j| = 4. This
graph looks like this:
3
4
2
5
1
6
9
7
8
.
(1, 4, 7, 3, 6, 9, 5, 2, 5, 8) .
This walk traverses every vertex of G; thus, any two vertices of G are path-
connected. Hence, G has only one component, namely {1, 2, . . . , 9}. Thus, G
is connected.
Example 2.9.17. The empty graph on a finite set V has |V | many components
(those are the singleton sets {v} for v ∈ V). Thus, it is connected if and only
if |V | = 1.
An introduction to graph theory, version August 2, 2023 page 42
Proof. Let G [C] be this induced subgraph. We need to show that G [C] is con-
nected. In other words, we need to show that G [ C] has exactly 1 component.
Clearly, G [ C] has at least one vertex (since C is a component, i.e., an equiv-
alence class of ≃ G , but equivalence classes are always nonempty), thus has at
least 1 component. So we only need to show that G [C] has no more than 1
component. In other words, we need to show that any two vertices of G [ C] are
path-connected in G [C].
So let u and v be two vertices of G [C]. Then, u, v ∈ C, and therefore u ≃ G
v (since C is a component of G). In other words, there exists a walk w =
(w0 , w1 , . . . , wk ) from u to v in G. We shall now prove that this walk w is
actually a walk of G [C]. In other words, we shall prove that all vertices of w
belong to C.
But this is easy: If wi is a vertex of w, then (w0 , w1 , . . . , wi ) is a walk from
u to wi in G, and therefore we have u ≃ G wi , so that wi belongs to the same
component of G as u; but that component is C. Thus, we have shown that
each vertex wi of w belongs to C. Therefore, w is a walk of the graph G [C].
Consequently, it shows that u ≃ G [C ] v.
We have now proved that u ≃ G [C ] v for any two vertices u and v of G [C].
Hence, the relation ≃ G [C ] has no more than 1 equivalence class. In other words,
the graph G [C] has no more than 1 component. This completes our proof.
In the following proposition, we are using the notation G [S] for the induced
subgraph of a simple graph G on a subset S of its vertex set.
An introduction to graph theory, version August 2, 2023 page 43
Exercise 2.12. Let V be a nonempty finite set. Let G and H be two simple
graphs such that V ( G ) = V ( H ) = V. Assume that for each u ∈ V and
v ∈ V, there exists a path from u to v in G or a path from u to v in H. Prove
that at least one of the graphs G and H is connected.
[Solution: This is Exercise 8 on homework set #1 from my Spring 2017
course; see the course page for solutions.]
vertices u and v in V are adjacent in G if and only if they are not adjacent in
G.)
Prove that at least one of the following two statements holds:
The following exercise is not explicitly concerned with connectedness and com-
ponents, but it might help to think about components to solve it (although there
are solutions that do not use them):
Exercise 2.15. Let G be a simple graph with n vertices. Assume that each
vertex of G has at least one neighbor.
A matching of G shall mean a set F of edges of G such that no two edges
in F have a vertex in common. Let m be the largest size of a matching of G.
An edge cover of G shall mean a set F of edges of G such that each vertex
of G is contained in at least one edge e ∈ F. Let c be the smallest size of an
edge cover of G.
Prove that c + m = n.
(a) A closed walk of G means a walk whose first vertex is identical with
its last vertex. In other words, it means a walk (w0 , w1 , . . . , wk ) with
w0 = wk . Sometimes, closed walks are also known as circuits (but
many authors use this latter word for something slightly different).
This graph looks as follows (we have already seen it in Example 2.9.2):
3 2
4 1
5 6
Then:
• The sequences (1) and (1, 2, 1) are closed walks, but not cycles of G
(since they fail the k ≥ 3 condition).
Authors have different opinions about whether (1, 2, 3, 1) and (1, 3, 2, 1) count
as different cycles. Fortunately, this matters only if you want to count cycles,
but not for the existence or non-existence of cycles.
We have now defined paths (in an arbitrary graph) and also path graphs Pn ;
we have also defined cycles (in an arbitrary graph) and also cycle graphs Cn .
Besides their similar names, are they related? The answer is “yes”:
Proof. Straightforward.
Certain graphs contain cycles; other graphs don’t. For instance, the complete
graph Kn contains a lot of cycles (when n ≥ 3), whereas the path graph Pn
contains none. Let us try to find some criteria for when a graph can and when
it cannot have cycles7 :
Proof of Proposition 2.10.4. We assume that w is not a path. We must then show
that w contains a cycle.
Write w as w = (w0 , w1 , . . . , wk ). Since w is not a path, two of the vertices
w0 , w1, . . . , wk must be equal. In other words, there exists a pair (i, j) of integers
i and j with i < j and wi = w j . Among all such pairs, we pick one with
minimum difference j − i. We shall show that the walk wi , wi +1, . . . , w j is a
cycle.
First, this walk is clearly a closed walk (since wi = w j ). It thus remains to
show that j − i ≥ 3 and that the vertices wi , wi +1, . . . , w j−1 are distinct. The
distinctness of wi , wi +1, . . . , w j−1 follows from the minimality of j − i. To show
that j − i ≥ 3, we assume the contrary. Thus, j − i is either 1 or 2 (since i < j).
But j − i cannot be 1, since the endpoints of an edge cannot be equal (since our
graph is a simple graph). So j − i must be 2. Thus, wi = wi +2. Therefore, the
two edges wi wi +1 and wi +1 wi +2 are identical. But this contradicts the fact that
no two adjacent edges of w are identical. Contradiction, qed.
Corollary 2.10.6. Let G be a simple graph. Assume that G has a closed walk
w of length > 0 such that no two adjacent edges of w are identical. Then, G
has a cycle.
Proof. More generally, we shall prove this theorem with the word “path” re-
placed by “backtrack-free walk”, where a “backtrack-free walk” means a walk
w such that no two adjacent edges of w are identical. This is a generalization
of the theorem, since every path is a backtrack-free walk (why?).
So we claim the following:
( p 0 , p 1 , . . . , p a − 1 , p a = q b , q b − 1 , . . . , q0 ) .
(a) Prove that if G has a closed walk of odd length, then G has a cycle of
odd length.
(b) Is it true that if G has a closed walk of length not divisible by 3, then G
has a cycle of length not divisible by 3 ?
(c) Does the answer to part (b) change if we replace “walk” by “non-
backtracking walk”? (A walk w with edges e1 , e2 , . . . , ek (in this or-
der) is said to be non-backtracking if each i ∈ {1, 2, . . . , k − 1} satisfies
ei 6= ei +1 .)
(d) A trail (in a graph) means a walk whose edges are distinct (but whose
vertices are not necessarily distinct). Does the answer to part (b) change
if we replace “walk” by “trail”?
Proposition 2.11.1. Let G be a simple graph with at least one vertex. Let
d > 1 be an integer. Assume that each vertex of G has degree ≥ d. Then, G
has a cycle of length ≥ d + 1.
p′ := (u, v0 , v1 , . . . , vm ) .
v0 v1 v2 ··· vi = u ···
c := (u, v0 , v1 , . . . , vi ) .
2.12. Bridges
One question that will later prove crucial is: What happens to a graph if we
remove a single edge from it? Let us first define a notation for this:
Definition 2.12.1. Let G = (V, E) be a simple graph. Let e be an edge of G.
Then, G \ e will mean the graph obtained from G by removing this edge e.
In other words,
G \ e := (V, E \ {e}) .
a (1)
(where we have labeled the edges a and b for further reference). This graph
has 4 components. The edge a is an edge of a cycle of G, whereas the edge
An introduction to graph theory, version August 2, 2023 page 51
Proof of Theorem 2.12.2. We will only sketch the proof. For details, see [21f6,
§6.7].
Let u and v be the endpoints of e, so that e = uv. Note that (u, v) is a path of
G, and thus we have u ≃ G v.
(a) Assume that e is an edge of some cycle of G. Then, if you remove e from
this cycle, then you still have a path from u to v left (as the remaining edges of
the cycle function as a detour), and this path is a path of G \ e. Thus, u ≃ G \e v.
Now, we must show that the components of G \ e are precisely the compo-
nents of G. This will clearly follow if we can show that the relation ≃ G \e is
precisely the relation ≃ G (because the components of a graph are the equiva-
lence classes of its ≃ relation). So let us prove the latter fact.
We must show that two vertices x and y of G satisfy x ≃ G \e y if and only if
they satisfy x ≃ G y. The “only if” part is obvious (since a walk of G \ e is always
a walk of G). It thus remains to prove the “if” part. So we assume that x and y
are two vertices of G satisfying x ≃ G y, and we want to show that x ≃ G \e y.
An introduction to graph theory, version August 2, 2023 page 52
( x, . . . , u, v, . . . , y) .
If we remove the edge e = uv, then this path breaks into two smaller paths
( x, . . . , u) and (v, . . . , y)
(since the edges of a path are distinct, so e appears only once in it). Both of
these two smaller paths are paths of G \ e. Thus, x ≃ G \e u and v ≃ G \e y.
Now, recalling that ≃ G \e is an equivalence relation, we combine these results to
obtain
x ≃ G \e u ≃ G \e v ≃ G \e y.
Hence, x ≃ G \e y. This completes the proof of Theorem 2.12.2 (a).
(b) Assume that e appears in no cycle of G. We must prove that the graph G \
e has one more component than G. To do so, it suffices to show the following:
• Case 1: This path p does not use the edge e. In this case, p is a path of
G \ e, and thus we obtain c ≃ G \e u. In other words, c ∈ A (since A is the
component of G \ e containing u).
• Case 2: This path p does use the edge e. In this case, the edge e must be
the last edge of p (since the path p would otherwise contain the vertex u
twice11 ; but a path cannot contain a vertex twice), and the last two vertices
of p must be v and u in this order. Thus, by removing the last vertex from
p, we obtain a path from c to v, and this latter path is a path of G \ e (since
it no longer contains u and therefore does not use e). This yields c ≃ G \e v.
In other words, c ∈ B (since B is the component of G \ e containing v).
In either of these two cases, we have shown that c belongs to one of A and B.
In other words, c ∈ A ∪ B. This is precisely what we wanted to show. This
completes the proof of Theorem 2.12.2 (b).
We introduce some fairly standard terminology:
(b) We say that e is a cut-edge (of G) if the graph G \ e has more compo-
nents than G.
3 0 1
results in an empty graph on the set {1, 2, 3, 4}, so the number of components
has increased from 1 to 4.
2
3
4
5
C5 = ({1, 2, 3, 4, 5} , {12, 23, 34, 45, 51}) = .
12 When we remove a vertex, we must of course also remove all edges that contain this vertex.
An introduction to graph theory, version August 2, 2023 page 55
The set {1, 3} is a dominating set for C5 , since all three vertices 2, 4, 5 that
don’t belong to {1, 3} have neighbors in {1, 3}. The set {1, 5} is not a dom-
inating set for C5 , since the vertex 3 has no neighbor in {1, 5}. There is no
dominating set for C5 that has size 0 or 1, but there are several of size 2, and
every subset of size ≥ 3 is dominating.
Clearly, the “denser” a graph is (i.e., the more edges it has), the “easier” it
is for a set to be dominating. Often, a graph is given, and one is interested in
finding a dominating set of the smallest possible size13 . As the case of an empty
graph reveals, sometimes the only choice is the whole vertex set. However, in
many cases, we can do better. Namely, we need to require that the graph has
no isolated vertices:
(b) There exist two disjoint dominating subsets A and B of V such that
A ∪ B = V.
13 Supposedly,this has applications in mobile networking: For example, you might want to
choose a set of routers in a given network so that each node is either a router or directly
connected (i.e., adjacent) to one.
An introduction to graph theory, version August 2, 2023 page 56
One proof of this proposition will be given in Exercise 2.19 below (homework
set #2 exercise 4). Another appears in [17s, §3.6].
For specific graphs, the bound |V | /2 in Proposition 2.13.4 (a) can often be
improved. Here is an example:
Exercise 2.17. Let n ≥ 3 be an integer. Find a formula for the smallest size
of a dominating set of the cycle graph Cn . You can use the ceiling function
x 7→ ⌈ x ⌉, which sends a real number x to the smallest integer that is ≥ x.
Exercise 2.19. Let G = (V, E) be a connected simple graph with at least two
vertices.
The distance d (v, w) between two vertices v and w of G is defined to be
the smallest length of a path from v to w. (In particular, d (v, v) = 0 for each
v ∈ V.)
Fix a vertex v ∈ V. Define two subsets
of V.
(c) Prove that there exists a dominating set of G that has size ≤ |V | /2.
(d) Prove that the claim of part (c) holds even if we don’t assume that G is
connected, as long as we assume that each vertex of G has at least one
neighbor. (In other words, prove Proposition 2.13.4 (a).)
Three proofs of this theorem are given in Brouwer’s note [Brouwe09].14 Let
me show the one I like the most. We first need a notation:
3 2
4 1
5 6
C6 = ({1, 2, 3, 4, 5, 6} , {12, 23, 34, 45, 56, 61}) = .
Then, ({1, 2} , {4, 5}) is a detached pair, whereas ({1, 2} , {3, 4}) is not (since
23 is an edge). Of course, there are many other detached pairs; in particular,
any pair of the form (∅, B) or ( A, ∅) is detached.
Let me stress that the word “pair” always means “ordered pair” unless I say
otherwise. So, if ( A, B) is a detached pair, then ( B, A) is a different detached
pair, unless A = B = ∅.
Here is an attempt at a proof of Theorem 2.13.5. It is a nice example of how
to apply known results to new graphs to obtain new results. The only problem
is, it shows a result that is a bit at odds with the claim of the theorem...
Proof of Theorem 2.13.5, attempt 1. Write the graph G as (V, E).
Recall that P (V ) denotes the set of all subsets of V.
Construct a new graph H with the vertex set P (V ) as follows: Two subsets
A and B of V are adjacent as vertices of H if and only if ( A, B) is a detached
pair. (Note that if the original graph G has n vertices, then this graph H has 2n
vertices. It is huge!)
I claim that the vertices of H that have odd degree are precisely the subsets
of V that are dominating. In other words:
[Proof of Claim 1: We let N ( A) denote the set of all vertices of G that have a
neighbor in A. (This may or may not be disjoint from A.)
The neighbors of A (as a vertex in H) are precisely the subsets B of V such
that ( A, B) is a detached pair (by the definition of H). In other words, they are
the subsets B of V that are disjoint from A and also have no neighbors in A (by
the definition of a “detached pair”). In other words, they are the subsets B of
V that are disjoint from A and also disjoint from N ( A). In other words, they
are the subsets of the set V \ ( A ∪ N ( A)). Hence, the number of such subsets
B is 2|V \( A∪ N ( A))| .
The degree of A (as a vertex of H) is the number of neighbors of A in H.
Thus, this degree is 2|V \( A∪ N ( A))| (because we have just shown that the num-
ber of neighbors of A is 2|V \( A∪ N ( A))| ). But 2k is odd if and only if k = 0.
Thus, we conclude that the degree of A (as a vertex of H) is odd if and only if
|V \ ( A ∪ N ( A))| = 0. The condition |V \ ( A ∪ N ( A))| = 0 can be rewritten as
follows:
(|V \ ( A ∪ N ( A))| = 0)
⇐⇒ (V \ ( A ∪ N ( A)) = ∅)
⇐⇒ (V ⊆ A ∪ N ( A))
⇐⇒ (V \ A ⊆ N ( A))
⇐⇒ (each vertex v ∈ V \ A belongs to N ( A))
⇐⇒ (each vertex v ∈ V \ A has a neighbor in A)
⇐⇒ ( A is dominating) (by the definition of “dominating”) .
Thus, what we have just shown is that the degree of A (as a vertex of H) is odd
if and only if A is dominating. This proves Claim 1.]
Claim 1 shows that the vertices of H that have odd degree are precisely the
dominating sets of G. But the handshake lemma (Corollary 2.4.4) tells us that
any simple graph has an even number of vertices of odd degree. Applying this
to H, we conclude that there is an even number of dominating sets of G.
Huh? We want to show that there is an odd number of dominating sets of G,
not an even number! Why did we just get the opposite result?
Puzzle: Find the mistake in our above reasoning! The answer will be revealed
on the next page.
An introduction to graph theory, version August 2, 2023 page 59
Part (a) of this theorem is obvious (recall that if ( A, B) is a detached pair, then
so is ( B, A)). Part (b) is the interesting part. In [17s, §3.3–§3.4], I give a long but
elementary proof.
An introduction to graph theory, version August 2, 2023 page 60
More recently ([HeiTit18]), Heinrich and Tittmann have refined their formula
to allow counting dominating sets of a given size. Their main result is the
following formula (exercise 5 on homework set #2):
Exercise 2.20. Let G = (V, E) be a simple graph with at least one vertex. Let
n = |V |. A detached pair means a pair ( A, B) of two disjoint subsets A and
B of V such that there exists no edge ab ∈ E with a ∈ A and b ∈ B.
Prove the following generalization of the Heinrich–Tittmann formula:
∑ x |S | = (1 + x ) n − 1 + ∑ (−1)| A| x | B| .
S is a dominating ( A,B ) is a detached pair;
set of G A 6 = ∅; B 6 = ∅
v1 . This closed walk will certainly contain each vertex. Conversely, such a walk
cannot exist if G is not connected.
The question becomes a lot more interesting if we replace “closed walk” by
“path” or “cycle”. The resulting objects have a name:
Example 2.14.3. Which of the following eight graphs have hamps? Which
have hamcs?
3 2
5 2
A= 4 1
B= 4 1
5 6 6 3
1 1 2
D=
C=
2 3 3 4
3 2
E= 4 0 1 5 6 7 8
5 6 F= 1 2 3 4
2′ 2′
3′ 3′
2 2
3 3
G= 1 1′ H= 1 1′
4 4
5 5
4′ 4′
5′ 5′
Answers:
• The graph B has a hamp (2, 3, 1, 4, 5, 6), but no hamc. The easiest way
to see that B has no hamc is the following: The edge 14 is a cut-edge
(i.e., removing it renders the graph disconnected), thus a bridge (i.e., an
edge that appears in no cycle); therefore, any cycle must stay entirely
“on one side” of this edge.
• The graph C has a hamp (0, 1, 2, 3), but no hamc. The argument for the
non-existence of a hamc is the same as for B: The edge 01 is a bridge.
• The graph D has neither a hamp nor a hamc, because it is not con-
nected. Only a connected graph can have a hamp.
• The graph E has a hamp (0, 3, 2, 1, 6, 5, 4), but no hamc (checking this
requires some work, though).
• The graph G has a hamc (1, 2, 3, 4, 5, 5′, 4′ , 3′ , 2′ , 1′ , 1), thus also a hamp.
There are various proofs of this theorem scattered around; see [Harju14, The-
orem 3.6] or [Guicha16, Theorem 5.3.2]. We shall give another proof (following
the “Algorithm” section on the Wikipedia page for “Ore’s theorem”):
Proof of Theorem 2.14.4. A listing (of V) shall mean a list of elements of V that
contains each element exactly once. It must clearly be an n-tuple.
The hamness of a listing (v1 , v2 , . . . , vn ) will mean the number of all i ∈
{1, 2, . . . , n} such that vi vi +1 ∈ E. Here, we set vn+1 = v1 . (Visually, it is best
to represent a listing (v1 , v2 , . . . , vn ) by drawing the vertices v1 , v2 , . . . , vn on a
circle in this order. Its hamness then counts how often two successive vertices
on the circle are adjacent in the graph G.) Note that the hamness of a listing
(v1 , v2 , . . . , vn ) does not change if we cyclically rotate the listing (i.e., transform
it into (v2 , v3 , . . . , vn , v1 )).
Clearly, if we can find a listing (v1 , v2 , . . . , vn ) of hamness ≥ n, then all of
v1 v2 , v2 v3 , . . . , vn v1 are edges of G, and thus (v1 , v2 , . . . , vn , v1 ) is a hamc of G.
Thus, we need to find a listing of hamness ≥ n.
To do so, I will show that if you have a listing of hamness < n, then you can
slightly modify it to get a listing of larger hamness. In other words, I will show
the following:
[Proof of Claim 1: Since the listing (v1 , v2 , . . . , vn ) has hamness k < n, there
exists some i ∈ {1, 2, . . . , n} such that vi vi +1 ∈/ E. Pick such an i. Thus, the
vertices vi and vi +1 of G are non-adjacent. The “deg x + deg y ≥ n” assumption
of the theorem thus yields deg (vi ) + deg (vi +1 ) ≥ n.
However,
• First, cyclically rotate the old listing so that it begins with vi +1 . Thus, you
get the listing (vi +1, vi +2 , . . . , vn , v1 , v2 , . . . , vi ).
• Then, reverse the part of the listing starting at vi +1 and ending at v j . Thus,
you get the new listing
v j , v j −1 , . . . , vi +1 , v j +1 , v j +2 , . . . , vi .
| {z } | {z }
This is the reversed part; This is the part that
it may or may not “wrap around” was not reversed.
(i.e., contain ...,v1 ,vn ,... somewhere).
I claim that this new listing has hamness larger than k. Indeed, rotating the
old listing clearly did not change its hamness. But reversing the part from vi +1
to v j clearly did: After the reversal, the edges vi vi +1 and v j v j+1 no longer count
towards the hamness (if they were edges to begin with), but the edges vi v j and
vi +1 v j+1 started counting towards the hamness. This is a good bargain, because
it means that the hamness gained +2 from the newly-counted edges vi v j and
An introduction to graph theory, version August 2, 2023 page 66
vi +1 v j+1 (which, as we know, both exist), while only losing 0 or 1 (since the
edge vi vi +1 did not exist, whereas the edge v j v j+1 may or may not have been
lost). Thus, the hamness of the new listing is larger than the hamness of the
old listing either by 1 or 2. In other words, it is larger than m by at least 1 or 2.
This proves Claim 1.]
Now, we can start with any listing of V and keep modifying it using Claim 1,
increasing its hamness each time, until its hamness becomes ≥ n. But once its
hamness is ≥ n, we have found a hamc (as explained above). Theorem 2.14.4 is
thus proven.
Proof. Follows from Ore’s theorem, since any two vertices x and y of G satisfy
n n
deg x + deg y ≥ + = n.
| {z } | {z } 2 2
n n
≥ ≥
2 2
Exercise 2.22.
(a) Let G = (V, E) be a simple graph, and let u and v be two distinct
vertices of G that are not adjacent. Let n = |V |. Assume that deg u +
deg v ≥ n. Let G ′ = (V, E ∪ {uv}) be the simple graph obtained from
G by adding a new edge uv. Assume that G ′ has a hamc. Prove that G
has a hamc.
3 2
G= 4 0 1
5 6
(For example, if and S = {3, 6}, then
2
G\S = 4 0 1
5
.)
Also, we let b0 ( H ) denote the number of connected components of a sim-
ple graph H.
For example, part (a) of this proposition shows that the graph E from Exam-
ple 2.14.3 has no hamc, because if we take S to be {3, 6}, then b0 ( G \ S) = 3
whereas |S| = 2. Thus, the proposition can be used to rule out the existence of
hamps and hamcs in some cases.
Proof of Proposition 2.14.6. (a) Let S ⊆ V be a nonempty set. If we cut |S| many
vertices out of a cycle, then the cycle splits into at most |S| paths:
† †
Of course, our graph G itself may not be a cycle, but if it has a hamc, then the
removal of the vertices in S will split the hamc into at most | S| paths (according
to the preceding sentence), and thus the graph G \ S will have ≤ |S| many
components (just using the surviving edges of the hamc alone). Taking into
account all the other edges of G can only decrease the number of components.
An introduction to graph theory, version August 2, 2023 page 68
2.14.4. Hypercubes
Now, let us move on to a concrete example of a graph that has a hamc.
Q1 = 0
01 11
Q2 = 00 10
101 111
001 011
100 110
Q3 = 000 010
Such hamcs are known as Gray codes. They are circular lists of bitstrings of
length n such that two consecutive bitstrings in the list always differ in exactly
one bit. See the Wikipedia article on “Gray codes” for applications.
Proof of Theorem 2.14.9. We will show something stronger:
)
An introduction to graph theory, version August 2, 2023 page 70
and
(v, w1 ) (v, w2 ) where w1 w2 ∈ F and v ∈ V.
C5 C5 × P2
(2, 2)
(3, 2)
(2, 1)
(3, 1)
(1, 1) (1, 2)
2
3 (4, 1)
(5, 1)
1 (4, 2)
4
(5, 2)
5
Proof. This is Exercise 1 (a) on homework set #2 from my Spring 2017 course;
see the course page for solutions.
Now, we claim the following:
Theorem 2.14.12. Let G and H be two simple graphs. Assume that each of
the two graphs G and H has a hamp. Then:
An introduction to graph theory, version August 2, 2023 page 72
(b) Now assume furthermore that at least one of the two numbers |V ( G )|
and |V ( H )| is even, and that both numbers |V ( G )| and |V ( H )| are
larger than 1. Then, the Cartesian product G × H has a hamc.
Since Gn ∼
= Qn , we can restate this question equivalently as follows: If n ≥ 3
is odd, and if Q′n is the induced subgraph of Qn on the set
( )
n
n − 1 n + 1
a1 a2 · · · an ∈ {0, 1}n | ∑ ai ∈ , ,
i =1
2 2
Exercise 2.23. Let n and k be two integers such that n > k > 0. Define the
simple graph Qn,k as follows: Its vertices are the bitstrings ( a1 , a2 , . . . , an ) ∈
{0, 1}n ; two such bitstrings are adjacent if and only if they differ in exactly k
bits (in other words: two vertices ( a1 , a2 , . . . , an ) and (b1 , b2 , . . . , bn ) are adja-
cent if and only if the number of i ∈ {1, 2, . . . , n} satisfying ai 6= bi equals k).
(Thus, Qn,1 is the n-hypercube graph Qn .)
(a) Does Qn,k have a hamc when k is even? (Recall that “hamc” is short for
“Hamiltonian cycle”.)
[Hint: One way to approach part (b) is by identifying the set {0, 1} with
the field F2 with two elements. The bitstrings ( a1 , a2 , . . . , an ) ∈ {0, 1}n thus
become the size-n row vectors in the F2 -vector space F2n . Let e1 , e2 , . . . , en be
the standard basis vectors of F2n (so that ei has a 1 in its i-th position and
zeroes everywhere else). Then, two vectors are adjacent in the n-hypercube
graph Qn (resp. in the graph Qn,k ) if and only if their difference is one of the
standard basis vectors (resp., a sum of k distinct standard basis vectors). Try
to use this to find a graph isomorphism from Qn to a subgraph of Qn,k .]
The next exercise extends the idea of our proof of Theorem 2.14.9:
3. Multigraphs
3.1. Definitions
So far, we have been working with simple graphs. We shall now introduce
several other kinds of graphs, starting with the multigraphs.
Definition 3.1.1. Let V be a set. Then, P1,2 (V ) shall mean the set of all
1-element or 2-element subsets of V. In other words,
For instance,
P1,2 ({1, 2, 3}) = {{1} , {2} , {3} , {1, 2} , {1, 3} , {2, 3}} .
Definition 3.1.2. A multigraph is a triple (V, E, ϕ), where V and E are two
finite sets, and ϕ : E → P1,2 (V ) is a map.
2
β
α δ
γ
ǫ
λ 1 3 4 5
κ
V = {1, 2, 3, 4, 5} , E = {α, β, γ, δ, ε, κ, λ} ,
(c) If e is an edge of G, then the elements of ϕ (e) are called the endpoints
of e.
(d) We say that an edge e contains a vertex v if v ∈ ϕ (e) (in other words, if
v is an endpoint of e).
(e) Two vertices u and v are said to be adjacent if there exists an edge e ∈ E
whose endpoints are u and v.
(f) Two edges e and f are said to be parallel if ϕ (e) = ϕ ( f ). (In the above
example, any two of the edges δ, ε, κ are parallel.)
(g) We say that G has no parallel edges if G has no two distinct edges that
are parallel.
(h) An edge e is called a loop (or self-loop) if ϕ (e) is a 1-element set (i.e.,
if e has only one endpoint). (In Example 3.1.3, the edge λ is a loop.)
deg v = degG v
:= |{e ∈ E | v ∈ ϕ (e)}| + |{e ∈ E | ϕ (e) = {v}}| .
| {z } | {z }
this counts all edges this counts all loops
that contain v that contain v once again
(Note that, unlike in the case of a simple graph, deg v is not the number
of neighbors of v, unless it happens that v is not contained in any loops
or parallel edges.)
(For example, in Example 3.1.3, we have deg 1 = 3 and deg 2 = 3 and
deg 3 = 2 and deg 4 = 3 and deg 5 = 3.)
( v0 , e1 , v1 , e2 , v2 , . . . , e k , v k ) (with k ≥ 0) ,
An introduction to graph theory, version August 2, 2023 page 76
ϕ ( ei ) = { vi −1 , vi }
(that is, the endpoints of each edge ei are vi −1 and vi ). Note that we
have to record both the vertices and the edges in our walk, since we
want the walk to “know” which edges it traverses. (For instance, in
Example 3.1.3, the two walks (1, α, 2, β, 3) and (1, α, 2, γ, 3) are distinct.)
The vertices of a walk (v0 , e1 , v1 , e2 , v2 , . . . , ek , vk ) are v0 , v1 , . . . , vk ; the
edges of this walk are e1 , e2 , . . . , ek . This walk is said to start at v0 and
end at vk ; it is also said to be a walk from v0 to vk . Its starting point is
v0 , and its ending point is vk . Its length is k.
(n) A closed walk (or circuit) means a walk (v0 , e1, v1 , e2, v2 , . . . , ek , vk ) with
v k = v0 .
(p) Hamiltonian paths and cycles are defined as for simple graphs.
Nevertheless, the two notions have much in common; thus, they are both
called “graphs”:
Convention 3.1.5. The word “graph” means either “simple graph” or “multi-
graph”. The precise meaning should usually be understood from the context.
(I will try not to use it when it could cause confusion.)
3.2. Conversions
We can turn each multigraph into a simple graph, but at a cost of losing some
information:
In other words, it is the simple graph with vertex set V in which two distinct
vertices u and v are adjacent if and only if u and v are adjacent in G. Thus,
Gsimp is obtained from G by removing loops and “collapsing” parallel edges
to a single edge.
1 3 4 5
.
(V, E, ι) ,
Example 3.2.3. If
G= 1 3 4
,
then
2
{1, 2} {2, 3}
{3, 4}
Gmult = 1 3 4
{1, 3}
.
Proof. This is not completely obvious, since our definitions of a cycle of a simple
graph and of a cycle of a multigraph were somewhat different. The proof boils
down to checking the following two statements:
Checking statement 2 is easy (we cannot have k = 1 since Gmult has no loops,
and we cannot have k = 2 since this would lead to e1 = e2 ). Statement 1
is also clear, since the distinctness of the k vertices v0 , v1 , . . . , vk−1 forces the 2-
element sets formed from these k vertices to also be distinct (and since the edges
{v0 , v1 } , {v1 , v2 } , . . . , {vk−1 , vk } = {vk−1 , v0 } are such 2-element sets).
For all other notions discussed above, it is even more obvious that there is no
ambiguity.
3.3.2. Degrees
In Definition 2.4.1, we defined the degree of a vertex v in a simple graph G =
(V, E) by
Proposition 2.4.2 (which says that if G is a simple graph with n vertices, then
any vertex v of G has degree deg v ∈ {0, 1, . . . , n − 1}) also no longer holds
for multigraphs, because you can have arbitrarily many edges in a multigraph
with just 1 or 2 vertices. (You can even have parallel loops!)
Is Proposition 2.4.3 true for multigraphs? Yes, because we have said that
loops should count twice in the definition of the degree. The proof needs some
tweaking, though. Let me give a slightly different proof; but first, let me state
the claim for multigraphs as a proposition of its own:
However,
since each edge e ∈ E is counted in exactly one addend of this sum. Similarly,
with the property that if e ∈ E, then the endpoints of β (e) are the im-
ages under α of the endpoints of e. (This property can also be restated
as a commutative diagram
β
E // F ,
ϕ ψ
P1,2 (V ) // P1,2 (W )
P ( α)
where P (α) is the map from P1,2 (V ) to P1,2 (W ) that sends each sub-
set {u, v} ∈ P1,2 (V ) to {α (u) , α (v)} ∈ P1,2 (W ). If you are used to
category theory, this restatement may look more natural to you.)
(a) We redefine the 2-nd cycle graph C2 to be the multigraph with two
vertices 1 and 2 and two parallel edges with endpoints 1 and 2. (We
don’t care what the edges are, only that there are two of them and each
1 2
has endpoints 1 and 2.) Thus, it looks as follows: .
(b) We define the 1-st cycle graph C1 to be the multigraph with one vertex
1 and one edge (which is necessarily a loop). Thus, it looks as follows:
1
.
This has the effect that the n-th cycle graph Cn has exactly n edges for each
n ≥ 1 (rather than having 1 edge for n = 2, as it did back when it was a simple
graph).
of G, where
With these definitions, we can now identify cycles in a multigraph with sub-
graphs isomorphic to a cycle graph: A cycle of length n in a multigraph G is
“the same as” a submultigraph of G isomorphic to Cn . (We leave the details to
the reader.)
3.3.7. Walks
We already defined walks, paths, closed walks and cycles for multigraphs back
in Section 3.1. The length of a walk is still defined to be its number of edges.
Now, let’s see which of their basic properties (seen in Section 2.9) still hold for
multigraphs.
First of all, the edges of a path are still always distinct. This is just as easy to
prove as for simple graphs.
Next, let us see how two walks can be “spliced” together:
(a0 , e1 , a1 , . . . , ek , ak , f 1 , b1 , f 2 , b2 , . . . , f ℓ , bℓ )
= (a0 , e1 , a1 , . . . , ak−1 , ek , b0 , f 1 , b1 , . . . , f ℓ , bℓ )
= (a0 , e1 , a1 , . . . , ak−1 , ek , v, f 1 , b1 , . . . , f ℓ , bℓ )
Walks that are not paths contain smaller walks between the same vertices:
3.3.8. Path-connectedness
The relation “path-connected” is defined for multigraphs just as it is for simple
graphs (Definition 2.9.8), and is still denoted ≃ G . It is still an equivalence
relation (and the proof is the same as for simple graphs). The following also
holds (with the same proof as for simple graphs):
An introduction to graph theory, version August 2, 2023 page 86
Proof. The proof of this proposition for multigraphs is more or less the same as
it was for simple graphs (i.e., as the proof of Proposition 2.10.4), with a mild
difference in how we prove that the walk wi , wi +1, . . . , w j is a cycle (of course,
this walk is no longer wi , wi +1, . . . , w j now, but rather wi , ei +1, wi +1, . . . , e j , w j ,
because the edges need to be included).17
The first of these claims follows from the minimality of j − i. The third follows from i < j.
It remains to prove the second claim. In other words, it remains to prove that the edges
ei+1, ei+2, . . . , e j are distinct, i.e., that we have e a 6= eb for any two integers a and b satisfying
An introduction to graph theory, version August 2, 2023 page 87
Proof. For simple graphs, this was proved as Theorem 2.10.7 above. The same
proof applies to multigraphs, once the obvious changes are made (e.g., instead
of p a−1 p a and qb−1 qb , we need to take the last edges of the two walks p and
q).
i < a < b ≤ j. Let us do this. Let a and b be two integers satisfying i < a < b ≤ j. We must
show that e a 6= eb . We distinguish two cases: the case a = b − 1 and the case a 6= b − 1.
• If a = b − 1, then e a and eb are two adjacent edges of w and thus distinct (since we
assumed that no two adjacent edges of w are identical). Thus, e a 6= eb is proved in
the case when a = b − 1.
• Now, consider the case when a 6= b − 1. In this case, we must have a < b − 1 (since
a < b entails a ≤ b − 1). Also, i ≤ a − 1 (since i < a). Hence, i ≤ a − 1 < a < b − 1 ≤
j − 1 (since b ≤ j). Therefore, b − 1, a − 1 and a are three distinct elements of the
set {i, i + 1, . . . , j − 1}. Consequently, wb−1, w a−1 , w a are three distinct vertices (since
the vertices wi , wi+1, . . . , w j−1 are distinct). Therefore, wb−1 ∈ / { w a −1 , w a } = ϕ ( e a )
(since w is a walk, so that the edge e a has endpoints w a−1 and w a ). However, ϕ (eb ) =
{ wb−1 , wb } (since w is a walk, so that the edge eb has endpoints wb−1 and wb ). Now,
comparing wb−1 ∈ {wb−1 , wb } = ϕ (eb ) with wb−1 ∈ / ϕ (e a ), we see that the sets ϕ (eb )
and ϕ (e a ) must be distinct (since ϕ (eb ) contains wb−1 but ϕ (e a ) does not). In other
words, ϕ (eb ) 6= ϕ (e a ). Hence, eb 6= e a . In other words, e a 6= eb . Thus, e a 6= eb is
proved in the case when a 6= b − 1.
We have now proved e a 6= eb in both cases, so we are done.
An introduction to graph theory, version August 2, 2023 page 88
3.3.12. Exercises
Exercise 3.1. Which of the Exercises 2.3, 2.4, 2.7, 2.14, 2.15, 2.5 and 2.8 remain
true if “simple graph” is replaced by “multigraph”?
(For each exercise that becomes false, provide a counterexample. For each
exercise that remains true, either provide a new solution that works for multi-
graphs, or argue that the solution we have seen applies verbatim to multi-
graphs, or derive the multigraph case from the simple graph case.)
Exercise 3.2. Let G be a multigraph with at least one edge. Assume that each
vertex of G has even degree. Prove that G has a cycle.
[Solution: This is Exercise 4 on midterm #1 from my Spring 2017 course;
see the course page for solutions.]
Exercise 3.4. Let G be a multigraph. Assume that G has exactly two vertices
of odd degree. Prove that these two vertices are path-connected.
deg (e/v)
qv = ∑ deg v
.
e∈ E;
v ∈ ϕ (e )
(Note that the denominator deg v on the right hand side is nonzero whenever
the sum is nonempty!)
(Thus, qv is the average degree of the neighbors of v, weighted with the
number of edges that join v to the respective neighbors. If v has no neighbors,
then qv = 0.)
Prove that
∑ qv ≥ ∑ deg v.
v ∈V v ∈V
(In other words, in a social network, your average friend has, on average,
more friends than you do!)
x y
[Hint: Any positive reals x and y satisfy + ≥ 2. Why, and how does
y x
this help?]
An introduction to graph theory, version August 2, 2023 page 90
1 b d g
c
5 4 h
f
[Hint: Feel free to restrict yourself to the case of a simple graph; in this
case, E and F are two subsets of P2 (V ), and you have to show that
This isn’t any easier than the general case, but saves you the hassle of
carrying the map ϕ around.]
(b) Give an example where the inequality (2) does not become an equality.
b
z
a
x
y
c
One possible decomposition of its edge set into disjoint friendly couples is
{a, y} , {b, z} , {c, x }.]
[Hint: Induct on | E| . Pick a vertex v of degree > 1 and consider the
components of G \ v.]
(a) Prove that there exists a multigraph G with vertex set {1, 2, . . . , n} such
that all i ∈ {1, 2, . . . , n} satisfy deg i = di .
(b) Prove that there exists a loopless multigraph G with vertex set
{1, 2, . . . , n} such that all i ∈ {1, 2, . . . , n} satisfy deg i = di if and only
if each i ∈ {1, 2, . . . , n} satisfies the inequality
∑ d j ≥ di . (3)
j∈{1,2,...,n };
j 6 =i
Exercise 3.10. Let G be a loopless multigraph. Recall that a trail (in G) means
a walk whose edges are distinct (but whose vertices are not necessarily dis-
tinct). Let u and v be two vertices of G. As usual, “trail from u to v” means
“trail that starts at u and ends at v”. Prove that
[Hint: Try to pair up the non-path trails into pairs. Make sure to prove that
this pairing is well-defined (i.e., each non-path trail t has exactly one partner,
which is not itself, and that t is the designated partner of its partner!).]
An introduction to graph theory, version August 2, 2023 page 93
Exercise 3.11. Let G be a multigraph such that every vertex of G has even
degree. Let u and v be two distinct vertices of G. Prove that the number of
paths from u to v is even.
[Hint: When you add an edge joining u to v, the graph G becomes a graph
with exactly two odd-degree vertices u and v, and the claim becomes “the
number of paths from u to v is odd” (why?). In this form, the claim turns
out to be easier to prove. Indeed, any path must start with some edge...
Keep in mind that paths can be replaced by trails, by Exercise 3.10.]
Unlike for Hamiltonian paths and cycles, an Eulerian walk or circuit is usu-
ally not a path or cycle. Also, finding an Eulerian walk in a multigraph G is not
the same as finding an Eulerian walk in the simple graph Gsimp . (Nevertheless,
An introduction to graph theory, version August 2, 2023 page 94
some authors call Eulerian walks “Eulerian paths” and call Eulerian circuits
“Eulerian cycles”. This is rather confusing.)
Example 3.4.2. Consider the following multigraphs:
e
2 3 a
a 1 2
A= 1 b d g
B= d b
c
5 4
f 4 3
c
3 3
c
c
b d
C= g 1 2 D= 1 2
a
a e
e
f
4 4
2 2
a a
e
b f b
E= 1 4 F= 1 4
c c
g
d d
3 3
g h
a
1 2
H= 1
G= d b
f e
4 3
c
• The multigraph E has no Eulerian walk. The reason is the same as for
D. Note that E is the famous multigraph of bridges in Königsberg, as
studied by Euler in 1736 (see the Wikipedia page for “Seven bridges of
Königsberg” for the backstory).
Remark 3.4.3. For the pedants: A multigraph can have an Eulerian circuit
even if it is not connected, as long as all its edges belong to the same compo-
nent (i.e., all but one components are just singletons with no edges). Here is
An introduction to graph theory, version August 2, 2023 page 96
an example:
a
1 2
5 d b 6
4 3
c
Exercise 3.13. Let n be a positive integer. Recall from Definition 2.6.1 (a) that
Kn denotes the complete graph on n vertices. This is the graph with vertex
set V = {1, 2, . . . , n} and edge set P2 (V ) (so each two distinct vertices are
adjacent).
Find Eulerian circuits for the graphs K3 , K5 , and K7 .
[Solution: This is Exercise 2 on homework set #2 from my Spring 2017
course; see the course page for solutions.]
(a) The multigraph G has an Eulerian circuit if and only if each vertex of
G has even degree.
(b) The multigraph G has an Eulerian walk if and only if all but at most
two vertices of G have even degree.
We already proved the “=⇒” directions of both parts (a) and (b) in Example
3.4.2. It remains to prove the “⇐=” directions. I don’t think that Euler actually
proved them in his 1736 paper, but Hierholzer did in 1873. The “standard”
proof can be found in many texts, such as [Guicha16, Theorem 5.2.2 and The-
orem 5.2.3]. I will sketch a different proof, which I learnt from [LeLeMe18,
Problem 12.35]. We begin with the following definition:
is to start with some trail, and make it progressively longer until it becomes
Eulerian (hopefully).
This suggests the following approach to proving the “⇐=” directions of The-
orem 3.4.4: We pick the longest trail of G and argue that (under the right
assumptions) it has to be Eulerian, since otherwise there would be a way to
make it longer. Of course, we need to find such a way. Here is the first step:
Lemma 3.4.6. Let G be a multigraph with at least one vertex. Then, G has a
longest trail.
Proof. Clearly, G has at least one trail (e.g., a length-0 trail from a vertex to
itself). Moreover, G has only finitely many trails (since each edge of G can only
be used once in a trail, and there are only finitely many edges). Hence, the
maximum principle proves the lemma.
Our goal now is to show that under appropriate conditions, such a longest
trail will be Eulerian. This will require two further lemmas.
First, one more piece of notation: We say that an edge e of a multigraph G
intersects a walk w if at least one endpoint of e is a vertex of w. Here is how
this can look like:
w w w w
w w w w
w w w w
Proof. We assumed that there exists an edge of G that is not an edge of w. Pick
such an edge, and call it f .
A “w- f -path” will mean a path from a vertex of w to an endpoint of f . Such
a path clearly exists, since G is connected. Thus, we can pick a shortest such
path. If this shortest path has length 0, then we are done (since f intersects w in
this case). If not, we consider the first edge of this path. This first edge cannot
be an edge of w, because otherwise we could remove it from the path and get
an even shorter w- f -path. But it clearly intersects w. So we have found an edge
of G that is not an edge of w but intersects w. This proves the lemma.
Lemma 3.4.8. Let G be a multigraph such that each vertex of G has even
degree. Let w be a longest trail of G. Then, w is a closed walk.
Proof. Assume the contrary. Let u be the starting point and v the ending point
of w. Since we assumed that w is not a closed walk, we thus have u 6= v.
Consider the edges of w that contain v. Such edges are of two kinds: those
by which w enters v (this means that v comes immediately after this edge in
w), and those by which w leaves v (this means that v comes immediately before
this edge in w). 18 Except for the very last edge of w, each edge of the former
kind is immediately followed by an edge of the latter kind; conversely, each
edge of the latter kind is immediately preceded by an edge of the former kind
(since w starts at the vertex u, which is distinct from v). Hence, the walk w has
exactly one more edge entering v than it has edges leaving v. Thus, the number
of edges of w that contain v (with loops counting twice) is odd. However, the
total number of edges of G that contain v (with loops counting twice) is even
(because it is the degree of v, but we assumed that each vertex of G has even
degree). So these two numbers are distinct. Thus, there is at least one edge of
G that contains v but is not an edge of w.
Fix such an edge and call it f . Now, append f to the trail w at the end. The
result will be a trail (since f is not an edge of w) that is longer than w. But this
contradicts the fact that w is a longest trail. Thus, the lemma is proved.
We can now finish the proof of the Euler–Hierholzer theorem:
Proof of Theorem 3.4.4. (a) =⇒: We proved this back in Example 3.4.2.
⇐=: Assume that each vertex of G has even degree.
By Lemma 3.4.6, we know that G has a longest trail. Fix such a longest trail,
and call it w. Then, Lemma 3.4.8 shows that w is a closed walk.
We claim that w is Eulerian. Indeed, assume the contrary. Then, there exists
an edge of G that is not an edge of w. Hence, Lemma 3.4.7 shows that there
exists an edge of G that is not an edge of w but intersects w. Fix such an edge,
and call it f .
Since f intersects w, there exists an endpoint v of f that is a vertex of w.
Consider this v. Since w is a closed trail, we can WLOG assume that w starts
and ends at v (since we can otherwise achieve this by rotating19 w). Then, we
can append the edge f to the trail w. This results in a new trail (since f is not
an edge of w) that is longer than w. And this contradicts the fact that w is a
longest trail of G.
This contradiction proves that w is Eulerian. Hence, w is an Eulerian circuit
(since w is a closed walk). Thus, the “⇐=” direction of Theorem 3.4.4 (a) is
proven.
(b) =⇒: Already proved in Example 3.4.2.
⇐=: Assume that all but at most two vertices of G have even degree. We
must prove that G has an Eulerian walk.
If each vertex of G has even degree, then this follows from Theorem 3.4.4 (a),
since every Eulerian circuit is an Eulerian walk. Thus, we WLOG assume that
not each vertex of G has even degree. In other words, the number of vertices of
G having odd degree is positive.
The handshake lemma for multigraphs (i.e., Corollary 3.3.3) shows that the
number of vertices of G having odd degree is even. Furthermore, this number
is at most 2 (since all but at most two vertices of G have even degree). So this
number is even, positive and at most 2. Thus, this number is 2. In other words,
the multigraph G has exactly two vertices having odd degree. Let u and v be
these two vertices.
Add a new edge e that has endpoints u and v to the multigraph G (do this
even if there already is such an edge!20 ). Let G ′ denote the resulting multi-
graph. Then, in G ′ , each vertex has even degree (since the newly added edge
e has increased the degrees of u and v by 1, thus turning them from odd to
even). Moreover, G ′ is still connected (since G was connected, and the newly
added edge e can hardly take that away). Thus, we can apply Theorem 3.4.4
(a) to G ′ instead of G. As a result, we conclude that G ′ has an Eulerian circuit.
Cutting the newly added edge e out of this Eulerian circuit21 , we obtain an Eu-
19 Rotating a closed walk (w0 , e1 , w1 , e2 , w2 , . . . , ek , wk ) means moving its first vertex and its first
edge to the end, i.e., replacing the walk by (w1 , e2 , w2 , e3 , w3 , . . . , ek , wk , e1 , w1 ). This always
results in a closed walk again. For example, if (1, a, 2, b, 3, c, 1) is a closed walk, then we can
rotate it to obtain (2, b, 3, c, 1, a, 2); then, rotating it one more time, we obtain (3, c, 1, a, 2, b, 3).
Clearly, by rotating a closed walk several times, we can make it start at any of its vertices.
Moreover, if we rotate a closed trail, then we obtain a closed trail.
20 This is a time to be grateful for the notion of a multigraph. We could not do this with simple
graphs!
21 More precisely: We rotate this circuit until e becomes its last edge, and then we remove this
lerian walk of G. Hence, G has an Eulerian walk. Thus, the “⇐=” direction of
Theorem 3.4.4 (b) is proven.
Note: If you look closely at the above proof, you will see hidden in it an
algorithm for finding Eulerian circuits and walks.22
G L (G)
b
b
2 3
.
c a
a c
d
1 4 d
Definition 4.1.1. A simple digraph is a pair (V, A), where V is a finite set,
and where A is a subset of V × V.
(e) An arc (u, v) is called a loop (or self-loop) if u = v. (In other words, an
arc is a loop if and only if its source is its target.)
A = {(i, j) ∈ V × V | i divides j} .
3 2
4 1
5 6
. (4)
Note that simple digraphs (unlike simple graphs) are allowed to have loops
(i.e., arcs of the form (v, v)).
Definition 4.1.4. A multidigraph is a triple (V, A, ψ), where V and A are
two finite sets, and ψ : A → V × V is a map.
(c) If a is an arc of D, and if ψ ( a) = (u, v), then the vertex u is called the
source of a, and the vertex v is called the target of a.
a 2 3
e
D= 1 b d g
c
5 4
f
. (5)
The word “digraph” was originally a shorthand for “directed graph”, but
by now it is a technical term that is perfectly understood by everyone in the
subject. (It is also understood by linguists, but in a rather different way.)
Definition 4.2.1. Let D be a digraph with vertex set V. (This can be either a
simple digraph or a multidigraph.) Let v ∈ V be any vertex. Then:
Recall Euler’s result (Proposition 3.3.2) saying that in a graph, the sum of all
degrees is twice the number of edges. Here is an analogue of this result for
digraphs:
Proposition 4.2.3 (diEuler). Let D be a digraph with vertex set V and arc set
A. Then,
∑ deg+ v = ∑ deg− v = | A| .
v ∈V v ∈V
4.3. Subdigraphs
Just as we defined subgraphs of a multigraph, we can define subdigraphs (or
“submultidigraphs”, to be very precise) of a digraph:
of D, where
In other words, it denotes the subdigraph of D whose vertices are the el-
ements of S, and whose arcs are precisely those arcs of D whose sources
and targets both belong to S. We denote this induced subdigraph by
D [ S] .
4.4. Conversions
4.4.1. Multidigraphs to multigraphs
Any multidigraph D can be turned into an (undirected) graph G by “removing
the arrowheads” (aka “forgetting the directions of the arcs”):
Definition 4.4.1. Let D be a multidigraph. Then, Dund will denote the multi-
graph obtained from D by replacing each arc with an edge whose endpoints
are the source and the target of this arc. Formally, this is defined as follows:
If D = (V, A, ψ), then Dund = (V, A, ϕ), where the map ϕ : A → P1,2 (V )
sends each arc a ∈ A to the set of the entries of ψ ( a) (that is, to the set
consisting of the source of a and the target of a).
For example, if D is the multidigraph from (5), then Dund is the following
An introduction to graph theory, version August 2, 2023 page 106
multigraph:
h
a 2 3
e
Dund = 1 b d g
c
5 4
f
.
Note that the map ψ depends on our choice of se ’s (that is, it depends on
which endpoint of an edge e we choose to be se ). This makes the definition of
Gbidir non-canonical; I don’t know if there is a good way to fix this. Fortunately,
all choices of se ’s will lead to mutually isomorphic multidigraphs Gbidir . (The
notion of isomorphism for multidigraphs is exactly the one that you expect.)
Example 4.4.3. If
3
a
G= g 1 2
c
b
4
,
An introduction to graph theory, version August 2, 2023 page 107
then
3
( a, 1)
( g, 1)
(c, 2)
( a, 2)
Gbidir = 1 2
(b, 1)
(c, 1)
( g, 2)
(b, 2)
4
.
(Here, for example, we have chosen s a to be 2, so that ta = 3 and ψ ( a, 1) =
(2, 3) and ψ ( a, 2) = (3, 2).) Yes, even the loops of G are duplicated in Gbidir !
(V, A, ι) ,
Example 4.4.5. If
D= 1 3 4
,
An introduction to graph theory, version August 2, 2023 page 108
then
2
(1, 2) (2, 3)
(3, 4)
Dmult = 1 3 4
(1, 3)
.
(V, {ψ ( a) | a ∈ A}) .
In other words, it is the simple digraph with vertex set V in which there is an
arc from u to v if there exists an arc from u to v in D. Thus, Dsimp is obtained
from D by “collapsing” parallel arcs (i.e., arcs having the same source and
the same target) to a single arc.
Example 4.4.7. If
2
a b
e
D= 1 c 3 4
g
f
d ,
then
Dsimp = 1 3 4
.
23 I will use a notation that I probably should have introduced before: If u and v are two vertices
of a digraph, then an “arc from u to v” means an arc with source u and target v.
An introduction to graph theory, version August 2, 2023 page 109
Note that the arcs c and d have not been “collapsed” into one arc, since they
do not have the same source and the same target. Likewise, the loop g has
been preserved (unlike for undirected graphs).
Since all three of these operations are injective (i.e., lose no information), we
thus can encode each of our four notions of graphs as a multidigraph. Con-
sequently, any theorem about multidigraphs can be specialized to the other
three types of graphs. This doesn’t mean that any theorem on any other type
of graphs can be generalized to multidigraphs, though (e.g., Mantel’s theorem
holds only for simple graphs) – but when it can, we will try to state it at the
most general level possible, to avoid doing the same work twice.
(c) A path (in D) means a walk (in D) whose vertices are distinct. In other
words, a path means a walk (v0 , v1 , . . . , vk ) such that v0 , v1 , . . . , vk are
distinct.
(d) Let p and q be two vertices of D. A walk from p to q means a walk that
starts at p and ends at q. A path from p to q means a path that starts at
p and ends at q.
(e) A closed walk of D means a walk whose first vertex is identical with
its last vertex. In other words, it means a walk (w0 , w1 , . . . , wk ) with
w0 = wk . Sometimes, closed walks are also known as circuits (but
many authors use this latter word for something slightly different).
D= 1 3 4
.
Then, (1, 2, 3, 4) and (1, 3, 4) are two walks of D, and these walks are paths.
But (2, 3, 1) is not a walk (since you cannot use the arc 13 to get from 3 to 1).
This digraph D has no cycles, and its only closed walks have length 0.
An introduction to graph theory, version August 2, 2023 page 111
D= 1 3 4
.
( v 0 , a1 , v 1 , a2 , v 2 , . . . , a k , v k ) (with k ≥ 0) ,
ψ ( ai ) = ( v i − 1 , v i )
(that is, each arc ai has source vi −1 and target vi ). Note that we have
to record both the vertices and the arcs in our walk, since we want the
walk to “know” which arcs it traverses.
The vertices of a walk (v0 , a1 , v1 , a2 , v2 , . . . , ak , vk ) are v0 , v1 , . . . , vk ; the
arcs of this walk are a1 , a2 , . . . , ak . This walk is said to start at v0 and
end at vk ; it is also said to be a walk from v0 to vk . Its starting point is
v0 , and its ending point is vk . Its length is k.
2
a b
e
D= 1 c 3 4
g
f
d .
(a0 , e1 , a1 , . . . , ek , ak , f 1 , b1 , f 2 , b2 , . . . , f ℓ , bℓ )
= (a0 , e1 , a1 , . . . , ak−1 , ek , b0 , f 1 , b1 , . . . , f ℓ , bℓ )
= (a0 , e1 , a1 , . . . , ak−1 , ek , v, f 1 , b1 , . . . , f ℓ , bℓ )
Proof. The same (trivial) argument as for undirected graphs works here.
However, unlike for undirected graphs, we can no longer reverse walks or
paths in digraphs. Thus, it often happens that there is a walk from u to v, but
no walk from v to u.
Reducing a walk to a path (as we did in Proposition 2.9.5 for simple graphs
and in Proposition 3.3.9 for multigraphs) still works for multidigraphs:
4.5.3. Exercises
Exercise 4.1. Let D be a multidigraph with at least one vertex. Prove the
following:
ai , ai + ai + 1 , ai + ai + 1 + ai + 2 , . . . , ai + ai + 1 + · · · + ai + p − 1
Exercise 4.4. Let D be a simple digraph with n vertices and a arcs. Assume
that D has no loops, and that we have a > n2 /2. Prove the following:
(b) If D has only one toposort, then this toposort is a Hamiltonian path of
D.
Here, a Hamiltonian path in D means a walk of D that contains each
vertex of D exactly once.
An introduction to graph theory, version August 2, 2023 page 115
3 2
Exercise 4.6. Let n be a positive integer. Let D be a digraph that has no cycles
of length ≤ 2. Assume that D has at least 2n−1 vertices. Prove that D has an
induced subdigraph that has n vertices and has no cycles.
24 This is short for “topological sorting”. I don’t know where this name comes from.
An introduction to graph theory, version August 2, 2023 page 116
2
a b
e
D= 1 c 3 4
g
f
d
andthus Theorem 4.5.10 yields (among other things) that the (1, 3)-rd entry
Ck 1,3 of its k-th power Ck equals the number of all walks of D having
starting point 1, ending point 3 and length k.
The adjacency matrix of a multidigraph D determines D up to the iden-
tities of the arcs, and thus is often used as a convenient way to encode a
multidigraph.
Proof of Theorem 4.5.10. Forget that we fixed i, j and k. We want to prove the
following claim:
Before we prove this claim, let us recall that C is the adjacency matrix of D.
Thus, for each i ∈ V and j ∈ V, we have
(by the definition of the adjacency matrix). In other words, for each i ∈ V and
j ∈ V, we have
Ci,j = (the number of arcs from i to j) ,
where we agree that an “arc from i to j” means an arc a ∈ A with source i and
target j.
Renaming i as w in this statement, we obtain the following: For each w ∈ V
and j ∈ V, we have
for any i ∈ V and j ∈ V. (Indeed, this is just the rule for how matrices are
multiplied.)
We can now prove Claim 1:
[Proof of Claim 1: We shall prove Claim 1 by induction on k:
Induction base: We shall first prove Claim 1 for k = 0.
Indeed, let i ∈ V and j ∈ V. The 0-th power of any n × n-matrix is defined to
be the n × n identity matrix In ; thus, C0 = In . Hence,
(
1, if i = j;
C0 = ( In )i,j = (8)
i,j 0, if i 6= j
Now, forget that we fixed i and j. We thus have proven (9) for any i ∈ V and
j ∈ V. In other words, Claim 1 holds for k = 0. Thus, the induction base is
complete.
Induction step: Let g be a positive integer. Assume that Claim 1 holds for
k = g − 1. We must show that Claim 1 holds for k = g as well.
We have assumed that Claim 1 holds for k = g − 1. In other words, for any
i ∈ V and j ∈ V, we have
C g−1 = (the number of walks from i to j that have length g − 1) .
i,j
• First, we choose a vertex w of D to serve as the vertex v g−1 (that is, as the
penultimate vertex of the walk w). This vertex w must belong to V.
• Now, we choose the vertices v0 , v1 , . . . , v g−1 (that is, all vertices of our
walk except for the last one) and the arcs a1 , a2 , . . . , a g−1 (that is, all arcs
of our walk except for the last one) in such a way that v g−1 = w. This is
tantamount to choosing a walk v0 , a1 , v1 , a2 , v2 , . . . , a g−1 , v g−1 from i to
w that has length g − 1. This choice can be made in C g−1 i,w many ways
(because (10) shows
that the number of walks from i to w that have length
g − 1 is C g − 1 ).
i,w
• We have now determined all but the last vertex and all but the last arc of
our walk w. We set the last vertex v g of our walk to be j. (This is the only
possible option, since our walk w has to be a walk from i to j.)
• We choose the last arc a g of our walk w. This arc a g must have source v g−1
and target v g ; in other words, it must have source w and target j (since
v g−1 = w and v g = j). In other words, it must be an arc from w to j. Thus,
it can be chosen in Cw,j many ways (because (6) shows that the number of
arcs from w to j is Cw,j ).
we obtain
Now, forget that we fixed i and j. We thus have proven (11) for any i ∈ V
and j ∈ V. In other words, Claim 1 holds for k = g. Thus, the induction step is
complete. Hence, Claim 1 is proven by induction.]
Theorem 4.5.10 follows immediately from Claim 1.
E= 2 3
2 5 7
D= 3
1 4 6
.
25 Someauthors use the word “diconnected” for “strongly connected”. As this word is just a
single letter away from “disconnected”, I cannot recommend it.
An introduction to graph theory, version August 2, 2023 page 121
Example 4.6.9. The digraph from Example 4.5.2 is weakly connected, but not
at all strongly connected (indeed, each of its strong components has size 1).
The digraph from Example 4.5.3, on the other hand, is strongly connected.
(a) The walks of G are “more or less the same as” the walks of the multi-
digraph Gbidir . More precisely, each walk of G gives rise to a walk of
Gbidir (with the same starting point and the same ending point), and
conversely, each walk of Gbidir gives rise to a walk of G. If G has no
loops, then this is a one-to-one correspondence (i.e., a bijection) be-
tween the walks of G and the walks of Gbidir .
(b) The paths of G are “more or less the same as” the paths of the multi-
digraph Gbidir . This is always a one-to-one correspondence, since paths
cannot contain loops.
(c) The closed walks of G are “more or less the same as” the closed walks
of the multidigraph Gbidir .
(d) The cycles of G are not quite the same as the cycles of Gbidir . In fact, if e
is an edge of G with two distinct endpoints u and v, then (u, e, v, e, u) is
An introduction to graph theory, version August 2, 2023 page 122
not a cycle of G, but either (u, (e, 1) , v, (e, 2) , u) or (u, (e, 2) , v, (e, 1) , u)
is a cycle of Gbidir (this is best seen on a picture: G has the edge
(e, 1)
u v
e
u v (e, 2)
whereas Gbidir has the arc-pair ), so Gbidir
usually has more cycles than G has. But it is true that each cycle of G
gives rise to a cycle of Gbidir .
[Note: Keep in mind that the multidigraph with 0 vertices does not count
as strongly connected.]
[Solution: This is a generalization of Exercise 7 on midterm #2 from my
Spring 2017 course; see the course page for solutions.]
(a) The multidigraph D has an Eulerian circuit if and only if each vertex v
of D satisfies deg+ v = deg− v.
(b) The multidigraph D has an Eulerian walk if and only if all but two
vertices v of D satisfy deg+
v = deg− v, and the remaining two vertices
v satisfy deg+ v − deg− v ≤ 1.
Proof. The definition of Gbidir yields that each vertex v of Gbidir satisfies deg+ v =
deg v and deg− v = deg v, where deg v denotes the degree of v as a vertex of
G. Hence, each vertex v of Gbidir satisfies deg+ v = deg v = deg− v. In other
words, Gbidir is balanced.
Combining this proposition with Theorem 4.7.2 (a), we can obtain a curious
fact about undirected(!) multigraphs:
Proof. The multidigraph Gbidir is balanced (by Proposition 4.7.4) and weakly
connected (this follows easily from the connectedness of G). Hence, Theorem
4.7.2 (a) can be applied to D = Gbidir . Thus, Gbidir has an Eulerian circuit.
Reinterpreting this circuit as a circuit of G, we obtain a circuit of G that con-
tains each edge exactly twice, and uses it once in each direction. This proves
Theorem 4.7.5.
We might wonder what can be said about hamps and hamcs for digraphs. Is
there an analogue of Ore’s theorem? The answer is “yes”, but it is significantly
harder to prove:
Arev = {( j, i ) | (i, j) ∈ A} .
Thus, Drev is the digraph obtained from D by reversing each arc (i.e.,
swapping its source and its target). This is called the reversal of D.
(d) We define D as the simple digraph (V, (V × V ) \ A). This is the di-
graph that has the same vertices as D, but whose arcs are precisely the
non-arcs of D. This digraph D is called the complement of D.
3 4
D= .
Then,
1 2 1 2
3 4 3 4
Drev = and D= .
Convention 4.9.3. In the following, the symbol # means “number”. For ex-
ample,
(# of subsets of {1, 2, 3}) = 8.
and where
A = {(i, j) | i < j} .
Then, (# of hamps of D ) = 1.
Proof. The hamps of Drev are obtained from the hamps of D by walking back-
wards.
So far, so boring. What about this:
1 2 3
D= .
This digraph has 3 hamps: (1, 2, 3) and (2, 3, 1) and (3, 1, 2).
Its complement D looks as follows:
1 2 3
D= .
Proof of Theorem 4.9.6. (This is an outline; see [17s-lec7, proof of Theorem 1.3.6]
for more details.)
Write the simple digraph D as D = (V, A), and assume WLOG that V 6= ∅.
Set n = |V |.
A V-listing will mean a list of elements of V that contains each element of
V exactly once. (Thus, each V-listing is an n-tuple, and there are n! many V-
listings.) Note that a V-listing is the same as a hamp of the “complete” digraph
(V, V × V ). Any hamp of D or of D is therefore a V-listing, but not every
V-listing is a hamp of D or D.
If σ = (σ1 , σ2 , . . . , σn ) is a V-listing, then we define a set
We call this set P (σ) the arc set of σ. When we regard σ as a hamp of
(V, V × V ), this set P (σ) is just the set of all arcs of σ. Note that this is an
(n − 1)-element set. We make a few easy observations (prove them!):
Now, let N be the # of pairs (σ, B), where σ is a V-listing and B is a subset of
A satisfying B ⊆ P (σ). Thus,
N= ∑ Nσ ,
σ is a V-listing
where
Nσ = (# of subsets B of A satisfying B ⊆ P (σ)) .
But we also have
N= ∑ NB,
B is a subset of A
where
N B = (# of V-listings σ satisfying B ⊆ P (σ)) .
Let us now relate these two sums to hamps. We begin with ∑ Nσ .
σ is a V-listing
We shall use the Iverson bracket notation: i.e., the notation [A] for the truth
value of a statement A. This truth value is defined to be the number 1 if A is
true, and 0 if A is false. For instance,
[ 2 + 2 = 4] = 1 and [2 + 2 = 5] = 0.
An introduction to graph theory, version August 2, 2023 page 128
where
N B = (# of V-listings σ satisfying B ⊆ P (σ)) .
We want to prove that this sum equals (# of hamps of D ), at least modulo 2.
So let B be a subset of A. We want to know N B mod 2. In other words, we
want to know when N B is odd.
Let us first assume that N B is odd, and see what follows from this.
Since N B is odd, we have N B > 0. Thus, there exists at least one V-listing σ
satisfying B ⊆ P (σ). We shall now draw some conclusions from this.
First, a definition: A path cover of V means a set of paths in the “complete”
digraph (V, V × V ) such that each vertex v ∈ V is contained in exactly one of
these paths. The set of arcs of such a path cover is simply the set of all arcs of
all its paths. For example, if V = {1, 2, 3, 4, 5, 6, 7}, then
{(1, 3, 5) , (2) , (6) , (7, 4)}
An introduction to graph theory, version August 2, 2023 page 129
However,
h i
B B
N ≡ N is odd (since m ≡ [m is odd] mod 2 for any m ∈ Z)
= [ B = P (σ) for some hamp σ of D ] mod 2.
An introduction to graph theory, version August 2, 2023 page 130
N= ∑ NB
|{z}
B is a subset of A ≡[ B = P (σ) for some hamp σ of D ] mod 2
4.10. Tournaments
4.10.1. Definition
We now introduce a special class of simple digraphs.
3
.
An introduction to graph theory, version August 2, 2023 page 131
3
.
3
,
3
,
5
.
A tournament can also be viewed as a complete graph, whose each edge has
been given a direction.
Using Definition 4.9.1, we can restate the definition of a tournament as fol-
lows:
27 Here we agree to consider the empty list () to be a hamp of the digraph (∅, ∅).
An introduction to graph theory, version August 2, 2023 page 133
Theorem 4.10.6 (Easy Rédei theorem). A tournament always has at least one
hamp.
(# of hamps of D ) is odd.
Our goal now is to prove these two theorems. Clearly, the Easy Rédei Theo-
rem follows from the Hard one, since an odd number cannot be 0. Thus, it will
suffice to prove the Hard one.
The proof of the hard Rédei theorem will rely on the following crucial lemma:
D: v w D′ : v w
; .
(Here, we are only showing the arcs joining v with w, since D and D ′ agree in
all other arcs.)
Proof of Lemma 4.10.8. (This is an outline; see [17s-lec7, proof of Lemma 1.6.2]
for more details.)
First of all, D ′ is clearly a tournament. It remains to prove the congruence.
We introduce two more digraphs: Let
Note that these are not tournaments any more. Here is a comparative illustra-
tion of all four digraphs D, D ′ , D0 and D2 (again showing only the arcs joining
v with w, since there are no differences in the other arcs):
D: v w D′ : v w
; ;
D0 : v w D2 : v w
; .
(# of hamps of D0 )
= # of hamps of D ′ that do not use the arc wv
= # of hamps of D ′ − # of hamps of D ′ that use the arc wv .
(# of hamps of D )
= (# of hamps of D2 ) − (# of hamps of D2 that use the arc wv)
= (# of hamps of D2 ) − # of hamps of D ′ that use the arc wv
(the last equality is because a hamp of D2 that uses the arc wv cannot use the
arc vw, and therefore is automatically a hamp of D ′ as well, and of course the
converse is obviously true).
However, from the previously proved equality
(# of hamps of D0 )
= # of hamps of D ′ − # of hamps of D ′ that use the arc wv ,
we obtain
# of hamps of D ′
= (# of hamps of D0 ) + # of hamps of D ′ that use the arc wv
≡ (# of hamps of D0 ) − # of hamps of D ′ that use the arc wv mod 2
An introduction to graph theory, version August 2, 2023 page 135
(since x + y ≡ x − y mod 2 for any integers x and y). Thus, if we can show that
(# of hamps of D )
= (# of hamps of D2 ) − # of hamps of D ′ that use the arc wv
| {z }
≡(# of hamps of D0 ) mod 2
≡ (# of hamps of D0 ) − # of hamps of D ′ that use the arc wv
≡ # of hamps of D ′ mod 2,
(by Theorem 4.9.6). As explained above, this completes the proof of Lemma
4.10.8.
Now, the Hard Rédei theorem has become easy:
Proof of Theorem 4.10.7. (This is an outline; see [17s-lec7, proof of Theorem 1.6.1]
for more details.)
We need to prove that the # of hamps of D is odd. Lemma 4.10.8 tells us that
the parity of this # does not change when we reverse a single arc of D. Thus, of
course, if we reverse several arcs of D, then this parity does not change either.
However, we can WLOG assume that the vertices of D are 1, 2, . . . , n for some
n ∈ N, and then, by reversing the appropriate arcs, we can ensure that the arcs
of D are
(i.e., each arc of D has the form ij with i < j). But at this point, the tournament
D has only one hamp: namely, (1, 2, . . . , n). So (# of hamps of D ) = 1 is odd
at this point. Since the parity of the # of hamps of D has not changed as we
reversed our arcs, we thus conclude that it has always been odd. This proves
the Hard Rédei theorem (Theorem 4.10.7).
As we already mentioned, the Easy Rédei theorem follows from the Hard
Rédei theorem. But it also has a short self-contained proof ([17s-lec7, Theorem
1.4.9]).
In general, this is only a necessary criterion for a hamc, not a sufficient one.
Not every strongly connected digraph has a hamc. However, it turns out that
for tournaments, it is also sufficient, as long as the tournament has enough
vertices:
Proof sketch. A detailed proof can be found in [17s-lec7, Theorem 1.5.5]; here is
just a very rough sketch.
Let D = (V, A) be a strongly connected tournament with at least two ver-
tices.29 We must show that D has a hamc.
It is easy to see that D has a cycle. Let c = (v1 , v2 , . . . , vk , v1 ) be a cycle of
maximum length. We shall show that c is a hamc.
Let C be the set {v1 , v2 , . . . , vk } of all vertices of this cycle c.
A vertex w ∈ V \ C will be called a to-vertex if there exists an arc from some
vi to w.
28 Recallthat “hamc” is our shorthand for “Hamiltonian cycle”.
29 Bythe way, a tournament with exactly two vertices cannot be strongly connected (as it has
only 1 arc). Thus, by requiring D to have at least two vertices, we have actually guaranteed
that D has at least three vertices.
An introduction to graph theory, version August 2, 2023 page 137
• If a to-vertex w has an arc from some vi , then it must also have an arc
from vi +1 30 (because otherwise there would be an arc from w to vi +1 ,
and then we could make our cycle c longer by interjecting w between vi
and vi +1 ; but this would contradict the fact that c is a cycle of maximum
length).
• Iterating this argument, we see that if a to-vertex w has an arc from some
vi , then it must also have an arc from vi +1 , an arc from vi +2 , an arc from
vi +3 , and so on; i.e., it must have an arc from each vertex of c. Conse-
quently, w cannot be a from-vertex. This shows that a to-vertex cannot be
a from-vertex.
Let F be the set of all from-vertices, and let T be the set of all to-vertices.
Then, as we have just shown, F and T are disjoint. Moreover, F ∪ T = V \ C.
Since a to-vertex cannot be a from-vertex, we furthermore conclude that any to-
vertex has an arc from each vertex of c (otherwise, it would be a from-vertex),
and that any from-vertex has an arc to each vertex of c (otherwise, it would be
a to-vertex).
Next, we argue that there cannot be an arc from a to-vertex t to a from-vertex
f . Indeed, if there was such an arc, then we could make the cycle c longer by
interjecting t and f between (say) v1 and v2 .
In total, we now know that every vertex of D belongs to one of the three
disjoint sets C, F and T, and furthermore there is no arc from T to F, no arc
from T to C, and no arc from C to F. Thus, there exists no walk from a vertex
in T to a vertex in C (because there is no way out of T). This would contradict
the fact that D is strongly connected, unless the set T is empty. Hence, T must
be empty. Similarly, F must be empty. Since F ∪ T = V \ C, this entails that
V \ C is empty, so that V = C. In other words, each vertex of D is on our cycle
c. Therefore, c is a hamc. This proves Camion’s theorem.
There are many simple proofs of this theorem (e.g., a few on its ProofWiki
page, which works with the transpose matrix). I will now outline a combina-
torial one, using tournaments. This proof goes back to Ira Gessel’s 1979 paper
[Gessel79].
First, how do det V and ∏ xi − x j relate to tournaments?
1≤ i < j ≤ n
As a warmup, let’s assume that we have some number y(i,j) given for each
pair (i, j) of integers, and let’s expand the product
y(1,2) + y(2,1) y(1,3) + y(3,1) y(2,3) + y(3,2) .
The result is a sum of 8 products, one for each way to pluck an addend out of
each of the three little sums:
y(1,2) + y(2,1) y(1,3) + y(3,1) y(2,3) + y(3,2)
= y(1,2) y(1,3) y(2,3) + y(1,2) y(1,3) y(3,2) + y(1,2) y(3,1) y(2,3) + y(1,2) y(3,1) y(3,2)
+ y(2,1) y(1,3) y(2,3) + y(2,1) y(1,3) y(3,2) + y(2,1) y(3,1) y(2,3) + y(2,1) y(3,1) y(3,2) .
Note that each of the 8 products obtained has the form y a yb yc , where
We can view these pairs a, b and c as the arcs of a tournament with vertex
set {1, 2, 3}. Thus, our above expansion can be rewritten more compactly as
An introduction to graph theory, version August 2, 2023 page 139
follows:
y(1,2) + y(2,1) y(1,3) + y(3,1) y(2,3) + y(3,2)
= ∑ ∏ y(i,j).
D is a tournament (i,j) is an arc of D
with vertex set {1,2,3}
For reference, here are all the 8 tournaments with vertex set {1, 2, 3}:
1 1 1
2 3 2 3 2 3
1 1 1
2 3 2 3 2 3
1 1
2 3 2 3
Here, for convenience, we are drawing an arc ij in blue if i < j and in red
otherwise.
This expansion can be generalized: We have
∏ y (i,j) + y ( j,i ) = ∑ ∏ y(i,j) .
1≤ i < j ≤ n D is a tournament (i,j) is an arc of D
with vertex set {1,2,...,n }
An introduction to graph theory, version August 2, 2023 page 140
(
xj, if i < j;
Substituting y(i,j) = in this equality, we obtain
− x j , if i ≥ j
(
xj, if i < j;
∏ x j − xi = ∑ ∏ − x j , if i ≥ j
1≤ i < j ≤ n D is a tournament (i,j) is an arc of D
with vertex set {1,2,...,n } | {z }
n deg− j
=(−1)(# of red arcs of D) ∏ x j
j =1
(where deg− j means the indegree of j in D,
and where the “red arcs” are the arcs ij with i > j)
n
(# of red arcs of D ) deg− j
= ∑ (−1) xj ∏ .
D is a tournament j =1
with vertex set {1,2,...,n }
(by the definition of a determinant). We shall refer to this sum as the “small
sum”.
Our goal is to prove that the big sum equals the small sum. To prove this, we
must verify the following:
1. Each addend of the small sum is an addend of the big sum. Indeed, for
each permutation σ ∈ Sn , there is a certain tournament Tσ that has
n n
deg− j σ( j)−1
(−1)(# of red arcs of Tσ ) ∏ x j = sign σ · ∏ x j .
j =1 j =1
2. All the addends of the big sum that are not addends of the small sum
cancel each other out. Why?
The basic idea is to argue that if a tournament D appears in the big sum
but not in the small sum, then D has a 3-cycle (i.e., a cycle of length
3). When we reverse such a 3-cycle (i.e., we reverse each of its arcs), the
indegrees of all vertices are preserved, but the sign (−1)(# of red arcs of D) is
flipped (since three arcs change their orientation).
This suffices to show that for each addend that appears in the big sum but
not in the small sum, there is another addend with the same magnitude
but with opposite sign. Unfortunately, this in itself does not suffice to
An introduction to graph theory, version August 2, 2023 page 141
ensure that all these addends cancel out; for example, the sum 1 + 1 + 1 +
(−1) has the same property but does not equal 0. We need to show that
the # of addends with positive sign (i.e., with (−1)(# of red arcs of D) = 1)
and a given magnitude equals the # of addends with negative sign (i.e.,
with (−1)(# of red arcs of D) = −1) and the same magnitude.
One way to achieve this would be by constructing a bijection (aka “perfect
matching”) between the “positive” and the “negative” addends. This is
tricky here: We would have to decide which 3-cycle to reverse (as there
are usually many of them), and this has to be done in a bijective way
(so that two “positive” addends don’t get assigned the same “negative”
partner).
A less direct, but easier way is the following: Fix a positive integer k,
and consider only the tournaments with exactly k many 3-cycles. For
each such tournament, we can reverse any of its k many 3-cycles. It can
be shown (nice exercise!) that reversing the arcs of a 3-cycle does not
change the # of all 3-cycles; thus, we don’t accidentally change our k in the
process. Thus, we find a “k-to-k” correspondence between the “positive”
addends of a given magnitude and the “negative” addends of the same
magnitude. As one can easily see, this entails that the former and the
latter are equinumerous, and thus really cancel out. The addends that
remain are exactly those in the small sum.
As already mentioned, this is only a rough summary of the proof; the details
can be found in [17s-lec8].
For example, the tournament shown in Example 4.10.4 has the nine different
3-cycles
(1, 4, 3) , (1, 5, 3) , (2, 5, 3) , (3, 1, 4) ,
(3, 1, 5) , (3, 2, 5) , (4, 3, 1) , (5, 3, 1) ,
(5, 3, 2) .
(Yes, we are counting a 3-cycle (u, v, w) as being distinct from (v, w, u) and
(w, u, v).)
An introduction to graph theory, version August 2, 2023 page 142
Proof. We have already proved this for simple graphs (in Proposition 2.10.4).
More or less the same argument works for multigraphs. (“More or less” be-
cause the definition of a cycle in a multigraph is slightly different from that in
a simple graph; but the proof is easy to adapt.)
Proof. We have already proved this for simple graphs (Claim 1 in the proof of
Theorem 2.10.7). More or less the same argument works for multigraphs.
An introduction to graph theory, version August 2, 2023 page 144
Proof. Part (a) follows from Theorem 3.3.18 (a). Part (b) follows from Theorem
3.3.18 (b). Part (c) follows by combining parts (a) and (b).
conn ( G \ e) ≥ |V | − | E \ { e}|
An introduction to graph theory, version August 2, 2023 page 145
(since G \ e is a multigraph with vertex set V and edge set E \ { e}). However,
Corollary 5.1.5 (c) yields conn ( G \ e) ≤ conn G + 1. Thus,
conn G ≥ conn ( G \ e) −1 ≥ |V | − | E \ { e}| −1 = |V | − (| E| − 1) − 1 = |V | − | E| .
| {z } | {z }
≥|V |−| E \{e}| =| E |−1
Proof. Replay the proof of Corollary 5.1.6, with just a few changes: Instead of
applying Corollary 5.1.5 (c), apply Corollary 5.1.5 (b) (this is allowed because
G has no cycles and thus e appears in no cycle of G). The induction hypothesis
can be used because when G has no cycles, G \ e has no cycles either. All ≤ and
≥ signs in the above proof now can be replaced by = signs (since Corollary
5.1.5 (b) claims an equality, not an inequality). The result is therefore conn G =
|V | − | E | .
Corollary 5.1.8. Let G = (V, E, ϕ) be a multigraph that has at least one cycle.
Then, conn G ≥ |V | − | E| + 1.
Proof. Pick an edge e ∈ E that belongs to some cycle (such an edge exists, since
G has at least one cycle). Then, Corollary 5.1.5 (a) yields conn ( G \ e) = conn G.
However, Corollary 5.1.6 (applied to G \ e and E \ { e} instead of G and E) yields
conn ( G \ e) ≥ |V | − | E \ { e}| = |V | − (| E| − 1) = |V | − | E| + 1.
| {z }
=| E |−1
e
a 2 3
2 3
A= 1 b d g
B= 1 b d g
c
5 4 c
f 5 4
3
c
2 3 D= 1 2
a
g e
C= 1 b
.
c
5 4 4
2 2
a
a
b
E= 1 4 F= 1 4
c
c
d
3 3
G= H= 1
(Yes, G is an empty graph with no vertices.) Which of them are forests, and
which are trees?
• The graph A is not a forest, since it has a cycle (actually, several cycles).
Thus, A is not a tree either.
• The graph B is a tree.
• The graph C is a forest, but not a tree, since it is not connected.
• The graph D is a tree.
• The graph E is a forest, but not a tree.
An introduction to graph theory, version August 2, 2023 page 148
• The graph G (which has no vertices and no edges) is a forest, but not
a tree, since it is not connected (recall: a graph is connected if it has 1
component; but G has 0 components).
T7
T2
T6
T1 T3
T8
T5
T4
.
In this digraph, an arc from Ti to Tj stands for the implication Ti =⇒Tj. Since
this digraph is strongly connected (i.e., you can travel from Statement Ti to
Statement Tj along its arcs for any i, j), this will prove the theorem. So let us
prove the implications.
Proof of T1=⇒T3: Assume that Statement T1 holds. Thus, G is a tree. There-
fore, G is connected, so that V 6= ∅. We must prove that for each u ∈ V and
v ∈ V, there is a unique backtrack-free walk from u to v. The existence of such
a walk is clear (since G is connected, so there is a path from u to v). Thus, we
only need to show that it is unique. But this is easy: If there were two distinct
backtrack-free walks from u to v (for some u ∈ V and v ∈ V), then Theorem
5.1.3 would show that G has a cycle, and thus G could not be a forest, let alone
a tree. Thus, the backtrack-free walk from u to v is unique. So we have proved
Statement T3. The implication T1=⇒T3 is thus proved.
Proof of T3=⇒T2: Assume that Statement T3 holds. We must prove that State-
ment T2 holds. First, G has no loops, because if there was a loop e with end-
point u, then the two walks (u) and (u, e, u) would be two distinct backtrack-
free walks from u to u. It remains to prove that for each each u ∈ V and
v ∈ V, there is a unique path from u to v. However, the existence of a walk
from u to v always implies the existence of a path from u to v (by Corollary
3.3.10). Moreover, the uniqueness of a backtrack-free walk from u to v implies
the uniqueness of a path from u to v (since any path is a backtrack-free walk).
Thus, Statement T2 follows from Statement T3.
Proof of T2=⇒T7: Assume that Statement T2 holds. Then, G is connected.
Now, let us remove any edge e from G. Let u and v be the endpoints of e. Then,
u 6= v (since G has no loops). There cannot be a path from u to v in the graph
G \ e (because if there was such a path, then it would also be a path from u to v
in the graph G, and this path would be distinct from the path (u, e, v); thus, the
graph G would have at least two paths from u to v; but this would contradict
the uniqueness part of Statement T2). Hence, the graph G \ e is disconnected.
So we have shown that G is connected, but removing any edge from G yields a
disconnected graph. In other words, Statement T7 holds.
An introduction to graph theory, version August 2, 2023 page 150
Proof. =⇒: Assume that G is a forest. Thus, G has no cycles. Hence, the induced
subgraphs G [C1 ] , G [C2 ] , . . . , G [Ck ] have no cycles either (since a cycle in any
of them would be a cycle of G); in other words, they are forests. But they are
furthermore connected (since the induced subgraph on a component is always
connected). Hence, they are connected forests, i.e., trees.
⇐=: Assume that the induced subgraphs G [C1 ] , G [C2 ] , . . . , G [Ck ] are trees.
Hence, none of them has a cycle. Thus, G has no cycles either (since a cycle of
G would have to be fully contained in one of these induced subgraphs31 ). In
other words, G is a forest.
5.2.3. Summary
Let us briefly summarize some properties of trees:
If T = (V, E, ϕ) is a tree, then...
• adding any new edge to T creates a cycle. (This follows from the implica-
tion T1=⇒T6 in Theorem 5.2.4.)
31 Indeed,
if it wasn’t, then it would contain vertices from different components. But this is
impossible, since there are no walks between vertices in different components.
An introduction to graph theory, version August 2, 2023 page 152
Remark 5.2.6. Computer scientists use some notions of “trees” that are sim-
ilar to ours, but not quite the same. In particular, their trees often have roots
(i.e., one vertex is chosen to be called “the root” of the tree), which leads to
a parent/child relationship on each edge (namely: the endpoint closer to the
root is called the “parent” of the endpoint further away from the root). Of-
ten, they also impose a total order on the children of each given vertex. With
these extra data, a tree can be used for addressing objects, since each vertex
has a unique “path description” from the root leading to it (e.g., “the second
child of the fourth child of the root”). But this all is going too far afield for
us here; we are mainly interested in trees as graphs, and won’t impose any
extra structure unless we need it for something.
Exercise 5.1. Let G be a multigraph that has no loops. Assume that there
exists a vertex u of G such that
5.3. Leaves
Continuing with our faux-botanical terminology, we define leaves in a tree:
2 3
1 b d g
c
5 4
How to find a tree with as many leaves as possible (for a given number of
vertices)? For any n ≥ 3, the simple graph
3
2
4
0 1
5
7
6
(for n = 8) .
It is easy to see that no tree with n ≥ 3 vertices can have more than n − 1 leaves,
so the n-star graph is optimal in this sense. Note that for n = 2, the n-star graph
has 2 leaves, not 1.
How to find a tree with as few leaves as possible? For any n ≥ 2, the n-path
graph
Pn = 1 2 3 ··· n
is a tree with only 2 leaves (viz., the vertices 1 and n). Can we find a tree with
fewer leaves? For n = 1, yes, because the 1-path graph P1 (this is simply the
graph with 1 vertex and no edges) has no leaves at all. However, for n ≥ 2, the
n-path graph is the best we can do:
(b) Let v be a vertex of T. Then, there exist two distinct leaves p and q of T
such that v lies on the path from p to q.
Note that I’m saying “the path” rather than “a path” here. This is allowed,
because in a tree, for any two vertices p and q, there is a unique path from p
to q. This follows from Statement T2 in the tree equivalence theorem (Theorem
5.2.4).
Proof of Theorem 5.3.2. (b) We apply a variant of the “longest path trick”: Among
all paths that contain the vertex v, let w be a longest one. Let p be the starting
An introduction to graph theory, version August 2, 2023 page 154
point of w, and let q be the ending point of w. We shall show that p and q are
two distinct leaves.
[Here is a picture of w, for what it’s worth:
p ··· v ··· q
.
Of course, the tree T can have other edges as well, not just those of w.]
First, we observe that T is connected (since T is a tree), and has at least one
vertex u distinct from v (since T has at least 2 vertices). Hence, T has a path r
that connects v to u. This path r must contain at least one edge (since u 6= v).
Thus, we have found a path r of T that contains v and contains at least one
edge. Hence, the path w must contain at least one edge as well (since w is a
longest path that contains v, and thus cannot be shorter than r). Since w is a
path from p to q, we thus conclude that p 6= q (because if a path contains at
least one edge, then its starting point is distinct from its ending point).
Now, assume (for the sake of contradiction) that p is not a leaf. Then, deg p 6=
1. The path w already contains one edge that contains p (namely, the first edge
of w). Since deg p 6= 1, there must be another edge f of T that contains w.
Consider this f . Let p′ be its endpoint distinct from p (if f is a loop, then we
set p′ = p). Appending this edge f (and its endpoint) to the beginning of the
path w, we obtain a backtrack-free walk
p′ , f , p, . . . , v, . . . , q
| {z }
This is w
(this is backtrack-free since f is not the first edge of w). According to Proposi-
tion 5.1.2, this backtrack-free walk either is a path or contains a cycle. Since T
has no cycle (because T is a forest), we thus conclude that this backtrack-free
walk is a path. It is furthermore a path that contains v and is longer than w
(longer by 1, in fact). But this contradicts the fact that w is a longest path that
contains v. This contradiction shows that our assumption (that p is not a leaf)
was wrong.
Hence, p is a leaf. A similar argument shows that q is a leaf (here, we need
to append the new edge at the end of w rather than at the beginning). Thus,
p and q are two distinct leaves of T (distinct because p 6= q) such that v lies on
the path from p to q (since v lies on the path w, which is a path from p to q).
This proves Theorem 5.3.2 (b).
(a) Pick any vertex v of T. Then, Theorem 5.3.2 (b) shows that there exist two
distinct leaves p and q of T such that v lies on the path from p to q. Thus, in
particular, there exist two distinct leaves p and q of T. In other words, T has at
least two leaves. This proves Theorem 5.3.2 (a).
An introduction to graph theory, version August 2, 2023 page 155
[Remark: Another way to prove part (a) is to write the tree T as T = (V, E, ϕ),
and recall the handshake lemma, which yields
Since each v ∈ V satisfies deg v ≥ 1 (why?), this equality entails that at least
two vertices v ∈ V must satisfy deg v ≤ 1 (since otherwise, the sum ∑ deg v
v ∈V
would be ≥ 2 · |V | − 1), and therefore these two vertices are leaves.]
Leaves are particularly helpful for performing induction on trees. The formal
reason for this is the following theorem:
Theorem 5.3.3 (induction principle for trees). Let T be a tree with at least 2
vertices. Let v be a leaf of T. Let T \ v be the multigraph obtained from T
by removing v and all edges that contain v (note that there is only one such
edge, since v is a leaf). Then, T \ v is again a tree.
5 8 5 8
1 7 1 7
3 2 6 2 6
4 4
T T\v
Proof. Left to the reader. (The main step is to show that a cycle of G cannot
contain v.)
Theorem 5.3.3 helps prove many properties of trees by induction on the num-
ber of vertices. In the induction step, remove a leaf v and apply the induction
hypothesis to T \ v.
The following exercise is essentially a generalization of Theorem 5.3.2 (a):
Exercise 5.2. Let T be a tree. Let w be any vertex of T. Prove that T has at
least deg w many leaves.
∑ (−1)|D| = ±1.
D is a dominating set of G
Exercise 5.4. Let T be a tree having more than 1 vertex. Let L be the set of
leaves of T. Prove that it is possible to add | L| − 1 new edges to T in such a
way that the resulting multigraph has a Hamiltonian cycle.[Solution: This is
Exercise 4 on homework set #3 from my Spring 2017 course; see the course
page for solutions.]
An introduction to graph theory, version August 2, 2023 page 157
• To build an induced subgraph, we throw away some vertices but keep all
the edges that we can keep. (As usual in mathematics, the words “some
vertices” include “no vertices” and “all vertices”.)
λ
ε 2 3 κ
1 δ 4
α
β γ
µ ν
5
.
An introduction to graph theory, version August 2, 2023 page 158
ε 2 3
1 δ 4
α
ν
5
.
Here is another:
ε 2 3
1 δ 4
β
ν
5
.
(Yes, this is a different one, because α 6= β.) And here is yet another spanning
tree of G:
λ
ε 2 3
1 4
β
ν
5
.
Example 5.4.4. Let n be a positive integer. Consider the cycle graph Cn . (We
defined this graph Cn in Definition 2.6.3 for all n ≥ 2, but we later redefined
C2 and defined C1 in Definition 3.3.5. Here, we are using the latter modified
definition.)
The graph Cn has exactly n spanning trees. Indeed, any graph obtained
from Cn by removing a single edge is a spanning tree of Cn .
Proof. A tree with n vertices must have exactly n − 1 edges (by the implication
T1=⇒T4 in Theorem 5.2.4). Thus, a spanning subgraph of Cn can be a tree only
if it has n − 1 edges, i.e., only if it is obtained from Cn by removing a single edge
(since Cn has n edges in total). Thus, Cn has at most n spanning trees (since
Cn has n edges that can be removed). It remains to check that any subgraph
An introduction to graph theory, version August 2, 2023 page 159
a, b, x1 , x2 , . . . , xm , y1 , y2 , . . . , ym , z1 , z2 , . . . , zm
(Thus, the graph consists of two vertices a and b connected by three paths,
each of length m + 1, with no overlaps between the paths except for their
starting and ending points. Here is a picture for m = 3:
x1 x2 x3
a y1 y2 y3 b
z1 z2 z3
Theorem 5.4.6. Each connected multigraph G has at least one spanning tree.
with endpoints u and v to L creates a cycle if and only if u and v lie in the
same component of L (before we add e). Thus, we only add an edge to L if
its endpoints lie in different components of L; otherwise, we discard it. This
way, at the end of the procedure, our graph L will still have no cycles (since we
never create any cycles). In other words, it will be a forest.
Let me denote this forest by H. (Thus, H is the L at the end of the procedure.)
I claim that this forest H is a spanning tree of G. Why? Since we know that H is
a forest, we only need to show that H is connected. Assume the contrary. Thus,
there is at least one edge e of G whose endpoints lie in different components of
H (why?). This edge e is therefore not an edge of H. Therefore, at some point
during our construction of H, we must have discarded this edge e (instead of
adding it to L). As we know, this means that the endpoints of e used to lie
in the same component of L at the point at which we discarded e. But this
entails that these two endpoints lie in the same component of L at the end of
the procedure as well (because the graph L never loses any edges during the
procedure, so that any two vertices that used to lie in the same component of
L at some point will still lie in the same component of L ever after). In other
words, the endpoints of e lie in the same component of H. This contradicts
our assumption that the endpoints of e lie in different components of H. This
contradiction completes our proof that H is connected. Hence, H is a spanning
tree of G, and we have proved Theorem 5.4.6 again.
Third proof. This proof takes yet another approach to constructing a spanning
tree of G: We choose an arbitrary vertex r of G, and then progressively “spread
a rumor” from r. The rumor starts at vertex r. On day 0, only r has heard
the rumor. Every day, every vertex that knows the rumor spreads it to all its
neighbors (i.e., all vertices adjacent to it). Since G is connected, the rumor
will eventually spread to every vertex of G. Now, each vertex v (other than r)
remembers which other vertex v′ it has first heard the rumor from (if it heard
it from several vertices at the same time, it just picks one of them), and picks
some edge ev that has endpoints v and v′ (such an edge must exist, since v must
have heard the rumor from a neighbor). The edges ev for all v ∈ V \ {r } (where
V is the vertex set of G) then form a spanning tree of G (that is, the graph with
vertex set V and edge set {ev | v ∈ V \ {r }} is a spanning tree). Why?
Intuitively, this is quite convincing: This graph cannot have cycles (because
that would require a time loop) and must be connected (because for any ver-
tex v, we can trace back the path of the rumor from r to v by following the
edges ev backwards). To obtain a rigorous proof, we formalize this construction
mathematically:
Write G as G = (V, E, ϕ). Choose any vertex r of G.
We shall recursively construct a sequence of subgraphs
(V0 , E0 , ϕ0 ) , (V1 , E1 , ϕ1 ) , (V2 , E2 , ϕ2 ) , ...
of G. The idea behind these subgraphs is that for each i ∈ N, the set Vi will
consist of all vertices v that have heard the rumor by day i, and the set Ei will
An introduction to graph theory, version August 2, 2023 page 162
Ei +1 := Ei ∪ {ev | v ∈ Vi +1 \ Vi } .
33 We say that an edge joins a vertex p to a vertex q if the endpoints of this edge are p and q.
34 Here is the proof in detail: We must show that Vi = V. Assume the contrary. Thus, there
exists a vertex u ∈ V \ Vi . Consider this u. The path from r to u starts at a vertex in Vi
(since r ∈ V0 ⊆ Vi ) and ends at a vertex in V \ Vi (since u ∈ V \ Vi ). Thus, it must cross over
from Vi into V \ Vi at some point. Therefore, there exists an edge with one endpoint in Vi
and the other endpoint in V \ Vi . Let v and w be these two endpoints, so that v ∈ Vi and
w ∈ V \ Vi . Then, w is adjacent to some vertex in Vi (namely, to v), and therefore belongs to
Vi+1 (by the definition of Vi+1 ). Hence, w ∈ Vi+1 = Vi . But this contradicts w ∈ / V \ Vi . This
contradiction shows that our assumption was wrong, qed.
An introduction to graph theory, version August 2, 2023 page 163
2
5
1 4
3 10
.
V0 = { 3} ,
V1 = {3, 1, 4} ,
V2 = {3, 1, 4, 2, 5, 6, 10} ,
V3 = {3, 1, 4, 2, 5, 6, 10, 8, 9, 7} = V,
2
5
1 4
3 10
(The dark-red inner circle is V0 ; the red circle is V1 ; the orange circle is V2 ;
the yellow circle is V3 = V4 = V5 = · · · = V.) Finally, the edges ev can be
An introduction to graph theory, version August 2, 2023 page 165
chosen to be the following (we are painting them red for clarity):
7
e7
2
e6 5 e8
e2
8
e5
1 4
e10
e9 9
e3 e4
3 10
.
(Here, we have made two choices: We chose e2 to be the edge joining 2 with 1
rather than the edge joining 2 with 4, and we chose e7 to be the edge joining
7 with 6 rather than 7 with 5. The other options would have been equally
fine.)
We now return to the general proof. Let us first show the following:
Claim 1: Let j ∈ N. Each vertex of the graph Vj , E j , ϕ j is path-
connected to r in this graph.
(Vk−1 , Ek−1 , ϕk−1 ) (by the induction hypothesis, since u ∈ Vk−1 ), hence also
in the graph (Vk , Ek , ϕk ) (since (Vk−1 , Ek−1 , ϕk−1 ) is a subgraph of (Vk , Ek , ϕk )).
Since the relation “path-connected” is transitive, we conclude from the previous
two sentences that v is path-connected to r in the graph (Vk , Ek , ϕk ).
So we have shown that each vertex v of the graph (Vk , Ek , ϕk ) is path-connected
to r in the graph (Vk , Ek , ϕk ). In other words, Claim 1 holds for j = k. This com-
pletes the induction step, and Claim 1 is proved.]
Claim 1 (applied to j = i) shows that each vertex of the graph (Vi , Ei , ϕi ) is
path-connected to r in this graph. Since the relation “path-connected” is an
equivalence relation, this entails that any two vertices of this graph are path-
connected. Thus, the graph (Vi , Ei , ϕi ) is connected (since it has at least one
vertex). It remains to prove that this graph (Vi , Ei , ϕi ) is a forest.
Again, we do this using an auxiliary claim:
Claim 2: Let j ∈ N. Then, the graph Vj , E j , ϕ j has no cycles.
Vk = {v ∈ V | d (r, v) ≤ k} ,
• If some neighbor of v has not been bitten yet, then the snake picks such
a neighbor w as well as some edge f that joins w with v; the snake then
moves to w along the edge f , bites the vertex w and marks the edge f .
• If not, then the snake marks the vertex v as fully digested and backtracks
(along the marked edges) to the last vertex it has visited but not fully
digested yet.
2 5 9 12
1 4 10 13
3 6 11 14
7
.
Let our snake start its journey at r = 3. It bites this vertex. Then, let’s say
that it picks the vertex 1 as its next victim (it could just as well go to 4 or 7;
the snake has many choices, but we follow one possible trip). Thus, it next
arrives at vertex 1, bites it and marks the edge that brought it to this vertex.
As its next destination, it necessarily picks the vertex 2 (since vertex 3 has
already been bitten). It moves to vertex 2, bites it and marks the edge. Next,
let’s say that it picks the vertex 4 (the other option would be 8). It thus moves
to 4, bites it and marks the edge. Proceeding likewise, it then moves to 5 (the
other options are 6 and 10; the vertices 2 and 3 do not qualify since they are
already bitten), bites 5 and marks an edge. From there, let’s say it moves to
8, bites 8 and marks an edge. Now, there is no longer an unbitten neighbor
of 8 to move to. Thus, the snake marks the vertex 8 as fully digested and
backtracks to the last vertex not fully digested – which, at this point, is 5.
From this vertex 5, it moves on to 9 (this is the only option, since 4 and 8
have already been bitten). And so on. Here is one possible outcome of this
journey (there are a few more decisions that the snake can make here, so you
An introduction to graph theory, version August 2, 2023 page 169
2 5 9 12
1 4 10 13
3 6 11 14
7
.
Here, the marked edges are drawn in bold red ink, and endowed with an
arrow that represents the direction in which they were first used (e.g., the
edge joining 2 with 4 has an arrow towards 4 because it was first used to get
from 2 to 4).
Now, as promised, let me outline a proof of the above claim (that the marked
edges form a spanning tree of G). To wit, argue the following four observations
(ideally in this order):
1. After each step, the marked edges are precisely the edges along which the
snake has moved so far.
2. After each step, the network of bitten vertices and marked edges is a tree.
4. At that point, the network of bitten vertices and marked edges is a span-
ning tree (since each neighbor of a fully digested vertex is bitten, thus
fully digested by observation 3).
5.4.5. Applications
Spanning trees have lots of applications:
Proof. Pick a spanning tree T of G (we know from Theorem 5.4.6 that such a
spanning tree exists). Then, T has at least 2 leaves (by Theorem 5.3.2 (a)). But
each leaf of T is a non-cut-vertex of G (why?).
5.4.6. Exercises
[Hint: The two parts look very similar, but (to my knowledge) their proofs
are not.]
3
a d
b
1 2
c ,
3
a
1 2
c
3 3
a a d
b
1 2 1 2
3 3
d
b
1 2 1 2
c c
Proof. Apply Theorem 5.4.6 to each component of the multigraph. Then, com-
bine the resulting spanning trees into a spanning forest.
Remark 5.5.3. Distances in a multigraph satisfy the rules that you would
expect a distance function to satisfy:
(c) We have d (u, v) + d (v, w) ≥ d (u, w) for any vertices u, v and w. (Here,
we understand that ∞ ≥ m and ∞ + m = ∞ for any m ∈ N.)
Also:
An introduction to graph theory, version August 2, 2023 page 174
(e) If V is the vertex set of our multigraph, then d (u, v) ≤ |V | − 1 for any
vertices u and v.
Proof. Part (d) follows from Corollary 3.3.10. The proofs of (a), (b) and (c) are
then straightforward (the proof of (c) relies on part (d), because splicing two
paths generally only yields a walk, not a path). Finally, in order to prove part
(e), observe that any path of our multigraph has length ≤ |V | − 1 (since its
vertices are distinct).
We note that the definition of a distance becomes simpler if our multigraph
is a tree: Namely, if T is a tree, then the distance d (u, v) between two vertices
u and v is the length of the only path from u to v in T. Thus, in a tree, we do
not have to worry whether a given path is the shortest.
We also notice that if G is a multigraph, and if u and v are two vertices of
G, then the distance d G (u, v) in G equals the distance d Gsimp (u, v) in the simple
graph Gsimp . (The reason for this is that any path of G can be converted into
a path of Gsimp having the same length, and vice versa. Of course, this is not
a one-to-one correspondence, but it suffices for our purposes.) Thus, when
studying distances on a multigraph, we can WLOG restrict ourselves to simple
graphs.
The following few exercises give some curious properties of distances in var-
ious kinds of graphs.
Exercise 5.10. Let a, b and c be three vertices of a connected multigraph
G = (V, E, ϕ). Prove that d (b, c) + d (c, a) + d ( a, b) ≤ 2 |V | − 2.
[Solution: This is Exercise 7 on midterm #1 from my Spring 2017 course,
except that the simple graph has been replaced by a multigraph (but this
makes no serious difference); see the course page for solutions.]
are equal.
[Solution: This is Exercise 6 on midterm #2 from my Spring 2017 course;
see the course page for solutions.]
max {d (v, u) | u ∈ V } ∈ N ∪ { ∞} .
r u w
p q v
.
Then, the eccentricities of its vertices are as follows (we are just labeling each
vertex with its eccentricity):
2 3 4
4 3 2
.
Example 5.5.8. Let G be a graph with more than one component. Then, each
vertex v of G has eccentricity ∞ (because there exists at least one vertex u
that lies in a different component of G than v, and thus this vertex u satisfies
d (v, u) = ∞). Hence, each vertex of G is a center of G.
To prove Theorem 5.5.9, we first study how a tree is affected when all its
leaves are removed:
(that is, the paths of T from u to v are precisely the paths of T \ L from
u to v).
1 2 3 4
5 6 7 9
8 10 11
.
Then, the set L from Lemma 5.5.10 is {4, 5, 7, 8, 10, 11}, and the tree T \ L
looks as follows:
1 2 3
6 9
.
Proof of Lemma 5.5.10. First, we notice that T is a forest (since T is a tree), and
thus has no cycles. In particular, T therefore has no loops and no parallel edges.
Also, for any two vertices u and v of T, there is a unique path from u to v in T.
Next, we introduce some terminology: If p is a path of some multigraph, then
an intermediate vertex of p shall mean a vertex of p that is neither the starting
point nor the ending point of p. In other words, if p = ( p0 , e1 , p1 , e2 , p2 , . . . , ek , pk )
is a path of some multigraph, then the intermediate vertices of p are p1 , p2 , . . . , pk−1 .
Clearly, any intermediate vertex of a path p must have degree ≥ 2 (since the
path p enters it along some edge, and leaves it along another). Hence, if p is a
path of T, then
(because it must have degree ≥ 2, thus cannot be a leaf of T; but this means
that it cannot belong to L; therefore, it must belong to V \ L).
(b) Let u ∈ V \ L and v ∈ V \ L. Let p be a path of T from u to v. We shall
show that p is a path of T \ L as well.
Indeed, let us first check that all vertices of p belong to V \ L. This is clear for
the vertices u and v (since u ∈ V \ L and v ∈ V \ L); but it also holds for every
intermediate vertex of p (by (12)). Thus, it does indeed hold for all vertices of
p.
An introduction to graph theory, version August 2, 2023 page 179
(d) If u and v are two vertices of T \ L, then the two distances d T (u, v) and
d T \ L (u, v) are equal (by Lemma 5.5.10 (c)); thus, we shall denote both distances
by d (u, v) (since there is no confusion to be afraid of).
Let v ∈ V \ L. We must show that eccT v = eccT \ L v + 1.
Let u be a vertex of T \ L such that d (v, u) is maximum. Thus, eccT \ L v =
d (v, u) (by the definition of eccT \ L v). However, u is a vertex of T \ L, and thus
does not belong to L. Hence, u is not a leaf of T (since L is the set of all leaves
of T). Hence, u has degree ≥ 2 in T (since a vertex in a tree with more than 1
vertex cannot have degree 0).
Now, consider the path p from v to u in the tree T. This path p has length
d (v, u). Since u has degree ≥ 2, there exist at least two edges of T that contain
u. Hence, in particular, there exists at least one edge f that contains u and is
distinct from the last edge of p 37 . Consider this edge f . Let w be the endpoint
of f other than u. Appending f and w to the end of the path p, we obtain a
walk from v to w. This walk is backtrack-free (since f is distinct from the last
edge of p) and thus must be a path (by Proposition 5.1.2, since T has no cycles).
This path has length d (v, u) + 1 (since it was obtained by appending an edge
to the path p, which has length d (v, u)). Hence, d (v, w) = d (v, u) + 1. But the
definition of eccentricity yields
On the other hand, let x be a vertex of T such that d (v, x ) is maximum. Thus,
eccT v = d (v, x ) (by the definition of eccT v). The path from v to x has length
≥ 1 (since otherwise, we would have x = v and therefore d (v, x ) = d (v, v) = 0,
which would easily contradict the maximality of d (v, x )). Thus, it has a second-
to-last vertex. Let y be this second-to-last vertex. Then, the path from v to
y is simply the path from v to x with its last edge removed. Consequently,
d (v, y) = d (v, x ) − 1. However, it is easy to see that y ∈ V \ L 38 . In other
words, y is a vertex of T \ L. Thus, the definition of eccentricity yields
37 Ifthe path p has no edges, then f can be any edge that contains u.
38 Proof.Assume the contrary. Thus, y ∈ / V \ L. Hence, y 6= v (since y ∈
/ V \ L but v ∈ V \ L).
However, y is the second-to-last vertex of the path from v to x. Therefore, y is either
the starting point v of this path, or an intermediate vertex of this path. Since y 6= v, we
thus conclude that y is an intermediate vertex of this path. Hence, by (12), we see that y
must belong to V \ L. But this contradicts y ∈ / V \ L. This contradiction shows that our
assumption was false, qed.
An introduction to graph theory, version August 2, 2023 page 181
(e) If u and v are two vertices of T \ L, then the two distances d T (u, v) and
d T \ L (u, v) are equal (by Lemma 5.5.10 (c)); thus, we shall denote both distances
by d (u, v) (since there is no confusion to be afraid of).
Let v ∈ L be a leaf. Let w be the unique neighbor of v in T. We must prove
that eccT v = eccT w + 1.
We first claim that
d (v, u) = d (w, u) + 1 for each u ∈ V \ { v} . (14)
[Proof of (14): We have deg v = 1 (since v is a leaf). In other words, there is a
unique edge of T that contains v. Let e be this edge. The endpoints of e are v
and w (since w is the unique neighbor of v). Thus, v 6= w (since T has no loops)
and d (v, w) = 1.
Now, let u ∈ V \ {v}. Then, the path from v to u in T must have length ≥ 1
(since u 6= v), and therefore must begin with the edge e (since e is the only edge
that contains v). If we remove this edge e from this path, we thus obtain a path
from w to u. As a consequence, the path from v to u is longer by exactly 1 edge
than the path from w to u. In other words, we have d (v, u) = d (w, u) + 1. This
proves (14).]
Now, the definition of eccentricity yields
eccT v = max { d (v, u) | u ∈ V } . (15)
This maximum is clearly not attained for u = v (since d (v, v) = 0 is smaller
than d (v, w) = 1). Thus, this maximum does not change if we remove v from
its indexing set V. Hence, (15) rewrites as
eccT v = max d (v, u) | u ∈ V \ { v}
| {z }
=d(w,u)+1
(by (14))
= max {d (w, u) + 1 | u ∈ V \ {v}}
= max {d (w, u) | u ∈ V \ {v}} + 1. (16)
On the other hand, the definition of eccentricity yields
eccT w = max { d (w, u) | u ∈ V } . (17)
We shall now show that this maximum does not change if we remove v from
its indexing set V. In other words, we shall show that
max {d (w, u) | u ∈ V } = max { d (w, u) | u ∈ V \ { v}} . (18)
[Proof of (18): Assume that (18) is false. Then, the maximum max {d (w, u) | u ∈ V }
is attained only at u = v. In other words, we have
d (w, v) > d (w, u) for all u ∈ V \ {v} . (19)
An introduction to graph theory, version August 2, 2023 page 182
However, the tree T has more than 2 vertices. Thus, it has a vertex u that is
distinct from both v and w. Consider this u. Thus, u ∈ V \ { v}, so that (19)
yields d (w, v) > d (w, u). In view of d (w, v) = d (v, w) = 1, this rewrites as
1 > d (w, u), so that d (w, u) < 1. Therefore, w = u. But this contradicts the
facts that w is distinct from u. This contradiction shows that our assumption
was false, and thus (18) is proved.]
Now, (16) becomes
In other words, the tree T \ L has either 1 or 2 centers, and if it has 2 centers,
then these 2 centers are adjacent. Since the centers of T are precisely the centers
of T \ L, we can rewrite this as follows: The tree T has either 1 or 2 centers,
and if it has 2 centers, then these 2 centers are adjacent. In other words, parts
(a) and (b) of Theorem 5.5.9 hold for our tree T. This completes the induction
step. Thus, parts (a) and (b) of Theorem 5.5.9 are proved.
(c) This follows from Lemma 5.5.10 (f). Indeed, if T has at most 2 vertices,
then all vertices of T are centers of T (this is trivial to check). If not, then each
“leaf-removal” step of our algorithm leaves the set of centers of T unchanged
(by Lemma 5.5.10 (f)), and thus the centers of the original tree T are precisely
the centers of the tree that remains at the end of the algorithm. But the latter
tree has at most 2 vertices, and thus its centers are precisely its vertices. So the
centers of T are precisely the vertices that remain at the end of the algorithm.
Theorem 5.5.9 (c) is proven.
The following exercise shows another approach to the centers of a tree:
(b) If m is odd, then the two centers of T are p(m−1)/2 and p(m+1)/2 .
Remark 5.5.12. Exercise 5.14 is a result by Arthur Cayley from 1875. It shows
once again that each tree has exactly one center or two adjacent centers, and
also shows that any two longest paths of a tree have a common vertex.
Exercise 5.15. Let T be a tree. For any vertex v of T, we let cv denote the size
of the largest component of the graph T \ v. (Recall that T \ v is the graph
obtained from T by removing the vertex v and all edges that contain v. Note
that a component (according to our definition) is a set of vertices; thus, its
size is the number of vertices in it.)
The vertices v of T that minimize the number cv are called the centroids of
T.
(a) Prove that T has no more than two centroids, and furthermore, if T has
two centroids, then these two centroids are adjacent.
An introduction to graph theory, version August 2, 2023 page 184
(b) Find a tree T such that the centroid(s) of T are distinct from the center(s)
of T.
10 9 10
10 5 7 10
8 10
10 10
.
Thus, the vertex labelled 5 is the only centroid of this tree T.]
Note the analogy between Exercise 5.15 (a) and Theorem 5.5.9 (a) and (b).
5.6. Arborescences
5.6.1. Definitions
Enough about undirected graphs.
What would be a directed analogue of a tree? I.e., what kind of digraphs
play the same role among digraphs that trees do among undirected graphs?
Trees are graphs that are connected and have no cycles. This suggests two
directed versions:
• We can study digraphs that are strongly connected and have no cycles.
Unfortunately, there is not much to study: Any such digraph has only 1
vertex and no arcs. (Make sure you understand why!)
fewer edges than vertices, but a dag can have more arcs than vertices.39
(a) We say that r is a from-root (or, short, root) of D if for each vertex v of
D, the digraph D has a path from r to v.
2 3
0
1 4
40 We recall that we defined a multigraph Dund for every multidigraph D (in Definition
4.4.1). Roughly speaking, this multigraph Dund is obtained by “forgetting the di-
rections” of the arcs of D. Parallel arcs are not merged into one. For example,
if D = 1 2 , then Dund = 1 2
.
An introduction to graph theory, version August 2, 2023 page 186
2 3
0
1 4
which has only one from-root (namely, 1) and is still not an arborescence (for
the same reason as before).
5 8
1 7
3 2 6
4
.
5 8
1 7
3 2 6
4
,
• Statement C2: The undirected multigraph Dund is a tree, and each arc
of D is “oriented away from r” (this means the following: the source of
this arc lies on the unique path between r and the target of this arc on
Dund ).
• Statement A5: If we remove any arc from D, then the vertex r will no
longer be a from-root of the resulting multidigraph.
(v0 , a1 , v1 , a2 , v2 , . . . , ak , vk , a, t) ,
This contradiction shows that our assumption was false. Hence, the digraph
D \ a has no path from r to t. Thus, r is not a from-root of D \ a.
Forget that we fixed a. We have now proved that if a is any arc of D, then r
is not a from-root of D \ a. In other words, if we remove any arc from D, then
the vertex r will no longer be a from-root of the resulting multidigraph. Thus,
Statement A5 holds.
Proof of the implication A5=⇒A6: Assume that Statement A5 holds. We must
prove that Statement A6 holds. In other words, we must prove that deg− r = 0,
and that each v ∈ V \ {r } satisfies deg− v = 1.
Let us first prove that deg− r = 0. Indeed, assume the contrary. Thus,
deg− r 6= 0, so that there exists an arc a with target r. We shall show that r
is a from-root of D \ a.
The arc a has target r. Thus, a path that starts at r cannot use this arc a
(because this arc would lead it back to r, but a path is not allowed to revisit
any vertex), and therefore must be a path of D \ a. Thus we have shown that
any path of D that starts at r is also a path of D \ a. However, for each vertex
v of D, the digraph D has a path from r to v (since r is a from-root of D). This
path is also a path of D \ a (since any path of D that starts at r is also a path
of D \ a). Thus, for each vertex v of D \ a, the digraph D \ a has a path from
r to v. In other words, r is a from-root of D \ a. However, we have assumed
that Statement A5 holds. Thus, in particular, if we remove the arc a from D,
then the vertex r will no longer be a from-root of the resulting multidigraph. In
other words, r is not a from-root of D \ a. But this contradicts the fact that r is
a from-root of D \ a.
This contradiction shows that our assumption was false. Hence, deg− r = 0
is proved.
Now, let v ∈ V \ {r } be arbitrary. We must show that deg− v = 1.
Indeed, assume the contrary. Thus, deg− v 6= 1. Using the fact that r is a
from-root of D, it is thus easy to see that deg− v ≥ 2 41 . Hence, there exist
two distinct arcs a and b with target v. Consider these arcs a and b.
We are in one of the following three cases:
Case 1: The digraph D \ a has a path from r to v.
Case 2: The digraph D \ b has a path from r to v.
Case 3: Neither the digraph D \ a nor the digraph D \ b has a path from r to
v.
Let us first consider Case 1. In this case, the digraph D \ a has a path from r
to v. Let p be such a path.
We have assumed that Statement A5 holds. Thus, in particular, if we remove
the arc a from D, then the vertex r will no longer be a from-root of the resulting
41 Proof.Since r is a from-root of D, we know that the digraph D has a path from r to v. Since
v 6= r (because v ∈ V \ {r }), this path must have at least one arc. The last arc of this path
is clearly an arc with target v. Thus, there exists at least one arc with target v. In other
words, deg− v ≥ 1. Combining this with deg− v 6= 1, we obtain deg− v > 1. In other words,
deg− v ≥ 2.
An introduction to graph theory, version August 2, 2023 page 190
= 0+ ∑ 1= ∑ 1 = |V \ {r }| = |V | − 1.
v∈V \{r } v∈V \{r }
Proof. We recall that since T is a tree, the distance d ( p, q) between two vertices
p and q of T is simply the length of the path from p to q. (This path is unique,
since T is a tree.)
Let p be the path from r to u. Then, we are in one of the following two cases:
Case 1: The edge e is an edge of p.
Case 2: The edge e is not an edge of p.
Consider Case 1. In this case, e must be the last edge of p (since otherwise, p
would visit u more than once, but p cannot do this, since p is a path). Thus, if
we remove this last edge e (and the vertex u) from p, then we obtain a path from
r to v. This path is exactly one edge shorter than p. Thus, d (r, v) = d (r, u) − 1,
so that d (r, u) = d (r, v) + 1. So we are done in Case 1.
Now, consider Case 2. In this case, the edge e is not an edge of p. Thus, we
can append e and v to the end of the path p, and the result will be a backtrack-
free walk p′ . However, a backtrack-free walk in a tree is always a path (since
otherwise, it would contain a cycle44 , but a tree has no cycles). Thus, p′ is a
path from r to v, and it is exactly one edge longer than p (by its construction).
Therefore, d (r, v) = d (r, u) + 1. So we are done in Case 2.
Now, we are done in both cases, so that Proposition 5.7.1 is proven.
Example 5.7.3. Here is a tree T, a vertex r, an edge e and its r-parent e−r and
44 by Proposition 5.1.2
An introduction to graph theory, version August 2, 2023 page 193
T r→ := (V, E, ψ) ,
Example 5.7.5. If T is the tree from Example 5.7.3, then T r→ is the following
multidigraph:
The proof of this theorem is best organized by splitting into two lemmas:
Lemma 5.7.7. Let T = (V, E, ϕ) be a tree. Let r ∈ V be a vertex of T. Then,
the multidigraph T r→ is an arborescence rooted from r.
Proof. The idea is to show that if p is a path from r to some vertex v in the tree
T, then p is also a path in the digraph T r→ , because all the edges of p have been
“oriented correctly” (i.e., their orientation matches how they are used in p).
Here are the details: Clearly, (T r→ )und = T. Hence, the graph (T r→ )und is a
tree and hence has no cycles. Thus, it suffices to prove that r is a from-root of
T r→ . In other words, we must prove that
T r→ has a path from r to v (20)
for each v ∈ V.
We shall prove (20) by induction on d (r, v) (where d means the distance on
the tree T):
Base case: If v ∈ V satisfies d (r, v) = 0, then v = r, and thus T r→ has a path
from r to v (namely, the trivial path (r )). Thus, (20) is proved for d (r, v) = 0.
Induction step: Let k ∈ N. Assume (as the induction hypothesis) that (20)
holds for each v ∈ V satisfying d (r, v) = k. We must now prove the same for
each v ∈ V satisfying d (r, v) = k + 1.
So let v ∈ V satisfy d (r, v) = k + 1. Then, the path of T from r to v has
length k + 1. Let p be this path, let e be its last edge, and let u be its second-
to-last vertex (so that its last edge e has endpoints u and v). Then, by removing
the last edge e from the path p, we obtain a path from r to u that is one edge
shorter than p. Hence, d (r, u) = d (r, v) − 1 < d (r, v). Consequently, the edge
e has r-parent u and r-child v (by Definition 5.7.2). In other words, e−r = u
and e+r = v. Therefore, in the digraph T r→ , the edge e is an arc from u to
v (by Definition 5.7.4). Moreover, we have d (r, u) = d (r, v) − 1 = k (since
d (r, v) = k + 1); therefore, the induction hypothesis tells us that (20) holds for
u instead of v. In other words, T r→ has a path from r to u. Attaching the arc
e and the vertex v to this path, we obtain a walk of T r→ from r to v (since e
is an arc from u to v in T r→ ). Thus, the digraph T r→ has a walk from r to v,
therefore also a path from r to v. Hence, (20) holds for our v. This completes
the induction step.
Thus, (20) is proved by induction. As we explained above, this yields Lemma
5.7.7.
Lemma 5.7.8. Let D = (V, A, ψ) be an arborescence rooted from r (for some
r ∈ V). Let a ∈ A be an arc of D. Let s be the source of a, and let t be the
target of a. Then:
(a) We have d (r, s) < d (r, t), where d means distance on the tree Dund .
r →
(b) In the multidigraph Dund , the arc a has source s and target t.
An introduction to graph theory, version August 2, 2023 page 195
the arc a has source s and target t as well. In other words, ψ′ ( a) = (s, t) (since
ψ′ is the psi-map of this multidigraph). Hence, ψ′ ( a) = (s, t) = ψ ( a).
Forget that we fixed a. We thus have shown that ψ′ ( a) = ψ ( a) for each
a ∈ A. In other words, ψ′ = ψ. As explained above, this completes the proof of
Statement C2.
Proof of the implication C2=⇒C1: Assume that Statement C2 holds. Thus, the
r →
undirected multigraph Dund is a tree, and we have D = Dund . Hence,
und und
r→
Lemma 5.7.7 (applied to T = D ) yields that the multidigraph D is
an arborescence rooted from
und
r→ r. In other words, D is an arborescence rooted
from r (since D = D ). This shows that Statement C1 holds.
Having now proved both implications C1=⇒C2 and C2=⇒C1, we conclude
that Statements C1 and C2 are equivalent. Thus, Theorem 5.7.6 is proved.
Oof.
Let’s get one more consequence out of this. First, let us show that an arbores-
cence can have only one root:
Proposition 5.7.9. Let D be an arborescence rooted from r. Then, r is the
only root of D.
Proof of Proposition 5.7.9. Assume the contrary. Thus, D has another root s dis-
tinct from r. Hence, D has a path from r to s (since r is a root) as well as a path
from s to r (since s is a root). Combining these paths gives a circuit of length
> 0. However, a circuit of length > 0 in a digraph must always contain a cycle
(since Proposition 4.5.9 shows that it either is a path or contains a cycle; but it
clearly cannot be a path). Hence, D has a cycle. Therefore, Dund also has a cycle
(since any cycle of D is a cycle of Dund ). However, Dund has no cycles (since
D is an arborescence rooted from r). The preceding two sentences contradict
each other. This shows that the assumption was wrong, and Proposition 5.7.9
is proven.
Definition 5.7.10. A multidigraph D is said to be an arborescence if there
exists a vertex r of D such that D is an arborescence rooted from r. In this
case, this r is uniquely determined as the only root of D (by Proposition
5.7.9).
and
√
where D denotes the root of D.
However, Statement 1 follows from Theorem 5.7.6 (specifically, from the im-
plication C1=⇒C2 in Theorem 5.7.6). Statement 2 follows from Lemma 5.7.7
r → und = T part of Statement 2 is obvious, whereas
q precisely, the ( T )
(more
the ( T r→ )und = r part follows from Lemma 5.7.7). Thus, Theorem 5.7.11 is
proved.
Theorem 5.7.11 formalizes the idea that an arborescence is “just a tree with a
chosen vertex”. For this reason, arborescences are sometimes called “oriented
trees”, but this name is also shared with a more general notion, which is why I
avoid it.
2
a b
e
D= 1 c 3 4
g
f
d .
2
a
e
c
1 3 4
V, { a, c, e} , ψ |{ a,c,e} = .
2
3
4
5
)
−
→
Note that this digraph C n is a directed analogue of the cycle graph Cn . As
we recall from Example 5.4.4, the cycle graph Cn has n spanning trees.
−
→
In contrast, the digraph C n has only one spanning arborescence rooted
−
→
from 1. This spanning arborescence is the subdigraph of C n obtained by
removing the arc n1.
An introduction to graph theory, version August 2, 2023 page 200
−
→
Proof. If we remove the arc n1 from C n , then we obtain the simple digraph E
with vertices 1, 2, . . . , n and arcs 12, 23, . . . , (n − 1) n. This digraph E is easily
seen to be an arborescence rooted from 1 (indeed, 1 is a from-root of E, and the
underlying undirected graph Eund = Pn has no cycles). Thus, E is a spanning
−
→
arborescence of C n rooted from 1.
We shall now prove that it is the only such arborescence. Indeed, let F be
−
→
any spanning arborescence of C n rooted from 1. Then, 1 is a from-root of
F. Hence, for each vertex v ∈ {2, 3, . . . , n}, the digraph F must have a path
from 1 to v, and thus must contain an arc with target v (namely, the last arc
−
→
of this path). This arc must be (v − 1, v) (since this is the only arc of C n with
target v). Thus, for each vertex v ∈ {2, 3, . . . , n}, the digraph F must contain
the arc (v − 1, v). In other words, the digraph F must contain all n − 1 arcs
−→
12, 23, . . . , (n − 1) n. If F were to also contain the remaining arc n1 of C n ,
then the underlying undirected graph Fund = Cn would contain a cycle, which
would contradict F being an arborescence. Hence, F cannot contain the arc n1.
Thus, F contains the n − 1 arcs 12, 23, . . . , (n − 1) n and no others. In other
−
→
words, F = E. This shows that any spanning arborescence of C n rooted from
−
→
1 must be E. In other words, E is the only spanning arborescence of C n rooted
from 1. This completes the proof of Example 5.8.6.
The “BEST” in the name of this theorem is an abbreviation for de Bruijn, van
Aardenne–Ehrenfest, Smith and Tutte, who discovered it in the middle of the
20th century45 . 46
45 More precisely, van Aardenne–Ehrenfest and de Bruijn discovered it in 1951 (see [VanEhr51,
§6]) generalizing an earlier result of Smith and Tutte.
46 We note that the number of Eulerian circuits of D whose last arc is a is precisely the number
An introduction to graph theory, version August 2, 2023 page 201
Clearly, Definition 5.6.1 and Definition 5.10.1 differ only in the direction of
the arcs. In other words, if we reverse each arc of our digraph (turning its
source into its target and vice versa), then a from-root becomes a to-root, and
an arborescence rooted from r becomes an arborescence rooted to r, and vice
versa. Thus, every property that we have proved for arborescences rooted from
r can be translated into the language of arborescences rooted to r by reversing
all arcs.
If you want to see this stated more rigorously, here is a formal definition of “revers-
ing each arc”:
Definition 5.10.2. Let D = (V, A, ψ) be a multidigraph. Then, Drev shall denote the
multidigraph (V, A, τ ◦ ψ), where τ : V × V → V × V is the map that sends each
pair (s, t) to (t, s). Thus, if an arc a of D has source s and target t, then it is also an
arc of Drev , but in this digraph Drev it has source t and target s.
The multidigraph Drev is called the reversal of the multidigraph D; we say that it
is obtained from D by “reversing each arc”.
Note that when we reverse each arc in a digraph D, the outdegrees of its
vertices become their indegrees and vice versa. Hence, a balanced digraph D
remains balanced when this happens. In particular, the BEST theorem (Theo-
rem 5.9.1) thus gets translated as follows:
We will soon prove Theorem 5.10.4, and then derive Theorem 5.9.1 from it by
reversing the arcs.
First, however, let us state the analogue of the Arborescence Equivalence
Theorem (Theorem 5.6.5) for “arborescences rooted to r” (as opposed to “ar-
borescences rooted from r”):
• Statement A’5: If we remove any arc from D, then the vertex r will no
longer be a to-root of the resulting multidigraph.
Proof. Upon reversing all arcs of D, this turns into the original Arborescence
Equivalence Theorem (Theorem 5.6.5).
An introduction to graph theory, version August 2, 2023 page 203
Claim 1: This set Exit e (or, more precisely, the spanning subdigraph
(V, Exit e, ψ |Exit e )) is a spanning arborescence of D rooted to r.
Let’s assume for the moment that Claim 1 is proven. Thus, given any a-
Eulerian circuit e, we have constructed a spanning arborescence of D rooted to
r.
How many a-Eulerian circuits e lead to a given arborescence in this way?
The answer is rather nice:
k f
c j 1
h l
e
4
d
5 i
(1, a, 2, b, 3, c, 4, d, 5, e, 1, f , 3, g, 3, h, 5, i, 5, j, 2, k, 4, l, 1)
(we have deliberately named the arcs in such a way that they appear on an
Eulerian circuit in alphabetic order). Then,
k
j 1
h l
[Proof of Claim 1: The set Exit e contains exactly one outgoing arc (namely,
e (u)) from each vertex u ∈ V \ {r }, and no outgoing arc from r. Thus, |Exit e| =
|V | − 1.
Let us number the arcs of e as a1 , a2 , . . . , am , in the order in which they appear
in e. (Thus, a1 = a, since the first arc of e is a.)
Recall that the arcs in Exit e are the arcs e (u) for all u ∈ V \ {r } (defined as
above – i.e., the arc e (u) is the last exit of e from u). We shall refer to these arcs
as the last-exit arcs.
For each u ∈ V \ {r }, we let j (u) be the unique number i ∈ {1, 2, . . . , m} such
that e (u) = ai . (This i indeed exists and is unique, since each arc of D appears
exactly once on e.) Thus, j (u) tells us how late in the Eulerian circuit e the arc
e (u) appears. Since e (u) is the last exit of e from u, the Eulerian circuit e never
visits the vertex u again after this.
Thus, if a last-exit arc e (u) has target v 6= r, then
j ( u) < j ( v ) (21)
(because the arc e (u) leads the circuit e into the vertex v, which the circuit then
has to exit at least once; therefore, the corresponding last-exit arc e (v) has to
appear later in e than the arc e (u)).
An introduction to graph theory, version August 2, 2023 page 206
We shall now show that r is a to-root of Exit e (that is, of the spanning subdi-
graph (V, Exit e, ψ |Exit e )). To this purpose, we must show that for each vertex
v ∈ V, there is a path from v to r in the digraph (V, Exit e, ψ |Exit e ).
Indeed, let v ∈ V be any vertex. We must find a path from v to r in the
digraph (V, Exit e, ψ |Exit e ). It will suffice to find a walk from v to r in this
digraph (by Corollary 4.5.8). In other words, we must find a way to walk from
v to r in D using last-exit arcs only.
So we start walking at v. If v = r, then we are already done. Otherwise, we
have v ∈ V \ {r }, so that the arc e (v) and the number j (v) are well-defined.
We thus take the arc e (v). This brings us to a vertex v′ (namely, the target of
e (v)) that satisfies j (v) < j (v′ ) (by (21)). If this vertex v′ is r, then we are done.
If not, then e (v′ ) and j (v′ ) are well-defined, so we continue our walk by taking
the arc e (v′ ). This brings us to a further vertex v′′ (namely, the target of e (v′ ))
that satisfies j (v′ ) < j (v′′ ) (by (21)). If this vertex v′′ is r, then we are done.
Otherwise, we proceed as before. We thus construct a walk
v, e (v) , v′ , e v′ , v′′ , e v′′ , . . .
deg+
B r = 0, and deg+
B v = 1 for all v ∈ V \ {r }
(where deg+ B v means the outdegree of a vertex in the digraph (V, B, ψ | B )).
In other words, there is no B-arc with source r; however, for each vertex u ∈
V \ {r }, there is exactly one B-arc with source u.
Now, we are trying to count the a-Eulerian circuits e such that Exit e = B.
An introduction to graph theory, version August 2, 2023 page 207
2
b
g 3 a
k f
c j 1
h l
e
4
d 5 i
,
and let r = 1 and a = a (we called it a on purpose). Let B be the set { d, e, h, k},
regarded as a spanning subdigraph of D. (The arcs of B are drawn bold and
in red in the above picture.)
The turtle starts at r = 1 and walks along the arc a. This leads it to the
vertex 2. It now must choose between the arcs b and k, but since it must not
use the B-arc k unless it has to, it is actually forced to take the arc b next.
This brings it to the vertex 3. It now has to choose between the arcs c, g and
h, but again the arc h is disallowed because it is not yet time to use a B-arc.
Let us say that it takes the arc g. This brings it back to the vertex 3. Next, the
turtle must walk along c (since g is already used, while the B-arc still must
An introduction to graph theory, version August 2, 2023 page 208
wait until it is the only option). This brings it to the vertex 4. Its next step is
to take the arc l to the vertex 1. From there, it follows the arc f to the vertex
3. Now, it can finally take the B-arc h, since all the other outgoing arcs from
3 have already been used. This brings it to the vertex 5. Now it has a choice
between the arcs e, i and j, but the arc e is disallowed because it is a B-arc.
Let us say it decides to use the arc j. This brings it to the vertex 2. From
there, it takes the B-arc k to the vertex 4 (since it has no other options). From
there, it continues along the B-arc d to the vertex 5. Now, it has to traverse
the loop i, and then leave 5 along the B-arc e to come back to 1. At this point,
the turtle is stuck, since it has nowhere left to go. The walk w we obtained is
thus
w = (1, a, 2, b, 3, g, 3, c, 4, l, 1, f , 3, h, 5, j, 2, k, 4, d, 5, i, 5, e, 1) .
(Of course, other choices would have led to other walks.)
Returning to the general case, let us analyze the walk w traversed by the
turtle.
Thus, we have shown that all vertices of D are exhausted. In other words,
the turtle has used all arcs of D. In other words, the trail w contains all arcs of
D. Since w is a trail and a closed walk, this entails that w is an Eulerian circuit
of D. Since w starts with r and a, this shows further that w is an a-Eulerian
circuit. Since the turtle only used B-arcs as a last resort (and it used each B-arc
eventually, because w is Eulerian), we have Exit w = B.
Thus, the turtle’s walk has produced an a-Eulerian circuit e satisfying Exit e =
B (namely, the walk w). However, this circuit depends on some decisions the
turtle made during its walk. Namely, every time the turtle was at some vertex
u ∈ V, it had to decide which arc to take next; this arc had to be an unused arc
with source u, subject to the conditions that
Let us count how many options the turtle has had in total. To make the
argument clearer, we modify the procedure somewhat: Instead of deciding ad-
hoc which arc to take, the turtle should now make all these decisions before
embarking on its journey. To do so, it chooses, for each vertex u ∈ V, a total
order on the set of all arcs with source u, such that
where each asterisk stands for some B-arc (not the same one, of course). This is a closed
walk of the digraph (V, B, ψ | B ). Since this closed walk has length > 0, it cannot be a path;
therefore, it contains a cycle (by Proposition 4.5.9). Thus, we have found a cycle of the
digraph (V, B, ψ | B ). However, the digraph (V, B, ψ | B ) is an arborescence, and thus has no
cycles (because if D is an arborescence, then any cycle of D would be a cycle of Dund ; but
the multigraph Dund has no cycles by the definition of an arborescence). The previous two
sentences contradict each other. This shows that our assumption was wrong, and our proof
is finished.
48 We say “the B-arc”, because there is exactly one B-arc with source u.
An introduction to graph theory, version August 2, 2023 page 211
between two sets such that each element of Y has exactly m preimages under f .
51 The multijection principle is a basic counting principle that says the following: Let X and Y
be two finite sets, and let m ∈ N. Let f : X → Y be an m-to-1 correspondence (i.e., a map
such that each element of Y has exactly m preimages under f ). Then, | X | = m · |Y |.
For example, n (intact) sheep have 4n legs in total, since the map that sends each leg to
its sheep is a 4-to-1 correspondence.
52 The symbol “#” means “number”.
An introduction to graph theory, version August 2, 2023 page 212
Proof of Corollary 5.12.1. WLOG assume that |V | > 1 (else, the claim is obvious).
If there is a vertex v ∈ V with deg+ v = 0, then this vertex v satisfies deg− v = 0
as well (since the balancedness of D entails deg− v = deg+ v = 0), and therefore
D has no spanning arborescences at all (since any spanning arborescence would
have an arc with source or target v). Thus, we WLOG assume that deg+ v > 0
for all v ∈ V. In other words, each vertex has outdegree > 0.
Let r and s be two vertices of D. We must prove that τ ( D, r ) = τ ( D, s).
Pick an arc a with source r. (This exists, since deg+ r > 0.) Pick an arc b with
source s. (This exists, since deg+ s > 0.)
Applying the BEST’ theorem (Theorem 5.10.4), we get
ε ( D, a) = τ ( D, r ) · ∏ deg+ u − 1 ! and similarly
u ∈V
ε ( D, b) = τ ( D, s) · ∏ deg+ u − 1 !.
u ∈V
B := { e | (e, i ) ∈ B} .
(Recall that we are identifying spanning arborescences with their arc sets, so
that “(e, i ) ∈ B” means “(e, i ) is an arc of B”.)
Then:
is a bijection.
An introduction to graph theory, version August 2, 2023 page 214
Example 5.13.2. Here is a multigraph G (on the left) with the corresponding
multidigraph Gbidir (on the right):
5 5
3 4 3 4
2 1 2 1
G Gbidir
5 5
3 4 3 4
2 1 2 1
B B
(here, the arcs of Gbidir that don’t belong to B, as well as the edges of G that
don’t belong to B, have been drawn as dotted arrows). It is fairly easy to see
how B can be reconstructed from B: You just need to replace each edge of B
by the appropriately directed arc (namely, the one that is “directed towards
1”).
no longer dealing with trees in isolation, but rather with spanning trees of G).
(a) Let B be a spanning arborescence of Gbidir rooted to r. Then, Bund is a tree
(by the implication A’1=⇒A’3 in Theorem 5.10.5). However, it is easy to see
that Bund ∼= B as multigraphs (indeed, each vertex v of Bund corresponds to the
same vertex v of B, whereas any edge (e, i ) of Bund corresponds to the edge e
of B) 53 . Thus, B is a tree (since Bund is a tree)54 , therefore a spanning tree of
G (since B is clearly a spanning subgraph of G). This proves Proposition 5.13.1
(a).
(b) We must prove that this map is surjective and injective.
Surjectivity: Let T be a spanning tree of G. Then, the multidigraph T r→
(defined in Definition 5.7.4) is an arborescence rooted from r (by Lemma 5.7.7).
Reversing each arc in this arborescence T r→ , we obtain a new multidigraph
T r← , which is thus an arborescence rooted to r. Unfortunately, T r← is not a
subdigraph of Gbidir , for a rather stupid reason: The arcs of T r← are elements
of E, whereas the arcs of Gbidir are pairs of the form (e, i ) with e ∈ E and
i ∈ {1, 2}.
Fortunately, this is easily fixed: For each arc e of T r← , we let e′ be the arc
(e, i ) of Gbidir that has the same source as e (and thus the same target as e). This
is uniquely determined, since the arcs (e, 1) and (e, 2) of Gbidir have different
sources55 . If we replace each arc e of T r← by the corresponding arc e′ of Gbidir ,
then we obtain a spanning subdigraph S of Gbidir that is an arborescence rooted
to r (since T r← is an arborescence rooted to r, and we have only replaced its
arcs by equivalent ones with the same sources and the same targets). In other
words, we obtain a spanning arborescence S of Gbidir rooted to r. It is easy to
see that S = T. Hence, the map
n o
bidir
spanning arborescences of G rooted to r → {spanning trees of G } ,
B 7→ B
53 Here we need to use the fact that for each edge e of B, exactly one of the two pairs (e, 1) and
(e, 2) is an edge of Bund . But this is easy to check: At least one of the two pairs (e, 1) and
(e, 2) must be an arc of B (since e is an edge of B). In other words, at least one of the two
pairs (e, 1) and (e, 2) must be an edge of Bund . But both of these pairs cannot be edges of
Bund at the same time (since this would create a cycle, but Bund is a tree and thus has no
cycles). Hence, exactly one of these pairs is an edge of Bund , qed.
54 Alternatively, you can prove this as follows: The vertex r is a to-root of B (since B is an
arborescence rooted to r). Thus, for each v ∈ V, there is a path from v to r in B. By “project-
ing” this path onto B (that is, replacing each arc (e, i ) of this path by the corresponding edge
e of B), we obtain a path from v to r in B. This shows that the multigraph B is connected.
Furthermore, the definition of B shows that B ≤ | B| = |V |−1 (by Statement A’2 in The-
orem 5.10.5, since B is an arborescence rooted to r). Hence, B < |V |. Thus, we can apply
the implication T5=⇒T1 of the Tree Equivalence Theorem (Theorem 5.2.4) to conclude that
B is a tree.
55 Proof. The edge e of T is not a loop (because T is a tree, but a tree cannot have any loops).
Hence, its two endpoints are distinct. Thus, the arcs (e, 1) and (e, 2) of Gbidir have different
sources (since their sources are the two endpoints of e).
An introduction to graph theory, version August 2, 2023 page 216
sends S to T. This shows that T is a value of this map. Since we have proved this
for every spanning tree T of G, we have thus shown that this map is surjective.
Injectivity: The main idea is that, in order to recover a spanning arborescence
B back from the corresponding spanning tree B, we just need to “orient the
edges of the tree towards r”. Here are the (annoyingly long) details:
Let B and C be two sparbs56 such that B = C. We must show that B = C.
Assume the contrary. Thus, B 6= C. Let T be the tree B = C. Thus, each edge
e of T corresponds to either an arc (e, 1) or an arc (e, 2) in B (since T = B), and
likewise for C. Conversely, each arc (e, i ) of B or of C corresponds to an edge e
of T. Hence, from B 6= C, we see that there must exist an edge e of T such that
Consider this edge e. We WLOG assume that (e, 1) ∈ B and (e, 2) ∈ C (else,
we can just swap B with C). Let the arc (e, 1) of Gbidir have source s and target
t, so that (e, 2) has source t and target s. The edge e thus has endpoints s and t.
Since B is an arborescence rooted to r, the vertex r is a to-root of B. Hence,
there exists a path p from s to r in B. This path p must begin with the arc (e, 1)
57 . Projecting this path p down onto T, we obtain a path p from s to r in T. (By
the word “projecting”, we mean replacing each arc (e, i ) by the corresponding
edge e. Clearly, doing this to a path in B yields a path in T, because T = B.)
Since the path p begins with the arc (e, 1), the “projected” path p begins with
the edge e. Thus, in the tree T, the path from s to r begins with the edge e
(because this path must be the path p). As a consequence, t must be the second
vertex of this path (since the edge e has endpoints s and t), so that removing the
first edge from this path yields the path from t to r. Thus, d (t, r ) = d (s, r ) − 1,
where d denotes distance on the tree T. Hence, d (t, r ) < d (s, r ).
A similar argument (but with the roles of B and C swapped, as well as the
roles of s and t swapped, and the roles of (e, 1) and (e, 2) swapped) shows that
d (s, r ) < d (t, r ). But this contradicts d (t, r ) < d (s, r ).
This contradiction shows that our assumption was false. Thus, we have
proved that B = C.
Forget that we fixed B and C. We thus have shown that if B and C are two
sparbs such that B = C, then B = C. In other words, our map
n o
spanning arborescences of Gbidir rooted to r → {spanning trees of G } ,
B 7→ B
is injective.
We have now shown that this map is both surjective and injective. Hence, it
is a bijection. This proves Proposition 5.13.1 (b).
Example 5.14.1. There is only one spanning tree of the complete graph K1 :
1 .
1 2 .
2 2 2
1 1 1 .
3 3 3
2 2 2 2
3 1 3 1 3 1 3 1
4 4 4 4
2 2 2 2
3 1 3 1 3 1 3 1
4 4 4 4
.
2 2 2 2
3 1 3 1 3 1 3 1
4 4 4 4
2 2 2 2
3 1 3 1 3 1 3 1
4 4 4 4
5.14.2. Notations
First, we introduce a notation:
An introduction to graph theory, version August 2, 2023 page 219
For example,
a b c a b c
d e f = f d e f a b
and = .
g h
g h i 2,3 g h i ∼2,∼3
1 3
.
One thing we notice from this example is that loops do not matter at all to
the Laplacian L. Indeed, a loop with source i and target i counts once in deg+ i
and once in ai,i , but these contributions cancel out.
Here is a simple property of Laplacians:
Proof. The sum of all columns of L is the zero vector, because for each i ∈ V we
have
n n
∑ Li,j = ∑ deg+ i · [i = j] − ai,j (by the definition of L)
j =1 j =1
n n
+
= ∑ deg i · [i = j] − ∑ ai,j
j =1 j =1
| {z } | {z }
=deg+ i =deg+ i
(since only the addend (since this is counting
for j=i can be nonzero) all arcs with source i)
+ +
= deg i − deg i = 0.
In other words, we have Le = 0 for the vector e := (1, 1, . . . , 1)T . Thus, this
vector e lies in the kernel (aka nullspace) of L, and so L is singular.
(Note that we used the positivity of n here! If n = 0, then e is the zero vector,
because a vector with 0 entries is automatically the zero vector.)
some interesting information; they are “the closest the matrix has” to a nonzero
determinant. In the case of the Laplacian, they turn out to count spanning ar-
borescences:
• The determinant det ( L∼r,∼r ) is the (r, r )-th entry of the adjugate matrix
of L.
(this is the n × n-matrix whose diagonal entries are n − 1 and whose off-diagonal
entries are −1). By Proposition
5.13.1 (b) (applied to G = Kn and r = 1),
there is a bijection between spanning arborescences of Knbidir rooted to 1 and
59 Suchmatrices are perfectly fine, just somewhat unusual and hard to write down (which row
do you put on top?). See https://mathoverflow.net/questions/317105 for details.
An introduction to graph theory, version August 2, 2023 page 222
= nn −2 .
An introduction to graph theory, version August 2, 2023 page 223
• The so-called matrix determinant lemma says that for any m × m-matrix
A ∈ R m×m , any column vector u ∈ R m×1 and any row vector v ∈ R1×m ,
we have
det ( A + uv) = det A + v (adj A) u.
This helps us compute our determinant, since
n − 1 −1 · · · −1
−1 n − 1 · · · −1
.. .
. . . .
.
. . . .
−1 −1 · · · n − 1
n 0 ··· 0 −1
0 n
· · · 0 −1
= . .. .. . + . 1 1 ··· 1 .
.. . . .. .. | {z }
=v
0 0 ··· n −1
| {z } | {z }
=A =u
There are other ways as well. Either way, the result we obtain is nn−2 . Thus,
we have proved (relying on the Matrix-Tree Theorem, which we haven’t yet
proved):
In other words:
Proof. This is just Theorem 5.14.8, since the simple graphs with vertex set
{1, 2, . . . , n} that are trees are precisely the spanning trees of Kn .
There are many ways to prove Cayley’s formula (Theorem 5.14.8). I can par-
ticularly recommend the two combinatorial proofs given in [Galvin21, §2.4 and
§2.5], as well as Joyal’s proof sketched in [Leinst19]. Most textbooks on enu-
merative combinatorics give one proof or another; e.g., [Stanle18, Appendix to
Chapter 9] gives three. Cayley’s formula also appears in Aigner’s and Ziegler’s
best-of compilation of mathematical proofs [AigZie18, Chapter 33] with four
different proofs. Note that some of the sources use a matrix-tree theorem for
undirected graphs; this is a particular case of our matrix-tree theorem.61
However, in order to complete our proof, we still need to prove the Matrix-
Tree Theorem.
This lemma is precisely Exercise 4.4 (b), at least after reversing all arcs. But
let us give a self-contained proof here:
61 Onemore remark: In Corollary 5.14.9, we have counted the trees with n vertices (i.e., simple
graphs with vertex set {1, 2, . . . , n} that are trees). It sounds equally natural to count the
“unlabelled trees with n vertices”, i.e., the equivalence classes of such trees up to isomor-
phism. Unfortunately, this is one of those “messy numbers” with no good expression: the
best formula known is recursive. There is also an asymptotic formula (“Otter’s formula”,
[Otter48]): the number of equivalence classes of n-vertex trees (up to isomorphism) is
αn
≈β with α ≈ 2.955 and β ≈ 0.5349.
n5/2
An introduction to graph theory, version August 2, 2023 page 225
w = (v0 , a1 , v1 , a2 , v2 , . . . , ak , vk , b, w)
of D that starts at u (since v0 = u). Proposition 4.5.9 shows that this walk w
either is a path or contains a cycle. Hence, w is a path (since D has no cycles).
Thus, w is a path of D that starts at u. Since w is longer than p (namely, longer
by 1), this shows that p is not the longest path of D that starts at u. But this
contradicts the very definition of p.
This contradiction shows that our assumption was false. Hence, vk = r. Thus,
p is a path from u to r (since v0 = u and vk = r). Therefore, the digraph D has
a path from u to r (namely, p).
Forget that we fixed u. We thus have shown that for each vertex u of D,
the digraph D has a path from u to r. In other words, r is a to-root of D.
Furthermore, we have deg+ r = 0 (since D has no arcs with source r), and each
v ∈ V \ {r } satisfies deg+ v = 1 (since we have assumed that each vertex v ∈
V \ {r } has outdegree 1). In other words, the digraph D satisfies Statement A’6
from the dual arborescence equivalence theorem (Theorem 5.10.5). Therefore,
it satisfies Statement A’1 from that theorem as well (since all six statements A’1,
A’2, . . ., A’6 are equivalent). In other words, D is an arborescence rooted to r.
This proves Lemma 5.14.10.
1. First, we will prove it in the case when each vertex v ∈ V \ {r } has out-
degree 1. In this case, after removing all arcs with source r from D (these
arcs do not matter, since neither the submatrix D∼r,∼r nor the spanning ar-
borescences rooted to r depend on them), we have essentially two options
(subcases): either D is itself an arborescence or D has a cycle.
2. Then, we will prove the matrix-tree theorem in the slightly more general
case when each v ∈ V \ {r } has outdegree ≤ 1. This is easy, since a vertex
v ∈ V \ {r } having outdegree 0 trivializes the theorem.
62 Sucha path clearly exists, since the length-0 path (u) is a path of D that starts at u, and since
a path of D cannot have length larger than |V | − 1.
An introduction to graph theory, version August 2, 2023 page 226
3. Finally, we will prove the theorem in the general case. This is done by
strong induction on the number of arcs of D. Every time you have a
vertex v ∈ V \ {r } with outdegree > 1, you can pick such a vertex and
color the outgoing arcs from it red and blue in such a way that each color
is used at least once. Then, you can consider the subdigraph of D obtained
by removing all blue arcs (call it Dred ) and the subdigraph of D obtained
by removing all red arcs (call it Dblue ). You can then apply the induction
hypothesis to Dred and to Dblue (since each of these two subdigraphs has
fewer arcs than D), and add the results together. The good news is that
both the # of spanning arborescences rooted to r and the determinant
det ( L∼r,∼r ) “behave additively” (we will soon see what this means).
Proof. (a) Lemma 5.14.10 shows that the digraph D itself is an arborescence
rooted to r.
As a consequence, D itself is a spanning arborescence of D rooted to r.
Therefore, | A| = |V | − 1 (by Statement A’2 in the Dual Arborescence Equiv-
alence Theorem (Theorem 5.10.5)63 ). Hence, D has no spanning arborescences
other than itself (because the condition | A| = |V | − 1 would get destroyed as
soon as we remove an arc). So the only spanning arborescence of D rooted to r
is D itself. This proves Lemma 5.14.11 (a).
(b) We WLOG assume that r = n (otherwise, we can swap r with n, so that
L∼r,∼r becomes L∼n,∼n ).
Let D ′ be the digraph D with a loop added at each vertex – i.e., the multidi-
graph obtained from D by adding n extra arcs ℓ1 , ℓ2 , . . . , ℓn and letting each arc
ℓi have source i and target i.
Let Sn−1 denote the group of permutations of the set
( )
{1, 2, . . . , n − 1} = {1, 2, . . . , n} \ |{z}
n = V \ {r } .
| {z }
=V =r
(by the Leibniz formula for the determinant). We shall now study the addends
in the sum on the right hand side of this equality. Specifically, we will show that
n −1
the only addend whose product ∏ Li,σ(i ) is nonzero is the addend for σ = id.
i =1
n −1
Indeed, let σ ∈ Sn−1 be a permutation such that the product ∏ Li,σ(i ) is
i =1
nonzero. We shall prove that σ = id.
Consider an arbitrary v ∈ {1, 2, . . . , n − 1}. Then, Lv,σ(v) 6= 0 (because Lv,σ(v)
n −1
is a factor in the product ∏ Li,σ(i ) , which is nonzero). However, the definition
i =1
of L yields Lv,σ(v) = deg+ v · [v = σ (v)] − av,σ( v) . Thus,
deg+ v · [v = σ (v)] − av,σ(v) = Lv,σ( v) 6= 0.
Hence, at least one of the numbers [v = σ (v)] and av,σ( v) is nonzero. In other
words, we have v = σ (v) (this is what it means for [v = σ (v)] to be nonzero) or
the digraph D has an arc with source v and target σ (v) (because this is what it
means for av,σ(v) to be nonzero). In either case, the digraph D ′ has an arc with
source v and target σ (v) (because if v = σ (v), then one of the loops we added
to D does the trick). We can apply the same argument to σ (v) instead of v, and
obtain an arc with source σ (v) and target σ (σ (v)). Similarly, we obtain an arc
with source σ (σ (v)) and target σ (σ (σ (v))). We can continue this reasoning
indefinitely. By continuing it for n steps, we obtain a walk
2 3 n
v, ∗, σ (v) , ∗, σ (v) , ∗, σ (v) , . . . , ∗, σ (v)
in the digraph D ′ , where each asterisk means an arc (we don’t care about what
these arcs are, so we are not giving them names). This walk cannot be a path
(since it has n + 1 vertices, but D ′ has only n vertices); thus, it must contain
a cycle (by Proposition 4.5.9). All arcs of this cycle must be loops (because
otherwise, we could remove the loops from this cycle and obtain a cycle of D,
but we know that D has no cycles). In particular, its first arc is a loop. Thus, our
above walk v, ∗, σ (v) , ∗, σ2 (v) , ∗, σ3 (v) , . . . , ∗, σn (v) contains a loop (since
the arcs of the cycle come from this walk). In other words, we have σi (v) =
σi +1 (v) for some i ∈ {0, 1, . . . , n − 1}. Since σ is injective, we can apply σ−i
to both sides of this equality, and conclude that v = σ (v). In other words,
σ (v) = v.
Forget that we fixed v. We thus have shown that σ (v) = v for each v ∈
{1, 2, . . . , n − 1}. In other words, σ = id.
An introduction to graph theory, version August 2, 2023 page 228
Forget that we fixed σ. We thus have proved that σ = id for each permutation
n −1
σ ∈ Sn−1 for which the product ∏ Li,σ(i ) is nonzero. In other words, the
i =1
n −1
only permutation σ ∈ Sn−1 for which the product ∏ Li,σ(i ) is nonzero is the
i =1
permutation id.
Thus, the only nonzero addend on the right hand side of (22) is the addend
corresponding to σ = id. Hence, (22) can be simplified as follows:
n −1 n −1
det ( L∼n,∼n ) = sign (id) · ∏ Li,id(i ) = ∏ Li,id(i) .
| {z } i =1 i =1
=1
Proof. First of all, we note that an arc with source r cannot appear in any
spanning arborescence of D rooted to r (since any such arborescence satisfies
deg+ r = 0, according to Statement A’6 in the Dual Arborescence Equivalence
Theorem (Theorem 5.10.5)). Furthermore, the arcs with source r do not affect
the matrix L∼r,∼r , since they only appear in the r-th row of the matrix L (but
this r-th row is removed in L∼r,∼r ).
Hence, any arc with source r can be removed from D without disturbing
anything we currently care about. Thus, we WLOG assume that D has no arcs
with source r (else, we can just remove them from D).
We WLOG assume that r = n (otherwise, we can swap r with n, so that L∼r,∼r
becomes L∼n,∼n ).
An introduction to graph theory, version August 2, 2023 page 229
64 Namely, the −1 in the vi+1-th position of the vi -th row gets cancelled by the 1 in the vi+1-th
position of the vi+1-th row. (We are using the fact that vm = v1 here.)
65 Let me illustrate this on a representative example: Assume that the numbers
v1 , v2 , . . . , vm−1 , vm are 1, 2, . . . , m − 1, 1 (respectively). Then, the first m − 1 rows of L look
as follows:
1 −1
1 −1
1 −1
.. ..
. .
1 −1
−1 1
(where all the missing entries are zeroes). Thus, the sum of these m − 1 rows is the zero
vector. The same is therefore true of the matrix L∼r,∼r (since the first m − 1 rows of the latter
matrix are just the first m − 1 rows of L, with their r-th entries removed).
The general case is essentially the same as this example; the only difference is that the
relevant rows are in other positions.
66 Specifically, we are using the following fact: “Let M be a square matrix. If there is a certain
nonempty set of rows of M whose sum is the zero vector, then the matrix M is singular.”.
To prove this fact, we let S be this nonempty set. Choose one row from this set, and
call it the chosen row. Now, add all the other rows from this set to this one chosen row.
This operation does not change the determinant of M (since the determinant of a matrix
is unchanged when we add one row to another), but the resulting matrix has a zero row
(namely, the chosen row) and thus has determinant 0. Hence, the original matrix M must
have had determinant 0 as well. In other words, M was singular, qed.
An introduction to graph theory, version August 2, 2023 page 230
(since an arborescence cannot have a cycle); but then, the source of this arc
would have outdegree 0, and thus we could no longer find a path from this
source to r, so we would not obtain a spanning arborescence). In other words,
Let M and N be two n × n-matrices that agree in all but one row.
That is, there exists some j ∈ {1, 2, . . . , n} such that for each i 6= j,
we have
(the i-th row of M) = (the i-th row of N ) .
An introduction to graph theory, version August 2, 2023 page 231
j j
Then, we write M ≡ N, and we let M + N be the n × n-matrix that
is obtained from M by adding the j-th row of N to the j-th row of M
(while leaving all remaining rows unchanged).
a b c a b c
2
For example, if M = d e f and N = d′ e′ f ′ , then M ≡ N
g h i g h i
and
2
a b c
M + N = d + d′ e + e′ f + f ′ .
g h i
A well-known property of determinants (the multilinearity of the determi-
nant) says that if M and N are two n × n-matrices and j ∈ {1, 2, . . . , n} is a
j
number such that M ≡ N, then
j
det M + N = det M + det N.
Now, let us prove the MTT. We proceed by strong induction on the # of arcs
of D.
Induction step: Let m ∈ N. Assume (as the induction hypothesis) that the
MTT holds for all digraphs D that have < m arcs. We must now prove it for
our digraph D with m arcs.
WLOG assume that r = n (otherwise, swap r with n).
If each vertex v ∈ V \ {r } has outdegree ≤ 1, then the MTT holds by Lemma
5.14.13. Thus, we WLOG assume that some vertex v ∈ V \ {r } has outdegree
> 1. Pick such a vertex v. We color each arc with source v either red or blue,
making sure that at least one arc is red and at least one arc is blue. (We can
do this, since v has outdegree > 1.) All arcs that do not have source v remain
uncolored.
Now, let Dred be the subdigraph obtained from D by removing all blue arcs.
Then, Dred has fewer arcs than D. In other words, Dred has < m arcs. Hence,
the induction hypothesis yields that the MTT holds for Dred . That is, we have
# of spanning arborescences of Dred rooted to r = det Lred
∼r,∼r ,
c 3
b
a 1
d
Let us pick v = 3 (this is a vertex with outdegree > 1), and let us color the
arcs a and c red and the arcs b and d blue (various other options are possible).
Then, Dred and Dblue look as follows (along with their Laplacians Lred and
Lblue ):
An introduction to graph theory, version August 2, 2023 page 233
2 2
c 3 3
b
a 1 1
d
4 4
5 5
Dred Dblue
1 −1 0 0 0 1 −1 0 0 0
0 1 −1 0 0 0 1 −1 0 0
Lred = 0 0 1 −1 0 Lblue = −1 0 2 0 −1
0 0 0 1 −1 0 0 0 1 −1
−1 0 0 0 1 −1 0 0 0 1
Now, the digraphs D, Dblue and Dred differ only in the arcs with source v,
and as far as the latter arcs are concerned, the arcs of D are divided between
Dblue and Dred . Hence, by the definition of the Laplacian, we have
v v
Lred ≡ Lblue and Lred + Lblue = L.
Thus,
v v
Lred blue
∼r,∼r ≡ L∼r,∼r and Lred blue
∼r,∼r + L∼r,∼r = L∼r,∼r
(here, we have used the fact that r = n and v 6= r, so that when we remove
the r-th row and the r-th column of the matrix L, the v-th row remains the v-th
row). Hence,
v
det L
| ∼{zr,∼r
= det L red
+ L blue
= det L red
+ det L blue
} ∼r,∼r ∼r,∼r ∼r,∼r ∼r,∼r
v
= Lred blue
∼r,∼r + L ∼r,∼r
we have
(since we proved that det ( L∼r,∼r ) = det Lred blue
∼r,∼r + det L∼r,∼r ). That is, the
MTT holds for our digraph D and its vertex r. This completes the induction
step, and thus the MTT (Theorem 5.14.7) is proved.
Our above proof of Theorem 5.14.7 has followed [Stanle18, Theorem 10.4].
Other proofs can be found across the literature, e.g., in [VanEhr51, Theorem
7], in [Margol10, Theorem 2.8], in [DeLeen19, Theorem 1] and in [Holzer22,
Theorem 2.5.3]. (Some of these sources prove more general versions of the
theorem. Confusingly, each source uses different notations and works in a
slightly different setup, although most of them quickly reveal themselves to be
equivalent upon some introspection.)
The following two exercises stand at the beginning of the theory of chip-firing
and related dynamical systems on a digraph (see [CorPer18], [Klivan19] and
[JoyMel17] for much more). While the Laplacian is not mentioned in them
directly, it is implicitly involved in the definition of a “donation” (how?).
3 2
4 1
5 6
by having the vertices 4, 5, 6, 1 donate in some order (the order clearly does
not matter for the result67 ).
Note that vertices are allowed to donate multiple times (although in the
above example, this was unnecessary).]
[Hint: A donation will be called safe if its donor v (that is, the vertex cho-
sen to lose wealth) satisfies kv ≥ deg+ v, where k is the wealth distribution
just before this donation. Start by showing that if the total wealth is larger
than | A| − |V |, then at least one vertex v has wealth ≥ deg+ v (and thus can
make a safe donation). Next, show that for any given wealth distribution k,
there are only finitely many wealth distributions that can be obtained from
k by a sequence of safe donations. Finally, for any vertex v, find a rational
quantity that increases every time that a donor distinct from v makes a do-
nation. Conclude that in a sufficiently long sequence of safe donations, every
vertex must appear as a donor. But a donor of a safe donation must be out
of debt just before its safe donation, and will never go back into debt.]
Exercise 5.20. We continue with the setting and terminology of Exercise 5.19.
A clawback is an operation that transforms a wealth distribution as fol-
lows: We choose a vertex v, and we increase its wealth by its outdegree
deg+ v, and then decrease the wealth of each vertex w ∈ V (including v
itself) by av,w . (Thus, a clawback is the inverse of a donation.)
Let k be a wealth distribution on D whose total wealth is larger than | A| −
|V |. Prove that by an appropriately chosen finite sequence of clawbacks, we
can ensure that no vertex is in debt.
[Remark: Note that we are still assuming D to be strongly connected.
Otherwise, the truth of the claim is not guaranteed. For instance, for the
digraph
3 4
1 2
Proposition 5.14.15. Let n be a positive integer. Pick any arc a of the multi-
digraph Knbidir . Then, the # of Eulerian circuits of Knbidir whose first arc is a is
n n −2 · ( n − 2) ! n .
Proof. Let r be the source of the arc a. The digraph Knbidir is balanced, and each
of its vertices has outdegree n − 1. By the BEST’ theorem (Theorem 5.10.4), we
have
# of Eulerian circuits of Knbidir whose first arc is a
n
= # of spanning arborescences of Knbidir rooted to r · ∏ deg+ u −1!
| {z } u =1 | {z }
= n −1
= n n −2
(as we saw in Subsection 5.14.5 in the case when r =1,
and can similarly prove for arbitrary r)
n
n −2 n −2 n
=n · ∏ ( n − 2) ! = n · ( n − 2) ! ,
u =1
qed.
In comparison, there is no good formula known for the # of Eulerian circuits
of the undirected graph Kn . For n even, this # is 0 of course (since Kn has
vertices of odd degree in this case). For n odd, the # grows very fast, but little
else is known about it (see https://oeis.org/A135388 for some known values,
and see Exercise 5.22 for a divisibility property).
where ai,j is the # of edges of G that have endpoints i and j (with loops
counting twice). Then:
Proof. (a) Let r be a vertex of G. Then, Proposition 5.13.1 (b) shows that there is
a bijection
n o
spanning arborescences of Gbidir rooted to r → {spanning trees of G } .
An introduction to graph theory, version August 2, 2023 page 239
Imagine expanding the right hand side (using the Leibniz formula) and ex-
panding the resulting products further. For instance, the product
(t + a) t + b′ d′′ c′′′
An introduction to graph theory, version August 2, 2023 page 240
becomes ttd′′ c′′′ + tb′ d′′ c′′′ + atd′′ c′′′ + ab′ d′′ c′′′ . In the huge sum that results,
we are interested in those addends that contain exactly one t, because it is
precisely these addends that contribute to the coefficient of t1 in the polynomial
det (tIn + L). Where do these addends come from? To pick up exactly one t
from a product like (t + a) (t + b′ ) d′′ c′′′ , we need to have at least one diagonal
entry in our product (for example, we cannot pick up any t from the product
cd′ b′′ a′′′ ), and we need to pick out the t from this diagonal entry (rather than,
e.g., the a or b′ or c′′ or d′′′ ). If we pick the r-th diagonal entry, then the rest of
the product is part of the expansion of det ( L∼r,∼r ) (since we must not pick any
further ts and thus can pretend that they are not there in the first place). Thus,
n
the total t1 -coefficient in det (tIn + L) will be ∑ det ( L∼r,∼r ). This proves (23),
r =1
and thus the proof of Theorem 5.15.1 (b) is complete.
(c) Consider the polynomial det (tIn + L) introduced in part (b), and in par-
ticular its t1 -coefficient c1 .
It is known that the characteristic polynomial det (tIn − L) of L is a monic
polynomial of degree n, and that its roots are the eigenvalues λ1 , λ2 , . . . , λn of
L. Hence, it can be factored as follows:
det (tIn − L) = (t − λ1 ) (t − λ2 ) · · · (t − λn ) .
det (tIn + L) = (t + λ1 ) (t + λ2 ) · · · (t + λn )
= ( t + λ1 ) ( t + λ2 ) · · · ( t + λ n − 1 ) t (since λn = 0) .
Here, however, let us give a simpler example, in which Theorem 5.15.1 (a)
suffices:
Exercise 5.23. Let n and m be two positive integers. Let Kn,m be the simple
graph with n + m vertices
where two vertices i and j are adjacent if and only if they have opposite
signs (i.e., each positive vertex is adjacent to each negative vertex, but no two
vertices of the same sign are adjacent).
[For example, here is how K5,2 looks like:
1 2 3 4 5
−2 −1
.]
We have already computed the determinant of a matrix much like this back in
our proof of Cayley’s Formula (Subsection 5.14.5); let us deal with the general
case:
Proposition 5.15.2. Let n ∈ N. Let x and a be two numbers. Then,
x a a ··· a a
a x a ··· a a
a a x ··· a a
det . . . . = ( x + ( n − 1) a ) ( x − a ) n −1 .
.. .. .. . . .. ..
. .
a a a ··· x a
a a a ··· a x
| {z }
the n × n-matrix
whose diagonal entries are x
and whose off-diagonal entries are a
where two vertices i and j are adjacent if and only if they have opposite signs.
Then,
(# of spanning trees of Kn,m ) = mn−1 · nm−1 .
1 2 3 4 5
−2 −1
An introduction to graph theory, version August 2, 2023 page 245
′ :
And here is the corresponding graph Kn,2
1 2 3 4 5
−2 −1
Exercise 5.26. Let n be a positive integer. Let Qn be the n-hypercube graph (as
defined in Definition 2.14.7). Recall that its vertex set is the set V := {0, 1}n
of length-n bitstrings, and that two vertices are adjacent if and only if they
differ in exactly one bit. Our goal is to compute the # of spanning trees of
Qn .
Let D be the digraph Qbidir n . Let L be the Laplacian of D. We regard L as a
V × V-matrix (i.e., as a 2 × 2n -matrix whose rows and columns are indexed
n
by bitstrings in V).
We shall use the notation ai for the i-th entry of a bitstring a. Thus, each
bitstring a ∈ V has the form a = ( a1 , a2 , . . . , an ). (We shall avoid the short-
hand notation a1 a2 · · · an here, as it could be mistaken for an actual product.)
For any two bitstrings a, b ∈ V, we define the number h a, bi to be the
integer a1 b1 + a2 b2 + · · · + an bn .
An introduction to graph theory, version August 2, 2023 page 246
(d) The eigenvalues of L are 2k for k ∈ {0, 1, . . . , n}, and each eigenvalue
all
n
2k appears with multiplicity .
k
(e) The # of spanning trees of Qn is
n
1 n
2n ∏ (2k)( k ) .
k=1
101 111
001 011
100 110
Q3 = 000 010
An introduction to graph theory, version August 2, 2023 page 247
where the rows and the columns are ordered by listing the eight bitstrings
a ∈ V in the order 000, 001, 010, 011, 100, 101, 110, 111. ]
a a a ··· xn
(This is an infinite sequence of 0’s and 1’s; the spaces between some of them
are only for readability. The || : and : || symbols are “repeat signs” – they mean
that everything that stands between them should be repeated over and over. So
the sequence above is 0000 1111 0110 0101 0000 1111 . . ..)
An introduction to graph theory, version August 2, 2023 page 249
One nice property of this sequence is that if you slide a ”length-4 window”
(i.e., a window that shows four consecutive entries) along it, you get all 16
possible bitstrings of length 4 depending on the position of the window, and
these bitstrings do not repeat until you move 16 steps to the right. Just see:
0000 11110110010100001111 . . .
0 0001 1110110010100001111 . . .
00 0011 110110010100001111 . . .
000 0111 10110010100001111 . . .
0000 1111 0110010100001111 . . .
00001 1110 110010100001111 . . .
000011 1101 10010100001111 . . .
0000111 1011 0010100001111 . . .
00001111 0110 010100001111 . . .
000011110 1100 10100001111 . . .
0000111101 1001 0100001111 . . .
00001111011 0010 100001111 . . .
000011110110 0101 00001111 . . .
0000111101100 1010 0001111 . . .
00001111011001 0100 001111 . . .
000011110110010 1000 01111 . . .
Note that, as you slide the window along the sequence, at each step, the first
bit is removed and a new bit is inserted at the end. Thus, by sliding a length-4
window along the above sequence, you run through all 16 possible length-4
bitstrings in such a way that each bitstring is obtained from the previous one
by removing the first bit and inserting a new bit at the end. This is nice and
somewhat similar to Gray codes (in which you run through all bitstrings of a
given length in such a way that only a single bit is changed at each step).
Can we find such nice sequences for any window length, not just 4 ?
Here is an answer for window length 3, for instance:
|| : 000 111 01 : || .
What about higher window length?
Moreover, we can ask the same question with other alphabets. For instance,
instead of bits, here is a similar sequence for the alphabet {0, 1, 2} (that is, we
use the numbers 0, 1, 2 instead of 0 and 1) and window length 2:
|| : 00 11 22 02 1 : || .
An introduction to graph theory, version August 2, 2023 page 250
( a1 , a2 , . . . , a n ) = ( c r , c r + 1 , . . . , c r + n − 1 ) .
Here, the indices under the letter “c” are understood to be periodic modulo
kn ; that is, we set cq+kn = cq for each q ∈ Z (so that ckn = c0 and ckn +1 = c1
and so on).
(0, 0, 1, 1, 2, 2, 0, 2, 1)
ψ ( a1 , a2 , . . . , an ) = (( a1 , a2 , . . . , an−1 ) , ( a2 , a3 , . . . , an )) .
Thus, the vertices of D are the (n − 1)-tuples (not the n-tuples!) of elements
of K, whereas the arcs are the n-tuples of elements of K, and each such arc
( a1 , a2 , . . . , an ) has source ( a1 , a2 , . . . , an−1 ) and target ( a2 , a3 , . . . , an ). Hence,
there is an arc from each (n − 1)-tuple i ∈ K n−1 to each (n − 1)-tuple j ∈ K n−1
that is obtained by dropping the first entry of i and adding a new entry at the
end. (Be careful: If n = 1, then D has only one vertex but n arcs. If this confuses
you, just do the n = 1 case by hand. For any n > 1, there are no parallel arcs in
D.)
Example 5.16.3. For example, if n = 3 and k = 2 and K = {0, 1}, then D
looks as follows (we again write our tuples without commas and without
parentheses):
101 01
10 010
001
100
110 00
011
000
11 111
i = ( i1 , i2 , . . . , i n −1 )
→ (i2 , i3 , . . . , in−1, j1 )
→ (i3 , i4 , . . . , in−1, j1 , j2 )
→ ···
→ (in−1 , j1 , j2 , . . . , jn−2 )
→ ( j1 , j2 , . . . , jn−1 ) = j.
Note that this walk has length n − 1, and is the unique walk from i to j
that has length n − 1. Thus, the # of walks from i to j that have length
n − 1 is 1. This will come useful further below.]
But this shows that D has an Eulerian circuit whose last arc is a.]
Now, for each i ∈ N, we let xi denote the first entry of the n-tuple pi . Then,
xq+kn = xq for all q ∈ N (since pq+kn = pq for all q ∈ N). In other words,
the sequence ( x0 , x1 , x2 , . . .) repeats itself every kn terms. Note that the kn -tuple
( x0 , x1 , . . . , xkn −1 ) consists of the first entries of the arcs p0 , p1 , . . . , pkn −1 of c (by
the definition of xi ).
For each i ∈ N and each s ∈ {1, 2, . . . , n}, we have
In other words, for each i ∈ N, the entries of pi (from first to last) are
xi , xi +1, . . . , xi +n−1. In other words, for each i ∈ N, we have
pi = ( xi , xi +1 , . . . , xi + n −1 ) . (26)
Now, recall that c is an Eulerian circuit. Thus, each arc of D appears exactly
once among its arcs p0 , p1 , . . . , pkn −1 . In other words, each n-tuple in K n appears
exactly once among p0 , p1 , . . . , pkn −1 (since the arcs of D are the n-tuples in K n ).
In other words, as i ranges from 0 to kn − 1, the n-tuple pi takes each possible
value in K n exactly once.
In view of (26), we can rewrite this as follows: As i ranges from 0 to kn − 1,
the n-tuple ( xi , xi +1, . . . , xi +n−1) takes each possible value in K n exactly once
(since this n-tuple is precisely pi , as we have shown in the previous para-
graph). In other words, for each ( a1 , a2 , . . . , an ) ∈ K n , there is a unique r ∈
{0, 1, . . . , kn − 1} such that ( a1 , a2 , . . . , an ) = ( xr , xr+1 , . . . , xr+n−1).
Hence, the kn -tuple ( x0 , x1 , . . . , xkn −1 ) is a de Bruijn sequence of order n on
K. This shows that a de Bruijn sequence exists. Theorem 5.16.2 is thus proven.
69 We have never formally defined infinite walks, but it should be fairly clear what they are.
An introduction to graph theory, version August 2, 2023 page 254
Example 5.16.4. For n = 3 and k = 2 and K = {0, 1}, one possible Eulerian
circuit c of D is
(00, 001, 01, 010, 10, 101, 01, 011, 11, 111, 11, 110, 10, 100, 00)
(where we have written the arcs in bold for readability). The first entries of
the arcs of this circuit form the sequence 0010111, which is indeed a de Bruijn
sequence of order 3 on {0, 1}. Any 3 consecutive entries of this sequence
(extended periodically to the infinite sequence || : 0010111 : ||) form the
respective arc of c.
70 Some of these sequences (the “prefer-one” and “prefer-opposite” generators) are just dis-
guised implementations of the algorithm for finding an Eulerian circuit implicit in our
proof of the BEST theorem.
71 My favorite is the one obtained by concatenating all Lyndon words whose length divides
n in lexicographically increasing order (assuming that the set K is totally ordered). See
[Moreno04] for the details of that construction.
An introduction to graph theory, version August 2, 2023 page 255
1
(# of spanning arborescences of D rooted to r ) = c1 .
n
1
(# of spanning arborescences of D rooted to r ) = · λ1 λ2 · · · λ n − 1 .
n
1
(# of Eulerian circuits of D ) = | A| · · λ1 λ2 · · · λn−1 · ∏ deg+ u − 1 !.
n u ∈V
(If you identify an Eulerian circuit with its cyclic rotations, then you
should drop the | A| factor on the right hand side.)
Proof. (a) The equality comes from the MTT (Theorem 5.14.7). It remains to
prove that the # of spanning arborescences of D rooted to r does not depend
on r. But this is Corollary 5.12.1.
(b) follows from (a) as in the undirected graph case (proof of Theorem 5.15.1
(b)).72
72 In more detail: Just as we proved in our above proof of Theorem 5.15.1 (for the undirected
An introduction to graph theory, version August 2, 2023 page 256
(c) follows from (b) as in the undirected graph case (proof of Theorem 5.15.1
(c)).
(d) Assume that all vertices of D have outdegree > 0. Then,
(# of Eulerian circuits of D )
= ∑ (# of Eulerian circuits of D whose first arc is a) .
a∈ A
Hence,
(# of Eulerian circuits of D )
= ∑ |(# of Eulerian circuits of
{z
D whose first arc is a)
}
a∈ A
1
= · λ1 λ2 ···λn−1 · ∏ (deg+ u −1)!
n u ∈V
1
= ∑ · λ1 λ2 · · · λn−1 · ∏ deg+ u − 1 !
a∈ A
n u ∈V
1
= | A| · · λ1 λ2 · · · λn−1 · ∏ deg+ u − 1 !.
n u ∈V
Now, let’s try to solve our question – i.e., let’s count the de Bruijn sequences
of order n on K.
Recall the digraph D from our above proof of Theorem 5.16.2. We constructed
a de Bruijn sequence of order n on K by finding an Eulerian circuit of D. This
actually works both ways: The map
is a bijection (make sure you understand why!). Hence, by the bijection princi-
ple, we have
(# of Eulerian circuits of D )
1
= | K n | · n−1 · λ1 λ2 · · · λkn−1 −1 · ∏ deg+ u − 1 !, (28)
k u ∈ K n −1
Also,
1 1
|Kn | · = kn · = k.
kn −1 kn −1
It remains to find λ1 λ2 · · · λkn−1 −1 . What are the eigenvalues of L ?
The Laplacian L of our digraph D is a kn−1 × kn−1 -matrix whose rows and
columns are indexed by (n − 1)-tuples in K n−1 . Strictly speaking, we should
relabel the vertices of D as 1, 2, . . . , kn−1 here, in order to have a “proper matrix”
with a well-defined order on its rows and columns. But let’s not do this; instead,
I trust you can do the relabeling yourself, or just use the more general notion
of matrices that allows for the rows and the columns to be indexed by arbitrary
things (see https://mathoverflow.net/questions/317105 for details).
Let C be the adjacency matrix of the digraph D; this is the kn−1 × kn−1 -matrix
(again with rows and columns indexed by (n − 1)-tuples in K n−1 ) whose (i, j)-
th entry is the # of arcs with source i and target j. In particular, the trace of C
is thus the # of loops of D. It is easy to see that the loops of D are precisely the
An introduction to graph theory, version August 2, 2023 page 258
L = ∆ − C, (29)
where ∆ is the diagonal matrix whose diagonal entries are the outdegrees of
the vertices of D. Since each vertex of D has outdegree k, the latter diagonal
matrix ∆ is simply k · I, where I is the identity matrix (of the appropriate size).
Hence, (29) can be rewritten as
L = k · I − C.
(The easiest way to see this is by noticing that J has rank 1 and trace kn−1 . 73 )
Cn−1 = J.
[Proof: We need to show that all entries of the matrix Cn−1 are 1. So let i and
j be two vertices of D. We must then show that the (i, j)-th entry of Cn−1 is 1.
Recall the combinatorial interpretation of the powers of an adjacency matrix
(Theorem 4.5.10): For any ℓ ∈ N, the (i, j)-th entry of Cℓ is the # of walks from
i to j (in D) that have length ℓ. Thus, in particular, the (i, j)-th entry of Cn−1
is the # of walks from i to j (in D) that have length n − 1. But this number
is actually 1, as we have already shown in our above proof of Theorem 5.16.2.
This completes the proof of Cn−1 = J.]
How does this help us compute the eigenvalues of C ? Well, let γ1 , γ2 , . . . , γkn−1
be the eigenvalues of C. Then, for any ℓ ∈ N, the eigenvalues of Cℓ are
γ1ℓ , γ2ℓ , . . . , γkℓn−1 (this is a fact that holds for any square matrix, and is probably
easiest to prove using the Jordan canonical form or triangularization). Hence, in
73 Here are the details: The matrix J has rank 1 (since all its rows are the same); thus, all but one
of its eigenvalues are 0. It remains to show that the remaining eigenvalue is kn−1 . However,
it is known that the sums of the eigenvalues of a square matrix equals its trace. Thus, if all
but one of the eigenvalues of a square matrix are 0, then the remaining eigenvalue equals
its trace. Applying this to our matrix J, we see that its remaining eigenvalue equals its trace,
which is kn−1 .
An introduction to graph theory, version August 2, 2023 page 259
particular, γ1n−1 , γ2n−1, . . . , γknn−−11 are the eigenvalues of Cn−1 = J; but we know
that the latter eigenvalues are 0, 0, . . . , 0 , kn−1 . Hence, all but one of the
| {z }
kn−1 −1 many zeroes
kn−1 numbers γ1n−1 , γ2n−1, . . . , γknn−−11 equal 0. Thus, all but one of the kn−1 num-
bers γ1 , γ2 , . . . , γkn−1 equal 0 (we don’t know what the remaining number is,
since (n − 1)-st roots are not uniquely determined in C). In other words, all but
one of the eigenvalues of C equal 0. The remaining eigenvalue must thus be
the trace of C (because the sum of the eigenvalues of a square matrix is known
to be the trace of that matrix), and therefore equal k (since we know that the
trace of C is k).
So we have shown that the eigenvalues of C are 0, 0, . . . , 0 , k. Thus, the
| {z }
kn−1 −1 many zeroes
eigenvalues of L are
k − 0, k − 0, . . . , k − 0, k − k
| {z }
kn−1 −1 many (k−0)’s
Hence, the eigenvalues λ1 , λ2 , . . . , λkn−1 −1 in (28) all equal k. Thus, (28) simpli-
fies to
(# of Eulerian circuits of D )
1
= |K n | · n−1 · kk
| · · · k} · ∏ deg+ u − 1 !
{z
| {zk } kn−1 −1 factors u∈K n−1
| {z }
n
1 k n −1
=k · =((k−1)!)
kn −1
=k
n −1 n −1 n −1
= k· kk · · · }k
| {z · ((k − 1)!)k = kk · ((k − 1)!)k
kn−1 −1 factors
| {z }
= k k n −1
k n −1
n −1
= k · ( k − 1) ! = k!k .
| {z }
= k!
In view of this, we can rewrite (27) as
n −1
(# of de Bruijn sequences of order n on K ) = k!k .
Thus, we have proved the following:
An introduction to graph theory, version August 2, 2023 page 260
Theorem 5.18.1 (or, more precisely, its weighted version, which we will see in
the next section) can be used to explicitly compute the steady state of a Markov
chain (see [KrGrWi10]); a similar interpretation, but in economical terms (emer-
gence of money in a barter economy), appears in [Sahi14, §1].
We shall give a proof of Theorem 5.18.1 based upon two lemmas. The first
lemma is a general linear-algebraic result:
Proof of Lemma 5.18.2. There are various ways to prove this, but here is probably
the most elegant one:
We WLOG assume that s 6= t, since otherwise the claim is obvious. Let us
now change the r-th row of the matrix B as follows:
Let C be the resulting n × n-matrix.74 Thus, C agrees with B in all rows other
than the r-th one. Hence, in particular,
a b c d
′ b′ c′ d′
74 For example, if n = 4 and B = a and s = 1 and t = 3 and r = 2, then
a′′ b′′ c′′ d′′
a′′′ b′′′ c′′′ d′′′
a b c d
1 0 − 1 0
C= a′′ b′′ c′′ d′′ .
Note also that the only nonzero entries in the r-th row of C are75 Cr,s = 1 and
Cr,t = −1. Hence, the entries in the r-th row of C add up to 0.
Recall that the sum of all columns of B is the zero vector. In other words,
in each row of B, the entries add up to 0. The matrix C therefore also has this
property (because the only row of C that differs from the corresponding row
of B is the r-th row; however, we have shown above that in the r-th row, the
entries of C also add up to 0). In other words, the sum of all columns of C is
the zero vector. This easily entails that det C = 0 76 .
On the other hand, Laplace expansion along the r-th row yields
n
det C = ∑ (−1)r+k Cr,k det (C∼r,∼k )
k=1
= (−1)r+s 1 det (C∼r,∼s ) + (−1)r+t (−1) det (C∼r,∼t )
(since the only nonzero entries Cr,k in the r-th row of C are Cr,s = 1 and Cr,t =
−1). Comparing this with det C = 0, we obtain
In other words, (−1)r+t det ( B∼r,∼t ) = (−1)r+s det ( B∼r,∼s ). Dividing both
sides of this by (−1)r+t , we obtain det ( B∼r,∼t ) = (−1)s−t det ( B∼r,∼s ). This
proves Lemma 5.18.2.
Our next lemma is the following generalization of Theorem 5.14.7:
75 We are using the notation Cr,k for the entry of C in the r-th row and the k-th column.
76 Proof.
It is well-known that the determinant of a matrix does not change if we add a column
to another. Hence, the determinant of C will not change if we add each column of C other
than the first one to the first column of C. However, the result of this operation will be
a matrix whose first column is 0 (since the sum of all columns of C is the zero vector),
and therefore this matrix will have determinant 0. Since the operation did not change the
determinant, we thus conclude that the determinant of C was 0. In other words, det C = 0.
An introduction to graph theory, version August 2, 2023 page 263
Note that Theorem 5.14.7 is the particular case of Theorem 5.18.3 for s = r.
Fortunately, using Lemma 5.18.2, we can easily derive the general case from the
particular:
Proof of Theorem 5.18.3. We have seen (in the proof of Proposition 5.14.6) that
the sum of all columns of the Laplacian L is the zero vector. Hence, Lemma
5.18.2 (applied to K = Q and B = L and t = r) yields
det ( L∼r,∼r ) = (−1)s−r det ( L∼r,∼s ) = (−1)r+s det ( L∼r,∼s ) .
| {z }
=(−1)r +s
78 I tried to explain this proof in more detail in the solutions to Spring 2018 Math 4707 midterm
#3 – see the proof of Theorem 0.7 in those solutions; you be the judge if I succeeded.
An introduction to graph theory, version August 2, 2023 page 265
2
β
α
D= 1 γ 3
δ , and let r = 3.
Then, D has two spanning arborescences rooted to r. One of the two has arcs
α and β (and thus has weight wα w β ); the other has arcs γ and β (and thus
has weight wγ w β ). Hence,
∑ w ( B) = wα w β + wγ w β , (32)
B is a spanning
arborescence
of D rooted to r
The weighted Laplacian Lw is
wα + wγ −wα −wγ
Lw = 0 w β −w β
−wδ 0 wδ
79 To remind: The original MTT is Theorem 5.14.7.
An introduction to graph theory, version August 2, 2023 page 266
wα + wγ −wα
Lw
∼3,∼3 = and therefore
0 wβ
det Lw
∼3,∼3 = ( wα + wγ ) w β = wα w β + wγ w β .
The right hand side of this agrees with that of (32). This confirms the
weighted MTT for our D and r.
As we already said, the weighted MTT generalizes the original MTT, because
if we take all w a ’s to be 1, we just recover the original MTT.
However, we can also go backwards: we can derive the weighted MTT from
the original MTT. Let us do this.
P ( k1 , k2 , . . . , k m ) = Q (k1 , k2 , . . . , k m ) (33)
Theorem 5.19.4 is often summarized as “in order to prove that two polynomi-
als are equal, it suffices to show that they are equal on all nonnegative integer
points” (where a “nonnegative integer point” means a point – i.e., a tuple of
inputs – whose all entries are nonnegative integers). Even shorter, one says
that “a polynomial identity (i.e., an equality between two polynomials) needs
only to be checked on nonnegative integers”. For example, if you can prove the
equality
( x + y)4 + ( x − y)4 = 2x4 + 12x2 y2 + 2y4
for all nonnegative integers x and y, then you automatically conclude that this
equality holds as a polynomial identity, and thus is true for any elements x and
y of a commutative ring.
An introduction to graph theory, version August 2, 2023 page 267
α β
D= 1 3
γ
,
80 Tobe precise, [Alon02, Lemma 2.1] is not concerned with two polynomials being identical,
but rather with one polynomial being identically zero. But this is an equivalent question:
Two polynomials P and Q are identical if and only if their difference P − Q is identically
zero.
An introduction to graph theory, version August 2, 2023 page 268
β1
α1 β2
α2
β3
γ1
D′ = 1 3
γ2
,
where α1 , α2 are the two arcs obtained from α, and so on.
Now, recall that the digraph D ′ has the same vertices as D, but each arc a
of D has turned into w a arcs of D ′ . Thus, the weighted outdegree deg+w i of
a vertex i of D equals the (usual, i.e., non-weighted) outdegree deg+ i of the
same vertex i of D ′ . Hence, the weighted Laplacian Lw of D is the (usual, i.e.,
non-weighted) Laplacian of D ′ .
Recall again that the digraph D ′ has the same vertices as D, but each arc a
of D has turned into w a arcs of D ′ . Thus, each subdigraph B of D gives rise
to w ( B) many subdigraphs of D ′ (because we can replace each arc a of B by
any of the w a many copies of this arc in D ′ ). Moreover, this correspondence
takes spanning arborescences to spanning arborescences81 , and we can obtain
any spanning arborescence of D ′ in this way from exactly one B. Hence,
∑ w ( B) = # of spanning arborescences of D ′ rooted to r .
B is a spanning
arborescence
of D rooted to r
Thus, applying the original MTT (Theorem 5.14.7) to D ′ yields the weighted
MTT for D (since the weighted Laplacian Lw of D is the (usual, i.e., non-
weighted) Laplacian of D ′ ). This completes the proof of Theorem 5.19.2.
[Remark: Alternatively, it is not hard to adapt our above proof of the original
MTT to the weighted case.]
Solution. The n-trees are just the spanning trees of the complete graph Kn .
To incorporate the deg i = di condition into our count, we use a generating
function. So let us not fix the numbers d1 , d2 , . . . , dn , but rather consider the
polynomial
deg 1 deg 2 deg n
P ( x1 , x2 , . . . , x n ) : = ∑ x1 x2 · · · xn (34)
T is a n-tree
P ( x1 , x2 , . . . , x n ) = ∑ w (T ) ,
T is an n-tree
where w ( T ) denotes the product of the weights of all edges of T. (Indeed, for
deg 1 deg 2 deg n
any subgraph T of Kn , the weight w ( T ) equals x1 x2 · · · xn , where deg i
means the degree of i in T.)
We have assigned weights to the edges of the graph Kn ; let us now assign the
same weights to the arcs of the digraph Knbidir . That is, the two arcs (ij, 1) and
(ij, 2) corresponding to an edge ij of Kn shall both have the weight
w(ij,1) = w(ij,2) = wij = xi x j . (35)
(# of spanning trees of Kn )
bidir
= # of spanning arborescences of Kn rooted to 1 .
An introduction to graph theory, version August 2, 2023 page 270
Moreover, since this bijection preserves weights (because of (35)), we also have
∑ w (T ) = ∑ w ( B) .
T is a spanning B is a spanning
tree of Kn arborescence of Knbidir
rooted to 1
In other words,
∑ w (T ) = ∑ w ( B)
T is an n-tree B is a spanning
arborescence of Knbidir
rooted to 1
= [i = j ] xi ( x1 + x2 + · · · + x n ) − xi x j
= xi [i = j ] ( x1 + x2 + · · · + x n ) − x j .
We can find its minor det Lw ∼1,∼1 without too much trouble (e.g., using row
transformations similar to the ones we have done back in the proof of Cayley’s
formula82 ); the result is
n −2
det Lw ∼1,∼1 = x1 x2 · · · xn ( x1 + x2 + · · · + xn ) .
82 The first step, of course, is to factor an xi out of the i-th row for each i.
An introduction to graph theory, version August 2, 2023 page 271
P ( x1 , x2 , . . . , x n ) = ∑ w (T ) = ∑ w ( B)
T is an n-tree B is a spanning
arborescence of Knbidir
rooted to 1
= det Lw
∼1,∼1 (by the weighted Matrix-Tree Theorem)
= x1 x2 · · · x n ( x1 + x2 + · · · + x n ) n −2 . (36)
d
As we recall, we are looking for the x11 x2d2 · · · xndn -coefficient in this polynomial.
From (36), we see that
d1 d2 dn
the x1 x2 · · · xn -coefficient of P ( x1 , x2 , . . . , xn )
= the x1d1 x2d2 · · · xndn -coefficient of x1 x2 · · · xn ( x1 + x2 + · · · + xn )n−2
= the x1d1 −1 x2d2 −1 · · · xndn −1 -coefficient of ( x1 + x2 + · · · + xn )n−2
(it does not matter whether we restrict the sum by the condition i1 + i2 + · · · +
k
in = k or not, since the coefficient is defined to be 0 when this
i1 , i2 , . . . , i n
condition is violated anyway). Hence,
k
i1 i2 in k
the x1 x2 · · · xn -coefficient of ( x1 + x2 + · · · + xn ) =
i1 , i2 , . . . , i n
83 See [23wd, Lecture 18, Section 4.12] for an introduction to multinomial coefficients.
An introduction to graph theory, version August 2, 2023 page 272
6. Colorings
Now to something different: Let’s color the vertices of a graph!
6.1. Definition
This is a serious course, so our colors are positive integers. Coloring the vertices
thus means assigning a color (= a positive integer) to each vertex. Here are the
details:
2 2 1 3 2 1
1 4 5 1 4 3
(where the numbers on the nodes are not the vertices, but rather the colors
of the vertices). The 7-coloring on the left (yes, it is a 7-coloring, even though
it does not actually use the colors 3, 6 and 7) is not proper, because the two
adjacent vertices on the top left have the same color. The 7-coloring on the
right, however, is proper.
An introduction to graph theory, version August 2, 2023 page 274
2 3 2 3
A= 1 B= 1
5 4 5 4
.
2 3 2 3
C= 1 D= 1
5 4 5 4
• The graph A has a proper 3-coloring. For example, the map f that
sends the vertices 1, 2, 3, 4, 5 to the colors 1, 2, 1, 2, 3 (respectively) is a
proper 3-coloring.
• The graph C has a proper 3-coloring and even a proper 2-coloring (e.g.,
assigning color 1 to each odd vertex and color 2 to each even vertex).
is a proper 2-coloring of Qn . (Check this! It boils down to the fact that if two
bitstrings (a1 , a2 , . . . , an ) and (b1 , b2 , . . . , bn ) differ in exactly one entry, then
An introduction to graph theory, version August 2, 2023 page 275
Example 6.1.5. Let n and m be two positive integers. The Cartesian product
Pn × Pm of the n-th path graph Pn and the m-th path graph Pm is known as
the (n, m)-grid graph, as it looks as follows:
.. .. .. .. ..
. . . . .
This (n, m)-grid graph Pn × ( Pm has a proper 2-coloring: namely, the map that
1, if i + j is even;
sends each vertex (i, j) to
2, if i + j is odd.
This 2-coloring is called the “chessboard coloring” for a fairly obvious
reason (view each vertex as a square of a chessboard).
More generally, if G and H are two simple graphs each having a proper
2-coloring, then their Cartesian product G × H has a proper 2-coloring as
well. (See Exercise 6.4 for the proof.)
An introduction to graph theory, version August 2, 2023 page 276
Example 6.1.6. Here is the Petersen graph (as defined in Subsection 2.6.3) :
{1, 4}
{2, 5}
{2, 3}
{3, 4}
{1, 2} {3, 5}
{4, 5}
{1, 5}
{1, 3}
{2, 4}
.
6.2. 2-colorings
In contrast, the existence of proper 2-colorings is a much simpler question. The
following is a nice criterion:
Theorem 6.2.1 (2-coloring equivalence theorem). Let G = (V, E, ϕ) be a
multigraph. Then, the following three statements are equivalent:
• Statement B1: The graph G has a proper 2-coloring.
• Statement B2: The graph G has no cycles of odd length.
• Statement B3: The graph G has no circuits of odd length.
An introduction to graph theory, version August 2, 2023 page 277
To prove this theorem, we will need a fact that is somewhat similar to Propo-
sition 3.3.14:
• We remind the reader once again that a “circuit” just means a closed walk
to us; we impose no further requirements.
1 2 3
6 7
.
(a) The odd-length walk (1, ∗, 2, ∗, 3, ∗, 4, ∗, 5, ∗, 2, ∗, 6, ∗, 7) (we are using
asterisks for the edges, since they can be trivially recovered from the vertices)
contains the odd-length path (1, ∗, 2, ∗, 6, ∗, 7) from 1 to 7.
(b) The odd-length walk (3, ∗, 2, ∗, 1, ∗, 6, ∗, 2, ∗, 3) contains the odd-length
cycle (2, ∗, 1, ∗, 6, ∗, 2).
all such pairs, we pick one with minimum difference j − i. Then, the vertices
wi , wi +1, . . . , w j−1 are distinct (since j − i is minimum).
Let c be the part of w between wi and w j ; thus,84
c = wi , ∗, wi + 1 , ∗, . . . , ∗, w j .
···
w i +1 w j −1
w0 w1 ··· wi = w j w j +1 ··· wk
( v0 , ∗, v1 , ∗, v2 , ∗, . . . , ∗, v k )
f ( vi ) 6 = f ( vi −1 ) (37)
assumption was false. Hence, G has no cycle of odd length. In other words,
Statement B2 holds. This proves the implication B1 =⇒ B2.
Proof of the implication B2 =⇒ B3: Assume that Statement B2 holds. We must
prove that Statement B3 holds. In other words, we must show that G has no
odd-length circuits.
Assume the contrary. Thus, G has an odd-length circuit w. Let u be the
starting and ending point of w. Thus, Proposition 6.2.2 (applied to v = u)
shows that this odd-length circuit w contains either an odd-length path from
u to u or an odd-length cycle. Since G has no odd-length cycle (because we
assumed that Statement B2 holds), we thus concludes that w contains an odd-
length path from u to u. However, an odd-length path from u to u is impossible
(since the only path from u to u has length 0). Thus, we obtain a contradiction,
which shows that G has no odd-length circuits. This proves the implication B2
=⇒ B3.
Proof of the implication B3 =⇒ B1: Assume that Statement B3 holds. We must
prove that Statement B1 holds.
We have assumed that Statement B3 holds. In other words, G has no odd-
length circuits. We must find a proper 2-coloring of G.
We WLOG assume that G is connected (otherwise, let C1 , C2 , . . . , Ck be the
components of G, and apply the implication B3 =⇒ B1 to each of the smaller
graphs G [C1 ] , G [C2 ] , . . . , G [Ck ], and then combine the resulting proper 2-
colorings of these smaller graphs into a single proper 2-coloring of G). Fix any
vertex r of G. Define a map f : V → {1, 2} by setting
(
1, if d (v, r ) is even;
f (v) = for each v ∈ V
2, if d (v, r ) is odd
(where d (v, r ) denotes the distance from v to r, that is, the smallest length of a
path from v to r).
I claim that f is a proper 2-coloring.86 Indeed, assume the contrary. Thus,
86 Here is an illustrative example:
2 1 2
1 2 2 1
2 1 2
.
(Of course, the numbers on the nodes here are not the vertices, but rather the colors of these
vertices.)
Note that all values of f can be easily found by the following recursive algorithm: Start
by assigning the color 1 to r. Then, assign the color 2 to all neighbors of r. Then, assign the
color 1 to all neighbors of these neighbors (unless they have already been colored). Then,
assign the color 2 to all neighbors of these neighbors of these neighbors, and so on.
An introduction to graph theory, version August 2, 2023 page 281
some two adjacent vertices u and v have the same color f (u) = f (v). Consider
these u and v. Since f (u) = f (v), we are in one of the following two cases:
Case 1: We have f (u) = f (v) = 1.
Case 2: We have f (u) = f (v) = 2.
Let us consider Case 2. In this case, we have f (u) = f (v) = 2. This means
that d (u, r ) and d (v, r ) are both odd (by the definition of f ). Hence, there
is an odd-length path p from u to r and an odd-length path q from v to r.
Consider these p and q. Also, there is an edge e that joins u and v (since u
and v are adjacent). Consider this edge e. By combining the paths p and q
and inserting the edge e into the result, we obtain a circuit from r to r (which
starts by following the path p backwards to u, then takes the edge e to v, then
follows the path q back to r). This circuit has odd length (since p and q have
odd lengths, and since the edge e adds 1 to the length). Thus, we have found
an odd-length circuit of G. However, we assumed that G has no odd-length
circuits. Contradiction!
Thus, we have found a contradiction in Case 2. Similarly, we can find a
contradiction in Case 1. Thus, we always get a contradiction. This shows that
f is indeed a proper 2-coloring. Thus, Statement B1 holds. This proves the
implication B3 =⇒ B1. 87
For aesthetical reasons, let me give a second proof of the implication B3 =⇒ B1, which
avoids the awkward “break G up into components” step:
Assume again that Statement B3 holds. We must prove that Statement B1 holds.
We assumed that Statement B3 holds. In other words, G has no odd-length cycles.
Two vertices u and v of G will be called oddly connected if G has an odd-length path
from u to v. By Proposition 6.2.2, this condition is equivalent to “G has an odd-length
walk from u to v”, since G has no odd-length cycles. Moreover, a vertex u cannot be
oddly connected to itself (since the only path from u to u is the trivial length-0 path
(u), which is not odd-length).
A subset A of V will be called odd-path-less if no two vertices in A are oddly
connected. (Note that “two vertices” doesn’t mean “two distinct vertices”.)
Pick a maximum-size odd-path-less subset A of V (such an A exists, since ∅ is
clearly odd-path-less). Now, let f : V → {1, 2} be the 2-coloring of G that assigns the
color 1 to all vertices in A and assigns the color 2 to all vertices not in A.
We shall show that this 2-coloring f is proper.
To prove this, we must show that no two adjacent vertices have color 1 and that no
two adjacent vertices have color 2. The first of these two claims is obvious88 . It thus
remains to prove the second claim – i.e., to prove that no two adjacent vertices have
87 Note that this proof provides a reasonably efficient algorithm for constructing a proper 2-
coloring of G, as long as you know how to compute distances in a graph (we have done
this, e.g., in homework set #4 exercise 5) and how to compute the components of a graph
(this is not hard).
88 Proof. An edge always makes a walk of length 1, which is odd. Thus, two adjacent vertices
are automatically oddly connected. Hence, two adjacent vertices cannot both be contained
in the odd-path-less subset A. In other words, two adjacent vertices cannot both have color
1.
An introduction to graph theory, version August 2, 2023 page 282
color 2.
Assume the contrary. Thus, there exist two adjacent vertices u and v that both have
color 2. Consider these u and v. These vertices u and v have color 2; in other words,
neither of them belongs to A.
The vertex u is not oddly connected to itself (as we already saw). Hence, the vertex
u is oddly connected to at least one vertex a ∈ A (because otherwise, we could insert u
into the odd-path-less set A and obtain a larger odd-path-less subset A ∪ {u} of V; but
this would contradict the fact that A is a maximum-size odd-path-less subset of V). For
similar reasons, the vertex v is oddly connected to at least one vertex b ∈ A. Consider
these vertices a and b. Since u is oddly connected to a, there exists an odd-length walk
p from u to a. Reversing this walk p yields an odd-length walk p′ from a to u. Since v
is oddly connected to b, there exists an odd-length walk q from v to b. Finally, there is
an edge e with endpoints u and v (since u and v are adjacent). Combine the two walks
p′ and q and insert this edge e between them; this yields a walk from a to b (via u and
v) that has odd length (since p′ and q have odd length each, and inserting e adds 1 to
the length). Thus, G has an odd-length walk from a to b. In other words, the vertices
a and b are oddly connected. This contradicts the fact that the set A is odd-path-less
(since a and b belong to A).
This contradiction shows that our assumption was false. Thus, we have shown that
no two adjacent vertices have color 2. This completes our proof that f is a proper 2-
coloring. Thus, Statement B1 holds. This proves the implication B3 =⇒ B1 once again.
Remark 6.2.4. A graph G that satisfies the three equivalent statements B1, B2,
B3 of Theorem 6.2.1 is sometimes called a “bipartite graph”. This is slightly
imprecise, since the proper definition of a “bipartite graph” is (equivalent to)
“a graph equipped with a proper 2-coloring”. Thus, if we equip one and
the same graph G with different proper 2-colorings, then we obtain different
bipartite graphs. We shall take a closer look at bipartite graphs in Sections
8.2, 8.3 and 8.4.
A further simple property of proper 2-colorings is the following:89
α := max {deg v | v ∈ V } .
• And so on, until all values f (v1 ) , f (v2 ) , . . . , f (vn ) have been chosen.
Why do we never run out of colors in this process? Well: When choosing f (vi ),
we must choose a color distinct from the colors of all already-colored neighbors
of vi . Since vi has at most α neighbors (because deg (vi ) ≤ α), this means that
we have at most α colors to avoid. Since there are α + 1 colors in total, this
leaves us at least 1 color that we can choose; therefore, we don’t run out of
colors.
The resulting (α + 1)-coloring f : V → {1, 2, . . . , α + 1} is called a greedy
coloring. This (α + 1)-coloring f is indeed proper, because if an edge has end-
points vi and v j with i > j, then the construction of f (vi ) ensures that f (vi ) is
distinct from f v j . (Note how we are using the fact that G is loopless here! If
G had a loop, then the endpoints of this loop could not be written as vi and v j
with i > j.)
Interestingly, these two examples are in fact the only cases when a con-
nected loopless multigraph with maximum degree α can fail to have a proper
α-coloring. In all other cases, we can improve the α + 1 to α:
(c) Does the converse to part (a) hold for k < n − 2 as well? Specifically,
does it hold for n = 5 and k = 2 ?
Exercise 6.3. Fix two positive integers n and k with n ≥ 2k > 0. Let S =
{1, 2, . . . , n}. Consider the k-Kneser graph KS,k as defined in Subsection 2.6.3.
Prove that KS,k has a proper (n − 2k + 2)-coloring.
[Hint: What can you say about the minima (i.e., smallest elements) of two
disjoint subsets of S? (Being distinct is a good first step.)]
[Remark: Lóvasz has proved in 1978 (using topology!) that this result is
optimal – in the sense that n − 2k + 2 is the smallest integer q such that KS,k
has a proper q-coloring.]
Exercise 6.4. Let k ∈ N. Let G and H be two simple graphs. Assume that
each of G and H has a proper k-coloring. Prove that the Cartesian product
G × H (defined in Definition 2.14.10) has a proper k-coloring as well.
[Remark: It is easy to see that the converse holds as well (i.e., if G × H has
a proper k-coloring, then so do G and H), provided that the vertex sets V ( G )
and V ( H ) are both nonempty.]
Exercise 6.5. Let n ∈ N. Let G be the n-th coprimality graph Copn defined
in Example 2.1.3. Let k ∈ N. Let m be the number of prime numbers in the
set {1, 2, . . . , n}. Prove the following:
Exercise 6.6. Let n and k be two positive integers. Let K be a set of size k.
Let D be the de Bruijn digraph – i.e., the multidigraph constructed in the
proof of Theorem 5.16.2. Let G be the result of removing all loops from the
undirected graph Dund . Prove that G has a proper (k + 1)-coloring.
k ( k + 1)
Exercise 6.7. Let k ∈ N. Let G be a simple graph with fewer than
2
edges. Prove that G has a proper k-coloring.
The proper place for this theorem is probably a course on enumerative com-
binatorics, but let us give here a proof for the sake of completeness (optional
material). The following proof is essentially due to Hassler Whitney in 1930
([Whitne32, §6]), and I am mostly copypasting it from my own writeup [17s-mt2s,
§0.5] (with some changes stemming from the fact that we are here working with
multigraphs rather than simple graphs).
We are going to use the Iverson bracket notation:
∑ (−1)| A| = [ P = ∅] .
A⊆ P
(Recall that the “color in f ” of a vertex v means the value f (v). If an edge
e ∈ E is a loop, then e always belongs to E f , since we think of the two
endpoints of e as being equal.)
An introduction to graph theory, version August 2, 2023 page 287
3 2
a
4 1
b
5 6
.
Let f : V → {1, 2} be the 2-coloring of G that sends each odd vertex to 1 and
each even vertex to 2. (Here, an “odd vertex” means a vertex that is odd as
an integer. Thus, the odd vertices are 1, 3, 5. “Even vertices” are understood
similarly.) Then, E f = { a, b} .
[Proof of Claim 1: This is an “if and only if” statement; we shall prove its
“=⇒” and “⇐=” directions separately:
=⇒: Assume that B ⊆ E f . We must prove that f is constant on each compo-
nent of the multigraph (V, B, ϕ | B ).
Let C be a component of (V, B, ϕ | B ). We must prove that f is constant on C.
In other words, we must prove that f (c) = f (d) for any c, d ∈ C.
So let us fix c, d ∈ C. Then, the vertices c and d belong to the same component
of the graph (V, B, ϕ | B ) (namely, to C). Hence, these vertices c and d are path-
connected in this graph. In other words, the graph (V, B, ϕ | B ) has a path from
c to d. Let
p = ( v0 , e1 , v1 , e2 , v2 , . . . , e s , v s )
be this path. Hence, v0 = c and vs = d and e1 , e2 , . . . , es ∈ B.
Let i ∈ {1, 2, . . . , s}. Then, the endpoints of the edge ei are vi −1 and vi (since
ei is surrounded by vi −1 and vi on the path p). However, from e1 , e2 , . . . , es ∈ B,
we obtain ei ∈ B ⊆ E f . Hence, the two endpoints of ei have the same color in f
(by the definition of E f ). In other words, f (vi −1 ) = f (vi ) (since the endpoints
of the edge ei are vi −1 and vi ).
Forget that we fixed i. We thus have proved the equality f (vi −1 ) = f (vi ) for
each i ∈ {1, 2, . . . , s}. Combining these equalities, we obtain
f ( v0 ) = f ( v1 ) = f ( v2 ) = · · · = f ( v s ) .
Hence, f (v0 ) = f (vs ). In other words, f (c) = f (d) (since v0 = c and vs = d).
Forget that we fixed c and d. We thus have shown that f (c) = f (d) for
any c, d ∈ C. In other words, f is constant on C. Since C was allowed to be
an arbitrary component of (V, B, ϕ | B ), we thus conclude that f is constant on
each component of the multigraph (V, B, ϕ | B ). This proves the “=⇒” direction
of Claim 1.
⇐=: Assume that f is constant on each component of the multigraph (V, B, ϕ | B ).
We must prove that B ⊆ E f .
An introduction to graph theory, version August 2, 2023 page 289
• For each component C of the graph (V, B, ϕ | B ), pick a color cC (that is,
an element cC of {1, 2, . . . , k}) and then assign this color cC to each vertex
in C (that is, set f (v) = cC for each v ∈ C).
χG = ∑ (−1)| F | xconn(V,F,ϕ| F ) .
F⊆E
An introduction to graph theory, version August 2, 2023 page 291
We thus obtain
χ G (k)
= ∑ (−1)| F | k|conn({z
V,F,ϕ| F )
} = ∑ (−1)| F | ∑ 1
F⊆E = ∑ 1 F⊆E f :V →{1,2,...,k};
f :V →{1,2,...,k}; F⊆E f
F⊆E f
(by Corollary 6.5.8)
= ∑ ∑ (−1)| F | 1 = ∑ ∑ (−1)| F |
F⊆E f :V →{1,2,...,k};
| {z } f :V →{1,2,...,k} F ⊆ E;
F⊆E f =(−1)|F| F⊆E f
| {z } |{z}
= ∑ ∑ = ∑
f :V →{1,2,...,k } F ⊆ E; F⊆ E f
F⊆E f (since E f ⊆ E)
= ∑ ∑ (−1)| F | = ∑ ∑ (−1)| A|
f :V →{1,2,...,k} F⊆E f f :V →{1,2,...,k} A⊆ E f
| {z }
= [ E f =∅]
(by Lemma 6.5.3,
applied to P = E f )
here, we have renamed the summation index F
in the inner sum as A
= ∑ Ef = ∅
f :V →{1,2,...,k}
= ∑ Ef = ∅
| {z }
+ ∑ Ef = ∅
| {z }
f :V →{1,2,...,k}; f :V →{1,2,...,k};
E f =∅ =1 not E f =∅ =0
(since E f =∅ is true) (since E f =∅ is false)
since each f : V → {1, 2, . . . , k} either satisfies E f = ∅
or does not
= ∑ 1+ ∑ 0= ∑ 1
f :V →{1,2,...,k}; f :V →{1,2,...,k}; f :V →{1,2,...,k};
E f =∅ not E f =∅ E f =∅
| {z }
=0
= the number of all f : V → {1, 2, . . . , k} such that E f = ∅ · 1
= the number of all f : V → {1, 2, . . . , k} such that E f = ∅
= (the number of all f : V → {1, 2, . . . , k} such that the k-coloring f is proper)
since Proposition 6.5.6 shows that the condition “E f = ∅”
is equivalent to “the k-coloring f is proper”
= (the number of all proper k-colorings ) .
In other words, the number of proper k-colorings of G is χ G (k). This completes
the proof of Theorem 6.5.1.
An introduction to graph theory, version August 2, 2023 page 292
χ Pn = x ( x − 1)n−1 .
χ T = x ( x − 1) n −1 .
χ K n = x ( x − 1) ( x − 2) · · · ( x − n + 1) .
χ En = x n .
(e) Assume that n ≥ 2. For the cycle graph Cn with n vertices, we have
Proof sketch. (c) In order to prove that two polynomials with real coefficients are iden-
tical, it suffices to show that they agree on all nonnegative integers (this is an instance
of the “principle of permanence of polynomial identities” that we have already stated
as Theorem 5.19.4). Thus, in order to prove that χKn = x ( x − 1) ( x − 2) · · · ( x − n + 1),
it suffices to show that χKn (k) = k ( k − 1) (k − 2) · · · (k − n + 1) for each k ∈ N.
So let us do this. Fix k ∈ N. Theorem 6.5.1 (applied to G = Kn ) yields
(# of proper k-colorings of Kn ) = χKn (k) . (38)
Now, how many proper k-colorings does Kn have? We can construct such a proper
k-coloring as follows:
• First, choose the color of the vertex 1. There are k options for this.
• Then, choose the color of the vertex 2. There are k − 1 options for this, since it
must differ from the color of 1.
• Then, choose the color of the vertex 3. There are k − 2 options for this, since it
must differ from the colors of 1 and of 2 (and the latter two colors are distinct,
so we must subtract 2, not 1).
An introduction to graph theory, version August 2, 2023 page 293
(# of proper k-colorings of Kn ) = k ( k − 1) (k − 2) · · · (k − n + 1) .
χ T (k) = χ T \ℓ (k) · (k − 1) .
χT = χ T \ℓ · ( x − 1) = x ( x − 1) n − 2 · ( x − 1) = x ( x − 1) n − 1 .
|{z}
= x ( x − 1 )n − 2
Exercise 6.8. Let g ∈ N. Let G be the simple graph whose vertices are the
2g + 1 integers − g, − g + 1, . . . , g − 1, g, and whose edges are
−2 −1
3 0 1
−3 −4
4
An introduction to graph theory, version August 2, 2023 page 295
]
[Solution: This is Exercise 2 (b) on midterm #3 from my Spring 2017
course; see the course page for solutions.]
Theorem 6.6.2 (Vizing’s theorem). Let G be a simple graph with at least one
vertex. Let
α := max {deg v | v ∈ V } .
Then, G has a proper (α + 1)-edge-coloring.
92 Note that [Schrij04] uses some standard graph-theoretical notations: What we call α is de-
noted by ∆ ( G ) in [Schrij04], whereas χ′ ( G ) denotes the minimum k ∈ N for which G has
a proper k-edge-coloring.
An introduction to graph theory, version August 2, 2023 page 296
7. Independent sets
7.1. Definition and the Caro–Wei theorem
Next, we define one of the most fundamental notions in graph theory:
Remark 7.1.2. Independent sets are closely related to proper colorings. In-
deed, let G be a graph, and let k ∈ N. Let f : V → {1, 2, . . . , k} be a
k-coloring. For each i ∈ {1, 2, . . . , k}, let
Vi := {v ∈ V | f (v) = i }
= {all vertices of G that have color i } .
1
≥ ∑ 1 + deg v
.
v ∈V
3 2
4 1
5 6
.
1 1 1 1 1 1 11
≥ + + + + + = ≈ 1.83.
1+3 1+2 1+3 1+2 1+2 1+2 6
An introduction to graph theory, version August 2, 2023 page 298
Since the size of an independent set is always an integer, we can round this
up and conclude that G has an independent set of size ≥ 2. In truth, G actu-
ally has an independent set of size 3 (namely, {2, 4, 6}), but there is no way
to tell this from the degrees of its vertices alone. For example, the vertices of
the graph
3 2
H := 4 1
5 6
have the same degrees as those of G, but H has no independent set of size 3.
We shall give two proofs of Theorem 7.1.3, both of them illustrating useful
techniques.94
First proof of Theorem 7.1.3. Assume the contrary. Thus, each independent set S
of G has size
1
| S| < ∑ . (39)
v ∈V
1 + deg v
A V-listing shall mean a list of all vertices in V, with each vertex occurring
exactly once in the list. If σ is a V-listing, then we define a subset Jσ of V as
follows:
2 3
1 4 7
5 6
.
Let σ be the V-listing (1, 2, 7, 5, 3, 4, 6). Then, the vertex 1 occurs before all its
neighbors (2, 4 and 5) in σ, and thus we have 1 ∈ Jσ . Likewise, the vertex 7
occurs before all its neighbors (3 and 6) in σ, so that we have 7 ∈ Jσ . But the
94 Notethat the looplessness requirement in Theorem 7.1.3 is important: If G has a loop at each
vertex, then the only independent set of G is ∅.
An introduction to graph theory, version August 2, 2023 page 299
vertex 2 does not occur before all its neighbors in σ (indeed, it occurs after its
neighbor 1), so that we have 2 ∈/ Jσ . Likewise, the vertices 5, 3, 4, 6 don’t belong
to Jσ . Altogether, we thus obtain Jσ = {1, 7}.]
The set Jσ is an independent set of G (because if two vertices u and v in Jσ
were adjacent, then u would have to occur before v in σ, but v would have to
occur before u in σ; but these two statements clearly contradict each other).
Thus, (39) (applied to S = Jσ ) yields
1
| Jσ | < ∑ 1 + deg v
.
v ∈V
This inequality holds for each V-listing σ. Thus, summing this inequality
over all V-listings σ, we obtain
1
∑ | Jσ | < ∑ ∑ 1 + deg v
σ is a V-listing σ is a V-listing v ∈V
1
= (# of all V-listings) · ∑ 1 + deg v
. (40)
v ∈V
exactly 1 + deg′ v many V-listings τ that satisfy Γ (τ ) = σ (in fact, one of these
τ’s is σ itself, and the remaining deg′ v many of these τ’s are obtained from σ
by switching v with some neighbor of v). Hence, by the multijection principle96 ,
we conclude that
|{all V-listings}| = 1 + deg′ v · |{all good V-listings}| .
In other words,
(# of all V-listings) = 1 + deg′ v · (# of all good V-listings) .
Hence,
(since deg′ v ≤ deg v). This proves Claim 1 (since the good V-listings are pre-
cisely the V-listings σ satisfying v ∈ Jσ ).]
Next, we recall a basic property of the Iverson bracket notation97 : If T is a
subset of a finite set S, then
|T| = ∑ [v ∈ T ] . (41)
v∈ S
96 See a footnote in the proof of Theorem 5.10.4 for the statement of the multijection principle.
97 See, e.g., Definition 5.14.2 for the definition of the Iverson bracket notation.
An introduction to graph theory, version August 2, 2023 page 301
= ∑ ∑ [ v ∈ Jσ ]
v ∈V σ is a V-listing
| {z }
=(# of all V-listings σ satisfying v∈ Jσ )
(because the sum ∑ [ v ∈ Jσ ]
σ is a V-listing
contains an addend equal to 1 for each V-listing σ satisfying v∈ Jσ ,
and an addend equal to 0 for each other V-listing σ)
Let us now give a second proof of the theorem, which does provide a good
algorithm:
An introduction to graph theory, version August 2, 2023 page 302
1 1 1
∑ 1 + degG v
= ∑ 1 + degG v
+ ∑ 1 + degG v
v ∈V v ∈U | {z } v ∈V \U | {z }
1 1
≤ ≤
1 + degG u 1 + degG ′ v
(since degG v≥degG u (since degG v≥degG ′ v
(by (42))) (because G ′ is a subgraph of G))
1 1
≤ ∑ 1 + degG u
+ ∑ 1 + degG ′ v
v ∈U v ∈V \U
| {z } | {z }
1 ≤| T |
=|U |·
1 + degG u 1
(since T has size ≥ ∑ )
=1 v ∈V \U 1 + degG ′ v
(since |U |=1+degG u)
≤ 1 + | T | = | S| (since S = {u} ∪ T ) .
98 Here, the notation degH u means the degree of a vertex u in a graph H.
An introduction to graph theory, version August 2, 2023 page 303
1
So we have found an independent set of G having size ≥ ∑ (namely,
v∈V 1 + degG v
S). This means that Theorem 7.1.3 holds for our G. This completes the induc-
tion step, and Theorem 7.1.3 is proved.
Remark 7.1.6. The second proof of Theorem 7.1.3 (unlike the first one) does
give a fairly efficient algorithm for finding an independent set of the appro-
priate size. However, the second proof is actually not that much different
from the first proof; it can in fact be recovered from the first proof by de-
randomization, specifically using the method of conditional probabilities.
(This is a general technique for “derandomizing” probabilistic proofs, i.e.,
turning them into algorithmic ones. It often requires some ingenuity and is
not guaranteed to always work, but the above is an example where it can be
applied. See [Aspnes23, Chapter 13] for much more about derandomization.)
See also [Chen14] and [AloSpe16] for more about probabilistic proofs in
combinatorics and in general. Here are two more applications of probabilis-
tic proofs:
Exercise 7.1. Let G = (V, E) be a simple graph such that each vertex of
G has degree ≥ 1. Prove that there exists a subset S of V having size ≥
2
∑ and with the property that the induced subgraph G [S] is a
v∈V 1 + deg v
forest.
1 2 3
[Hint: As the example of shows, this claim is not true
for loopless multigraphs (unlike the similar Theorem 7.1.3).]
Exercise 7.2. Let n be a positive integer. Prove that there exists a tournament
n!
with n vertices and at least n−1 Hamiltonian paths.
2
n2
≥ .
n + 2m
1 1 1 n2
+ +···+ ≥ .
a1 a2 an a1 + a2 + · · · + a n
1
• Apply Jensen’s inequality to the convex function R + → R + , x 7→ .
x
• Apply the Cauchy-Schwarz inequality to get
1 1 1
( a1 + a2 + · · · + a n ) + +···+
a1 a2 an
2
s s s
1 1 1
≥ a1 + a2 + · · · + a n = n2 .
a1 a2 an
| {z }
=n
99 For unexplained terminology used in the bullet points below, see any textbook on inequal-
ities, such as [Steele04]. (That said, notation is not completely standardized; what I call
“AM-HM inequality” is dubbed “HM-AM inequality” in [Steele04].)
An introduction to graph theory, version August 2, 2023 page 305
u v ( u − v)2
that + −2 = ≥ 0.) Now,
v u uv
1 1 1
( a1 + a2 + · · · + a n ) + +···+
a1 a2 an
! !
n n n n n n
1 1 ai
= ∑ ai ∑ aj = ∑ ∑ i aj ∑ ∑ aj
a =
i =1 j =1 i =1 j =1 i =1 j =1
!
n n n n
1 ai ai 1
2 i∑ ∑ a + ∑ ∑ aj
= since x = ( x + x ) for any x ∈ R
=1 j =1 j i =1 j =1
2
!
1 n n
ai n n a
j here, we renamed i and j as j and i
2 i∑ ∑ a + ∑ ∑ ai
=
=1 j =1 j j =1 i =1
in the second double sum
!
n n n n a here, we swapped the two
1 ai j
summation signs in the
= ∑ ∑ +∑ ∑
2 i = 1 j = 1 a j i = 1 j = 1 ai
second double sum
!
1 n n
ai aj 1 n n
1
= ∑ ∑ + ≥ ∑ ∑ 2 = n2 · 2 = n2 ,
2 i =1 j =1 a j ai 2 i =1 j =1 2
| {z } | {z }
≥2 = n2 ·2
(by (43))
n2 n
=
n + 2m
since
∑ (1 + deg v) = n + ∑ deg v = n + 2m
.
v=1 v ∈V
| {z }
=2m
This proves Corollary 7.2.1.
An introduction to graph theory, version August 2, 2023 page 306
r − 1 n2
e> · .
r 2
Then, there exist r + 1 distinct vertices of G that are mutually adjacent (i.e.,
any two distinct vertices among these r + 1 vertices are adjacent).
n2
≥ .
n
n+2· −e
2
2 2
3 3
G= 1 G= 1
4 4
100 For 5 5
example, if , then .
An introduction to graph theory, version August 2, 2023 page 307
8. Matchings
8.1. Introduction
Independent sets of a graph consist of vertices that “have no edges in common”
(i.e., no two belong to the same edge).
In a sense, matchings are the dual notion to this: they consist of edges that
“have no vertices in common” (i.e., no two contain the same vertex). Here is
the formal definition:
Definition 8.1.1. Let G = (V, E, ϕ) be a loopless multigraph.
5 6 7
1 2 3 4
8 9
.
Then:
• The set {12, 36, 47} is a matching of G. If we call this set M, then the
vertices matched in M are 1, 2, 3, 4, 6, 7, and their respective M-partners
are 2, 1, 6, 7, 3, 4. This matching is not perfect, but it is (for example)
{1, 3, 4}-complete and {1, 2, 3, 4, 6, 7}-complete.
• The set {12, 36, 67} is not a matching of G, since the two distinct edges
36 and 67 from this set have a common endpoint.
• The sets ∅, {36}, {15, 29, 36, 47} are matchings of G as well.
We see that any matching “pairs up” some vertices using the existing edges
of the graph. Clearly, the M-partner of the M-partner of a vertex v is v itself.
Also, no two distinct vertices have the same M-partner (since otherwise, their
M-edges would have a common endpoint).
Example 8.1.4. Let n and m be two positive integers. The Cartesian product
Pn × Pm of the n-th path graph Pn and the m-th path graph Pm is known as
the (n, m)-grid graph, as it looks as follows:
.. .. .. .. ..
. . . . .
(c) If n and m are both odd, then Pn × Pm has no perfect matching. Indeed,
any loopless multigraph G with an odd number of vertices cannot have
a perfect matching, since each edge of the matching covers exactly 2
vertices.
Example 8.1.5. The “pentagon with two antlers” C5′′ (this is my notation,
hopefully sufficiently natural) is the following graph:
7
2
3
4
5
.
It has no perfect matching. This is easiest to see as follows: The graph C5′′
is loopless, so each edge contains exactly two vertices. Thus, any matching
M of C5′′ matches exactly 2 · | M| vertices. In particular, any matching of C5′′
matches an even number of vertices. Since the total number of vertices C5′′ is
odd, this entails that C5′′ has no perfect matching.
What is the maximum size of a matching of C5′′ ? The matching {12, 34} of
C5′′ has size 2 and cannot be improved by adding any new edges. Thus, one
is tempted to believe that the maximum size of a matching is 2. However,
this is not the case. Indeed, the matching {12, 37, 45} has size 3. This latter
matching is actually maximum-size.
3 2
4 1
5 6
.
Then, (C6 , {1, 3, 5} , {2, 4, 6}) is a bipartite graph, since each edge of
G has one endpoint in {1, 3, 5} and one endpoint in {2, 4, 6}. Also,
(C6 , {2, 4, 6} , {1, 3, 5}) is a bipartite graph.
Note that a bipartite graph ( G, X, Y ) is not just the graph G but rather
the whole package consisting of the graph G and the subsets X and Y.
Two different bipartite graphs can have the same underlying graph G
but different choices of X and Y. For example, the two bipartite graphs
(C6 , {1, 3, 5} , {2, 4, 6}) and (C6 , {2, 4, 6} , {1, 3, 5}) are different.
We typically draw a bipartite graph ( G, X, Y ) by drawing the graph G in
such a way that the vertices in X are aligned along one vertical line and the
vertices Y are aligned along another, with the former line being left of the
latter. Thus, for example, the bipartite graph (C6 , {1, 3, 5} , {2, 4, 6}) can be
drawn as follows:
1 2
3 4
5 6
.
An introduction to graph theory, version August 2, 2023 page 312
Similarly, the bipartite graph (C6 , {2, 4, 6} , {1, 3, 5}) can be drawn as fol-
lows:
2 1
4 3
6 5
.
Thus, each edge of a bipartite graph joins one left vertex with one right vertex.
Bipartite graphs are “the same as” multigraphs with a proper 2-coloring. To
wit:
f : V → {1, 2} ,
(
1, if v ∈ X;
v 7→
2, if v ∈ Y
is a proper 2-coloring of G.
(c) These constructions are mutually inverse. (That is, going from a bipar-
tite graph to a proper 2-coloring and back again results in the original
bipartite graph, whereas going from a proper 2-coloring to a bipartite
graph and back again results in the original 2-coloring.)
An introduction to graph theory, version August 2, 2023 page 313
Proof. By Proposition 8.2.4 (a), we know that G has a proper 2-coloring. Hence,
the 2-coloring equivalence theorem (Theorem 6.2.1) shows that G has no circuits
of odd length. In particular, G has no loops or triangles (since these would yield
circuits of length 1 or 3, respectively).
We need another piece of notation:
Example 8.2.7. If G is the “pentagon with antlers” C5′′ from Example 8.1.5,
then
N ( A) ⊆ Y.
Proof. Let v ∈ N ( A). Thus, the vertex v has a neighbor in A (by definition of
N ( A)). Let w be this neighbor. Then, w ∈ A ⊆ X, so that w ∈ / Y (since the
bipartiteness of (G, X, Y ) shows that the sets X and Y are disjoint).
There exists some edge that has endpoints v and w (since w is a neighbor of
v). This edge must have an endpoint in Y (since the bipartiteness of ( G, X, Y )
shows that each edge of G has one endpoint in Y). In other words, one of v and
w must belong to Y (since the endpoints of this edge are v and w). Since w ∈ / Y,
we thus conclude that v ∈ Y.
Thus, we have shown that v ∈ Y for each v ∈ N ( A). In other words, N ( A) ⊆
Y.
An introduction to graph theory, version August 2, 2023 page 314
∑ (−1)| A| [ N ( A) = Y ] = ∑ (−1)|B| [ N ( B) = X ]
A⊆ X B ⊆Y
1 2
3 4
5 6
(drawn as explained in Example 8.2.2). Does this graph have a perfect match-
ing? No, because the two left vertices 1 and 3 would necessarily have the
same partner in such a matching (since their only possible partner is 2).
1 2
3 4
5 6
7 8
has no perfect matching, since the three left vertices 1, 5 and 7 have only two
potential partners (viz., 2 and 6).
p : X → V,
x 7→ (the M-partner of x )
is injective (since two distinct vertices cannot have the same M-partner). Thus,
|p ( A)| = | A| (because any injective map preserves the size of a subset). How-
ever, p ( A) ⊆ N ( A), because the M-partner of an element of A will always
belong to N ( A). Hence, | p ( A)| ≤ | N ( A)|. Thus, | N ( A)| ≥ |p ( A)| = | A|,
qed.
So we have found a necessary condition for the existence of an X-complete
matching. Interestingly, it is also sufficient:
This is called “marriage theorem” because one can interpret a bipartite graph
as a dating scene, with X being the guys and Y the ladies. A guy x and a
lady y are adjacent if and only if they are interested in one another. Thus, an
X-complete matching is a way of marrying off each guy to some lady he is
mutually interested in (without allowing polygamy). This is a classical model
for bipartite graphs and appears all across the combinatorics literature; to my
knowledge, however, no real-life applications have been found along these
lines. Nevertheless, Hall’s marriage theorem can be applied in many other sit-
uations, such as logistics (although its generalizations, which we will soon see,
are even more useful in that). Philip Hall has originally invented the theorem
in 1935 (in a somewhat obfuscated form), motivated (I believe) by a problem
about finite groups. So did Wilhelm Maak, also in 1935, for use in analysis
(defining a notion of integrals for almost-periodic functions).
There are many proofs of Hall’s marriage theorem, some pretty easy. Two
short and self-contained proofs can be found in [LeLeMe18, §12.5.2] and in
[Harju14, Theorem 3.9]. I will tease you by leaving the theorem unproved for
several pages, while exploring some of its many consequences. Afterwards, I
will give two proofs of Hall’s marriage theorem:
• one proof using the theory of network flows (Section 9.5) – an elegant
theory created for use in logistics102 in the 1950s that has proved to be
quite useful in combinatorics. Among other consequences, this proof will
also provide a polynomial-time algorithm for actually finding a maximum
matching in a bipartite graph (Theorem 8.3.4 by itself does not help here).
Example 8.4.2. Let n ≥ 1. What are the vertex covers of the complete graph
Kn ?
A quick thought reveals that any subset S of {1, 2, . . . , n} that has at least
n − 1 elements is a vertex cover of Kn . (In fact, Kn has no loops, so that
each edge of Kn contains two different vertices, and thus at least one of these
two vertices belongs to S.) On the other hand, a subset S with fewer than
n − 1 vertices will never be a vertex cover of Kn (since there will be at least
two distinct vertices that don’t belong to S, and the edge that joins these two
vertices contains no vertex in S).
Example 8.4.3. Let G = (V, E, ϕ) be the graph from Example 8.3.2. Then,
the set {2, 5} is a vertex cover of G. Of course, any subset of V that contains
{2, 5} as a subset will thus also be a vertex cover of G.
Note that the notion of a vertex cover is (in some sense) “dual” to the notion
of an edge cover, which we defined in Exercise 2.15. For those getting confused,
here is a convenient table (courtesy of Nadia Lafrenière, Math 38, Spring 2021):
Both Hall’s and König’s theorems easily follow from the following theorem:
| M| ≥ | N (U )| + | X | − |U | .
We will prove this theorem in Section 9.5 and again in Subsection 10.2.3.
For now, let us show that Hall’s marriage theorem (Theorem 8.3.4), König’s
theorem (Theorem 8.4.6) and the Hall–König matching theorem (Theorem 8.4.7)
are mutually equivalent. More precisely, we will explain how to derive the first
two from the third, and outline the reverse derivations.
Proof of Theorem 8.3.4 using Theorem 8.4.7. Assume that Theorem 8.4.7 has already
been proved.
Theorem 8.4.7 yields that there exist a matching M of G and a subset U of X
such that
| M| ≥ | N (U )| + | X | − |U | .
Consider these M and U. The Hall condition shows that each subset A of X
satisfies | N ( A)| ≥ | A|. Applying this to A = U, we obtain | N (U )| ≥ |U |.
Thus,
| M| ≥ | N (U )| + | X | − |U | ≥ | X | .
| {z }
≥|U |
Hence, the matching M is X-complete (by Proposition 8.3.1 (e)). Thus, we have
found an X-complete matching. This proves Theorem 8.3.4 (assuming that
Theorem 8.4.7 is true).
Proof of Theorem 8.4.6 using Theorem 8.4.7. Assume that Theorem 8.4.7 has already
been proved.
Write the multigraph G as G = (V, E, ϕ). Theorem 8.4.7 yields that there
exist a matching M of G and a subset U of X such that
| M| ≥ | N (U )| + | X | − |U | . (44)
An introduction to graph theory, version August 2, 2023 page 320
|C| = |( X \ U ) ∪ N (U )|
≤ | X \ U | + | N (U )| (actually an equality, but we don’t care)
| {z }
=| X |−|U |
(since U ⊆ X)
= | X | − |U | + | N (U )| = | N (U )| + | X | − |U | ≤ | M| (by (44))
≤ m.
Proof of Theorem 8.4.7 using Theorem 8.3.4 (sketched). Assume that Theorem 8.3.4 has al-
ready been proved.
Add a bunch of “dummy vertices” to Y and join each of these “dummy vertices” by
a new edge to each vertex in X. How many “dummy vertices” should we add? As
many as it takes to ensure that every subset A of X satisfies the Hall condition – i.e.,
exactly max {| A| − | N ( A)| | A is a subset of X } many.
Let G ′ be the resulting graph. Let also D be the set of all dummy vertices that
were added to Y, and let Y ′ = Y ∪ D be the set of all right vertices of G ′ . (The set
of left vertices of G ′ is still X.) Then, the bipartite graph ( G ′ , X, Y ′ ) satisfies the Hall
condition, and therefore we can apply Theorem 8.3.4 to ( G ′ , X, Y ′ ) instead of ( G, X, Y ),
and conclude that the graph G ′ has an X-complete matching. Let M ′ be this matching.
By removing from M ′ all edges that contain dummy vertices, we obtain a matching M
103 Proof.Let e be an edge of G. We must show that e has at least one endpoint in C.
Clearly, the edge e has an endpoint in X (since ( G, X, Y ) is a bipartite graph). Let x be
this endpoint. This x either belongs to U or doesn’t.
• If x belongs to U, then the other endpoint of e (that is, the endpoint distinct from
x) belongs to N (U ) (since its neighbor x belongs to U) and therefore to C (since
N (U ) ⊆ ( X \ U ) ∪ N (U ) = C).
• If x does not belong to U, then x belongs to X \ U (since x ∈ X) and therefore to C
(since X \ U ⊆ (X \ U ) ∪ N (U ) = C).
In either of these two cases, we have found an endpoint of e that belongs to C. Thus, e
has at least one endpoint in C, qed.
An introduction to graph theory, version August 2, 2023 page 321
However, the maximum of a set is always an element of this set. Hence, there exists
a subset U of X such that
≥ | X | − (|U | − | N (U )|) = | N (U )| + | X | − |U | .
Proof of Theorem 8.4.7 from Theorem 8.4.6 (sketched). Assume that Theorem 8.4.6 has al-
ready been proved.
Let M be a maximum-size matching of G. Let C be a minimum-size vertex cover of
G. Then, Theorem 8.4.6 says that | M | = |C |.
Let U := X \ C. Then, N (U ) ⊆ C \ X (why?). Hence, | N (U )| ≤ |C \ X |, so that
U ≤ | C \ X | + | X | − | X \ C | = | C \ X | + | C ∩ X | = | C | = | M | .
| N (U )| + | X | − |{z}
| {z } = X \ C | {z }
≤|C\ X | =|C∩ X |
Theorem 8.4.7 thus occupies a convenient “high ground” between the Hall
and König theorems, allowing easy access to both of them. We shall prove
Theorem 8.4.7 in Section 9.5 and again in Subsection 10.2.3.
An introduction to graph theory, version August 2, 2023 page 322
)
Then, we can find n distinct elements
a1 ∈ A 1 , a2 ∈ A 2 , ..., an ∈ An .
Example 8.5.3. Take a standard deck of cards, and deal them out into 13 piles
of 4 cards each – e.g., as follows:
{2♠, 2♥, 9♦, K ♦} , { A♠, A♥, 3♠, 3♦} , { A♦, 4♣, 5♣, Q♣} ,
{2♦, 4♥, 5♥, 5♠} , { A♣, 7♣, 7♠, 7♥} , {4♠, 6♠, 6♦, 6♣} ,
{3♥, 3♣, 8♠, 8♥} , {2♣, K ♣, K ♥, 10♥} , {4♦, 5♦, 9♠, 9♥} ,
{Q♠, Q♥, Q♦, Q♣} , {6♥, J ♠, J ♦, J ♣} , {7♦, 8♦, 8♣, 9♣} ,
{10♠, J ♥, 10♦, 10♣}
(you can distribute the cards among the piles randomly; this is just one ex-
ample). Then, I claim that it is possible to select exactly 1 card from each pile
so that the 13 selected cards contain exactly 1 card of each rank (i.e., exactly
one ace, exactly one 2, exactly one 3, and so on).
Indeed, this follows from Theorem 8.5.1 (applied to Ai =
{ranks that occur in the i-th pile}) because any p piles contain cards of
at least p different ranks.
Proof of Theorem 8.5.1. First, we WLOG assume that all n sets A1 , A2 , . . . , An are
finite. (If not, then we can just replace each infinite
one by an n-element subset
thereof. The assumption Ai1 ∪ Ai2 ∪ · · · ∪ Ai p ≥ p will not be disturbed by
this change – make sure you understand why!)
An introduction to graph theory, version August 2, 2023 page 323
Example 8.6.2. A 1-regular graph is a graph whose entire edge set is a perfect
matching. In other words, a 1-regular graph is a graph that is a disjoint union
of copies of the 2-nd path graph P2 . Here is an example of such a graph:
Example 8.6.4. The 3-regular graphs are known as cubic graphs or trivalent
graphs. An example is the Petersen graph (defined in Subsection 2.6.3). Here
An introduction to graph theory, version August 2, 2023 page 325
More examples of cubic graphs can be found on the Wikipedia page. There
is no hope of describing them all.
Recall the Kneser graphs defined in Subsection 2.6.3. They are all regular:
| S| − k
Example 8.6.5. Any Kneser graph KS,k is -regular.
k
Proof. This is
saying that if A is a k-element subset of a finite set S, then there
| S| − k
are precisely many k-element subsets of S that are disjoint from A.
k
But this is clear, since the latter subsets are just the k-element subsets of the
(|S| − k)-element set S \ A.
= ∑ k = k · |X| .
x∈X
= ∑ deg x
| {z }
= ∑ k = k · | A| .
x∈ A x∈ A
=k
(since G is k-regular)
On the other hand, each A-edge contains exactly one vertex in N ( A) (why?105 ).
Thus,
Hence,
k · | N ( A)| ≥ (# of A-edges) = k · | A| .
Since k > 0, we can divide this inequality by k, and thus find | N ( A)| ≥ | A|.
104 Here we are using the fact that A ⊆ X, so that no two vertices in A can be adjacent.
105 Here we are using the fact that N ( A) ⊆ Y (which follows from A ⊆ X using Proposition
8.2.8), so that no two vertices in N ( A) can be adjacent.
An introduction to graph theory, version August 2, 2023 page 327
Forget that we fixed A. We thus have proved | N ( A)| ≥ | A| for each subset
A of X. Hence, the HMT (Theorem 8.3.4) yields that the graph G has an X-
complete matching M. Consider this M.
However, Proposition 8.6.6 yields | X | = |Y |. Hence, Proposition 8.3.1 (f)
shows that the matching M is perfect (since M is X-complete). Therefore, G
has a perfect matching. This proves Theorem 8.6.7.
A popular example of Latin squares of order 9 are Sudokus (but they have to
satisfy an additional requirement, concerning certain 3 × 3 subsquares). See the
Wikipedia page and the book [LayMul98] for much more about Latin squares.
The Latin squares in Example 8.7.2 are rather boring. What would be a good
algorithm to construct general Latin squares?
Here is an attempt at a recursive algorithm: We just start by filling in the first
row, then the second row, then the third row, and so on, making sure at each
An introduction to graph theory, version August 2, 2023 page 328
step that the distinctness conditions (Conditions 2 and 3 in Definition 8.7.1) are
satisfied.
We continue along the same lines, ending up with the Latin square
3 1 4 2 5
2 4 1 5 3
1 5 2 3 4
5 2 3 4 1
4 3 5 1 2
can append to M at the bottom, such that the result will be a (k + 1) × n Latin
rectangle.
This new row should contain the numbers 1, 2, . . . , n in some order. More-
over, for each i ∈ {1, 2, . . . , n}, its i-th entry should be distinct from all entries
of the i-th column of M. How do we find such a new row?
Let X = {1, 2, . . . , n} and Y = {−1, −2, . . . , −n}.
Let G be the simple graph with vertex set X ∪ Y, where we let a vertex i ∈ X
be adjacent to a vertex − j ∈ Y if and only if the number j does not appear in
the i-th column of M. There should be no further adjacencies.
Thus, ( G, X, Y ) is a bipartite graph. Moreover, the graph G is (n − k)-regular
(this is not hard to see107 ). Thus, by the Frobenius matching theorem (Theorem
8.6.7), the graph G has a perfect matching. Let
be this perfect matching. Then, the numbers a1 , a2 , . . . , an are distinct (since two
edges in a matching cannot have a common endpoint), and the number ai does
not appear in the i-th column of M (since {i, − ai } is an edge of G). Thus, we
can append the row
a1 a2 · · · a n
to M at the bottom and obtain a (k + 1) × n Latin rectangle. This proves Propo-
sition 8.7.4.
Proposition 8.7.4 is a result of Marshall Hall (no relation to Philip Hall) from
1945 (see [Hall45]), and the proof given above is exactly his.
107 Proof.Each vertex i ∈ X has degree n − k (after all, there are k numbers in {1, 2, . . . , n} that
appear in the i-th column of M, thus n − k numbers in {1, 2, . . . , n} that do not appear in
this column). It remains to show that each vertex − j ∈ Y has degree n − k as well. To see
this, consider some vertex − j ∈ Y. Then, the number j appears exactly once in each row
of M (since Condition 2 forces each row to contain the numbers 1, 2, . . . , n in some order).
Hence, the number j appears a total of k times in M. These k appearances of j must be
in k distinct columns (since having two of them in the same column would conflict with
Condition 3). Thus, there are k columns of M that contain j, and therefore n − k columns
that don’t. In other words, the vertex − j ∈ Y has degree n − k.
An introduction to graph theory, version August 2, 2023 page 330
Clearly, these three concepts are closely related (in particular, all N-magic
matrices and all doubly stochastic matrices are R + -magic). The most impor-
tant of them is the last; in particular, majorization theory (one of the main
methods for proving inequalities) is deeply connected to the properties of dou-
bly stochastic matrices (see [MaOlAr11, Chapter 2]). See [BapRag97, Chapter
2] for a chapter-length treatment of doubly stochastic matrices. We shall only
prove some of their most basic properties. First, some examples:
is N-magic and also R + -magic. This matrix is not doubly stochastic (unless
n = 1), since the sum of the entries in a row or column is n, not 1. However,
if we divide this matrix by n, it becomes doubly stochastic.
An introduction to graph theory, version August 2, 2023 page 331
It turns out that these permutation matrices are (in a sense) the “building
blocks” of all magic (and doubly stochastic) matrices! Namely, the following
holds:
Theorem 8.8.7 (Birkhoff–von Neumann theorem). Let n ∈ N. Then:
Soon we will sketch a proof of this theorem using the HMT. First, two simple
results that will be used in the proof.
Lemma 8.8.9. Let M be an N-magic or R + -magic matrix that is not the zero
matrix. Then, there exists a permutation σ of {1, 2, . . . , n} such that all entries
M1,σ(1) , M2,σ(2) , . . . , Mn,σ(n) are nonzero.
2 7 1
Example 8.8.10. If n = 3 and M = 0 1 9 , then the permutation σ that
8 2 0
sends 1, 2, 3 to 3, 2, 1 has this property.
Proof of Lemma 8.8.9. Let s denote the sum of the entries in any given row of M
(it doesn’t matter which row we take, since M is magic). Then, s is also the sum
of the entries in any given column of M (by Proposition 8.8.8). Also, the sum
of all entries of M is ns. Hence, ns > 0 (since M has nonnegative entries and is
not the zero matrix). Thus, s > 0.
Let X = {1, 2, . . . , n} and Y = {−1, −2, . . . , −n}.
Let G be the simple graph with vertex set X ∪ Y and with edges defined as
follows: A vertex i ∈ X shall be adjacent to a vertex − j ∈ Y if and only if
Mi,j > 0 (here, Mi,j denotes the (i, j)-th entry of M). There shall be no further
adjacencies.
Thus, ( G, X, Y ) is a bipartite graph.
We shall now prove that it satisfies the Hall condition. That is, we shall prove
that every subset A of {1, 2, . . . , n} satisfies | N ( A)| ≥ | A|.
Assume the contrary. Thus, there exists a subset A of {1, 2, . . . , n} that satis-
fies | N ( A)| < | A|. Consider this A. WLOG assume that A = {1, 2, . . . , k} for
some k ∈ {0, 1, . . . , n} (otherwise, we permute the rows of M). Thus, all positive
entries in the first k rows of A are concentrated in fewer than k columns (since
the columns in which they lie are the j-th columns for j ∈ N ( A), but we have
| N ( A)| < | A| = k). Therefore, the sum of these entries is smaller than ks (since
the sum of all entries in any given column is s). On the other hand, however,
the sum of these entries equals ks, because they are all the positive entries in the
first k rows of A (and the sum of all positive entries in a given row equals the
sum of all entries in this row, which is s). The two preceding sentences clearly
contradict each other. This contradiction shows that our assumption was false.
An introduction to graph theory, version August 2, 2023 page 333
Hence, the Hall condition is satisfied. Thus, the HMT yields that G has a
perfect matching. Let
2 7 1
108 We are here omitting zero entries from matrices. Thus, 1 9 means the matrix
8 2
2 7 1
0 1 9 .
8 2 0
An introduction to graph theory, version August 2, 2023 page 334
1
1 . Subtracting this matrix from M, we find
1
2 7 1 1 2 7
1 9 − 1 = 9 .
8 2 1 7 2
This is again an N-magic matrix. Thus, let us do the same to it that we did to
M: We again subtract a permutation matrix.
This time,
we canactually dobetter: We can subtract the permutation matrix
1 2 7
1 from 9 not just once, but 7 times, without rendering
1 7 2
any entry negative, because the relevant entries 7, 9, 7 are all ≥ 7. The result is
2 7 1 2
9 −7· 1 = 2 .
7 2 1 2
Now, we follow the same recipe and again subtract a permutation matrix.
This time, we can do it 2 times, and obtain
2 1
2 −2· 1 = = 03 × 3
2 1
• If M is an N-magic matrix that is not the zero matrix, then Lemma 8.8.9
tells us that there is a permutation σ of {1, 2, . . . , n} such that all entries
M1,σ(1) , M2,σ(2) , . . . , Mn,σ(n) are nonzero. We can then choose such a σ
and subtract the corresponding permutation matrix P (σ) from M.
This results in an N-magic matrix (since the sum of the entries decreases
by m in each row and by m in each column, and since we are only sub-
tracting m from a bunch of entries that are ≥ m) that has at least one
fewer nonzero entry than M (since at least one of the nonzero entries
M1,σ(1) , M2,σ(2) , . . . , Mn,σ(n) becomes 0 when m is subtracted from it).
• This way, in each step of our process, the number of nonzero entries of
our matrix decreases by at least 1 (but the matrix remains an N-magic
matrix throughout the process). Hence, we eventually (after at most n2
steps) will end up with the zero matrix.
This proves Theorem 8.8.7 (a).
(b) This is analogous to the proof of part (a) (but this time, we have to sub-
tract m · P (σ) rather than P (σ) in our procedure, since the nonzero entries
M1,σ(1) , M2,σ(2) , . . . , Mn,σ(n) are not necessarily ≥ 1).
(c) Let M be a doubly stochastic n × n-matrix. Then, M is also R + -magic.
Hence, part (b) shows that M can be expressed in the form λ1 P1 + λ2 P2 +
· · · + λk Pk , where λ1 , λ2 , . . . , λk ∈ R + are numbers and where P1 , P2 , . . . , Pk are
permutation matrices. Consider these λ1 , λ2 , . . . , λk and these P1 , P2 , . . . , Pk .
Now, consider the sum of all entries in the first row of M. It is easy to see that
this sum is λ1 + λ2 + · · · + λk (because M = λ1 P1 + λ2 P2 + · · · + λk Pk , but each
permutation matrix Pi contributes a 1 to the sum of all entries in the first row).
But we know that this sum is 1, since M is doubly stochastic. Comparing these,
we conclude that λ1 + λ2 + · · · + λk = 1. Thus, we have expressed M in the form
λ1 P1 + λ2 P2 + · · · + λk Pk , where λ1 , λ2 , . . . , λk ∈ R + are numbers satisfying
λ1 + λ2 + · · · + λk = 1 and where P1 , P2 , . . . , Pk are permutation matrices. This
proves Theorem 8.8.7 (c).
Exercise 8.4. Let A and B be two finite sets such that | B| ≥ | A|. Let di,j be a
real number for each (i, j) ∈ A × B. Let
m1 = min max di,σ(i )
σ:A→ B injective i ∈ A
and
m2 = max min di,j .
I ⊆ A; J ⊆ B; (i,j)∈ I × J
| I |+| J |=| B |+1
An introduction to graph theory, version August 2, 2023 page 336
(The notation “minsome kind of objects some kind of value” means the minimum
of the given value over all objects of the given kind. An analogous notation
is used for a maximum.) Prove that m1 = m2 .
[Hint: First, reduce the problem to the case when |S| = 2k + 1. Then, in
that case, restate it as a claim about matchings in a certain bipartite graph.]
[Solution: This is Exercise 4 on homework set #4 from my Spring 2017
course; see the course page for solutions.]
Prove that M has maximum size among all matchings of G if and only if
there exists no augmenting path for M.
[Hint: If M and M′ are two matchings of G, what can you say about the
symmetric difference ( M ∪ M′ ) \ ( M ∩ M′ ) ?]
[17s-lec16] only works with simple digraphs). These adaptations are generally
easy.
I will only cover the very basics of network flow optimization, leading to a
proof of the max-flow-min-cut theorem (for integer-valued flows) and to a proof
of the Hall–König matching theorem. For the deeper reaches of the theory,
see [ForFul74] (a classical textbook written by the inventors of the subject),
[Schrij17, Chapter 4] and [Schrij03, Part I].
9.1. Definitions
9.1.1. Networks
Recall that we use the notation N = {0, 1, 2, . . .}.
• two distinct vertices s ∈ V and t ∈ V, called the source and the sink,
respectively;
1
u v
2 2
s 1 t
1
3 p q 2
3 .
Remark 9.1.3. The digraph D in Example 9.1.2 has no cycles and satisfies
deg− s = deg+ t = 0. This is not required in the definition of a network,
although it is satisfied in many basic applications.
Also, all capacities c ( a) in Example 9.1.2 were positive. This, too, is not
required; however, arcs with capacity 0 do not contribute anything useful to
the situation, so they could just as well be absent.
An introduction to graph theory, version August 2, 2023 page 340
Remark 9.1.4. The notion of “network” we just defined is just one of a myriad
notions of “network” that can be found all over mathematics. Most of them
can be regarded as graphs with “some extra structures”; apart from this, they
don’t have much in common.
(a) For any arc a ∈ A, we call the number c (a) ∈ N the capacity of the arc
a.
(c) If P and Q are two subsets of V, then [ P, Q] shall mean the set of all
arcs of D whose source belongs to P and whose target belongs to Q.
That is,
[ P, Q] := {a ∈ A | ψ ( a) ∈ P × Q} .
d ( P, Q) := ∑ d ( a) .
a∈[ P,Q]
Example 9.1.6. Let us again consider the network from Example 9.1.2. For
the subset {s, u} of V, we have { s, u} = { p, v, q, t} and
h i
{s, u} , {s, u} = {sp, uv, uq}
(recall that our D is a simple digraph, so an arc is just a pair of two vertices)
and
c {s, u} , {s, u} = ∑ c ( a) = c (sp) + c (uv) + c (uq)
| {z } | {z } | {z }
a∈[ {s,u },{s,u }] =3 =1 =1
= 3 + 1 + 1 = 5.
An introduction to graph theory, version August 2, 2023 page 341
We can make this visually clearer if we draw a “border” between the sets
{s, u} and {s, u}:
u v
2 1 2
s 1 t
3 1
p q 2
3
.
h i
Then, {s, u} , {s, u} is the set of all arcs that cross this border from {s, u} to
{s, u}. (Of course, this visualization works only for sums of the form d P, P ,
not for the more general case of d ( P, Q) where P and Q can have elements
in common. But the d P, P are the most useful sums.)
1 of 1
u v
2 of 2 1 of 2
s 0 of 1 t
1 of 1
1 of 3 p q 2 of 2
1 of 3
0 of 1
u v
1 of 2 1 of 2
s 1 of 1 t
1 of 1
0 of 3 p q 0 of 2
0 of 3
There are several intuitive ways to think of a network N and of a flow on it:
second. The capacity constraints say that no pipe is over its capacity or
carries a negative amount of water. The conservation constraints say that
at every vertex v other than s and t, the amount of water coming in (that
is, f − (v)) equals the amount of water moving out (that is, f + (v)); that
is, there are no leaks and no water being injected into the system other
than at s and t. This is why s is called the “source” and t is the “sink”. A
slightly counterintuitive aspect of this visualization is that each pipe has
a direction, and water can only flow in that one direction (from source to
target). That said, you can always model an undirected pipe by having
two pipes of opposite directions.
• We can regard N as a money transfer scheme: Each vertex v ∈ V is a bank
account, and the goal is to transfer some money from s to t. All other
vertices v act as middlemen. Each arc a ∈ A corresponds to a possibility
of transfer from its source to its target; the maximum amount that can be
transferred on this arc is c (a). A flow describes a way in which money
is transferred such that each middleman vertex v ∈ V \ { s, t} ends up
receiving exactly as much money as it gives away.
Needless to say, these visualizations have been chosen for their intuitive
grasp; the real-life applications of network flows are somewhat different.
f − ( v) := ∑ f ( a) and f + (v) := ∑ f ( a) .
a∈ A is an arc a∈ A is an arc
with target v with source v
An introduction to graph theory, version August 2, 2023 page 344
We call f − (v) the inflow of f into v, and we call f + (v) the outflow of
f from v.
(b) We define the value of the map f to be the number f + (s) − f − (s). This
value is denoted by | f |.
f + (s) = 3, f − (s) = 0,
f + (u) = f − (u) = 2,
f + ( p) = f − ( p) = 1,
f + (v) = f − (v) = 1,
f + (q) = f − (q) = 2, ,
f + (t) = 0, f − ( t) = 3
and has value | f | = 3. The flow g in Example 9.1.8 has value | g| = 1. More
generally, the flow f p in Remark 9.1.9 always has value f p = 1.
Example 9.1.12. For any network N, we can define the zero flow on N. This
is the flow 0 A : A → N that sends each arc a ∈ A to 0. This flow has value
|0 A | = 0.
1 4 1 4
2 5 s 2 5 t
3 6 3 6
G N
(we are not showing the capacities of the arcs, since they are all equal to 1).
The flows of this network N are in bijection with the matchings of G.
Namely, if f is a flow on N, then the set
e ∈ E (G) | f −
→e =1
is a matching of G. Conversely, if M is a matching of G, then we obtain a flow
f on N by assigning the arc flow 1 to all arcs of the form −
→e where e ∈ M, as
well as assigning the arc flow 1 to every new arc that joins s or t to a vertex
matched in M. All other arcs are assigned the arc flow 0. For instance, in our
above example, the matching {15, 36} corresponds to the following flow:
1 4
s 2 5 t
3 6
,
where we are using the convention that an arc a with f ( a) = 0 is drawn
dashed whereas an arc a with f (a) = 1 is drawn boldfaced (thankfully, the
only possibilities for f ( a) are 0 and 1, because all capacities are 1).
One nice property of this bijection is that if a flow f corresponds to a
matching M, then | f | = | M|. Thus, finding a flow of maximum value means
finding a matching of maximum size.
An introduction to graph theory, version August 2, 2023 page 346
(See [17s-lec16, Proposition 1.36 till Proposition 1.40] for details and proofs;
that said, the proofs are straightforward and you will probably “see” them
just by starting at an example.)
| f | = f + (s) − f − (s)
= f − ( t) − f + ( t) .
Proof. We have
∑ f + (v) = ∑ ∑ f ( a) +
since f (v) is defined as ∑ f ( a)
v ∈V v ∈V a∈ A is an arc a∈ A is an arc
with source v with source v
| {z }
=∑
a∈ A
= ∑ f ( a)
a∈ A
(note that this is a generalization of the familiar fact that ∑ deg+ v = | A|).
v ∈V
Similarly, ∑ f − (v) = ∑ f ( a). Hence,
v ∈V a∈ A
∑ f − (v) − f + (v) = ∑ f − (v) − ∑ f + (v) = 0. (46)
v ∈V v ∈V v ∈V
| {z } | {z }
= ∑ f (a) = ∑ f ( a)
a∈ A a∈ A
so that
f − ( t) − f + (t) = − f − ( s ) − f + ( s ) = f + ( s ) − f − ( s ) = | f |
(a) We have
f S, S − f S, S = ∑ f + (v) − f − (v) .
v∈ S
and
f (a) = c (a) for all a ∈ S, S .
Proof. Let me first make these claims intuitive in terms of the “money transfer
scheme” model for our network. Consider S as a country. Then, f S, S is the
from this country S (that is, the total wealth exported from S), whereas
“export”
f S, S is the “import” into this country S (that is, the total wealth imported
into S). Thus, part (a) of the proposition is saying that the “net export” of S (that
is, the export from S minus the import into S) can be computed by summing
the “outflow minus inflow” values of all accounts in S. This should match
the intuition for exports and imports (in particularly, any transfers that happen
within S should cancel out when we sum the “outflow minus inflow” values of
all accounts in S). Part (b) says that if the country S contains the source s but
not the sink t (that is, the goal of the network is to transfer money out of the
country), then the total value transferred is actually the net export of S. Part (c)
claims that this total value is no larger than the total “export capacity” c S, S
An introduction to graph theory, version August 2, 2023 page 348
(that is, the total capacity of the “export arcs” a ∈ S, S ). Part (d) says that if
equality holds in this inequality (i.e., if the
total value equals the total export
capacity), then each “import arc” a ∈ S, S is unused (i.e., nothing is imported
into S), whereas each “export arc” a ∈ S, S is used to its full capacity.
I hope this demystifies all claims of the proposition. But for the sake of
completeness, here are rigorous proofs (though rather terse ones, since I assume
you have seen enough manipulations of sum to fill in the details):
(a) This follows from
∑ f + ( v) − f − ( v) = ∑ f + ( v) − ∑ f − ( v)
v∈S v∈S v∈S
| {z } | {z }
= f (S,V ) = f (V,S)
(why?) (why?)
= f (S, V ) − f (V, S)
| {z } | {z }
= f (S,S)+ f (S,S) = f (S,S)+ f (S,S)
(since V is the union of the (since V is the union of the
two disjoint sets S and S) two disjoint sets S and S)
= f (S, S) + f S, S − f (S, S) + f S, S = f S, S − f S, S .
= |f|.
all arcs a ∈ S, S – become equalities. In other words, it is necessary and sufficient
that we have
f ( a) = 0 for all a ∈ S, S
and
f ( a) = c ( a) for all a ∈ S, S .
This proves Proposition 9.3.2 (d).
Example
h 9.4.2.i Let us again consider the network from Example 9.1.2. Then,
{s, u} , {s, u} = {sp, uv, uq} is a cut of this network, and its capacity is
c {s, u} , {s, u} = 5.
In other words, the maximum value of a flow equals the minimum capacity
of a cut.
We shall soon sketch a proof of this theorem that doubles as a fairly efficient
(polynomial-time) algorithm for finding both a maximum flow (i.e., a flow of
maximum value) and a minimum cut (i.e., a cut of minimum capacity). The
algorithm is known as the Ford-Fulkerson algorithm, and is sufficiently fast to
be useful in practice.
Example 9.4.4. Consider the flow f from Example 9.1.8. We can increase
the arc flows f (sp) , f ( pq) , f (qv) , f (vt) of f on all the arcs of the path
(s, p, q, v, t) (since neither of these arcs is used to its full capacity). As a
result, we obtain the following flow h:
1 of 1
u v
2 of 2 2 of 2
s 1 of 1 t
1 of 1
2 of 3 p q 2 of 2
2 of 3 ,
However, simple increases like the one we just did are not always enough to
find a maximum flow. They can leave us stuck at a “local maximum” – i.e., at a
flow which does not have any more paths from s to t that can be used for any
further increases (i.e., any path from s to t contains an arc that is already used
to its full capacity), yet is not a maximum flow. Here is an example:
Example 9.4.5. Consider the following network and flow:
0 of 1
u v
1 of 1 0 of 1
s 1 of 1 t
0 of 1 p q 1 of 1
0 of 1 .
This flow is not maximum, but each path from s to t has at least one arc that
is used to its full capacity. Thus, we cannot improve this flow by increasing
all its arc flows on any given path from s to t.
The trick to get past this hurdle is to use a “zig-zag path” – i.e., not a
literal path, but rather a sequence (v0 , a1 , v1 , a2 , v2 , . . . , ak , vk ) of vertices and
arcs that can use arcs both in the forward and backward directions (i.e., any
i ∈ {1, 2, . . . , k} has to satisfy either ψ ( ai ) = (vi −1, vi ) or ψ ( ai ) = (vi , vi −1 )). In-
stead of increasing the flow on all arcs of this “path”, we do something slightly
subtler: On the forward arcs, we increase the flow; on the backward arcs, we
decrease it (all by the same amount). This, too, preserves the conservation con-
straints (think about why; we will soon see a rigorous proof), so it is a valid
way of increasing the value of a flow. Here is an example:
Example 9.4.6. Consider the flow in Example 9.4.5. The underlying digraph
has a “zig-zag path” (s, p, q, u, v, t), which uses the arc uq in the backward
direction. We can decrease the arc flows of f on all forward arcs sp, pq, uv
and vt of this “zig-zag path”, and decrease it on the backward arc uq. As a
result, we obtain the flow
1 of 1
u v
1 of 1 1 of 1
s 0 of 1 t
1 of 1 p q 1 of 1
1 of 1 .
This new flow has value 2, and can easily be seen to be a maximum flow.
An introduction to graph theory, version August 2, 2023 page 352
Good news: Allowing ourselves to use “zig-zag paths” like this (rather than
literal paths only), we never get stuck at a non-maximum flow; we can always
increase the value further and further until we eventually arrive at a maximum
flow.
In order to prove this, we introduce some convenient notations. We prefer
not to talk about “zig-zag paths”, but rather reinterpret these “zig-zag paths”
as (literal) paths of an appropriately chosen digraph (not D). This has the
advantage of allowing us to use known properties of paths without having to
first generalize them to “zig-zag paths”.
arcs of D that are not used to their full capacity by f as well as the
reversals of all arcs of D that are used by f .
Example 9.4.8. Let f be the flow f from Example 9.1.8. Then, the residual
digraph D f is
uv−1
u v
vt
su−1
uq−1 vt−1
s qv t
sp−1
pq−1
qt−1
sp
p q
pq
.
Notice that the digraph D f has cycles even though D has none!
Example 9.4.9. Let f be the non-maximum flow from Example 9.4.5. Then,
the residual digraph D f is
uv
u v
su−1 vt
uq−1
s t
sp qt−1
p q
pq
.
You can think of the residual digraph D f as follows: Each arc of D f corre-
sponds to an opportunity to change an arc flow f ( a); namely, a forward arc
a of D f means that f (a) can be increased, whereas a backward arc a−1 of D f
means that f ( a) can be decreased. Hence, the paths of the residual digraph D f
are the “zig-zag paths” of D that allow the flow f to be increased (on forward
arcs) or decreased (on backward arcs) as in Example 9.4.6. Thus, using D f , we
can avoid talking about “zig-zag paths”.
An introduction to graph theory, version August 2, 2023 page 354
(a) If the digraph D f has a path from s to t, then the network N has a flow
f ′ with a larger value than f .
(b) If the digraph D f has no path from s to t, then the flow f has maximum
value (among all flows on N), and there exists a subset S of V satisfying
s ∈ S and t ∈/ S and | f | = c S, S .
Proof. (a) Assume that the digraph D f has a path from s to t. Pick such a path,
and call it p. Each arc of p is an arc of D f .
For each forward arc a ∈ A that appears in p, we have f ( a) < c ( a) (since a is
an arc of D f ), and thus we can increase the arc flow f (a) by some positive ε ∈ N
(namely, by any ε < c (a) − f ( a)) without violating the capacity constraints.109
For each backward arc a−1 ∈ A−1 that appears in p, we have f ( a) > 0 (since
a−1 is an arc of D f ), and thus we can decrease the arc flow f ( a) by some positive
ε ∈ N (namely, by any ε > f ( a)) without violating the capacity constraints.
Let now
ε := min { c (a) − f ( a) | a ∈ A is a forward arc that appears in p}
n o
−1 −1
∪ f (a) | a ∈ A is a backward arc that appears in p .
• For each forward arc a ∈ A that appears in p, we increase the arc flow
f ( a) by ε (that is, we set f ′ ( a) := f (a) + ε).
109 Of course, such a unilateral increase will likely violate the conservation constraints.
110 because
• for each forward arc a ∈ A that appears in p, we have f ( a) < c (a) and thus c (a) −
f ( a) > 0;
• for each backward arc a−1 ∈ A−1 that appears in p, we have f (a) > 0.
An introduction to graph theory, version August 2, 2023 page 355
• For each backward arc a−1 ∈ A−1 that appears in p, we decrease the arc
flow f (a) by ε (that is, we set f ′ ( a) := f ( a) − ε).
• For all other arcs a of D, we keep the arc flow f ( a) unchanged (i.e., we
set f ′ ( a) := f ( a)).
This new map f ′ still satisfies the capacity constraints111 . We claim that it
also satisfies the conservation constraints. To check this, we have to verify that
− +
( f ′ ) (v) = ( f ′ ) (v) for each vertex v ∈ V \ {s, t}. So let us do this.
Let v ∈ V \ { s, t} be a vertex. We know that f − (v) = f + (v) (since f is a
− +
flow). We must prove that ( f ′ ) (v) = ( f ′ ) (v).
The path p is a path from s to t. Thus, it neither starts nor ends at v (since
v ∈ V \ {s, t}). Hence, if v is a vertex of p, then the path p enters v by some arc
and exits v by another. Hence, we are in one of the following five cases:
Case 1: The vertex v is not a vertex of the path p.
Case 2: The path p enters v by a forward arc and exits v by a forward arc.
Case 3: The path p enters v by a forward arc and exits v by a backward arc.
Case 4: The path p enters v by a backward arc and exits v by a forward arc.
Case 5: The path p enters v by a backward arc and exits v by a backward arc.
− +
Now, we can prove ( f ′ ) (v) = ( f ′ ) (v) in each of these five cases by hand.
Here is how this can be done in the first three cases:
First, we consider Case 1. In this case, v is not a vertex of the path p. Hence,
each arc a ∈ A with target v satisfies f ′ ( a) = f ( a) (because neither a nor a−1
− +
appears in p). Therefore, ( f ′ ) (v) = f − (v). Similarly, ( f ′ ) (v) = f + (v).
− +
Hence, ( f ′ ) (v) = f − (v) = f + (v) = ( f ′ ) (v). Thus, we have proved
( f ′ )− (v) = ( f ′ )+ (v) in Case 1.
Let us now consider Case 2. In this case, the path p enters v by a forward arc
and exits v by a forward arc. Let b be the former arc, and c the latter. Then, both
b and c are arcs of D, and the vertex v is the target of b and the source of c. The
definition of f ′ yields that f ′ (b) = f (b) + ε, whereas each other arc a ∈ A with
−
target v satisfies f ′ ( a) = f ( a). Hence, ( f ′ ) (v) = f − (v) + ε. Similarly, using
+ −
the arc c, we see that ( f ′ ) (v) = f + (v) + ε. Hence, ( f ′ ) (v) = f − (v) +ε =
| {z }
= f + (v)
+ − +
f + (v) + ε = ( f ′ ) (v).
Thus, we have proved = ( f ′ ) (v) ( f ′ ) (v)
in Case 2.
Let us next consider Case 3. In this case, the path p enters v by a forward arc
and exits v by a backward arc. Let b be the former arc, and c−1 the latter. Then,
both b and c are arcs of D, and the vertex v is the target of both b and c. The
111 since the definition of ε shows that
• for each forward arc a that appears in p, we have ε ≤ c (a) − f (a) and thus f ( a) + ε ≤
c ( a );
• for each backward arc a−1 ∈ A−1 that appears in p, we have ε ≤ f (a) and thus
f ( a) − ε ≥ 0.
An introduction to graph theory, version August 2, 2023 page 356
definition of f ′ yields that f ′ (b) = f (b) + ε (since p uses the forward arc b) and
f ′ (c) = f (c) − ε (since p uses the backward arc c−1 ), whereas each other arc
−
a ∈ A with target v satisfies f ′ ( a) = f ( a). Hence, ( f ′ ) (v) = f − (v) + ε − ε =
+
f − (v). Moreover, ( f ′ ) (v) = f + (v) (since none of the arcs of D with source
−
v appears in p, nor does its reversal). Hence, ( f ′ ) (v) = f − (v) = f + (v) =
+ − +
( f ′ ) (v). Thus, we have proved ( f ′ ) (v) = ( f ′ ) (v) in Case 3.
The other two cases are similar (Case 4 is analogous to Case 3, while Case 5
− +
is analogous to Case 2). Thus, altogether, we have proved ( f ′ ) (v) = ( f ′ ) (v)
in all five cases.
Forget that we fixed v. We thus have shown that each vertex v ∈ V \ {s, t}
− +
satisfies ( f ′ ) (v) = ( f ′ ) (v). In other words, the map f ′ satisfies the con-
servation constraints. Since f ′ also satisfies the capacity constraints, we thus
conclude that f ′ is a flow.
What is the value | f ′ | of this flow? The path p starts at s, so it exits s by
some arc γ (it must have at least one arc, since s 6= t) and never comes back
to s again. If this arc γ is a forward arc b, then f ′ (b) = f (b) + ε and therefore
+ −
( f ′ ) (s) = f + (s) + ε and ( f ′ ) (s) = f − (s). If this arc γ is a backward arc
− +
c−1 , then f ′ (c) = f (c) − ε and therefore ( f ′ ) (s) = f − (s) − ε and ( f ′ ) (s) =
f + (s). Thus,
(
+ − ( f + (s) + ε) − f − (s) , if γ is a forward arc;
f ′ (s ) − f ′ (s ) =
f + (s) − ( f − (s) − ε) , if γ is a backward arc
(
f + (s) − f − (s) + ε, if γ is a forward arc;
=
f + (s) − f − (s) + ε, if γ is a backward arc
= f + (s) − f − (s) + ε = | f | + ε.
| {z }
=| f |
(by the definition of | f |)
In other words, the flow f ′ has a larger value than f . Thus, we have found a
flow f ′ with a larger value than f . This proves Lemma 9.4.10 (a).
(b) Assume that the digraph D f has no path from s to t. Define a subset S of
V by
S = v ∈ V | the digraph D f has a path from s to v .
Then, s ∈ S (because the trivial path (s) is a path from s to s) and t ∈
/ S (since we
assumed that D f has no path from s to t). We shall next show that | f | = c S, S .
Indeed, we shall obtain this from Proposition 9.3.2 (d). To do so, we will first
show that
f (a) = 0 for all a ∈ S, S (47)
An introduction to graph theory, version August 2, 2023 page 357
and
f ( a) = c (a) for all a ∈ S, S . (48)
[Proof of (47): Let a ∈ S, S . Assume that f (a) 6= 0. Thus, f (a) > 0 (since
the capacity constraints yield f ( a) ≥ 0). Hence, the backward arc a−1 is an arc
of the residual digraph D f . Let u be the source of a, and let v be the target of
a. Since a ∈ S, S , we thus have u ∈ S and v ∈ S. From v ∈ S, we see that the
digraph D f has a path from s to v. Let q be this path. Appending the backward
arc a−1 (which is an arc from v to u) and the vertex u to this path q (at the end),
we obtain a walk from s to u in D f . Hence, D f has a walk from s to u, thus also
a path from s to u (by Corollary 4.5.8). This entails u ∈ S (by the definition of
S). However, this contradicts u ∈ S = V \ S. This contradiction shows that our
assumption (that f ( a) 6=0) was wrong. Therefore, f (a) = 0. This proves (47).]
[Proof of (48): Let a ∈ S, S . Assume that f ( a) 6= c ( a). Thus, f ( a) < c (a)
(since the capacity constraints yield f (a) ≤ c ( a)). Hence, the forward arc a is
an arc of the residual digraph D f . Let u be the source of a, and let v be the
target of a. Since a ∈ S, S , we thus have u ∈ S and v ∈ S. From u ∈ S, we see
that the digraph D f has a path from s to u. Let q be this path. Appending the
forward arc a (which is an arc from u to v) and the vertex v to this path q (at the
end), we obtain a walk from s to v in D f . Hence, D f has a walk from s to v, thus
also a path from s to v (by Corollary 4.5.8). This entails v ∈ S (by the definition
of S). However, this contradicts v ∈ S = V \ S. This contradiction shows that
our assumption (that f ( a) 6= c ( a)) was wrong. Therefore, f (a) = c ( a). This
proves (48).]
Now, Proposition 9.3.2 (d) yields that | f | = c S, S holds (since (47) and (48)
hold).
We have now found a subset S of V satisfying s ∈ S and t ∈ / S and | f | =
c S, S . In order to prove Lemma 9.4.10 (b), it suffices to show that the flow
f has maximum value (among all flows on N). However, this is now easy:
Any flow g on N has value | g| ≤ c S, S (by Proposition 9.3.2 (c), applied to
g instead of f ). In other words, any flow g on N has value | g| ≤ | f | (since
| f | = c S, S ). Thus, the flow f has maximum value. This completes the proof
of Lemma 9.4.10 (b).
2. If the digraph D f has a path from s to t, then Lemma 9.4.10 (a) shows that
the network N has a flow f ′ with a larger value than f (and furthermore,
the proof of Lemma 9.4.10 (a) shows how to find such an f ′ efficiently112 ).
Fix such an f ′ , and replace f by f ′ . Then, go back to step 1.
3. If the digraph D f has no path from s to t, then we end the algorithm.
The replacement of f by f ′ in Step 2 of this algorithm will be called an aug-
mentation. Thus, the algorithm proceeds by repeatedly performing augmenta-
tions until this is no longer possible.
I claim that the algorithm will eventually end – i.e., it cannot keep performing
augmentations forever. Indeed, each augmentation increases the value | f | of the
flow f , and therefore it increases this value | f | by at least 1 (because increasing
an integer always means increasing it by at least 1). However, the value |f|
is bounded from above by the capacity c S, S of an arbitrary cut S, S (by
Proposition 9.3.2 (c)), and thus cannot get increased by 1 more than c S, S
many times (since its initial value is 0). Therefore, we cannot perform more
than c S, S many augmentations in sequence.
Thus, the algorithm eventually ends. Let us consider the flow f that is ob-
tained once the algorithm has ended. This flow f has the property that the
digraph D f has no path from s to t. Thus, Lemma 9.4.10 (b) shows that the
flow f has maximum value (among all flows on N), and there exists a subset S
of V satisfying s ∈ S and t ∈ / S and | f | = c S, S . Consider this S.
Since the flow f has maximum value, we have
| f | = max {| g| | g is a flow} .
On the other hand, for each subset T of V satisfying s ∈ T and t ∈
/ T, we have
c S, S = | f | ≤ c T, T
(by Proposition 9.3.2 (c), applied to T instead of S). Hence,
c S, S = min c T, T | T ⊆ V; s ∈ T; t ∈ /T .
Comparing this with
c S, S = | f | = max {| g| | g is a flow} ,
we obtain
max {| g| | g is a flow} = min c T, T | T ⊆ V; s ∈ T; t ∈
/T .
In other words, the maximum value of a flow equals the minimum capacity of
a cut. This proves Theorem 9.4.3. (Of course, we cannot use the letters f and S
for the
bound variables in max {| g| | g is a flow} and
min c T, T | T ⊆ V; s ∈ T; t ∈ / T , since f and S already stand for a specific
flow and a specific set.)
112 Ofcourse, this requires an algorithm for finding a path from s to t in D f . But there are many
efficient algorithms for this (see, e.g., homework set #4 exercise 5).
An introduction to graph theory, version August 2, 2023 page 359
1 4 S
s 2 5 t
3 6
X Y
≥ | X | − |U | + | N (U )| = | N (U )| + | X | − |U | .
• A proof [Berge91, §6.3] of the Erdös–Gallai theorem, which states that for
a given weakly decreasing n-tuple (d1 ≥ d2 ≥ · · · ≥ dn ) of nonnegative
integers, there exists a simple graph with n vertices whose n vertices have
degrees d1 , d2 , . . . , dn if and only if the sum d1 + d2 + · · · + dn is even and
each i ∈ {1, 2, . . . , n} satisfies
k n
∑ di ≤ k ( k − 1) + ∑ min {di , k} .
i =1 i = k+1
(The “only if” part of this theorem was Exercise 2.6 = Exercise 6 on home-
work set #2.)
The following exercise can be solved both with and without using the max-
flow-min-cut theorem; it should make good practice to solve it in both ways.
114 A row sum of a matrix means the sum of all entries in some row of this matrix. Thus, an
m × n-matrix has m row sums.
115 A column sum of a matrix means the sum of all entries in some column of this matrix. Thus,
Theorem ... the places are ... the paths must be ... the bottleneck consists of ...
10.1.6 vertices arc-disjoint arcs
10.1.10 vertices arc-disjoint arcs of a cut
10.1.18 sets of vertices arc-disjoint arcs of a cut
10.1.32 vertices internally vertex-disjoint vertices ∈ V \ {s, t}
10.1.36 sets of vertices internally vertex-disjoint vertices ∈ V \ ( X ∪ Y )
10.1.39 sets of vertices vertex-disjoint vertices ∈ V
116 See [Schrij03, §9.6e] for more about its history.
117 All undefined terminology used here will be defined further below.
An introduction to graph theory, version August 2, 2023 page 363
Theorem ... the places are ... the paths must be ... the bottleneck consists of ...
10.1.22 vertices edge-disjoint edges
10.1.25 vertices edge-disjoint edges of a cut
10.1.42 vertices internally vertex-disjoint vertices ∈ V \ {s, t}
10.1.44 sets of vertices internally vertex-disjoint vertices ∈ V \ ( X ∪ Y )
10.1.45 sets of vertices vertex-disjoint vertices ∈ V
Example 10.1.2. The following picture shows two arc-disjoint paths p and q
(they can be told apart by their labels: each arc of p is labelled with a “p”,
and likewise for q):
q
p
p p
q q
.
The following picture shows two paths r and s that are not arc-disjoint (the
common arc is marked with “r, s”):
r
r, s
s s .
has no path from s to t (in other words, removing from D all arcs contained
in B destroys all paths from s to t).
s a t
δ γ
α
ε β
c b
.
Then, the set { α, γ} is not an s-t-arc-separator (since the path drawn in blue
contains no arc from this set). However, the set { β, γ} is an s-t-arc-separator,
and so is the set {δ, ε}. Of course, any set that contains any of { β, γ} and
{δ, ε} as a subset is therefore an s-t-arc-separator as well.
s a t
δ γ
α
ε β
c b
.
An introduction to graph theory, version August 2, 2023 page 365
Before proving Theorem 10.1.6, let me state another variant of this theorem,
which is closer to the proof. First, some notations:
(These are the same definitions that we introduced for networks in Def-
inition 9.1.5.)
(b) An s-t-cut means a subset of A that has the form S, S , where S is a
subset of V that satisfies s ∈ S and t ∈
/ S. (This was just called a “cut”
back in Definition 9.4.1 (a).)
An s-t-cut is called this way because its removal would cut the vertex s from
the vertex t. More precisely:
Theorem 10.1.10 (arc-Menger theorem for directed graphs, version 2). Let
D = (V, A, ψ) be a multidigraph, and let s and t be two distinct vertices of
D. Then, the maximum number of pairwise arc-disjoint paths from s to t
equals the minimum size of an s-t-cut.
An introduction to graph theory, version August 2, 2023 page 366
b d g
s a e t
c f
.
Then, the maximum number of pairwise arc-disjoint paths from s to t is 3.
Indeed, the following picture shows 3 such paths in red, blue and brown,
respectively:
b d g
s a e t
c f
.
More than 3 pairwise arc-disjoint paths from s to t cannot exist in D, since
(e.g.) there are only 3 arcs outgoing from s.
By Theorem 10.1.10, this shows that the minimum size of an s-t-cut in D
is
h as well.
3 i There are many s-t-cuts of size 3 (forh instance, the “obvious”
i cut
{s} , {s} has this property, as does the s-t-cut {s, a, f } , {s, a, f } ).
Let us now reverse of the direction of the arc from c to e in D (thus de-
stroying the brown path). The resulting multidigraph D ′ looks as follows:
b d g
s a e t
c f
.
An introduction to graph theory, version August 2, 2023 page 367
To prove the above two arc-Menger theorems, we need one more lemma
about networks. We recall the notations from Section 9.1 and from Definition
9.4.1, and introduce a couple more:
(a) We let f + g denote the map from A to N that sends each arc a ∈ A to
f ( a) + g ( a). (This is the pointwise sum of f and g.)
(c) If g ≤ f , then we let f − g denote the map from A to N that sends each
arc a ∈ A to f ( a) − g ( a). (This is really a map to N, since g ≤ f entails
g ( a) ≤ f ( a).)
These notations satisfy the properties that you’d expect: e.g., the pointwise
sum of maps from A to N is associative (meaning that ( f + g) + h = f +
( g + h), so that you can write f + g + h for both sides); inequalities can be
manipulated in the usual way (e.g., we have f − g ≤ h if and only if f ≤ g + h).
Verifying this all is straightforward.
The following definition codifies the flows that we constructed in Remark
9.1.9:
We call this map f p the path flow of p. It is an actual flow of value 1 if all
the arcs of p have capacity ≥ 1.
An introduction to graph theory, version August 2, 2023 page 368
1 4
s 2 5 t
3 6
,
where each arc has capacity 1. Then, the path p = (s, 2, 6, t) leads to the
following path flow f p :
0
1 4
0 0
0
1 0
s 2 5 t
1
0 1
3 6
0 .
Here, in order not to crowd the picture, we have left out the “of 1” part of
the label of each arc (so you should read the “0”s and the “1”s atop the arcs
as “0 of 1” and “1 of 1”, respectively).
The path flow thus turns any path from s to t in a network into a flow,
provided that the arcs have enough capacity to carry this flow. If we have m
paths p1 , p2 , . . . , pm from s to t, then we can add their path flows together,
and obtain a flow f p1 + f p2 + · · · + f pm of value m, provided (again) that the
arcs have enough capacity for it. (In general, we cannot uniquely reconstruct
p1 , p2 , . . . , pm back from this latter flow, as they might have gotten “mixed to-
gether”.)
Our next lemma can be viewed as a (partial) converse of this observation:
Any flow f of value m “contains” a sum f p1 + f p2 + · · · + f pm of m path flows
f p1 , f p2 , . . . , f pm corresponding to m (not necessarily distinct) paths p1 , p2 , . . . , pm
from s to t. Here, the word “contains” signals that f is not necessarily equal to
f p1 + f p2 + · · · + f pm , but only satisfies f p1 + f p2 + · · · + f pm ≤ f in general. So
here is the lemma:
An introduction to graph theory, version August 2, 2023 page 369
f p1 + f p2 + · · · + f p m ≤ f .
Proof. We induct on m.
The base case (m = 0) is obvious (since the empty sum f p1 + f p2 + · · · + f pm is
the zero flow, and thus is ≤ f because of the capacity constraints).
Induction step: Let m be a positive integer. Assume (as the induction hypoth-
esis) that the lemma holds for m − 1. We must prove the lemma for m.
So we consider a flow f on N that has value m. We need to show that there
exist m paths p1 , p2 , . . . , pm from s to t in D such that f p1 + f p2 + · · · + f pm ≤ f .
We shall first find some path p from s to t such that f p ≤ f .
We shall refer to the arcs a ∈ A satisfying f ( a) > 0 as the active arcs. Let
A′ := { a ∈ A | f (a) > 0} be the set of these active arcs. Consider the spanning
subdigraph D ′ := (V, A′ , ψ | A′ ) of D.
Let S be the set of all vertices v ∈ V such that D ′ has a path from s to v. Then,
s ∈ S (since the trivial path (s) is apath of D ′ ).
We next claim that each arc b ∈ S, S satisfies f (b) = 0.
[Proof: Assume the contrary. Thus, some arc b ∈ S, S satisfies f (b) 6= 0.
Consider this b. From f (b) 6= 0, we obtain f (b) > 0 (since f is a flow), thus
b ∈ A′ (by the definition of A′ ). Hence, b is an arc of D ′ (by the definition of
D ′ ).
Let u be the source of the arc b, and v its target. Since b ∈ S, S , we therefore
have u ∈ S and v ∈ S. Since u ∈ S, the digraph D ′ has a path p from s to u (by
the definition of S). Consider this path p. Appending the arc b and the vertex v
at the end of this path p, we obtain a walk from s to v in D ′ (since b is an arc of
D ′ with source u and target v). Hence, the digraph D ′ has a walk from s to v,
thus also a path from s to v (by Corollary 4.5.8). This means that v ∈ S (by the
definition of S). But this contradicts v ∈ S = V \ S. This contradiction shows
that our assumption was wrong, qed.]
We thus have proved that each b ∈ S, S satisfies f (b) = 0. Therefore,
f S, S = 0 (using the notations of Definition 9.1.5 (d)). However, recall that
s ∈ S. Thus, if we had t ∈ / S, then Proposition 9.3.2 (b) would yield
| f | = f S, S − f S, S ≤ 0 − 0 = 0,
| {z } | {z }
=0 ≥0
which would contradict | f | = m > 0. Hence, we must have t ∈ S. In other
words, the digraph D ′ has a path from s to t (by the definition of S). Let p be
this path. Then, p is also a path in D and satisfies f p ≤ f 118 . Therefore,
f − f p is
a map from A to N. Moreover, f − f p is again a flow119 , and has value
f − f p = m − 1 120 . Thus, by the induction hypothesis, we can apply Lemma
10.1.15 to m − 1 and f − f p instead of m and f . As a result, we conclude that
there exist m − 1 paths p1 , p2 , . . . , pm−1 from s to t in D such that f p1 + f p2 +
· · · + f pm−1 ≤ f − f p . Consider these m − 1 paths p1 , p2 , . . . , pm−1 , and set
pm := p. Then, f p1 + f p2 + · · · + f pm−1 ≤ f − f p = f − f pm (since p = pm ), so
that f p1 + f p2 + · · · + f pm ≤ f .
Thus, we have found m paths p1 , p2 , . . . , pm from s to t in D such that f p1 +
f p2 + · · · + f pm ≤ f . But this is precisely what we wanted. Thus, the induction
step is complete, and Lemma 10.1.15 is proved.
satisfying
h ≤ g, then
| g − h| = | g| − |h|. Applying this fact to g = f and h = f p , we obtain
f − f p = | f | − f p = m − 1.
|{z} |{z}
=m =1
An introduction to graph theory, version August 2, 2023 page 371
Proving this improved claim is a bit harder than proving Lemma 10.1.15,
but not by too much (in particular, the argument in Remark 10.1.16 can be
adapted, since a walk becomes a path if we successively remove all cycles
from it).
Proof of Theorem 10.1.10. We make D into a network N (with source s and sink
t) by assigning the capacity 1 to each arc a ∈ A. Clearly, a cut of this network
is the same as what we call an s-t-cut. Moreover, the capacity c S, S of a cut
S, S is simply the size of this cut (since each arc has capacity 1).
The max-flow-min-cut theorem (Theorem 9.4.3) tells us that the maximum
value of a flow equals the minimum capacity of a cut, i.e., the minimum size of
an s-t-cut (because, as we just explained, a cut is the same as an s-t-cut, and its
capacity is simply its size). It thus remains to show that the maximum value of
a flow is the maximum number of pairwise arc-disjoint paths from s to t. But
this is easy by now:
• If you have a flow f of value m, then you can find m pairwise arc-disjoint
paths from s to t (because Lemma 10.1.15 gives you m paths p1 , p2 , . . . , pm
such that f p1 + f p2 + · · · + f pm ≤ f , and the latter inequality tells you that
these m paths p1 , p2 , . . . , pm are arc-disjoint121 ). Thus,
so that
0 ≤ f p1 + f p2 + · · · + f p m ( a ) ≤ 1 = c ( a )
(since each arc has capacity 1). Since we have proved this for each arc a ∈ A, we thus have
shown that the map f p1 + f p2 + · · · + f pm satisfies the capacity constraints. Hence, this map
is a flow (since it also satisfies the conservation constraints).
It remains to show that the value of this flow is m. But this is easy: For any flows
g1 , g2 , . . . , gk , we have | g1 + g2 + · · · + gk | = | g1 | + | g2 | + · · · + | gk | (this is straightforward
to see from the definition of value). Thus,
m m
f p + f p + · · · + f pm = f p + f p + · · · + f pm = f p = ∑ 1 = m.
∑ |{z
1 2 1 2 k
k =1 } k =1
=1
We can also extend the arc-Menger theorem to paths between different pairs
of vertices:
124 Proof.We know that there exist x pairwise arc-disjoint paths from s to t (by the definition of
x). Let p1 , p2 , . . . , p x be these x paths.
We know that there exists an s-t-arc-separator of size ns (by the definition of ns ). Let B
be this s-t-arc-separator. Thus, each path from s to t contains at least one arc from B (by
the definition of an s-t-arc-separator). Hence, in particular, each of the x paths p1 , p2 , . . . , p x
contains at least one arc from B. These altogether x arcs must be distinct (since the x paths
p1 , p2 , . . . , p x are arc-disjoint); thus, we have found at least x arcs that belong to B. This
shows that | B| ≥ x. However, B has size ns ; in other words, we have | B| = ns . Thus,
ns = | B| ≥ x, so that x ≤ ns .
An introduction to graph theory, version August 2, 2023 page 374
Y .
Y .
S S
• We replace all the vertices in X by a single (new) vertex s, and replace all
the vertices in Y by a single (new) vertex t. (Thus, formally speaking, we
set V ′ = (V \ ( X ∪ Y )) ∪ { s, t}, where s and t are two objects not in V.)
For any vertex p ∈ V, we define a vertex p′ ∈ V ′ by
s, if p ∈ X;
′
p = t, if p ∈ Y;
p, otherwise.
• We keep all the arcs of D around, but we replace all their endpoints (i.e.,
sources and targets) by their projections (thus, any endpoint in X gets
replaced by s, and any endpoint in Y gets replaced by t, while an endpoint
that belongs neither to X nor to Y stays unchanged). For example, an arc
with source in X becomes an arc with source in s. (Formally speaking,
this means the following: We set A′ = A and we define the map ψ′ :
A′ → V ′ × V ′ as follows: For any a ∈ A′ = A, we set ψ′ (a) = (u′ , v′ ),
where (u, v) = ψ ( a).)
follows:
s t
.
Now, Theorem 10.1.10 (applied to D ′ = (V ′ , A′ , ψ′ ) instead of D = (V, A, ψ))
shows that the maximum number of pairwise arc-disjoint paths from s to t in
D ′ equals the minimum size of an s-t-cut in D ′ .
Let us now connect this with the claim that we want to prove. It is easy to
see that the minimum size of an s-t-cut in D ′ equals the minimum size of an
X-Y-cut in D (indeed, the s-t-cuts in D ′ are precisely the X-Y-cuts in D 125 ).
If we can also show that the maximum number of pairwise arc-disjoint paths
from s to t in D ′ equals the maximum number of pairwise arc-disjoint paths
from X to Y in D, then the result of the preceding paragraph will thus become
the claim of Theorem 10.1.18, so we will be done.
So how can we show that the maximum number of pairwise arc-disjoint
paths from s to t in D ′ equals the maximum number of pairwise arc-disjoint
paths from X to Y in D ? It would be easy if there was a well-behaved bijection
between the former paths and the latter paths that preserves the arcs of any
path, but this is not quite the case. Each path from X to Y in D becomes a walk
from s to t in D ′ if we replace each of its vertices by its projection. However, the
latter walk is not necessarily a path, since different vertices can have the same
projection.
Fortunately, this is easy to fix. If we have k pairwise arc-disjoint paths from
X to Y in D, then we can turn them into k pairwise arc-disjoint walks from s to
t in D ′ , and then we also obtain k pairwise arc-disjoint paths from s to t in D ′
(since any walk from s to t contains a path from s to t). Thus,
the maximum number of pairwise arc-disjoint paths from s to t in D ′
≥ (the maximum number of pairwise arc-disjoint paths from X to Y in D ) .
Proof of Theorem 10.1.25. We shall not prove this from scratch, but rather derive
this from the directed version (Theorem 10.1.10).
Namely, we apply Theorem 10.1.10 to126 D = Gbidir . We thus see that the
maximum number of pairwise arc-disjoint paths from s to t (in Gbidir ) equals
the minimum size of an s-t-cut (in Gbidir ). This is similar to the claim that
we want to prove, but not quite the same statement, because Gbidir is not G.
To obtain the claim that we want to prove, we must prove the following two
claims:
126 Recall that Gbidir is the multidigraph obtained from G by replacing each edge by two arcs in
opposite directions. (If the edge has endpoints u and v, then one of the two arcs has source
u and target v, while the other has source v and target u.) See Definition 4.4.2 for a formal
definition.
127 A “directed s-t-cut” here simply means an s-t-cut in a digraph.
An introduction to graph theory, version August 2, 2023 page 379
Claim 2 is very easy to verify, since the directed s-t-cuts in Gbidir are essen-
tially the same as the undirected s-t-cuts in G 128 .
It remains to verify Claim 1. The simplest approach is to argue that each path
from s to t in Gbidir becomes a path from s to t in G (just replace each arc of
the path by the corresponding undirected edge). Unfortunately, this alone does
not suffice, since two arc-disjoint paths in Gbidir won’t necessarily become edge-
disjoint paths in G. Here is an example of how this can go wrong (imagine that
the two arcs between u and v come from the same edge of G, and the two paths
are marked red and blue):
s u v t
. (50)
If we replace each arc by the corresponding edge here, then the two paths will
no longer be edge-disjoint (since the edge between u and v will be used by both
paths).
However, this kind of situation can be averted. To do this, we let k be the
maximum number of pairwise arc-disjoint paths from s to t in Gbidir . We now
choose k pairwise arc-disjoint paths p1 , p2 , . . . , pk from s to t in Gbidir in such
a way that their total length (i.e., the sum of the lengths of p1 , p2 , . . . , pk ) is as
small as possible. Then, it is easy to see that these paths p1 , p2 , . . . , pk become
edge-disjoint paths in G when we replace each arc by the corresponding edge.
[Proof: Assume the contrary. Thus, two of these paths p1 , p2 , . . . , pk end up sharing
an edge when we replace each arc by the corresponding edge. Let pi and p j be these
two paths (where i 6= j, of course). Let e be the edge that they end up sharing, and let
u and v be the two endpoints of e, in the order in which they appear on pi . Hence, the
path pi uses the edge e (or, more precisely, one of the two arcs of Gbidir corresponding
to e) to get from u to v.
Since the paths pi and p j are arc-disjoint, they cannot both use the edge e in the same
direction (because this would mean that pi and p j share the same arc of Gbidir ). Hence,
the path p j uses the edge e to get from v to u (since the path pi uses the edge e to get
from u to v). Hence, the paths pi and p j have the following forms:
pi = (. . . , u, e1 , v, . . . ) ;
p j = (. . . , v, e2 , u, . . .) ,
128 In
detail: If S is a subset of V that satisfies
more s ∈ S and t ∈ / S, then the directed s-t-cut
S, S in Gbidir and the undirected s-t-cut S, S und in G have the same size (because each
edge in S, S und corresponds to exactly one arc in S, S ). Thus, the sizes of the directed s-t-
cuts in Gbidir are exactly the sizes of the undirected s-t-cuts in G. In particular, the minimum
size of a former cut equals the minimum size of a latter cut. This proves Claim 2.
An introduction to graph theory, version August 2, 2023 page 380
where e1 and e2 are the two arcs of Gbidir that correspond to the edge e. Now, let us
replace the two paths pi and p j by two new walks129
p′i = ...
|{z} , u, ...
|{z} and
the part of p i the part of p j
before u after u
p′j = ...
|{z} , v, ...
|{z} .
the part of p j the part of p i
before v after v
These walks p′i and p′j are two walks from s to t, and they don’t use any arcs that
were not already used by pi or p j . Thus, they are arc-disjoint from all of the paths
p1 , p2 , . . . , pk except for pi and p j . Moreover, they are arc-disjoint from each other (since
pi and p j were arc-disjoint, and since the arcs of any path are distinct). Furthermore,
their total length is smaller by 2 than the total length of pi and p j (since they use all
the arcs of pi and p j except for e1 and e2 ). They are not necessarily paths, but we can
turn them into paths from s to t by successively removing cycles (as in the proof of
Corollary 4.5.8). If we do this, we end up with two paths p′′i and p′′j from s to t that are
arc-disjoint from each other and from all of the paths p1 , p2 , . . . , pk except for pi and
p j , and whose total length is smaller by at least 2 than the total length of pi and p j .
Thus, if we replace pi and p j by these two paths p′′i and p′′j (while leaving the
remaining k − 2 of our k paths p1 , p2 , . . . , pk unchanged), then we obtain k mutually
129 Here is an illustration:
s e1 e2 t
u
pi (in red) and p j (in blue):
.
v
s t
u
p′i (in red) and p′j (in blue):
(The wavy arrows stand not for single arcs, but for sequences of multiple arcs.)
An introduction to graph theory, version August 2, 2023 page 381
arc-disjoint paths from s to t whose total length is smaller than the total length of our
original k paths p1 , p2 , . . . , pk . However, this is absurd, because we chose our original k
pairwise arc-disjoint paths p1 , p2 , . . . , pk from s to t in such a way that their total length
is as small as possible. This contradiction shows that our assumption was wrong. Thus,
we have proved that the paths p1 , p2 , . . . , pk become edge-disjoint paths in G when we
replace each arc by the corresponding edge.]
Hence, we have found k pairwise edge-disjoint paths from s to t in G (namely,
the k paths that are obtained from the paths p1 , p2 , . . . , pk when we replace each
arc by the corresponding edge). This shows that
(since there is an obvious way to transform paths in G into paths in Gbidir (just
replace each edge by one of the two corresponding arcs of Gbidir ), and apply-
ing this transformation to edge-disjoint paths of G yields arc-disjoint paths of
Gbidir ). Combining these two inequalities, we obtain
bidir
the maximum number of pairwise arc-disjoint paths from s to t in G
= (the maximum number of pairwise edge-disjoint paths from s to t in G) .
Exercise 10.3. Let G be a multigraph such that each vertex of G has even
degree. Let s and t be two distinct vertices of G. Prove that the maximum
number of pairwise edge-disjoint paths from s to t is even.
Example 10.1.28. The two paths p and q in Example 10.1.2 are arc-disjoint,
but not internally vertex-disjoint.
Here are two internally vertex-disjoint paths p and q:
p
p p
q
q
.
s a t
c b
.
(b) If D has no arc with source s and target t, then the set V \ {s, t} is an
internal s-t-vertex-separator (since any path from s to t contains at least
one intermediate vertex, and such a vertex must belong to V \ { s, t}).
(c) If D has an arc with source s and target t, then there exists no internal s-
t-vertex-separator (since the “direct” length-1 path from s to t contains
no vertices besides s and t).
Now, we state the analogue of Theorem 10.1.6 and Theorem 10.1.10 for inter-
nally vertex-disjoint paths:
a d
s b e t
c f
.
respectively:
a d
s b e t
c f
.
Why can there be no 3 such paths? This is not obvious from a quick look, but
can be easily derived from Theorem 10.1.32. Indeed, Theorem 10.1.32 yields
that the maximum number of pairwise internally vertex-disjoint paths from
s to t equals the minimum size of an internal s-t-vertex-separator. Thus, if
the former number was larger than 2, then so would be the latter number.
But this cannot be the case, since the 2-element set { a, f } is easily checked to
be an internal s-t-vertex-separator. Hence, we see that both of these numbers
are 2.
Example 10.1.34. Consider again the digraph D from Example 10.1.11. In that
example, we found 3 pairwise arc-disjoint paths from s to t. These 3 paths
are not internally vertex-disjoint (in fact, the brown path has non-starting
and non-ending vertices in common with both the red and the blue path).
However, there do exist 3 pairwise internally vertex-disjoint paths from s to
t. Can you find them?
Proof of Theorem 10.1.32. We will again derive this from the arc-Menger theorem
(Theorem 10.1.10), applied to an appropriate multidigraph D ′ = (V ′ , A′ , ψ′ ).
What is this multidigraph D ′ ? The idea is to modify the digraph D in such
a way that paths having a common vertex become paths having a common arc.
The most natural way to achieve this is to “stretch out” each vertex v of D into a
little arc. In order to do this in a systematic manner, we replace each vertex v of
D by two distinct vertices vi and vo (the notations stand for “v-in” and “v-out”,
and we can think of vi as the “entrance” to v while vo is the “exit” from v) and
an arc vio that goes from vi to vo . Any existing arc a of D becomes a new arc
aoi of D, whose source and target are specified as follows: If a has source u and
target v, then aoi will have source uo and target vi .
An introduction to graph theory, version August 2, 2023 page 385
Here is an example: If
d y
x
a g
D= s c e t
i
b h
z w
f
,
then
xo yo
doi
xio yio
xi yi
aoi goi
so to
eoi
D′ = sio coi i oi tio
si ti
boi hoi
zo wo
zio wio
f oi
zi wi
(where all arcs of the form aoi for a ∈ A have been colored blue, whereas all arcs
of the form vio for v ∈ V have been colored red). This D ′ satisfies the property
that we want it to satisfy: For instance, the two paths
(s, a, x, d, y, g, t) and
(s, b, z, i, y, e, w, h, t)
An introduction to graph theory, version August 2, 2023 page 386
of D ′ have the arc yio in common. If you think of D as a railway network with
the vertices being train stations and the arcs being train rides, then D ′ is a more
detailed version of this network that records a change of platforms as an arc as
well.
Here is a formal definition of the multidigraph D ′ = (V ′ , A′ , ψ′ ) in full gen-
erality:
• For any vertex v ∈ V of D, we introduce a new arc vio , which has source
vi and target vo . This arc vio will be called a “vertex-arc” of D ′ (since it
originates from a vertex of D).
Note that D ′ is something like a “bipartite digraph”: Each of its arcs goes
either from an out-vertex to an in-vertex or vice versa. Namely, each arc-arc
goes from an out-vertex to an in-vertex, whereas each vertex-arc goes from an
in-vertex to an out-vertex. Thus, on any walk of D ′ , the arc-arcs and the vertex-
arcs have to alternate.
An introduction to graph theory, version August 2, 2023 page 387
Informally speaking, this simply means that we stretch out each intermediate
vertex of p to the corresponding arc.
If p is a path from s to t in D, then poi is a path from so to ti in D ′ . Conversely,
any path from so to ti in D ′ must have the form poi , where p is some path from
s to t in D (because on any walk of D ′ , the arc-arcs and the vertex-arcs have to
alternate). Therefore, the map
n o
o i ′
{paths from s to t in D } → paths from s to t in D ,
p 7→ poi (51)
A path from s to t cannot contain a loop; nor can it contain an arc with
source t and target s (since the vertices of a path must be distinct). Hence,
we can remove such arcs (i.e., loops as well as arcs with source t and target s)
from D without affecting the meaning of the claim we are proving. Thus, we
WLOG assume that the digraph D has no such arcs. Since we also know (by
assumption) that D has no arc with source s and target t, we thus conclude that
D has no arc with source ∈ { s, t} and target ∈ { s, t} (because each such arc
would either have source s and target t, or have source t and target s, or be a
loop). In other words, each arc of D has at least one endpoint131 distinct from
both s and t.
However, k is the maximum number of pairwise arc-disjoint paths from so to
ti in D ′ . Therefore, by Theorem 10.1.10 (applied to D ′ = (V ′ , A′ , ψ′ ), so and ti
instead of D = (V, A, ψ), s and t), this number k equals
the minimum sizeof an
s -t -cut in D . Hence, there exists an s -t -cut S, S in D such that S, S = k.
o i ′ o i ′
Consider this so -ti -cut S, S . Since S, S is an so -ti -cut, we have S ⊆ V ′ and
so ∈ S and ti∈ / S.
Let B := S, S . Then, | B| = S, S = k. Moreover, it is easy to see that
sio ∈
/ B 132 and tio ∈ / B 133 .
To each vertex w ∈ V ′ of D ′ , we assign a vertex β ( w) ∈ V of D as follows: If
w = vi or w = vo for some v ∈ we set β (w) := v. In other words, β (w)
V, then
is the vertex v such that w ∈ vi , vo . We shall call β (w) the base of the vertex
w.
For each arc b ∈ B, there exists at least one endpoint w of b such that β ( w) ∈
V \ { s, t} 134 . We choose such an endpoint w arbitrarily, and we denote its
base β (w) by β ( b). We shall call β (b) the basepoint of the arc b. Thus, by
definition, we have
β ( b) ∈ V \ {s, t} for each b ∈ B. (53)
We let β ( B) denote the set { β (b) | b ∈ B}. Clearly, | β ( B)| ≤ | B| = k.
Now, we claim that
every path from s to t (in D) contains a vertex in β ( B) . (54)
[Proof of (54): Let p be a path from s to t (in D). We must prove that p contains a
vertex in β ( B).
Recall that we have assigned a path poi of D ′ to the path p of D. The definition of
p shows that the base of any vertex of poi is a vertex of p (indeed, if v0 , v1 , . . . , vk are
oi
the vertices of p, then the vertices of poi are v0o , v1i , v1o , v2i , v2o , . . . , vik−1 , vok−1 , vik , and their
respective bases are v0 , v1 , v1 , v2 , v2 , . . . , vk−1 , vk−1 , vk ).
The path poi is a path from so to ti (since p is a path from s to t). Hence, it starts at
a vertex in S (since so ∈ S) and ends at a vertex that is not in S (since ti ∈ / S). Thus,
this path poi must cross from S into S somewhere. In other words, there exists an arc b
of poi such that the source
of b belongs to S but the target of b belongs to S. Consider
this arc b. Thus, b ∈ S, S = B, so that β ( b) ∈ β ( B) (by the definition of β ( B)). Both
endpoints of b are vertices of poi (since b is an arc of poi ).
Now, consider the basepoint β ( b) of this arc b. This basepoint β ( b) is the base of an
endpoint of b (by the definition of β ( b)). Thus, β ( b) is the base of a vertex of poi (since
both endpoints of b are vertices of poi ). Hence, β ( b) is a vertex of p (since the base of
any vertex of poi is a vertex of p). In other words, the path p contains the vertex β ( b).
Since β ( b) ∈ β ( B), we thus conclude that p contains a vertex in β ( B). This proves
(54).]
Now, the set β ( B) is a subset of V \ { s, t} (since β (b) ∈ V \ { s, t} for each
b ∈ B) and has the property that every path from s to t contains a vertex in
β ( B) (by (54)). In other words, β ( B) is a subset W ⊆ V \ {s, t} such that every
path from s to t contains a vertex in W. In other words, β ( B) is an internal s-t-
vertex-separator (by the definition of an “internal s-t-vertex-separator”). Thus,
(the minimum size of an internal s-t-vertex-separator )
≤ | β ( B)| = k
≤ (the maximum number of pairwise internally vertex-disjoint
paths from s to t in D )
one endpoint distinct from both s and t (since we have shown above that each arc of D has
at least one endpoint distinct from both s and t). Let x be this endpoint. Then, x ∈ V \ {s, t}
(since s is distinct from both s and t).
But x is an endpoint of a. In other words, x is either the source or the target of a.
Hence, the arc aoi of D ′ either has source x o or has target x i (by the definition of aoi ). In
other words, the arc b of D ′ either has source x o or has target x i (since b = aoi ). Since
β (x ) = x ∈ V \ {s, t} and β x = x ∈ V \ { s, t}, we thus conclude that the arc b of D ′ has
o i
at least one endpoint w such that β (w) ∈ V \ {s, t} (namely, w = x o if b has source x o , and
w = x i if b has target x i ). This completes our proof in Case 2.
Thus, we are done in both Cases 1 and 2, so that our proof is complete.
An introduction to graph theory, version August 2, 2023 page 390
(by (52)).
On the other hand, we have
(by the pigeonhole principle135 ). Combining this inequality with the preceding
one, we obtain
(a) A path from X to Y shall mean a path whose starting point belongs to
X and whose ending point belongs to Y.
135 Proof in more detail: Let n be the minimum size of an internal s-t-vertex-separator. Let x be
the maximum number of pairwise internally vertex-disjoint paths from s to t in D. We must
show that n ≥ x.
Assume the contrary. Thus, n < x.
The definition of n shows that there exists an internal s-t-vertex-separator W that has size
n.
The set W is an internal s-t-vertex-separator. In other words, W is a subset of V \ {s, t}
such that every path from s to t contains a vertex in W. Moreover, W has size n; thus,
|W | = n < x.
The definition of x shows that there exist x pairwise internally vertex-disjoint paths from
s to t in D. Let p1 , p2 , . . . , p x be these x paths. Each of these x paths p1 , p2 , . . . , p x must
contain at least one vertex in W (since every path from s to t contains a vertex in W). Since
|W | < x, we thus conclude by the pigeonhole principle that at least two of the x paths
p1 , p2 , . . . , p x must contain the same vertex in W. In other words, there exist two distinct
elements i, j ∈ {1, 2, . . . , x } such that pi and p j contain the same vertex in W. Let w be the
latter vertex. Thus, w ∈ W ⊆ V \ { s, t}. Hence, w is distinct from both s and t. Therefore,
w is an intermediate vertex of pi (since the path pi has starting point s and ending point t).
Likewise, w is an intermediate vertex of p j .
However, the paths pi and p j are internally vertex-disjoint, and thus have no common
intermediate vertex. This contradicts the fact that w is an intermediate vertex of both paths
pi and p j . This contradiction shows that our assumption was false. Hence, n ≥ x is proved,
qed.
An introduction to graph theory, version August 2, 2023 page 391
X
Y
c
.
X
Y
c
An introduction to graph theory, version August 2, 2023 page 392
(there are other choices, of course). The minimum size of an internal X-Y-
vertex-separator is 2 as well; indeed, { a, b} is such an internal X-Y-vertex-
separator. These two numbers are equal, just as Theorem 10.1.36 predicts.
Hence, the result of the preceding paragraph is precisely the claim of Theorem
10.1.36, and our proof is thus complete.
Another variant of this result can be stated for vertex-disjoint (as opposed to
internally vertex-disjoint) paths. These are even easier to define:
X Y .
right arcs). The resulting k paths from X to Y in D are still pairwise internally vertex-disjoint
(since our “lifting” operation has not changed the intermediate vertices of our paths). Thus,
D has k pairwise internally vertex-disjoint paths from X to Y. This proves Observation 1.]
Observation 2: Let k ∈ N. If D has k pairwise internally vertex-disjoint paths from
X to Y, then D ′ has k pairwise internally vertex-disjoint paths from s to t.
[Proof of Observation 2: Assume that D has k pairwise internally vertex-disjoint paths from
X to Y. We can replace these k paths by k pairwise internally vertex-disjoint walks from s
to t in D ′ (by replacing their starting points with s and replacing their ending points with
t). Thus, D ′ has k pairwise internally vertex-disjoint walks from s to t. Therefore, D ′ has
k pairwise internally vertex-disjoint paths from s to t as well (since each walk contains a
path, and of course we don’t lose internal vertex-disjointness if we restrict our walk to a
path contained in it). This proves Observation 2.]
Observation 2 shows that the maximum number of pairwise internally vertex-disjoint
paths from s to t in D ′ is ≥ to the maximum number of pairwise internally vertex-disjoint
paths from X to Y in D. But Observation 1 shows the reverse inequality (i.e., it shows that
the former number is ≤ to the latter number). Thus, the inequality is an equality, i.e., the
two numbers are equal. Qed.
An introduction to graph theory, version August 2, 2023 page 394
X Y .
Proof of Theorem 10.1.39. We will reduce this to Theorem 10.1.32, again by tweak-
ing our digraph appropriately. This time, the tweak is pretty simple: We add
two new vertices s and t to D, and we furthermore add an arc from s to each
x ∈ X and an arc from each y ∈ Y to t (thus, we add a total of | X | + |Y | new
arcs). We denote the resulting digraph by D ′ . In more detail, the definition of
D ′ is as follows:
• For each x ∈ X, we introduce a new arc ax , which shall have source s and
target x.
• For each y ∈ Y, we introduce a new arc by , which shall have source y and
target t.
• We let A′ := A ∪ { ax | x ∈ X } ∪ by | y ∈ Y . This set A′ will be the arc
set of D ′ .
An introduction to graph theory, version August 2, 2023 page 395
s t
X Y .
(The arcs ax are drawn in red; the arcs by are drawn in blue.)
By its construction, the digraph D ′ has no arc with source s and target t.
Hence, Theorem 10.1.32 (applied to D ′ = (V ′ , A′ , ψ′ ) instead of D = (V, A, ψ))
yields that the maximum number of pairwise internally vertex-disjoint paths
from s to t equals the minimum size of an internal s-t-vertex-separator. How-
ever, it is easy to see the following two claims:
[Proof of Claim 1 (sketched): Given any path p from s to t, we can remove the
starting point and the ending point of this path; the result will always be a path
from X to Y (in D). Let us denote the latter path by p. Thus, we obtain a map
{paths from s to t} → {paths from X to Y (in D)} ,
p 7→ p.
An introduction to graph theory, version August 2, 2023 page 396
(a) A path from X to Y shall mean a path whose starting point belongs to
X and whose ending point belongs to Y.
10.2.1. Definitions
In order to state the first of these properties, we need the following three defi-
nitions:
An introduction to graph theory, version August 2, 2023 page 398
2 4
1 5
.
Then, {(1, ∗, 5, ∗, 4) , (3, ∗, 2)} is a path cover of D (we are again writing aster-
isks for the arcs, since the arcs of D are uniquely determined by their sources
and their targets). Another path cover of D is {(1, ∗, 3, ∗, 4) , (2) , (5)}. Yet
another path cover of D is {(1) , (2) , (3) , (4) , (5)}. There are many more.
Note that the set {(1, ∗, 5, ∗, 4) , (3, ∗, 2, ∗, 4)} is not a path cover of D, since
the vertex 4 is contained in two (not one) of its paths.
Let us draw the three path covers we have mentioned (by simply drawing
the arcs of the paths they contain, while omitting all other arcs of D):
2 4 2 4 2 4
3 3 3
1 5 1 5 1 5
{(1, ∗, 5, ∗, 4) , (3, ∗, 2)} {(1, ∗, 3, ∗, 4) , (2) , (5)} {(1) , (2) , (3) , (4) , (5)}
(Note that we have already seen path covers of a “complete” simple digraph
(V, V × V ) in the proof of Theorem 4.9.6; we called them “path covers of V”.)
An introduction to graph theory, version August 2, 2023 page 399
Example 10.2.7. Let D be the digraph from Example 10.2.4. Then, Theorem
10.2.6 tells us that there exist a path cover P of D and an independent set S
of D such that S has exactly one vertex from each path in P . For example,
we can take P = {(1, ∗, 5, ∗, 4) , (3, ∗, 2)} and S = {5, 3}.
We will now prove Theorem 10.2.6, following Diestel’s book [Dieste17, The-
orem 2.5.1]:
Proof of Theorem 10.2.6. Write the multidigraph D as D = (V, A, ϕ). We intro-
duce a notation:
Thus, the claim we must prove is saying that there exist a path cover P of D
and an independent cross-cut of P .
We will show something stronger:
Note that the size of a path cover means the number of paths in it. Thus, a
minimum-size path cover means a path cover with the smallest possible num-
ber of paths.
We will show something even stronger than Claim 1. To state this stronger
claim, we need more notations:
• If P is a path cover, then Ends P means the set of the ending points of all
paths in P . Note that |Ends P| = |P| .
138 Proof. Let P be a minimum-size path cover of D. If P was not end-minimal, then there would
be a path cover Q with |Ends Q| < |Ends P | and therefore |Q| = |Ends Q| < |Ends P | =
|P |; but this would contradict the fact that P is minimum-size. Hence, P is end-minimal.
139 On a sidenote: Is Claim 2 really stronger than Claim 1? Yes, because it can happen that
some end-minimal path cover fails to be minimum-size. For example, the path cover
{(1, ∗, 2, ∗, 3) , (4)} in the digraph
3 1
v1
v2 v4
v3
.
We can extend the path p2 beyond its ending point v2 by inserting the blue
arc and the vertex v1 at its end. This results in a new path, which we denote by
p2 + v1 ; this path has ending point v1 .
If v1 is the only vertex on the path p1 (that is, if the path p1 has length 0), then
we can therefore replace the path p2 by p2 + v1 and remove the length-0 path
p1 from our path cover P , and we thus obtain a new path cover Q such that
Ends Q is a proper subset of Ends P . But this is impossible, since we assumed
that P is end-minimal. Therefore, v1 is not the only vertex on p1 .
Thus, let v be the second-to-last vertex on p1 (that is, the vertex that is im-
mediately followed by v1 ). Then, the path p1 contains an arc from v to v1 . We
140 This picture illustrates just one representative case, with k = 4. The four columns (from left
to right) are the four paths p1 , p2 , p3 , p4 . Of course, the digraph D can have many more arcs
than we have drawn on this picture, but we are not interested in them right now.
An introduction to graph theory, version August 2, 2023 page 402
shall refer to this arc as the red arc, and we will draw it accordingly:
v1
v v2 v4
v3
.
Let D ′ be the digraph D \ v1 (that is, the digraph obtained from D by re-
moving the vertex v1 and all arcs that have v1 as source or target). Let p1′ be
the result of removing the vertex v1 and the red arc from the path p1 . Then,
P ′ := {p1′ , p2 , p3 , . . . , pk } is a path cover of D ′ . Note that the path p1′ has
ending point v (since it is obtained from p1 by removing the last vertex and
the last arc, but we know that the second-to-last vertex on p1 is v), whereas
the paths p2 , p3 , . . . , pk have ending points v2 , v3 , . . . , vk . Thus, Ends (P ′ ) =
{v, v2 , v3 , . . . , vk }. Here is an illustration of the digraph D ′ = D \ v1 and its
path cover P ′ :
v v2 v4
v3
.
Consider the path cover ofP′ D′ .
If we can find an independent cross-
′
cut of P , then we will be done, because any such cross-cut will also be an
independent cross-cut of our original path cover {p1 , p2 , . . . , pk } = P . Since
the digraph D \ v1 has N − 1 vertices141 , we can find such an independent
cross-cut by our induction hypothesis if we can prove that the path cover P ′ is
end-minimal (as a path cover of D ′ ).
So let us prove this now. Indeed, assume the contrary. Thus, D ′ has a path
cover Q′ such that Ends (Q′ ) is a proper subset of Ends (P ′ ). Consider this Q′ .
Note that142
Ends Q′ ( Ends P ′ = {v, v2 , v3 , . . . , vk } .
141 because
the digraph D has |V | = N vertices
142 Thesymbol “(” (note that the stroke only crosses the straight line, not the curved one) means
“proper subset of”.
An introduction to graph theory, version August 2, 2023 page 403
the ending point v of p has been replaced by the ending point v1 of p + v1 . Thus,
Ends Q = Ends Q′ \ { v} ∪ {v1 }
| {z }
⊆{v2 ,v3 ,...,v k }
(since Ends(Q ′ )⊆{v,v2 ,v3 ,...,v k })
For the same reason, we have |Ends Q| = |Ends (Q′ )| < k = |Ends P |, so that Ends Q 6=
Ends P . Combining this with Ends Q ⊆ Ends P , we conclude that Ends Q is a proper subset
of Ends P .
144 Proof. We obtained Q from Q ′ by replacing p by p + v . As a consequence of this replacement,
1
the ending point v2 of p has been replaced by the ending point v1 of p + v1 . Thus,
Ends Q = Ends Q′ \ { v2 } ∪ {v1 }
| {z }
⊆{v3 ,v4 ,...,v k }
(since Ends(Q ′ )⊆{v2 ,v3 ,...,v k })
⊆ { v3 , v4 , . . . , v k } ∪ {v1 } = { v1 , v3 , v4 , . . . , v k }
( { v1 , v2 , . . . , vk } = Ends P .
10.2.3. Applications
Here are two simple applications of the Gallai–Milgram theorem:
• Remember the Easy Rédei theorem (Theorem 4.10.6), which we proved
long ago. It says that each tournament has a Hamiltonian path.
We can now prove it again using the Gallai–Milgram theorem:
New proof of the Easy Rédei theorem: Indeed, let D be a tournament. The
Gallai–Milgram theorem shows that D has a path cover with an indepen-
dent cross-cut146 . Consider this path cover and this cross-cut. But since
D is a tournament, any independent set of D has size ≤ 1. Thus, our
independent cross-cut must have size ≤ 1. Hence, our path cover must
consist of 1 path only (because the size of the path cover equals the size
of its cross-cut). But this means that it is a Hamiltonian path (or, more
precisely, it consists of a single path, which is necessarily a Hamiltonian
path). Hence, D has a Hamiltonian path. So we have proved the Easy
Rédei theorem (Theorem 4.10.6) again.
145 Proof. We obtained Q from Q′ by adding the trivial path (v1 ), whose ending point is v1 .
Thus,
Ends Q = Ends Q′ ∪ {v1 } ⊆ {v3 , v4 , . . . , v k } ∪ { v1 } = {v1 , v3 , v4 , . . . , v k }
| {z }
⊆{v3 ,v4 ,...,v k }
( {v1 , v2 , . . . , vk } = Ends P .
In other words, Ends Q is a proper subset of Ends P .
146 Seethe above proof of Theorem 10.2.6 for the definition of a “cross-cut”.
An introduction to graph theory, version August 2, 2023 page 405
• Less obviously, Hall’s Marriage Theorem (Theorem 8.3.4) and the Hall–
König matching theorem (Theorem 8.4.7) can be proved again using Gallai–
Milgram. Here is how:
1 4 1 4
2 5 2 5
3 6 3 6
.
7 8 7 8
9 9
G D
of illustration, let us draw a path cover P (by marking the arcs in red) and
an independent cross-cut S of P (by drawing each vertex s ∈ S as a blue
diamond instead of a green circle):
1 4
2 5
3 6
7 8
9
.
|Y | = |Y \ S| + |Y ∩ S| ≥ | N (X ∩ S)| + |Y ∩ S|
| {z } | {z }
≥| N ( X ∩S )| =|S |−| X ∩S |
(since | S |=| X ∩S |+|Y ∩S |)
= | N ( X ∩ S)| + |S| − | X ∩ S| . (55)
On the other hand, the set Y contains exactly q vertices that are not
matched in M (by the definition of q). Therefore, Y contains exactly |Y | − q
vertices that are matched in M. In other words,
| M | + q = |Y | . (58)
| M| + p = |X | . (59)
An introduction to graph theory, version August 2, 2023 page 408
| M | + q = |Y |
≥ | N ( X ∩ S)| + | S| − | X ∩ S| (by (55))
|{z}
=| M |+ p+ q
(by (56))
= | N ( X ∩ S)| + | M| + p + q − | X ∩ S|
= | M| + p + | N (X ∩ S)| − | X ∩ S| + q
| {z }
=| X |
(by (59))
= | X | + | N ( X ∩ S)| − | X ∩ S| + q.
Cancelling q, we obtain
| M| ≥ | X | + | N ( X ∩ S)| − | X ∩ S|
= | N (X ∩ S)| + | X | − | X ∩ S| . (60)
New proof of Hall’s Marriage Theorem: Proceed as in the proof of the Hall–
König matching theorem that we just gave. But now assume that our bi-
partite graph ( G, X, Y ) satisfies the Hall condition (i.e., we have | N ( A)| ≥
| A| for each subset A of X). Hence, in particular, | N ( X ∩ S)| ≥ | X ∩ S|.
Therefore, (60) becomes
| M| ≥ | N (X ∩ S)| + | X | − | X ∩ S| ≥ | X | .
| {z }
≥|X ∩S |
(a) If D has an arc that is not used by any path from s to t (this is what we
∑ (−1)|B| = 0
B∈M
(c) If A = ∅, then
∑ (−1)|B| = 0
B∈M
where V ′ is the set of all vertices of D that have outdegree > 0 (and
thus |M| is odd).
b
1 2
a
c
s
e d
f t
3
.
Let s and t be the vertices labelled s and t here. Then, D has neither a cycle
nor a “useless arc”, and its arc set A is nonempty; thus, Theorem 10.3.1 (d)
applies. The path-missing subsets of A are the three sets { a, b, c, d}, {c, e}
An introduction to graph theory, version August 2, 2023 page 411
and {d, e, f } as well as all their subsets (such as { b, c, d}). In other words,
149 I have restated the result beyond recognition; see [Grinbe21, Remark 1.4] for why Theorem
10.4.1 actually implies [Elser84, Lemma 1].
An introduction to graph theory, version August 2, 2023 page 412
p 2 q
1 3
v w
4 ,
and let v be the vertex labelled v. Then, the subsets of E that infect every
edge are
Thus,
∑ (−1)| F |
F ⊆ E infects
every edge e∈ E
∑ (−1)| F | = 0
F ⊆ E does not infect
every edge e∈ E
(because the total sum ∑ (−1)| F | is known to be 0). In order to prove this
F⊆E
equality, we equip the set E with some total order (it doesn’t matter how; we
can just rank the edges arbitrarily), and we make the following definition: If
F ⊆ E is a subset that does not infect every edge e ∈ E, then we let ε ( F) be
the smallest (with respect to our chosen total order) edge that is not infected
by F. Now, you can show that if F ⊆ E is a subset that does not infect every
edge e ∈ E, then the set150 F′ := F △ {ε ( F)} (that is, the set obtained from F
by inserting ε ( F) if ε ( F) ∈
/ F and by removing ε ( F) if ε ( F) ∈ F) has the same
property (viz., it does not infect every edge e ∈ E) and satisfies ε ( F′ ) = ε ( F).
This entails that the addends in the sum ∑ (−1)| F | cancel each
F ⊆ E does not infect
every edge e∈ E
other in pairs (namely, the addend for a given set F cancels the addend for the
set F′ = F △ {ε ( F)}), and thus the whole sum is 0.
Elser’s theorem, too, can be generalized and strengthened. The strength-
ening is similar to what we did with Theorem 10.3.1: We treat the set of all
“non-pandemic-causing subsets” (i.e., of all subsets F ⊆ E that don’t infect ev-
ery edge) as a simplicial complex (since a subset of a non-pandemic-causing
subset is again non-pandemic-causing), and analyze this complex as a topo-
logical space. The claim of Theorem 10.4.1 then says that the reduced Euler
characteristic of this space is 0; but we can actually show that this space is con-
tractible (i.e., homotopy-equivalent to a point). Even better, we can prove that
the simplicial complex of all non-pandemic-causing subsets is collapsible (a
combinatorial property that is stronger than contractibility of the correspond-
ing space). See [Grinbe21, §5] for definitions and proofs.
150 Thesymbol △ stands for the symmetric difference of two sets. Recall its definition: If X and
Y are two sets, then their symmetric difference X △ Y is defined to be the set
( X ∪ Y ) \ ( X ∩ Y ) = ( X \ Y ) ∪ (Y \ X )
= {all elements that belong to exactly one of X and Y } .
An introduction to graph theory, version August 2, 2023 page 414
References
[17s] Darij Grinberg, Notes on graph theory, draft of two chapters, 6th
April 2023.
https://www.cip.ifi.lmu.de/~grinberg/t/17s/nogra.pdf
[17s-lec7] Darij Grinberg, UMN, Spring 2017, Math 5707: Lecture 7 (Hamilto-
nian paths in digraphs), 14 May 2022.
https://www.cip.ifi.lmu.de/~grinberg/t/17s/5707lec7.pdf
[17s-lec8] Darij Grinberg, UMN, Spring 2017, Math 5707: Lecture 8 (Vander-
monde determinant using tournaments), 28 April 2023.
https://www.cip.ifi.lmu.de/~grinberg/t/17s/5707lec8.pdf
[17s-lec16] Darij Grinberg, UMN, Spring 2017, Math 5707: Lecture 16 (flows and
cuts in networks), 14 May 2022.
https://www.cip.ifi.lmu.de/~grinberg/t/17s/5707lec16.pdf
An introduction to graph theory, version August 2, 2023 page 415
[17s-mt2s] Math 5707 Spring 2017 (Darij Grinberg): midterm 2 with solutions.
https://www.cip.ifi.lmu.de/~grinberg/t/17s/mt2s.pdf
[21f6] Darij Grinberg, Math 235 Fall 2021, Worksheet 6: Graphs and some of
their uses, 13 April 2023.
http://www.cip.ifi.lmu.de/~grinberg/t/21f/lec6.pdf
[AigZie18] Martin Aigner, Günter M. Ziegler, Proofs from the Book, 6th edition,
Springer 2018.
[AloSpe16] Noga Alon, Joel H. Spencer, The Probabilistic Method, 4th edition,
Wiley 2015.
[ChDiGr92] Fan Chung, Persi Diaconis, Ron Graham, Universal cycles for com-
binatorial structures, Discrete Mathematics 110 (1992), pp. 43–59,
http://www.math.ucsd.edu/~fan/wp/universalcycle.pdf.
[ChLeZh16] Gary Chartrand, Linda Lesniak, Ping Zhang, Graphs & Digraphs,
6th edition, CRC Press 2015.
[CorPer18] Scott Corry, David Perkinson, Divisors and Sandpiles, AMS 2018.
A preprint is available at https://people.reed.edu/~davidp/divisors_and_sandpile
.
[CraRab15] Daniel W. Cranston and Landon Rabern, Brooks’ Theorem and Be-
yond, Journal of Graph Theory 80 (2015), issue 3, pp. 199–225.
https://brianrabern.net/landon-papers/jgt21847.pdf
[Euler53] Leonhard Euler, James R. Newman, Leonhard Euler and the Koenigs-
berg bridges (English translation of “Solutio problematis ad geometriam
situs pertinentis”), Scientific American 1953.
[Griffi21] Christopher Griffin, Graph Theory: Penn State Math 485 Lecture
Notes, version 2.0, 2021.
An introduction to graph theory, version August 2, 2023 page 418
[GrKaLe21] Darij Grinberg, Lukas Katthän, Joel Brewster Lewis, The path-miss-
ing and path-free complexes of a directed graph, arXiv:2102.07894v1.
[Hall45] Marshall Hall, An existence theorem for Latin squares, Bull. Amer.
Math. Soc. 51, Number 6, Part 1 (1945), pp. 387–388.
[Ore96] Oystein Ore, Graphs and their uses, New Mathematical Library 34,
AMS 1990.
[Sahi14] Siddhartha Sahi, Harmonic vectors and matrix tree theorems, Journal
of Combinatorics 5, Number 2, pp. 195–202, 2014.
[Schrij04] Lex Schrijver, Vizing’s theorem for simple graphs, 26 August 2004.
https://homepages.cwi.nl/~lex/files/vizing.pdf .
[Tait21] Mike Tait, Math 8790: Graph Theory, Spring 2021, 2021.
https://sites.google.com/view/michaeltait/teaching-spring-2021
[Vos16] Vaya Sapobi Samui Vos, Methods for determining the effective resis-
tance, Master’s thesis, 20 December 2016.
https://www.universiteitleiden.nl/binaries/content/assets/science/mi/scrip
[West01] Douglas Brent West, Introduction to Graph Theory, 2nd edition, Pear-
son 2001.
See https://faculty.math.illinois.edu/~west/igt/ for errata.