A graph \( G \) consists of a vertex set \( V(G) \), whose elements are called vertices and an edge set \( E(G) \), where elements in \( E(G) \) are unordered pairs of vertices.
The elements of \(E(G)\) are called edges.
Remarks: Recall that an unordered pair is just any two-element set \(\{ u , v \}\), where \(u\ne v.\) For brevity, we often write such an edge more simply as \( uv \).
In various contexts, it is common to denote an edge by the ordered pair \( (u,v) \).
This leads to an alternative definition of a graph, equivalent to ours, as a relation on the vertex set \(V(G)\) that is both symmetric (meaning that \( (u,v) \) is an edge if and only if \( (v,u) \) is an edge) and irreflexive (meaning that \( (u,u) \) is never an edge.)
Example 1:
The picture shown above is a visual representation of a graph with the \(6\) vertices and \(8\) edges given below.
For any edge \( uv \in E(G) \), the vertices \( u, v \in V(G) \) are said to be adjacent and/or neighbors in \( G \). The vertices \( u, v \) are called the ends of the edge \( uv \), and any edge is said to be incident at either of its ends.
For any vertex \( u \in V(G) \), we define its neighborhood as the set
$$ \Gamma(u) = \{ v \in V(G) \mid uv \in E(G) \}. $$
The degree of \( u \) is the integer \( d(u) = \#\Gamma(u) \), which counts the number of \(u\)'s neighbors.
Our notation for neighborhood and degree suppress the dependence on the graph \(G,\) which is usually clear from the context. In cases where we must consider multiple graphs, we may instead write \(\Gamma_G\) and \(d_G.\)
If we sort the degrees of a graph's vertices in descending order, \( d(v_1) \ge \ldots \ge d(v_n) \), we obtain a sequence of nonnegative integers, written \( d(v_1) d(v_2) \cdots d(v_n) \), which is called the degree sequence of the graph.
Example 1 (cont.):
Let us determine the degrees of all vertices in our running example:
Notice what happens if we sum over all six vertices' degrees: \( 2+2+4+3+2+3 = 16 = 2 \cdot \#E(G). \) This reflects a general fact called the handshaking lemma, which we prove below.
Variations on the Definition of a Graph
Our definition of a graph given above can be qualified by describing it as a simple, undirected graph.
Directed Graph (Digraph): Edges are ordered pairs, often denoted \( \overrightarrow{uv} \) (an edge directed from \( u\) to \( v \). Digraphs allow the possibility of loops, which are edges of the form \( \overrightarrow{uu} \). A digraph with no loops is essentially a graph if it has the property that \( \overrightarrow{uv} \) is a directed edge if and only if \( \overrightarrow{vu} \) is.
Multigraph: The same edge can appear more than once. More formally, an (undirected) multigraph consists of a vertex set \( V(G) \), edge set \( E(G) \), and incidence function \( \psi \) that takes edges to unordered pairs of vertices: if ordered pairs are used, one obtains a directed multigraph. In addition to loops, in a multigraph it is possible to have parallel edges, meaning \( e, e' \in E(G) \) such that \( \psi (e) = \psi (e') = uv. \) A multigraph is simple if it has no loops or parallel edges.
In this course, "graph" always means a simple, undirected graph. When the need to consider digraphs or multigraphs arises, we will explicitly use these terms.
The Handshaking Lemma
Theorem: For any graph \( G \),
$$ \sum_{v \in V(G)} d(v) = 2 \cdot \#E(G) $$
One consequence of this result is the saying that "at any party, an even number of hands are shaken."
Proof: Consider the set of ordered pairs
$$ S = \{ (u,v) \in V(G) \times V(G) \mid uv \in E(G) \} $$
We will count the elements of \( S \) in two different ways.
First way: For any vertex \( v \in V(G) \), there are exactly \( d(v) \) pairs \( (u,v) \in S \). Thus, \( \#S = \sum_{v \in V(G)} d(v) \).
Second way: Any edge \( uv \in E(G) \) contributes exactly two elements to \( S \), namely \( (u,v) \) and \( (v,u) \). Thus, \( \#S = 2 \cdot \#E(G) \).
Combining these finishes the proof.
Exercise How does the handshaking lemma generalize to digraphs and/or multigraphs?
2. Subgraphs, Isomorphism, and Connected Graphs
Two Notions of Subgraph
A graph \( G' \) is a subgraph of \( G \) if \( V(G') \subseteq V(G) \) and \( E(G') \subseteq E(G) \). We write \( G' \subset G \).
For any subset of vertices \( U \subseteq V(G) \), we may form the induced subgraph \( G[U] \) with vertex set \( U \) and edge set \( \{ uv \in E(G) \mid u,v \in U \} \). "Induced subgraph" is a stronger condition than "subgraph."
Consider the graph \( G \) shown below:
Two of the induced subgraphs of \( G \) are shown below.
The next graph is a subgraph of \( G \) which is not induced.
Complete Graphs and Isomorphism
We say a graph is complete if any two of its vertices are adjacent.
Thus, the number of edges in a complete graph on \( n \) vertices is equal to the binomial coefficient \( \binom{n}{2} = \frac{n (n-1)}{2}. \) An \( n \)-vertex complete graph is also called an \(n \)-clique. The images below show \( n \)-cliques for \(n \in \{ 1,2,3,4 \} \).
\(K_1\)
\(K_2\)
\(K_3\)
\(K_4\)
Here is another image of a \(4\)-clique:
\(K_4\)
Notice that both \( 4 \)-cliques are labeled as \( K_4 \), despite two notable differences between the pictures: namely, (1) the two graphs have different vertex labels, and (2) one clique is drawn with edge crossings, and the other is not.
Note, however, that we could also draw the first four-clique without any crossings.
Indeed, if we simply relabel the vertices \(5,6,7,8\), respectively, by \(1,2,3,4\), we will get the same vertices and edges.
All cliques of a given size are exactly the same up to relabeling: this is formalized by the notion of graph isomorphism.
Recall that a bijection between two sets is a function that is one-to-one and onto.
Two graphs \( G, H \) are isomorphic if there exists a bijection of vertex sets \( \iota : V(G) \to V (H) \) that preserves adjacency: $$ uv \in E(G) \quad \Leftrightarrow \quad \iota (u) \iota (v) \in E(H).$$
It is not always obvious when two graphs are isomorphic: consider, for example, the two isomorphic graphs shown below, where we may construct the following isomorphism:
$$\iota (1)= 8,
\quad
\iota (2) = 10, \quad \iota (3) = 9, \quad \iota (4) = 6, \quad \iota (5) = 7.
$$
For the \( 5 \)-clique shown below, it turns out we cannot draw all \( 10 \) edges in the plane without crossings. Graphs which can be drawn in this way are said to be planar. Planar graphs are characterized by a theorem of Kuratowski, which we will discuss later in the course.
\(K_5\)
Paths, Cycles, and Connectivity
A path is a graph \( P \) of the form \( V(P) = \{x_0, \dots, x_l\} \) and \( E(P) = \{x_0x_1, x_1x_2, \dots, x_{l-1}x_l\} \), where all vertices \( x_i \) must be distinct.
The number of edges \( l \) is the length of \( P \). A path may also be denoted by \( x_0 \dots x_l \). The vertices \( x_0, x_l \) are the ends of the path \( P \), which is also said to be a \( x_0 x_l \)-path, or a path from \( x_0 \) to \( x_l) \). The ends of a path are the two unique degree-1 vertices: any other vertices must have degree 2.
Similarly, a cycle of length \( l \) is a graph \( C \) with vertex set \( V(C) = \{ x_1, \dots, x_l\} \) and edge set \( E(C) = \{ x_1x_2, \dots, x_{l-1}x_l, x_l x_1 \}. \) All vertices in a cycle must have degree 2.
When we refer to a "path" or a "cycle" in a graph, one should think of a subgraph isomorphic to the path and cycle graphs defined above.
In an \( n \)-vertex graph, a Hamiltonian path is any path of length \( n-1 \), and a Hamiltonian cycle is any cycle of length \( n \). Currently, there is no known algorithm for efficiently detecting Hamiltonian paths or cycles in a graph: this is related to the famous unsolved P vs NP problem.
A graph \( G \) is connected if it contains a \( uv \)-path for any \( u, v \in V(G) \). A maximal connected subgraph is a called a connected component. In most circumstances, if we have a graph with multiple connected components, it is better to think of the connected components separately as connected graphs.
Census of Small Graphs
For each \( n \in \{ 1, 2 \} \), there is exactly one connected graph up to isomorphism, the complete graphs \( K_1, K_2 \).
For \( n = 3 \) vertices, there are two nonisomorphic connected graphs: the triangle \( K_3 \) and the length-2 path:
For \( n = 4 \) vertices, there are exactly 6 isomorphism classes of connected graphs, shown below:
The number of \(n \)-vertex connected graph isomorphism classes has been tabluated for small values by the Online Encyclopedia of Integer Sequences (OEIS). This number grows exponentially in \( n .\)
For \( n=5 \) vertices, we find an example of two connected nonisomorphic graphs with the same degree sequence \( 33222 \).
Thus, two isomorphic graphs must have the same degree sequence, but not conversely.
A Connectivity Criterion
Proposition If \( G \) is a graph on \( n \) vertices where every vertex has degree at least \( \frac{n-1}{2} \), then \( G \) is connected.
In fact, our proof will show something stronger: such a graph will contain, for any \( u, v \in V(G) \), a \(uv\)-path of length at most 2. Note additionally that the converse of this proposition does not hold (take \( G \) to be a path of length at least 4.) This proposition can be viewed as a "local-to-global" principle ("local" information like the degrees of vertices gives us connectivity, a "global" property of the graph.)
Proof: Let \( u, v \in V(G) \) be distinct vertices. If \( uv \in E(G) \), we are done, so suppose not. We show \( \Gamma(u) \cap \Gamma(v) \neq \emptyset \), implying a path \(uwv \) for any \( w \in \Gamma (u) \cap \Gamma (v) \).
Consider the set \( A = \{ e \in E(G) \mid u \text{ or } v \text{ is an end of } e \} \).
We have \( \# A = d(u) + d(v) \ge \frac{n-1}{2} + \frac{n-1}{2} = n-1 \).
Next set \( B = V (G) \setminus \{ u, v \} \), and a function \( f : A \to B \) by the rule that \( f(e) = w\), where \( w \) is the end of \( e\in A\) not equal to \( u \) or \( v \).
By the Pigeonhole Principle, since \( \#A \ge n-1 > n-2 = \#B \), there must be a vertex \( w \in B\) with \( w \in \Gamma (u) \cap \Gamma (v)\).
3. Walks, Trails, Circuits and All That
Basic Definitions
Throughout this section, \( G \) will denote a multigraph.
A walk in a multigraph \( G \) is an alternating sequence of vertices and edges
$$
W = ( v_0, e_1, v_1, e_2, v_2, \ldots , v_{k-1}, e_k, v_k ),
$$
where \(v_0, \ldots , v_k \in V(G) \) and \( e_1, \ldots , e_k \in E(G) \) with \( e_i = v_{i-1} v_i \) for all \( i \). The integer \( k \ge 1\) is called the length of \( W \), and the vertices \( v_0 = v_k \) are its ends.
A walk is said to be closed if all of its ends are equal, \( v_0 = v_k \). A trail is a walk with no repeated edges, \( e_i \ne e_j \) for all \( i\ne j \). A circuit is a closed trail. One can essentially view the previously-defined notion of a path as being a trail with no repeated vertices. Similarly, a cycle is more-or-less the same as a circuit with no repeated vertices except the ends.
Example:
Consider the 5-vertex "house graph" with the following labeling:
There is a closed walk of length \( 7 \) given by
\(
W = (b, bd, d, de, e, ce, c, bc, b, ba, a, ac, c, bc, b).
\)
Since the edge \( bc \) is repeated, the walk \( W \) is not a circuit.
The walk
\(
T = (c, bc, b, bd, d, de, e, ce, c, ac, a, ab, b )
\)
is a trail that visits every edge of the house graph exactly once. This is called an Eulerian trail.
Finding paths and cycles in walks
Lemma
For any multigraph \( G \), the following hold:
Every walk with ends \( u, v\in V(G), u \ne v \) includes the edge set of a \( uv \)-path.
Every circuit includes the edge set of a cycle.
Every closed walk of odd length includes the edge set of an odd-length cycle.
Note: Any edge \(uv \in E(G) \) gives a closed walk \( W = (u, uv, v, uv, u ) \) of length 2. We may form even-length walks that can be arbitrarily long by taking \( (W, \ldots , W) \). Observe that walks of this form contain neither any even nor any odd cycle. This explains necessity of our hypotheses in parts 2 and 3 of this Lemma.
Proof: We will prove part 1, and leave parts 2 and 3 as an exercise for you.
We prove part 1 by induction on the length of the walk \( W \).
Base case A walk of length \( 1 \) has the form \( (u, uv, v) \), and \( \{ uv \} \) is the edge-set of a \( uv \)-path.
Inductive Step Let \( W \) be a \( uv \)-walk of length greater than \( 1 \). We assume the inductive hypothesis that our claim holds for all \(uv\)-walks of length strictly less than the length of \( W \). If \( W \) contains no repeated vertices, then all edges of \( W \) form the edge-set of a \( uv \)-path.
Otherwise, \( W \) has a repeated vertex \( w \). This means it has the form
$$
W = (W', w, e, \ldots , e', w, W''),
$$
where \( W' \) is a walk beginning at \( u \), \( W '' \) is a walk ending at \( v \), and \( (w, e, \ldots , e', w) \) is a closed walk of length at least \( 1 .\) By deleting this closed walk, we obtain a new \( uv \)-walk, $$(W' , W''),$$ whose length is strictly less than that of \( W \). By inductive hypothesis, this walk contains the edge set of a \( uv \)-path. Since all of this walk's edges belong to \( W \) we are done.
Bipartite Graphs
Theorem: The following are equivalent for a multigraph \( G \):
\( G \) contains no cycles of odd length.
\( V(G)=A \sqcup B \) is the union of two disjoint sets \( A \) and \( B \), such that every edge in \( G \) has one end in \( A \) and one in \( B \). (Such a multigraph is said to be bipartite).
Remark: The notation \(A \sqcup B\) is used when taking the union \( A \cup B \) of two sets which are disjoint, \( A \cap B = \emptyset \).
Proof
(2) \(\Rightarrow\) (1): Consider any cycle \( C \subset G \), \(C= x_1 x_2 \dots x_l x_1 \).
Either \( x_1 \in A \) or \( x_1 \in B \); assume \( x_1 \in A \) without loss of generality.
Then \( x_2 \in B \), \( x_3 \in A \), etc. Vertex colors alternate. Since the cycle returns to \( x_1 \in A \) after \( l \) steps, the length of the cycle \( l \) must be even.
(1) \(\Rightarrow\) (2): It is enough to consider the case where \( G \) is connected. (If \( G \) has components \( G_1, \dots, G_c \) with vertex bipartitions \( V(G_i) = A_i \sqcup B_i \), we may then take \( A = \bigcup_{1\le i \le c} A_i \) and \( B = \bigcup_{1\le i \le c} B_i \)).
Fix a vertex \( v \in V(G) \) and define:
$$ A = \{ u \in V(G) \mid \exists \text{ even } uv \text{-walk in } G \} $$
$$ B = \{ u \in V(G) \mid \exists \text{ odd } uv \text{-walk in } G \} $$
Since \( G \) is connected, we have \( V(G) = A \cup B \).
Claim: \( A \cap B = \emptyset \).
If not, then for any \( u \in A \cap B \), we have an even \( uv \)-walk \( W_1 \) and an odd \( vu \)-walk \( W_2 \), the latter of which can be obtained by reversing a \( uv \)-walk promised by the definition of \(B \).
Gluing the two walks gives us \( (W_1, W_2) \), which is an odd closed walk from \( u \) to \( u \).
By the previous lemma, this contains an odd cycle, which would contradict our starting assumption that the graph \( G \) contains only even cycles.
Thus \( V(G) = A \sqcup B \). Finally, we check that all edges cross between \(A \) and \(B \). If there were an edge \( uw \) with both ends in one of the sets \( A \) or \( B \), we could combine \(vu\)-walk \( W \) with the edge \( uw \) to create a \(vw\)-walk \( W ' = (W, uw, w ) \) such that \( W \) and \( W' \) have opposite parity (meaning that either \( W \) is even and \( W' \) is odd or vice-versa.) This, however, would contradict the previously-established disjointness of \( A \) and \( B \). Thus every edge of \( G\) has one end in \( A \) and the other in \( B \).
We've already encountered several examples of bipartite graphs. One of them is the "UFO graph" shown below, better known as the complete bipartite graph \( K_{2,3} \).
A suitable vertex bipartition is indicated by the red and blue vertices below. Observe that every cycle in this graph has length \( 4 \).
More generally, for any integers \( m,n \ge 1 \), there is a complete bipartite graph \( K_{m,n} \) on \( m+n \) vertices which can be defined as folllows:
$$
V(K_{m,n})= \{ a_1, \ldots , a_m, b_1, \ldots , b_n \}, \quad E (K_{m,n} ) = \{ a_i b_j \mid a_i \in A , b_j \in B \}.
$$
Eulerian Trails and Circuits
A trail in a multigraph \( G \) that visits every edge is said to be an Eulerian trail. Similarly, we define an Eulerian circuit to be a circuit which visits every edge exactly once.
A graph is Eulerian if it contains an Eulerian circuit.
Eulerian circuits are named after Leonhard Euler, who solved in 1736 a famous problem known as the Seven Bridges of Königsberg. The image below shows the city of Königsberg (now Kaliningrad, Russia.) Notice there are 7 bridges separating 4 landmasses. Can we cross all 7 bridges without using the same bridge twice?
Naturally, we will model this problem by constructing a multigraph, whose four vertices correspond to the landmasses, and whose seven edges correspond to the bridges.
The degree sequence is \( 5333 \). The following theorem provides a negative answer to the 7 bridges problem.
Theorem: A connected multigraph \( G \) has an Eulerian circuit if and only if every vertex has even degree.
Similarly, it has an Eulerian trail from \( u \) to \( v \) iff \( u \) and \( v \) are the only odd-degree vertices.
Proof of Necessity:
Suppose \( G \) is a graph containing an Eulerian circuit \( C \). Every time a vertex of \( G \) appears in \( C \), this accounts for an two number of edges (1 in and 1 out). Since \( C \) is a circuit, none of the edges in \( C \) are repeated. Furthermore, since \( C \) is Eulerian, every edge of \( G \) appears in \(C \). Finally, since \( G \) is connected, every vertex must appear in \( C \). Altogether, these facts show that every vertex of \( G \) has even degree.
A similar argument shows if \(G \) has an Eulerian trail from \( u \) to \( v \), then \( \text{deg}(u) \) and \( \text{deg}(v) \) are odd, and all other vertices even.
Proof of Sufficiency:
First, consider the case where \( G \) is a connected graph such that every vertex has even degree. We will prove that \( G \) has an Eulerian circuit using induction on the number of edges \( \# E( G) \).
As a base case, we may assume \( \# E(G) = 0.\) In this case, connectedness implies that \( G \) is a graph with one vertex \( v \), and the sequence \( C = (v) \) is an Eulerian circuit, since there are no edges in \(G \) to visit.
Now, suppose \( G \) is a graph with \( \# E(G) > 0\). We establish two claims.
Claim 1: \( G \) contains a circuit.
Proof: Let \( P \subseteq G \) be a path of maximal length, with ends \( u \) and \( v \). Since \( \text{deg}(u) \ge 2 \), \( u \) must have an incident edge \( e=uw \notin E(P) \). However, we cannot have \( w \notin V(P) \), since then we could get a path longer than \( P \). Thus, \( w \in V(P) \), and following \( P \) from \( u \) to \( w \) and then \( e \) gives us a circuit (in fact, a cycle.) (Note: this argument will give you a hint about how to solve Homework 1's Problem 5).
Claim 2: A maximal circuit \( C \) in \( G \) is Eulerian.
Proof: Suppose not, and consider the subgraph \( G' \subseteq G \) obtained by deleting edges in \( C \). If \( C\) was not Eulerian, then \(G ' \) would have a connected component \( H \) with at least one edge. Since every vertex in \( H \) has lost an even number of edges from \( C\), we may apply the inductive hypothesis to see that \( H \) has an Eulerian circuit \( D \). The circuits \( C \) and \( D \) are both edge-disjoint. They also have a common vertex \( u \in V(C) \cap V(D) \): this follows from the connectivity of \( G \). Without loss of generality, we may assume that \( u \) is the starting vertex for both circuits; with this assumption, we could then obtain a new Eulerian circuit by gluing, namely \( (C, D) \), whose length is strictly longer than that of \( C \). This is a contraction, so the claim that \( C \) is an Eulerian circuit must hold.
Trail Case:
Suppose now that \( G \) is connected and \( u, v \in V(G) \) are the only vertices of odd degree. Construct a new graph \( G^* \) with \( V(G^*) = V(G) \cup \{w\} \), where \( w \) is a new vertex not already in \( V(G) \), and \( E(G^*) = E(G) \cup \{uw, vw\} \). By our previous arguments, the graph \( G^* \) contains an Eulerian circuit. Finally, we may observe that removing the edges connected to \( w \) from this circuit produces a \( uv\)-Eulerian trail in the original graph \( G \).
Hamiltonian Graphs
We have seen that Eulerian graphs have a characterization which can be checked efficiently: examine each vertex and check if it has even degree.
In fact, our inductive proof of this characterization already suggests an algorithm for constructing an Eulerian circuit, given that the graph is in fact Eulerian: find a circuit, delete the edges, and recurse on some smaller connected component.
The Seven Bridges Problem that motivated our study of Eulerian graphs is superficially similar to the Traveling Salesperson Problem (TSP), which relates to Hamiltonian graphs, those graphs which contain a cycle through every vertex. Suppose a salesperson must visit \( n \) cities, labeled \( 1, 2, \dots, n \).
The cost of traveling from city \( i \) to city \( j \) is given by a nonnegative number \( c (i,j) \ge 0 \).
The TSP then asks: what is the minimum cost trip that visits all cities and returns back to the original city?
Recognizing Hamiltonian graphs is a special case of TSP. To see this, let \( G \) any graph on \( V(G)=\{1, \dots, n\} \). We define a set of \( \binom{n}{2} \) costs as follows: whenever \( 1 \le i < j \le n \),
$$ c(i,j) = \begin{cases} 0 & \text{if } ij \in E(G) \\ 1 & \text{if } ij \notin E(G) \end{cases} $$
With this choice of costs, observe that
\( G \) has a Hamiltonian cycle \( \iff \) Salesperson has a free trip.
As we have already noted, an efficient characterization of Hamiltonian graphs is currently unknown: providing one would be a major breakthrough.
On the other hand, it is possible to give some sufficient conditions implying Hamiltonicity.
Ore's Theorem: Let \( G \) be a connected graph with \( \#V(G) \ge 3 \) and such that \( d(u) + d(v) \ge \#V(G) \) whenever \( uv \notin E(G) \). Then \( G \) has a Hamiltonian cycle.
Note that the converse of Ore's theorem is false: there are many Hamiltonian graphs where \( d(u) + d(v) < \# V(G) \) for some non-edge \( uv \notin E(G) \). The simplest example is the cycle \( C_5 \), shown below.
Our proof of Ore's Theorem will rely on the lemma below.
Lemma 1: If \( G \) is connected and non-Hamiltonian, then the length of a longest path in \( G \) is at least the length of a longest cycle.
In contrapositive form, Lemma 1 states that if a longest path in a connected graph \( G \) is shorter than a longest cycle, then \( G \) is Hamiltonian.
Indeed, in any Hamiltonian graph \(G \) on \( n \) vertices, the longest cycle has length \( n \) and a longest path has \( n- 1 \).
Proof: Let \( C \) be a longest cycle in \( G \). Since we assumed \( G \) is not Hamiltoninan, the cycle has length \( \ell < \#V(G) \).
Since \( G \) is connected, there exists some vertex \( v \notin V(C) \).
For any \( v_0 \in V(C) \), there exists an \( v_0 \)-path \( P = v_0 v_1 \dots v \).
Pick the smallest index \( i \) such that \( v_i \notin V(C) \), so that \( v_{i-1} \in V(C) \).
We may write our cycle as \( C = (v_{i-1} , u_1, \ldots ,u_{\ell -1 }, v_{i-1} ) \). From this description of \( C \), we may obtain a path of length \( \ell \), namely \( (v_i, v_{i-1} , u_1, \ldots , u_{\ell -1 }) \).
Proof of Ore's Theorem:
Assume \( G \) satisfies the assumptions of Ore's theorem: \( \# V(G) \ge 3 \), and \( d(u) + d(v) \ge \# V(G)\) for any nonedge \(uv \in E(G) \). Using the pigeonhole principle as in our "Connectivity Criterion" from Section 2, we obtain that \( G \) that is connected.
Suppose now that \(G \) is non-Hamiltonian. Consider a longest path in \( G \), \( P = v_0 \dots v_\ell \).
Note that \( \# V(G) \ge 2 \) implies \( \ell \ge 2 \). Having assumed that \( G \) is not Hamiltonian, it follows from Lemma 1 that \( G \) contains no cycle of length greater than \( \ell \).
In particular, this implies \( v_0 v_\ell \notin E(G) \).
Consider the sets:
$$ A = \{ i \mid 1 \le i \le \ell, \quad v_0 v_i \in E(G) \} $$
$$ B = \{ i \mid 1 \le i \le \ell, \quad v_{i-1} v_\ell \in E(G) \} $$
We make the following two observations:
\( \Gamma(v_0) \cup \Gamma(v_\ell) \subseteq V(P) \) (otherwise, we could get longer path)
\( A \cap B = \emptyset \) (otherwise, could get a cycle of length greater than \( \ell \): to see this, note that if \( i\in A \cap B \), then we could construct the a cycle \( v_0 \dots v_{i-1} v_{\ell} v_{\ell -1} \dots v_i v_0 \), which has length \( \ell + 1\), see below.)
Our assumptions on \( G \) and the two observations above imply that $$
\# V(G) \le d(v_0) + d(v_\ell) = \#A + \#B \le \ell < \ell +1 = \# V(P),$$ which is a contradiction since the path \( P \subset G \) cannot have strictly more vertices than \( G \). Thus, our asumption that \( G \) was non-Hamiltonian cannot hold.
Shortest Paths
Graph Distance: On a connected graph, for \( u, v \in V(G) \), \( d(u,v) \) is the length of a shortest \( uv \) path.
Finding a longest path has played a role in the proofs of several of our results so far. Unfortunately, this is yet another problem that is difficult to solve in practice.
Surprisingly, it is much easier to find shortest paths in a graph \( G \).
This is true even if we attach nonegative weights/costs to the edges of \(G \).
Dijkstra's Algorithm finds a shortest \( s-v \) path for some fixed \( s \in V(G) \), and all \( v \in V(G) \setminus \{s\} \).
More generally, this algorithm works for graphs with cost function on edges, \( c: E(G) \to \mathbb{R}_{\ge 0} \).
$$ d(u,v) = \displaystyle\min_{P: \text{ a } uv\text{-path}} \Bigg( \displaystyle\sum_{e \in P} c(e)\Bigg)$$
Algorithm: Dijkstra(G, s, c)
Input: Connected graph \( G \), source \( s \in V(G) \), costs \( c \)
Output: Shortest path distances \( d(s,v) \) for all \( v \in V(G) \)
1
\( V \leftarrow \{s\} \), \( d(s,s)=0 \) // Initialize set of "visited" vertices and distances
2
while \( V \neq V(G) \):
3
Select \( u \in V(G) \setminus V \) and \( v \in V \) that minimize:
\( \text{cost} = d(s,v) + c(v,u) \)
4
update \( V \leftarrow V \cup \{u\} \)
5
\( d(s,u) \leftarrow \text{cost} \)
6
return all distances \( d \)
To illustrate Dijkstra's algorithm, let us consider an example of an undirected graph \( G \), with numeric labels indicating the cost \( c(u,v) \) on each edge \( uv \in E(G) \):
We consider each iteration of the "while" loop in Dijkstra's algorithm below.
First iteration
\( V = \{ s \} \)
Total costs of cut edges: sa (cost 6), sb (cost 2).
Second iteration
\( V = \{ s , b\} \)
Total costs of cut edges: sa (cost 6), bd (cost 2+2=4 ), be (cost 2+5=7).
Third iteration
\( V = \{ s , b, d\} \)
Total costs of cut edges: sa (cost 6), da (cost 1+4=5), dc (cost 4+4=8), de (cost 4+2=6), be (cost 2+5=7)
Fourth iteration
\( V = \{ s , b, d, a\} \)
Total costs of cut edges: ac (cost 5+2=7), dc (cost 4+4=8), de (cost 4+2=6), be (cost 2+5=7)
Fifth iteration
\( V = \{ s , b, d, a, e\} \)
Total costs of cut edges: ac (cost 5+2=7), ec (cost 6+4=10), dc (cost 4+4=8)
Upon termination, all vertices are visited, and Dijkstra's Algorithm has generated a search tree in which every vertex is labeled by its distance from the source.
Theorem: Dijkstra's algorithm finds all shortest paths from \( s \) to all other vertices of \( G \).
Proof: Induction on the number of visited vertices. The base case \( \# V = 1 \) is trivial, so suppose \( \# V > 1 \). Let \( v \in V \) be the most recently visited vertex, and suppose \( uv \) is the corresponding cut edge. By inductive hypothesis, Dijkstra's algorithm has already generated a shortest \( su \)-path, which we denote by \( P_u \). Now suppose \( P \) is an arbitrary \( sv \)-path. Let \( y \in V(P) \) be the closest non-visited vertex to \( s \), and \( x \in V(P) \) its left-neighbor on \( P \). The update rule in Dijkstra's algorithm then tells us that $$d(s, x) + c(x,y) \ge d(s,u) + c(u,v) .$$ Since all costs along edges are nonengative, this then implies that the total cost of \( P\) is at least \(d(s,u) + c(u,v)\). Thus, the path \( (P_u, uv) \) is a shortest \( sv \)-path.
4. Trees
Basic Facts and Examples
Trees are an important class of graphs, which admit several different characterizations.
Tree Theorem: Let \( G \) be a graph. The following are equivalent:
\( G \) is a connected, acyclic graph.
\( G \) is a maximally acyclic graph (adding any edge creates a cycle).
\( G \) is a minimally connected graph (deleting any edge disconnects the graph).
A tree is any graph satisfying the equivalent conditions of this theorem.
Proofs:
For convenience, we assume that \( \# V(G) \ge 3 \). The three conditions of the Theorem are easily seen to hold for graphs on one and two verteices.
(1) \(\Rightarrow\) (2): Suppose \( G \) is connected and acyclic. Since \( G \) cannot be a complete graph, there exist distinct vertices \( u, v \in V(G) \) with \( uv \notin E(G)\).
Consider the graph \( G + uv \) obtained by adding this edge to \( G \). By assumption, there exists a \(uv\)-path \(P\) in \( G\), so it follows that \( G + uv \) contains the cycle \( (P, uv) \). Thus, we see that \(G \) is maximally acyclic.
(2) \(\Rightarrow\) (3):
Suppose \( G \) is maximally acyclic, let \( uv \in E(G) \) be an arbitrary edge, and consider the subgraph \( G - uv \subset G \) obtained by removing this edge from \( G \). If \( G - uv \) contained a \( uv \)-path, then we could use it to construct a cycle in \( G \). Thus, \( G - uv \) does not contain any \( uv \)-path, implying it is disconnected, and thus that \( G \) is minimally connected.
(3) \(\Rightarrow\) (1): It suffices to show a minimally connected graph is acyclic. We prove the contrapositive; a connected graph containing a cycle is not minimally connected. Indeed, if \( G \) is a connected graph containing a cycle \( C \), let \( uv \) be any edge along that cycle, so that \( C = (P, uv) \) for some \(uv \)-path \( P \). We claim that the subgraph \( G - uv \subset G \) is still connected.
Indeed, any two vertices in this graph can be connected by a path in \( G \): if that path contains the edge \( uv \), we can "detour along \( P\)", replacing \( uv \) with \( P \) to get a path with the same ends in \( G - uv \).
Properties of Trees Let \( T \) be a tree.
\( \#E(T) = \#V(T) - 1 \).
\( T \) contains at least two leaves (vertices of degree 1) provided \( \# V(T) \ge 2 \).
First, notice that any tree contains one leaf: if all vertices had degree at least two, we could construct a cycle, contradicting the tree theorem.
Now, one can prove that any tree on \( n \ge 1 \) vertices has \( n- 1 \) edges by induction on \( n \): the case \(n=1\) is trivial, and for \( n > 1 \) one can delete any leaf and apply the inductive hypothesis on the resulting subtree.
Finally, supposing that \( T \) was a tree on \( n \ge 2 \) vertices with a unique leaf \( v \in V(T) \), we would then have
$$
2n - 2 = 2\#E(T) = \sum d(u) = d(v) + \sum_{u\ne v} d(u) \ge 1 + 2(n-1),
$$
which after simplifying would yield the contradiction \( 0 \ge 1 \).
Minimum Spanning Trees (MST) & Kruskal's Algorithm
Problem: You work for an airline, trying to create a network connecting all cities, where each flight has a fixed nonnegative cost, such as in the example below. Your task is to minimize the total cost of all flights while ensuring all cities are connected. The solution to this problem is to run only the flights in a spanning tree.
For any graph \(G \), a subgraph \( T \subseteq G \) is a spanning tree of \( G\) if \( T \) is a tree with \( V(T) = V(G) \).
The Tree Theorem of the previous section has the important corollary that any connected graph \( G \) contains a spanning tree. Indeed, the spanning trees of \( G \) are precisely its minimally-connected subgraphs.
In general, we may pose the following Minimum Spanning Tree (MST) Problem:
Input: Connected graph \( G \), cost function \( c: E(G) \to \mathbb{R} \).
Goal: Find a spanning tree \( T \subset G \) minimizing \( \sum_{e \in E(T)} c(e) \).
Remark: In practice, costs are usually nonnegative. However, unlike our solution for shortest-paths using Dikstra's algorithm, we will be able to find a minimum spanning tree even without this assumption.
We have already encountered spanning trees in our study of Dikstra's algorithm. However, it is important to note that Dijkstra's algorithm does not solve the MST problem. To see this, consider the example shown below. Check for yourself that there are multiple solutions to the MST problem attaining the minimum cost \( 6 \), yet Dijkstra's algorithm will always generate a spanning tree of cost \( 7\), regardless of the source vertex.
Kruskal's algorithm, given below, is similar to Dijktra's algorithm in the sense that it is a "greedy algorithm", which makes a locally optimal choice during each step. But, unlike Dijkstra's algorithm, Kruskal's algorithm yields a globally optimal solution to the MST problem.
\( F \leftarrow (V(G), \emptyset) \) // Initialize graph with no edges
2
Sort edges such that \( c(e_1) \le c(e_2) \le \dots \le c(e_m) \)
3
for \( i = 1 \) to \( m \):
4
if \( F + e_i \) has no cycles:
5
\( F \leftarrow F + e_i \)
6
return \( F \)
Note: an acyclic graph (not necessarily connected) is often called a forest. Thus, Kruskal's algorithm on an \(n \)-vertex graph updates a forest \( F \), initially the empty graph, for \( n-1 \) iterations, until \( F \) is a (minimum) spanning tree.
The correctness of Kruskal's algorithm is the content of our next theorem.
Theorem: Kruskal's Algorithm solves the MST problem.
Proof:
By induction on the number of edges in \( F \), we prove that \( F \) is contained in some minimum spanning tree of \( G \).
Upon termination of Kruskal's algorithm, this will imply that \( F \) itself is a minimum spanning tree.
The base case when \( \# E (F) = 0\) is easy: the empty graph is contained in every (minimum) spanning tree.
In general, suppose inductively that the forest \( F \) is contained in some minimum spanning tree \( T \).
If \( \# E (F) = \# E(T) \), we must have that \(F \) itself is a minimum spanning tree.
Otherwise, let \( e \in E(G) \setminus E(F) \) be the next edge chosen by Kruskal's algorithm.
If \( e \in T \), we are done.
Otherwise, since \(T \) is maximally acylic, the graph \( T+e \) contains a cycle \( C \).
Moreover, since \( F+e \) is acyclic, there exists an edge \( e' \in E(C) \setminus E(F) \).
The update rule of Kruskal's algorithm implies that \( c (e') \ge c(e). \)
Thus, replacing \( e' \) with \( e \) in \( T \) creates a new tree \( T' = T - e' + e \) whose cost is at least that of \( T\).
Since \(T \) is an MST, \( T' \) is also an MST, which contains \( F \) by construction, completing the proof.
Application to the Metric TSP
The Metric Traveling Salesperson Problem (Metric TSP) is a special case of TSP that can be posed as follows: can we find the least-costly Hamiltonian cycle in a complete graph \( G \) equipped with costs on edges \( c : E(G) \to \mathbb{R}_{\ge 0} \) which satisfy the triangle inequality,
$$
c(u,v) \le c(u, w) + c(w, v) \quad \text{ for all } u,v,w \in V(G)?
$$
For an instance of the metric TSP problem, let us consider the following four points in the plane
$$w = (-1, 0), x = (1, 0), y = (0, 0), z = (0, 1) \in \mathbb{R}^2.$$
The distances between these four points give us a weighted 4-clique which is an instance of the metric TSP.
This instance of metric TSP has a unique solution given by the Hamiltonian cycle \(C_* = wyxzw\), with cost of \(c(C_*) = 1 + 1 + \sqrt{2} + \sqrt{2} = 2 + 2\sqrt{2} \approx 4.828\). This can be verified by comparing the cost of \( C_* \) to the other two Hamiltonian cycles: for example, the cycle \( C = wxzyw \), which has total cost \( c(C) = 2 + \sqrt{2} + 1 + 1 \approx 5.414. \) The cycle \( C \) was constructed using the heuristic procedure below.
\( T \leftarrow \) an MST of \( G\) // Can use Kruska's algorithm
2
\( \widetilde{G} \gets \) a multigraph on \( V (G) \) where each edge of \( G \) is "doubled" with the same cost
3
\( \widetilde{C} \gets \) Eulerian circuit in \(\widetilde{G}\) // exists because every vertex in \( \widetilde{G} \) has even degree
4
return Hamiltonian cycle \(C \subset G\) with vertex order specified by \( \widetilde{C} \).
We may observe that although the cycle \( C\), despite being sub-optimal, is not that much more costly than \( C_* \). More precisely, the cost of \( C\) is less than twice the cost of \( C_* \), which turns out to be a general property of this metric TSP heuristic.
Metric TSP Factor-2 Approximation For any instance of metric TSP, letting \( C_* \) denote the optimal Hamiltonian cycle and \(C \) the Hamiltonian cycle returned by the heuristic above, we have
$$
c(C_*) \le c(C) \le 2 c(C_*).
$$
Thus, the 2-factor heuristic gives us a "solution" to metric TSP which is at most twice the cost of the optimal solution.
Note that the first inequality in the statmement of this theorem is obvious from the definition of \( C_* \), so we focus on the proving the second inequality.
Proof:
First observe that the optimal Hamiltonian cycle \( C_* \) contains some spanning tree \( T' \), namely the path obtained by deleting any edge from \( C_* \). Since \( T \) is a MST and the costs are nonnegative, we have
$$
c(T) \le c(T') \le c(C_*).
$$
Second, observe that our doubling construction implies
$$
c(\widetilde{C}) = 2 \cdot c(T).
$$
Finally, we must make use of the triangle inequality, which implies that
$$
c(C) \le c(\widetilde{C}),
$$
since each edge within \(C \) may be viewed as a "shortcut" along the path connecting its ends in \( \widetilde{C} \).
Putting it all together, we have
$$
c(C) \le c(\widetilde{C}) = 2 c(T) \le 2 c(C_*).
$$
Cayley's Formula
How many trees are there on \( n \) vertices? The question as we have posed it is vague: one must distinguish between labeled and unlabeled trees.
In general, the number of unlabeled objects is less than the number of labeled objects, but producing formulas for the number of labeled objects is much easier.
For example, the number of unlabeled graphs on \( n \) vertices equals \( 2^{\binom{n}{2}} \).
For \( n = 4 \), this tells us there are \( 64 \) labeled graphs.
However, many of these graphs are isomorphic; the number of unlabeled \( 4 \)-vertex graphs is just \( 11 \).
Returning to the problem of counting trees, let us start by considering the case of \( n = 4 \).
First, we determine the number of unlabeled trees.
We know that \( 4 \)-vertex tree must have at least two leaves.
Notice that the number of leaves cannot equal \( 4 \), as the sum over all vertex degrees must equal \( 6 \).
If the number of leaves is exactly \( 2 \), the only possibility up to isomorphism is a path of length \( 3 \).
If the number of leaves is exactly \( 3 \), the only possibility is a star.
Since there are just two isomorphism classes of \( 4 \)-vertex trees, it remains to count the number of ways in which we can assign labels from the set \( \{ 1,2,3,4 \} \) to the vertices.
For the star, a labelling is determined by the choice of the degree-\( 3 \) vertex; thus, there are \( 4 \) labeled stars.
For the paths, a labelling is determined by a sequential ordering of the labels; although there are \( 4! = 24 \) such orderings, reversing the order produces the same labeled tree, so there are exactly \( 12 \) labeled paths.
We show all \( 16 \) labeled trees below.
Our count of \( 16 = 4^{4-2} \) labeled \( 4 \)-vertex trees produced above is an instance of the following result.
Theorem (Cayley's Formula): For \( n \ge 2\), there are exactly \( n^{n-2} \) labeled \( n \)-vertex trees.
Prüfer Sequences
In this section, we will describe a bijective proof of Cayley's theorem, which establishes a one-to-one correspondence between the set of labeled trees on \( n \) vertices and the set of sequences of length \( n-2 \) with entries from \( \{1, 2, \dots, n\} \). Such a sequence will called a Prüfer sequence.
For ease of notation, we write \( [n] = \{ 1,\ldots , n \} \) and \( [n]^{(n-2)} \) for the set of all such sequences.
(In the next section, we will see a different proof of Cayley's theorem based on matrix algebra.)
Both the bijective correspondence described above and its inverse can both be described by simple algorithms. We we refer to these algorithms below as Prüfer encoding and the Prüfer decoding, respectively.
Prüfer Encoding (Tree to Sequence)
Let \( T \) be a tree with vertices labeled \( \{1, 2, \dots, n\} \). We construct a sequence \( S \) of length \( n-2 \) as follows:
Find the leaf (vertex of degree 1) with the smallest label.
Record the label of its unique neighbor as the next element in the sequence \( S \).
Delete the leaf and the edge connecting it to its neighbor from \( T \).
Repeat this process until exactly two vertices remain in the tree.
Because a tree on \( n \ge 2 \) vertices always has at least two leaves, this process is well-defined and always stops after \( n-2 \) steps, producing a sequence of length \( n-2 \).
Example: Constructing a Prüfer Sequence
Let's find the Prüfer sequence \( P(T) \) for the 7-vertex tree \( T \) shown below. Because there are \( n = 7 \) vertices, our final sequence will have exactly \( 7 - 2 = 5 \) elements.
We repeatedly find the leaf (degree-1 vertex) with the smallest label, record its unique neighbor, and then remove the leaf from the graph:
Step 1: The initial leaves are {2, 3, 5, 7}. The smallest is 2. Its neighbor is 1. We record \( 1 \) and delete vertex 2. Sequence so far: (1)
Step 2: The remaining leaves are {3, 5, 7}. The smallest is 3. Its neighbor is 4. We record \( 4 \) and delete vertex 3. Sequence so far: (1, 4)
Step 3: The remaining leaves are {5, 7}. The smallest is 5. Its neighbor is 4. We record \( 4 \) and delete vertex 5. Notice that deleting 5 turns vertex 4 into a new leaf! Sequence so far: (1, 4, 4)
Step 4: The current leaves are {4, 7}. The smallest is 4. Its neighbor is 6. We record \( 6 \) and delete vertex 4. Now vertex 6 becomes a leaf. Sequence so far: (1, 4, 4, 6)
Step 5: The current leaves are {6, 7}. The smallest is 6. Its neighbor is 1. We record \( 1 \) and delete vertex 6. Sequence so far: (1, 4, 4, 6, 1)
Exactly two vertices remain ({1, 7}), so the algorithm terminates. The final Prüfer sequence for this tree is \( S = (1, 4, 4, 6, 1) \).
Notice that the degree of any vertex in the tree is exactly one more than the number of times it appears in the sequence (e.g., vertex 4 appears twice in the sequence and has a degree of 3 in the original graph).
To produce a tree from an arbitrary sequence \( S = (u_1, \ldots , u_{n-2}) \in [n]^{n-2} \), we use the following algorithm.
Prüfer Decoding (Sequence to Tree)
Intialize a set of labels \( L \gets [ n ] \).
For each element \( i=1, \ldots , n-2 \):
Find the smallest \( v \in L \) not appearing in the partial sequence \( (u_i, \ldots , u_{n-2}) \).
Add an edge between \( v \) and \( u_i \).
Update \( L \gets L \setminus \{ v \} \).
After processing the entire sequence, exactly two vertices will have a degree of 1. Add a final edge between them.
Proof of Cayley's Formula (sketch): By induction on \( n \), one may check that, for any labeled tree \( T \), if we apply the Prüfer Encoding followed by the Prüfer Decoding, then we recover \( T \).
Similarly, for any sequence \( S \in [n]^{(n-2)} \), applying Prüfer Decoding and then Prüfer Encoding gives us back \( S \).
Thus, these procedures define bijective inverses of each other, and the number of labelled \( n \)-vertex trees equals the cardinality of the sequence space \( [n]^{(n-2)} \), which equals \( n^{n-2} \).
Deletion-Contraction and Kirchoff's Matrix-Tree Theorem
Let \( \tau(G) \) denote the number of spanning trees of a multigraph \( G \).
We define the edge contraction \( G/e \) as the multigraph obtained by deleting \( e \) and identifying its ends.
Note that this operation may produce loops or parallel edges.
Proposition: Let \( G \) be a multigraph, and let \( e \) be an edge that is not a loop. Then \( \tau(G) = \tau(G \setminus e) + \tau(G/e) \).
Proof: We can partition the spanning trees of \( G \) into two disjoint sets based on whether they contain the edge \( e \). The number of spanning trees of \( G \) that do not use \( e \) is exactly \( \tau(G \setminus e) \), and the number of spanning trees of \( G \) that use \( e \) is \( \tau(G/e) \). Summing these disjoint cases completes the proof.
While this recursive formula provides an algorithm to compute the number of spanning trees, it is exponential and thus not a very efficient method in practice. We will see a better way using matrix determinants.
The Adjacency and Laplacian Matrices
Let \( G \) be a multigraph with \( V(G)=\{1,2,\dots,n\} \). The adjacency matrix of \( G \) is an \( n \times n \) matrix \( A_G=(a_{ij})_{i,j=1}^n \) defined entrywise by \( a_{ij} = \# \) edges with ends \( i, j \).
The Laplacian matrix of a graph is defined entrywise by \( L_G=(l_{ij}) \), where:
$$ l_{ij} = \begin{cases} \sum_{k \neq i} a_{ik} & \text{if } i=j \\ -a_{ij} & \text{otherwise} \end{cases} $$
Note that the rows and columns of the Laplacian sum to 0, and hence \( \det L_G = 0 \).
Kirchhoff's Matrix Tree Theorem: Let \( G \) be a multigraph, let \( L_G \) be its Laplacian matrix, and for any \( k \in \{1,2,\dots,n\} \) let \( L_G(k) \) denote the principal submatrix of \( L_G \) obtained by deleting the \( k^{\text{th}} \) row and \( k^{\text{th}} \) column. We have \( \tau(G) = \det L_G(k) \).
Example
Consider a "diamond" graph \( G \) on 4 vertices with a central edge \( e \).
We can observe by counting that \( \tau(G) = 8 \) (there are 4 spanning trees containing \( e \), and 4 not containing \( e \)).
The Laplacian matrix \( L_G \) and the submatrix \( L_G(1) \) (obtained by deleting the first row and column) are given by:
$$ L_G = \begin{pmatrix} 3 & -1 & -1 & -1 \\ -1 & 3 & -1 & -1 \\ -1 & -1 & 2 & 0 \\ -1 & -1 & 0 & 2 \end{pmatrix}, \quad L_G(1) = \begin{pmatrix} 3 & -1 & -1 \\ -1 & 2 & 0 \\ -1 & 0 & 2 \end{pmatrix} $$
Calculating the determinant yields \( \det L_G(1) = 3(4-0) - (-1)(-2-0) + (-1)(0-(-2)) = 12 - 2 - 2 = 8 \), verifying the theorem.
Proof of Kirchhoff's Matrix Tree Theorem
First, we establish a useful lemma regarding determinants.
Lemma: For any square matrix \( M \in \mathbb{R}^{n\times n} \) and any index \( 1\le v \le n\), we have \( \det(M + E_{vv}) = \det(M) + \det M(v) \), where \( E_{vv}\in \mathbb{R}^{n\times n} \) is the with 1 in entry \( (v,v) \) and 0 elsewhere.
Proof: This follows directly from cofactor expansion along the \( v \)-th row (or column) of \(M.\)
Proof of Matrix Tree Theorem:
First, notice that \( \det L_G(k) = 0 \) for any \( k \) if \(G \) is disconnected. To see this, sum all rows/columns of \( L_G\) indexed by the vertices any connected component not containing \( k \). Deleting the \( k \)-th entry from this sum produces the zero vector, showing that \( \det L_G(k)=0.\)
Thus, if \( G \) is disconnected, then \( \tau(G)=0=\det L_G(k) \), so we may assume \( G \) is connected.
We may also assume \( G\) is loopless, since loops neither contribute to \( \tau(G)\) nor \( L_G\).
We proceed by induction on the number of edges, \( \# E(G) \).
If \( |E(G)|=0 \), then \( \tau(G)=1=\det L_G(k) \), so suppose \( \# E(G)>0.\)
Recall the deletion-contraction identity: \( \tau(G) = \tau(G \setminus e) + \tau(G/e) \).
To finish the induction, it is enough to show that \( \det L_G(u) = \det L_{G \setminus e}(u) + \det L_{G/e}(w) \), where \( e=uv \) and \( w \) is the new vertex of \( G/e \).
Notice that the Laplacian matrices satisfy \( L_G(u) = L_{G \setminus e}(u) + E_{vv} \).
Applying our determinant lemma, we have:
$$ \det L_G(u) = \det[L_{G \setminus e}(u) + E_{vv}] = \det L_{G \setminus e}(u) + \det L_{G \setminus e}(u,v) $$
Observe that \( \det L_{G \setminus e}(u,v) \) is precisely the determinant of the Laplacian of the contracted graph, \( \det L_{G/e}(w) \).
This matches the deletion-contraction structure and completes the proof.
Proof of Cayley's Formula via Matrix-Tree Theorem: We can compute \( \tau(K_n) \) by taking the determinant of the Laplacian matrix of the complete graph, with one row and column removed. This leaves an \( (n-1) \times (n-1) \) matrix with \( n-1 \) on the main diagonal and \( -1 \) everywhere else:
$$ \tau(K_n) = \det \begin{pmatrix} n-1 & -1 & \dots & -1 \\ -1 & n-1 & \dots & -1 \\ \vdots & \vdots & \ddots & \vdots \\ -1 & -1 & \dots & n-1 \end{pmatrix} $$
We can simplify this matrix using row operations. By adding rows \( 2, 3, \dots, n-1 \) to row 1, we obtain a top row consisting entirely of 1s:
$$ = \det \begin{pmatrix} 1 & 1 & \dots & 1 \\ -1 & n-1 & \dots & -1 \\ \vdots & \vdots & \ddots & \vdots \\ -1 & -1 & \dots & n-1 \end{pmatrix} $$
Next, by adding row 1 to all other rows, we clear out the negative ones below the first row, resulting in an upper triangular matrix:
$$ = \det \begin{pmatrix} 1 & 1 & \dots & 1 \\ 0 & n & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & n \end{pmatrix} $$
The determinant of an upper triangular matrix is the product of its diagonal entries. The diagonal consists of a single 1 and \( n-2 \) copies of \( n \). Therefore, the determinant is \( n^{n-2} \).
5. Flows, Connectivity, and Matching
Max-Flow, Min-Cut
Networks and Flows
A network is a quadruple \( N = (D, s, t, c) \), where \( D \) is a digraph, \( s, t \in V(D) \) are vertices, and \( c: E(D) \to \mathbb{R}_{\ge 0} \cup \{\infty\} \) is a nonnegative capacity function on edges. The distinguished vertices \( s \) and \( t \) are called the source and sink of \( N \), respectively.
For any \( u \in V(D) \), we define
$$\Gamma^+(u) = \{ v \in V(D) \mid \overrightarrow{uv} \in E(D) \} \quad \text{(out-neighborhood)}$$
$$\Gamma^-(u) = \{ v \in V(D) \mid \overrightarrow{vu} \in E(D) \} \quad \text{(in-neighborhood)}$$
A flow on a newtwork \( N = (D, s,t,c \) is any function \( f: E(D) \to \mathbb{R}_{\ge 0} \cup \{\infty\} \) satisfying the following two conditions:
(capacity constraints) $$0 \le f(e) \le c(e) \text{ for all } e \in E(D) $$
We define the value of a flow \( f \) as
$$v(f) = \sum_{u \in \Gamma^+(s)} f(\overrightarrow{su}) - \sum_{u \in \Gamma^-(s)} f(\overrightarrow{us}).$$
Alternatively, the value of a flow can be computed using the the in and out neighborhoods of the sink vertex \( t \) rather than the source vertex \( s \), as the next proposition shows.
Proposition: If \( f \) is any flow in a network \( (D, s, t, c) \),
$$v(f) = \sum_{v \in \Gamma^-(t)} f(\overrightarrow{vt}) - \sum_{u \in \Gamma^+(t)} f(\overrightarrow{tu}).$$
Proof: Consider the sum
$$0 = \sum_{u \in V(D) \setminus \{s,t\}} \left( \sum_{v \in \Gamma^+(u)} f(\overrightarrow{uv}) - \sum_{v \in \Gamma^-(u)} f(\overrightarrow{vu}) \right)$$
Any edge \( \overrightarrow{uv} \) w/ \( u,v \notin \{s,t\} \) contributes two terms \( f(\overrightarrow{uv}) \) and \( -f(\overrightarrow{vu}) \) which cancel, leaving only
$$0 = \underbrace{\sum_{u \in \Gamma^-(s)} f(\overrightarrow{us}) - \sum_{u \in \Gamma^+(s)} f(\overrightarrow{su})}_{= -v(f)} + \sum_{u \in \Gamma^-(t)} f(\overrightarrow{ut}) - \sum_{u \in \Gamma^+(t)} f(\overrightarrow{tu})$$
Max-Flow Problem: Given a network \( N = (D, s, t, c) \), find a max flow: that is, a flow \( f: E(D) \to \mathbb{R}_{\ge 0} \cup \{\infty\} \) of maximum value (if such a flow exists).
Let \( U \subseteq V(D) \) be a set of vertices. The set of edges
$$E(U, \overline{U}) = \{ \overrightarrow{uv} \in E(D) \mid u \in U, v \in \overline{U} \}$$
are the a cut edges associated with the cut.
Definition: If \( E(U, \overline{U}) \) is a cut separating \( s \) from \( t \) (\( s \in U, t \notin U \)), we define its capacity by
$$\text{cap}(U) = \sum_{e \in E(U, \overline{U})} c(e).$$
Proposition: The value of any flow in a network is at most the capacity of any cut separating \( s \) from \( t \).
Max-Flow, Min-Cut Theorem
If \( N \) is any network with \( f_* \) a flow of maximum value and \( U_* \) a cut of minimum capacity, we have
$$v(f_*) = \text{cap}(U_*).$$
Proof:
Let us assume that \( f_* \) is a maximum flow with finite value.
Define a subset \( U_* \subseteq V(D) \) recursively as follows: let \( s \in U_* \). For any \( u \in U_* \), and any out-neighbor \( v \in \Gamma^+ (u) \), we add \( v \in U_* \) if $$ c(\overrightarrow{uv}) > f_*(\overrightarrow{uv}) \quad \text{or} \quad f_*(\overrightarrow{vu}) > 0 .$$
Claim 1: \( U_* \) is a cut separating \( s \) from \( t \), w/ capacity \( v(f_*) \).
First, we show \( t \notin U_* \): if it were, then we could find an undirected path \( P = u_0 u_1 u_2 \dots u_\ell = t \) such that
$$\varepsilon_i := \max \left[ c(\overrightarrow{u_i u_{i+1}}) - f_*(\overrightarrow{u_i u_{i+1}}), \, f_*(\overrightarrow{u_{i+1} u_i}) \right] > 0$$
for all \( i=0,\dots,\ell-1 \). Set \( \varepsilon = \min \{ \varepsilon_0, \dots, \varepsilon_{\ell-1} \} \), and define a new flow \( \tilde{f} \) as follows:
$$\tilde{f}(e) = \begin{cases} f_*(e) + \varepsilon & \text{if } e = \overrightarrow{u_i u_{i+1}}, \quad \varepsilon_i > f_*(\overrightarrow{u_{i+1} u_i}) \\ f_*(e) - \varepsilon & \text{if } e = \overrightarrow{u_{i+1} u_i}, \quad \varepsilon_i = f_*(\overrightarrow{u_{i+1} u_i}) \\ f_*(e) & \text{else} \end{cases}$$
Claim 2: \( \tilde{f} \) is a flow.
Let us verify the capacity constraints on edge where \( \tilde{f} \) and \(f_*\) differ.
If \( e = \overrightarrow{u_i u_{i+1}} \) and \( \varepsilon_i > f_*(\overrightarrow{u_{i+1} u_i})\), then
$$0 \le f_*(e) + \varepsilon \le
f_*(e) + \varepsilon_i =
f_*(e) + c(e) - f_*(e) = c(e).$$
Similarly, if \( e = \overrightarrow{u_{i+1} u_i} \) and \( \varepsilon_i = f_*(\overrightarrow{u_{i+1} u_i})\),
$$c(e) \ge f_*(e) - \varepsilon \ge f_*(e) - \varepsilon = f_*(e) - f_*(e) = 0.$$
As for the conservation constraints, we only need to check interior vertices of the path \( P \), meaning \( u_i \) for \( i=1, \ldots , \ell -1 \).
Comparing \( \tilde{f} \) with \( f_* \), we either increase outflow from \( u_i \) by \( \varepsilon \) or decrease inflow to \( u_i \) by \( \varepsilon \): in either case, the total contribution of the pair \( (u_i, u_{i+1}) \) to the sum
$$\sum_{v \in \Gamma^+(u_i)} \tilde{f}(\overrightarrow{u_i v}) - \sum_{v \in \Gamma^-(u_i)} \tilde{f}(\overrightarrow{v u_i}) \quad (*)$$
is \( +\varepsilon \). A similar argument shows this is balanced by a contribution of \( - \epsilon \) from the pair edge \( (u_{i-1}, u_i) \). Hence the sum (*) is zero.
Thus, we have constructed a flow \( \tilde{f} \) with value \( v(\tilde{f}) = v(f_*) + \varepsilon > v(f_*) \). This completes the proof of both claims; such a flow \( \tilde{f} \) cannot exist, as this would contradict the maximality of \( f_* \), so we obtain that \( U_* \) is a cut separating \( s \) from \( t \). Now,
$$v(f_*) = \sum_{\overrightarrow{uv} \in E(U_*, \overline{U_*})} f_*(\overrightarrow{uv}) - \sum_{\overrightarrow{vu} \in E(\overline{U_*}, U_*)} f_*(\overrightarrow{vu}).$$
We claim that the first sum above equals
$$\sum_{\overrightarrow{uv} \in E(U_*, \overline{U_*})} c(\overrightarrow{uv}).$$
Indeed, if \( \overrightarrow{uv} \in E(U_*, \overline{U_*}) \), then \( f_*(\overrightarrow{uv}) = c(\overrightarrow{uv}) \) by construction of \( U_* \). Moreover, the second sum is zero: if \( \overrightarrow{vu} \in E(\overline{U_*}, U_*) \), the construction of \( U_* \) forces that \( f_*(\overrightarrow{vu}) = 0 \).
We conclude that
$$v(f_*) = \sum_{\overrightarrow{uv} \in E(U_*, \overline{U_*})} c(\overrightarrow{uv}) = \text{cap}(U_*).$$
Our proof of the Max-Flow Min-Cut Theorem can be easily converted into an algorithm for constructing a maximum flow.
The \( st \) path \( P \) used in the proof is called an augmenting path.
Starting from the flow that is zero on all edges, we can increase the value of a flow along any augmenting path.
Once this is no longer possible, we have constructed a flow \( f_* \) and a cut \( U_* \) satisfying the conditions of the Max-Flow Min-Cut Theorem.
Hence \( f_* \) is a max flow. This procedure is known as the Ford-Fulkerson algorithm.
Some of the details are not completely specified (for instance, how to construct the set \( U\)), and other aspects of the algorithm could be made more efficient. Nevertheless, many of the practical algorithms for solving the max flow problem are fundamentally based on the idea of finding augmenting paths.
Algorithm for Solving Max-Flow
INPUT: \( N=(D, s, t, c) \)
OUTPUT: A max flow \( f \) and a cut \(U \) with \( v(f) = \operatorname{cap} (U) \).
1.
Initialize flow \( f(e)=0 \) for all \( e \in E(D) \),
2.
Initialize cut \( U \) recursively: \( s \in U \), and \( v \in U \) if \( u \in U \) w/ \( c(\overrightarrow{uv}) > f(\overrightarrow{uv}) \) or \( f(\overrightarrow{vu}) > 0 \).
3.
while \( t \in U \):
3i.
find an undirected path \( s=u_0 u_1 \dots t=u_\ell \) with all \( u_i \in U \) (an augmenting path),
where \( \varepsilon = \min_{i=0}^{\ell-1} \epsilon_i. \)
3iii.
Update \( U \) recursively: \( s \in U \), and \( v \in U \) if \( u \in U \) w/ \( c(\overrightarrow{uv}) > f(\overrightarrow{uv}) \) or \( f(\overrightarrow{vu}) > 0 \).
4.
return \( f, U \)
NoteThe numbers \( \epsilon_i \) computed in each iteration of Ford-Fulkerson are known as residual capacities. In a word, Ford-Fulkerson can be summarized as follows: while there exists an augmenting path, augment the flow along that path by the minimum residual capacity.
Example
To illustrate the Ford-Fulkerson algorithm, consider the example of a network \( N = (D, s, t, c) \) shown below. The initial flow along each edge is set to 0. In the iterations below, we will greedily choose augmenting paths from \( s \) to \( t \) and increase the flow by the bottleneck capacity \( \varepsilon \).
In the first iteration, we find the augmenting path \( s v_1 v_3 t \) (highlighted in blue). The residual capacities along this path are \( \epsilon_0 = 16\) , \( \epsilon_1 = 12\), and , \(\epsilon_2 = 20\), with minimum \( \varepsilon = \min(16, 12, 20) = 12 \). We augment the flow on these edges by 12.
Next, we find the augmenting path \( s v_2 v_4 t \). The residual capacities are \( \epsilon _0 = 13\), \(\epsilon_1 = 14\), and \( \epsilon_2 = 4\), so \( \varepsilon = \min(13, 14, 4) = 4 \). We augment the flow on these edges by 4.
We find a third augmenting path: \( s v_2 v_4 v_3 t \). The residual capacities are \( \epsilon_0 = 13-4=9 \), \( \epsilon_1 = 14-4=10 \), \( 7-0=7 \), and \( \epsilon_2 = 20-12=8 \), so we augment the flow by \( \varepsilon = \min(9, 10, 7, 8) = 7 \).
Finally, no more augmenting paths can be found from \( s \) to \( t \). The algorithm terminates. We omit the zero-flow edges below to clearly see that our final max flow \( f_* \) has value \( v(f_*) = 11 +12 = 23. \)
In the final output, we have marked each edge \( e \) with the flow \( f_* (e) \), as well as three edges where the flow and capacity are equal. These three dashed edges are precisely the cut-edges \( E (U , \overline{U} ) \) of the min cut \( U_* = \{ s, v_1, v_2, v_4 \} \) separating \( s \) .
Note that \( \operatorname{cap} (U_* ) = 12 + 7 + 4 = 23 = v (f_*) \), exactly as predicted by the Max-Flow Min-Cut Theorem.
In this first example, no "back-edges" were considered. The next example illustrates a scenario where back-edges are chosen, and why the choice of augmenting paths is important in practice.
Example 2
In the first iteration, we arbitrarily (and poorly) choose the augmenting path \( s uv t \). The minimum (residual) capacity along this edge is \( \varepsilon = \min(100, 1, 100) = 1 \), so we push 1 unit of flow.
Next, we choose the augmenting path \( s vut \). Now, since \( vu \) is a back-edge, we decrease the flow along \( uv \) by \( \epsilon = 1 \).
For iterations 3 through 200, the algorithm ping-pongs back and forth, alternating between these two augmenting paths. Each cycle of two iterations pushes just 2 units of total flow. Because the max flow is 200, it takes exactly 200 iterations to terminate! A more careful choice of augmenting paths, however, would allow us to finish using just 2 iterations.
Although it is not the most practical method for solving max-flow problems, the Ford-Fulkerson algorithm is still a useful theoretical tool. We record one particularly important consequence known as the integrality theorem.
Theorem: Given integer-valued capacities, Ford-Fulkerson always returns an integer-valued max flow.
Menger's Theorem and Connectivity
Graph Connectivity
Let \( G \) be a connected graph. If \( W \subseteq V(G) \) is a subset of vertices such that \( G - W \) (the subgraph induced by \( V(G) \setminus W \)) is disconnected, we say that \( W \) separates \( G \). Furthermore, if two vertices \( s \) and \( t \) belong to different connected components of \( G - W \), we say \( W \) separates \( s \) from \( t \).
For an integer \( k \ge 2 \), we say a graph is \( k \)-connected if either \( G \cong K_{k+1} \) (the complete graph on \( k+1 \) vertices) or \( \#V(G) \ge k+2 \) and no subset of \( k-1 \) vertices separates \( G \). The largest value \( k \) such that \( G \) is \( k \)-connected is called the (vertex) connectivity of \( G \), denoted \( \kappa(G) \).
Similarly, if \( W \subseteq E(G) \), we say \( G \) is \( k \)-edge-connected if \( \#E(G) \ge 2 \) and deleting any \( k-1 \) edges does not disconnect \( G \). The largest \( k \) for which \( G \) is \( k \)-edge-connected is the edge connectivity of \( G \), denoted \( \lambda(G) \).
Example The "bowtie" graph shown below is not 2-connected, as deleting \( W = \{ 3 \} \) separates the graph into two connected components. However, the graph is \( 2 \)-edge-connected.
Menger's Theorem
For \( s, t \in V(G) \), we say two \( st \)-paths are independent if they are internally vertex-disjoint; that is to say, they contain no common vertices other than the ends \( s \) and \( t \).
Menger's theorem consists of two separate but related results, which provide min-max theorems related to graph connectivity.
Menger's Theorem (Vertex Form): Let \( s, t \in V(G) \) be nonadjacent distinct vertices in \( G \). The minimum number of vertices needed to separate \( s \) from \( t \) equals the maximum number of independent \( st \)-paths.
Menger's Theorem (Edge Form): Let \( s, t \in V(G) \) be distinct vertices. The minimum number of edges whose deletion disconnects \( s \) and \( t \) equals the maximum number of edge-disjoint paths between \( s \) and \( t \).
To illustrate the two forms of Menger's theorem, consider the graph \( G \) shown below. The red path \( sxt \) and the blue path \(syt \) are independent. Together with the green path \( suxvt \), we have three edge-disjoint paths from \( s \) to \( t \). To separate \( s \) from \( t \), we can delete any subset of three edges, one for each path. On the other hand, the green path is not independent of the red path or the blue path, due to the shared internal vertices \( x \) and \( y \).
Correspondingly, Menger's theorem tells us it is possible to separate \( s \) from \( t \) by deleting a subset of two vertices; in this specific example, we may take the subset \( W = \{ x , y \} \).
Proof: Both forms of Menger's Theorem can be elegantly proven by reducing them to the Max-Flow Min-Cut (MFMC) theorem. Since the edge form is simpler, we prove this first.
1. Proof of the Edge Form:
Let \( D \) be the digraph obtained by replacing every undirected edge in \( G \) with two directed edges pointing in opposite directions. That is, \( E(D) = \{ \overrightarrow{uv}, \overrightarrow{vu} \mid uv \in E(G) \} \).
Define a network \( N = (D, s, t, c) \) where the capacity \( c(\overrightarrow{uv}) = 1 \) for all \( \overrightarrow{uv} \in E(D) \).
By the Integrality Theorem for network flows, because all capacities are integers, there exists a maximum flow from \( s \) to \( t \) that sends exactly 0 or 1 unit of flow along each edge. Thus, the value of the max flow exactly equals the number of edge-disjoint directed paths from \( s \) to \( t \) in \( N \), which corresponds to edge-disjoint paths in \( G \).
By the Max-Flow Min-Cut Theorem, this maximum flow value equals the capacity of a minimum cut in \( N \). Since every edge has a capacity of 1, the capacity of a cut is exactly the number of edges crossing it. Therefore, the minimum cut gives exactly the minimum number of edges needed to disconnect \( s \) and \( t \) in \( G \).
2. Proof of the Vertex Form:
Just like the edge form, we will prove the vertex form of Menger's theorem by reduction to MFMC. However, the reduction is slightly more complicated, involving a a "vertex-splitting" construction.
From the data \( G , s , t\), we construct a new network \( \widetilde{N} = (\widetilde{D}, s, t, \widetilde{c}) \) as follows:
For every vertex \( u \in V(G) \setminus \{s, t\} \), split it into two vertices, an "in-node" \( u_- \in V ( \widetilde{D}) \) and an "out-node" \( u_+ V ( \widetilde{D}) \), and create a directed edge \( \overrightarrow{u_- u_+} \in E ( \widetilde{D}) \) with capacity \( 1 \).
For every undirected edge \( uv \in E(G) \), create a single directed edge: \( \overrightarrow{u_+ v_-} \in E ( \widetilde{D})\) with capacity \( \infty \).
For edges of the form \( sv \) or \( yt \), we create directed edges \( \overrightarrow{sv_-} , \overrightarrow{u_+t} \in E(\widetilde{D})\), with capacity \( \infty \).
We illustrate the construction of the network \( \widetilde{N} \) on an example below.
Original Graph \( G \)
→
Network \( \widetilde{N} \)
By the Integrality Theorem, there exists an integer-valued max flow in \( \widetilde{N} \). Because the internal edge \( \overrightarrow{u_- u_+} \) for any vertex \( u \) has a capacity of 1, at most 1 unit of flow can pass through \( u \). This guarantees that any paths carrying flow from \( s \) to \( t \) cannot share internal vertices, meaning they correspond to independent paths in \( G \).
Now, note that the network \( \widetilde{N} \) has a finite-capacity cut separating \(s \) from \( t \): one may take \( U = \{ s \} \cup \{ u_- \mid u \in \Gamma_G (s) \}\).
Moreover, a min cut in \( \widetilde{N} \) separating \( s \) from \( t \) can only have cut edges of the form \( \overrightarrow{u_- u_+} \), since all other edges have infinite capacity. Now, choosing a cut edge \( \overrightarrow{u_- u_+} \) in \( \widetilde{N} \) directly corresponds to deleting the vertex \( u \) in \( G \). Thus, the minimum capacity of a cut separating \( s \) from \( t \) in \( \widetilde{N} \) exactly equals the minimum number of vertices needed to separate \( s \) from \( t \) in \( G \).
Using Menger's theorem, it becomes straightforward to prove several facts about vertex and edge connectivity. Here is one such example.
Proposition: For any graph \( G \), we have
$$ \kappa(G) \le \lambda(G) \le \delta(G) $$
where \( \kappa(G) \), \( \lambda(G) \), and \( \delta(G) \) are the vertex connectivity, edge connectivity, and minimum degree of a vertex, respectively.
Proof:
First, we prove \( \lambda(G) \le \delta(G) \). Consider the vertex \( v \in V(G) \) that has the minimum degree \( d(v) = \delta(G) \). If we delete all \( \delta(G) \) edges incident to \( v \), the vertex \( v \) becomes isolated, which disconnects the graph. Because we can disconnect the graph by deleting \( \delta(G) \) edges, the minimum number of edges required to disconnect the graph \( \lambda(G) \) can be at most \( \delta(G) \).
Next, we prove \( \kappa(G) \le \lambda(G) \). Let \( s, t \in V(G) \) be a pair of vertices such that deleting exactly \( \kappa(G) \) vertices disconnects them. By Menger's Theorem (Vertex Form), \( G \) must contain exactly \( \kappa(G) \) independent \( st \)-paths.
Since these paths share no internal vertices, they certainly share no edges! Thus, they are also edge-disjoint. By applying Menger's Theorem (Edge Form) to these \( \kappa(G) \) edge-disjoint paths, we know that we need at least \( \kappa(G) \) edges to disconnect \( s \) from \( t \). Since \( \lambda(G) \) is the minimum number of edges to disconnect any pair in the graph, it follows that \( \kappa(G) \le \lambda(G) \).
2-Connectivity
Block Structure of Connected Graphs
A cut-vertex in a multigraph \( G \) is a vertex \( v \) such that the edge set \( E(G) \) can be partitioned into disjoint, non-empty sets \( E_1 \) and \( E_2 \) such that \( v \) is the only vertex that is incident with edges in both \( E_1 \) and \( E_2 \).
A block is a connected multigraph with no cut-vertex. Examples of blocks include every loopless and 2-connected multigraph. A block of a multigraph \( G \) is defined as a maximal submultigraph that is a block.
Proposition:
Every multigraph is a union of its blocks.
If \( B_1 \) and \( B_2 \) are distinct blocks of \( G \), then \( \# \left( V(B_1) \cap V(B_2)\right) \le 1 \), and if a vertex \( v \in V(B_1) \cap V(B_2) \), then \( v \) is a cut-vertex in \(G \).
Proof:
(i) This is immediate.
(ii) Suppose \(B_1\) and \( B_2 \) are distinct blocks and \( x, y \in V(B_1) \cap V(B_2) \) where \( x \ne y \).
We claim that the union \( B_1 \cup B_2 \) is then a block, which would be a contradiction since \( B_1 \cup B_2 \) strictly contains some \( B_i \).
To show the graph \( B_1 \cup B_2 \) is 2-connected, we must show that deleting a vertex doesn't disconnect the graph.
If we delete any vertex in \( B_i \), then two vertices belonging to a single block can still be connected (since the \( B_i \) are 2-connected.)
Also, two vertices in different blocks can also be connected; even if one of the vertices deleted is a common vertex \( x \) or \( y \), we can still join paths through the other common vertex.
Thus, we have shown the inequality \( \# \left( V(B_1) \cap V(B_2)\right) \le 1 \); if this inequality is an equality, it is immediate that the vertex common to both blocks is a cut vertex of \( G \).
Given a multigraph, we define a graph \( F \) as follows: \( V(F) = \mathcal{B} \cup \mathcal{C} \), where \( \mathcal{B} \) is the set of all blocks of \( G \), and \( \mathcal{C} \) is the set of all cut-vertices of \( G \). A block \( B \in \mathcal{B} \) is adjacent to a cut-vertex \( c \in \mathcal{C} \) if \( c \in V(B) \). This is called the block structure of a graph.
Theorem: \( F \) is a forest, and if \( G \) is connected, then it is a tree.
Proof: If \( F \) contained a cycle, it would need to consist of at least two blocks. The union of all of the blocks appearing in this cycle would then itself be a block, as we could connect two vertices by paths going different ways around the cycle. This is a contradiction, so \( F \) must be a forest.
Second, if \( G\) is connected, then any path between two vertices in \( G\) can be used to construct a path between a pair of vertices in \( C\), whether these vertices are cut-vertices or blocks in \( G\).
Graph \( G \)
→
Block Structure \( F \)
In general, a graph can be broken into its connected components, and a conneected graph can be broken up into its \( 2 \)-connected components.
Can we say anything interesting about the structure of a 2-connected graph?
The answer is yes!
Theorem (Ear structure of 2-connected graphs): Let \( G \) be a 2-connected graph. Then \( G \) can be written as \( G = G_0 \cup G_1 \cup \dots \cup G_k \), where:
\( G_0 \) is a cycle.
For \( i = 1, 2, \dots, k \), \( G_i \) is a path with both ends in \( G_0 \cup \dots \cup G_{i-1} \), and otherwise disjoint from it.
Proof: Consider a subgraph \( G_0 \cup G_1 \cup \cdots \cup G_k \subset G \) satisfying (i) and (ii) such that the number of ears \( k \) is maximized.
(Note that Menger's theorem implies \( G\) contains a cycle, so such subgraphs at least exist.)
Now, if a vertex \( v \in V(G) \) does not belong to \( G_0 \cup \dots \cup G_k \), then we can argue using Menger's theorem to show that there exist paths \( P_1 \) and \( P_2 \) from \( v \) which are disjoint, except for \( v \). The sequence \( G_0, G_1, \dots, G_k, P_1 \cup P_2 \) would then contradict the choice of \( k \).
For similar reasons, there cannot be any edge outside of \( G_0 \cup \cdots \cup G_k \).
Matching
Matchings in General
A matching in a graph \( G \) is a set of edges \( M \subseteq E(G) \) such that every vertex of \( G \) is incident with at most one edge of \( M \).
\( M \) saturates a vertex \( v \in V(G) \) (or \( v \) is saturated by \( M \)) if \( v \) is incident with an edge of \( M \).
A matching is perfect if it saturates every vertex in the graph.
A maximum matching is a matching \( M \) in \( G \) such that there is no matching \( M' \) with \( \#M' > \#M \).
A maximal matching is a matching \( M \) such that there is no matching \( M' \) with \( M \subsetneq M' \) (i.e., it cannot be extended by adding more edges).
Maximal Matching: \( M = \{ v_2 v_3 \} \) Cannot add any more edges
Size = 1
vs
Maximum Matching: \( M' = \{ v_1 v_2, v_3 v_4 \} \) Largest possible matching
Size = 2
An M-alternating path is a path \( P \) such that edges in \( M \) and edges not in \( M \) alternate along \( P \). An M-augmenting path is an \( M \)-alternating path \( P \) that starts and ends in an \( M \)-unsaturated vertex.
Notice that if we have an \( M \)-augmenting path \( P \), we may construct a new matching using the operation of symmetric difference $$ M' := M \, \Delta \, E(P) = \left( M \setminus E(P) \right) \cup \left( E(P) \setminus M \right). $$ It is straightforward to check that the set \( M' \) is indeed a new matching which satisfies \( \#M' > \#M \); since the path \( P \) starts and ends with non-matching edges, flipping the edges along the path yields one more matched edge than before.
Theorem: A matching \( M \) in \( G \) is maximum if and only if there is no \( M \)-augmenting path.
Proof: We have already argued one direction: if an augmenting path exists, we can obtain a larger matching, so the original matching isn't maximum.
For the converge, assume \( M \) is not maximum. Let \( M' \) be a matching with \( \#M' > \#M \). Consider the subgraph \( H \) with \( V(H) = V(G) \) and \( E(H) = M \Delta M' \).
Since both \( M \) and \( M' \) are matchings, the maximum degree in \( H \) is \( \Delta(H) \le 2 \). It follows that all connected components of \( H \) are either paths (possibly length zero) or even cycles (cycles must be even because the edges alternate between \( M \) and \( M' \)). Because \( \#M' > \#M \), there must be at least one component (a path) that contains more edges from \( M' \) than from \( M \). This path starts and ends with edges in \( M' \), making it exactly an \( M \)-augmenting path!
Matchings in Bipartite Graphs
Let \( G \) be a bipartite graph with a vertex bipartition \( V(G) = A \sqcup B \). A matching \( M \) is a complete matching from \(A\) to \(B\) if it saturates every vertex of \( A \). If \( \#A = \#B \), then a complete matching from \( A \) to \( B \) is the same as a perfect matching.
For any subset \( S \subseteq A \), let \( \Gamma(S) \) denote the neighborhood of \( S \), defined as:
$$ \Gamma(S) := \{ v \in B \mid v \text{ is adjacent to a vertex in } S \} $$
Notice that if \( \#\Gamma(S) < \#S \) for some \( S \subseteq A \), then a complete matching from \( A \) to \( B \) is strictly impossible, because there are not enough distinct neighbors in \( B \) to partner with the elements of \( S \). This is the fundamental obstruction to bipartite matching.
The Hall Obstruction
If the subset \( S \) is larger than its neighborhood \( \Gamma(S) \), a complete matching is impossible.
Theorem (Hall's Marriage Theorem): A bipartite graph with bipartition \( (A, B) \) has a complete matching from \( A \) to \( B \) if and only if \( \#\Gamma(S) \ge \#S \) for every subset \( S \subseteq A \).
Proof:
\( (\Rightarrow) \) This direction is already established by the obstruction logic above.
\( (\Leftarrow) \) We construct a flow network from our bipartite graph. Add a source \( s \) connected to all vertices in \( A \) with capacity 1. Direct all original edges from \( A \) to \( B \) and assign them capacity \( \infty \). Add a sink \( t \) and connect all vertices in \( B \) to \( t \) with capacity 1.
A complete matching from \( A \) to \( B \) exists if and only if the maximum flow in this network is \( \#A \). By the Max-Flow Min-Cut Theorem, it suffices to show that the minimum capacity of an \( s-t \) cut is at least \( \#A \).
Let \( U \) be the set of vertices on the source side of an arbitrary cut. Let \( S = U \cap A \) and \( T = U \cap B \). The capacity of the cut \( U \) is given by the edges leaving \( U \).
If there is an edge from \( S \) to a vertex in \( B \) that is not in \( T \) (meaning \( \Gamma(S) \not\subseteq T \)), the cut includes an edge of infinite capacity. Otherwise, the cut only includes edges from \( s \) to \( A \setminus S \) (each with capacity 1) and edges from \( T \) to \( t \) (each with capacity 1).
What is the capacity of \( U \)? We have:
$$ \text{cap}(U) = \begin{cases} \infty & \text{if } \Gamma(S) \not\subseteq T \\ (\#A - \#S) + \#T & \text{otherwise} \end{cases} $$
To make \( U \) a minimum cut, we must make \( T \) as small as possible subject to the condition \( \Gamma(S) \subseteq T \); i.e., we take \( T = \Gamma(S) \).
By Hall's condition, we know \( \#\Gamma(S) \ge \#S \), meaning \( (\#\Gamma(S) - \#S) \ge 0 \). Therefore:
$$ \text{cap}(U) \ge \#A $$
Because the minimum cut is at least \( \#A \) (and the cut separating \( s \) from everything else is exactly \( \#A \)), the maximum flow is exactly \( \#A \), confirming the existence of a complete matching.
To illustrate our proof of Hall's Theorem, here is an example of a bipartite graph and a matching of size 2.
Size 2 Matching
And here is another matching of size 3 in that same graph, obtained from the first by an augmenting path.
Size 3 Matching
Can we improve the matching of size 3 to a complete matching from \(A\) to \(B\)? The answer is no: for the set \( S = \{ a_2, a_4 \}, \) we have \( \Gamma (S) = \{ b_3 \} \), so Hall's condition fails.
The reduction to MFMC used in our proof is depicted for this example below.
MFMC Reduction Network (Max Flow = 3)
Vertex Covers and Kőnig's Theorem
A vertex cover in a graph \( G \) is a set of vertices \( C \subseteq V(G) \) such that every edge in \( G \) is incident to at least one vertex in \( C \).
Because every edge in a matching \( M \) is disjoint, any vertex cover must pick at least one distinct vertex for every edge in \( M \). Therefore, in any graph, the size of a maximum matching is always less than or equal to the size of a minimum vertex cover (\( \#M \le \#C \)). In bipartite graphs, these two quantities are exactly equal.
Kőnig's Theorem: In any bipartite graph \( G \), the maximum size of a matching is equal to the minimum size of a vertex cover.
It is important to note that Kőnig's Theorem does not generalize to non-bipartite graphs.
This can be seen from the triangle \( K_3 \), where a maximum matching has size 1, and a minimum vertex cover has size 2.
Proof of Kőnig's Theorem:
As in the proof of Hall's theorem, we construct the network \( N \) illustrated above. If \( M \) is a maximum matching, then by construction any maximum flow in \( N\) has value equal to \( \# M \).
Thus, by the MFMC theorem, if \( U \) is a min cut separating \( s \) from \( t \), then \( \operatorname{cap} (U) = \# M \).
Observe then that the set of cut edges \( E (U, \overline{U}) \) cannot contain any edges of the form \( \overrightarrow{ab} \), since these edges have infinite capacity.
We define
$$
C = (B \cap U) \cup (A \setminus U).
$$
(Note: In the example illustrated above, we construct \( C \) as follows:
$$
U = \{ s , a_2, a_4, b_3 \}
\quad
\Rightarrow
\quad
C = \{ a_1, a_3, b_3 \},
$$
where \( U \) consists of all vertices reachable from \( s \) via an augmenting path.)
Claim: \( C \) is a vertex cover in \( G \). If this were not the case, there would be some edge \( ab \in E(G) \) such that both \( a \notin C \) and \( b \notin C \).
From the definition of \( C\), this would mean \( a \in U \) and \( b \notin U\); but then this would imply we have a cut edge \( \overrightarrow{ab} \in E( U , \overline{U}) \) of infinite capacity!
Finally, notice that every vertex in the vertex cover \( C \) contributes a cut edge of capacity 1: vertices \( a \in A \setminus U \subset C \) contribute the cut edges \( \overrightarrow{sa} \), while vertices \( b \in B \cap U \) contribute cut edges \( \overrightarrow{bt} \). Thus, putting it all together, we have
$$
\# M = \operatorname{cap}(U) \ge \# C.
$$
The reverse inequality holds in general graphs by our earlier remarks, so we are done.
Stable Matching
Let \(A = \{ \text{Hospitals} \}\) and \(B = \{ \text{Med Students} \}\).
Form a complete bipartite graph \(G\) with \(V(G) = A \sqcup B\).
Each hospital ranks all students in order of preference: if \(a \in A\) prefers \(b' \in B\) over \(b \in B\), we write \(b' >_a b\).
Similarly, we denote a student's have preferences determined by ranking all hopsticals in \( B \), and we write \(a' >_b a\) if student \( b \) prefers hospital \( a' \) to \( a \).
A matching \(M \subseteq G\) is stable with respect to the given preferences if there are no opportunities to renege on offers; in other words, for every non-matching edge \(ab \in E(G) \setminus M\), at least one of the following is true:
There exists \(b' \in B\) such that \(ab' \in M\) and \(b' >_a b\)
There exists \(a' \in A\) such that \(a'b \in M\) and \(a' >_b a\)
Gale-Shapley Theorem: For any choice of preferences, the graph \( G \) has a stable matching.
The proof of this result is algorithmic: we can construct a stable matching by an alternating sequence of rounds as follows.
Odd Rounds: Each hospital makes an offer to their preferred student among those who have not already rejected them.
Even Rounds: Each student rejects all offers received except the one they most prefer.
The rounds \(1, 2, 3, \ldots \) continue until no further offers can be made. We begin by observing that this process does indeed terminate.
Proposition: For \(m = \# A\) hospitals and \(n = \# A\) med students, there are at most \(mn\) rounds.
Proof: Define, for any positive integer \( k \), the set $$\mathcal{P}_k = \{ (a,b) \mid a \text{ made an offer to } b \text{ by round } 2k \}.$$
As long as there are rounds, the sizes of these sets are strictly increasesing in \( k\):
$$ \#P_1 < \#P_2 < \#P_3 < \dots $$
Since no hospital makes an offer to the same student twice, the maximum possible length of such a sequence is bounded by the total number of possible offers, \(\#(A \times B) = mn\).
By similar reasoning, when \( m \le n \) all \( m \) hospitals are matched with students and when \( n \le m \) all students are matched with hospitals.
Thus, the matching \( M\) constructed by this process is complete.
It remains to show that \( M\) is stable. To see this, let \( ab \in E(G)\) be a non-matched edge. This means that \( a \) is matched in \( M\) with some other \( b ' \in B \) or \( b\) is matched with some other \( a ' \in A\). We now ask: did \( a \) ever made an offer to \( b \)? If so, then it must be the case that \( b \) preferred \( a' \), and if not then \( a \) must haveve preferred \( b' \). In either scenario, the required stability condition holds.
By similar reasoning, when \(m \le n\) all \(m\) hospitals are matched with students, and when \(n \le m\) all students are matched with hospitals.
Thus, the matching \(M\) constructed by this process is maximal.
It remains to show that \(M\) is stable. To see this, let \(ab \notin M\) be a non-matched edge. This means that \(a\) is matched in \(M\) with some other \(b' \in B\), or \(b\) is matched with some other \(a' \in A\). We now ask: did \(a\) ever make an offer to \(b\)?
If yes: Since \(ab \notin M\), \(b\) must have rejected \(a\)'s offer at some point. Students only reject offers if they already hold or receive a better one, and their retained offers only improve over time. Therefore, \(b\)'s final match \(a'\) must be strictly preferred over \(a\), meaning \(a' >_b a\).
If no: Hospitals make offers in strictly decreasing order of preference. Since \(a\) never reached the point of offering to \(b\) before the algorithm terminated, \(a\)'s final match \(b'\) must be strictly higher on its preference list than \(b\), meaning \(b' >_a b\).
In either scenario, the required stability condition holds, proving the graph has no blocking pairs.
Example:
Consider the following preference rankings for 3 Hospitals (MU, UNL, KU) and 3 Students (Alice, Bob, Chad):
Hospitals
Students
MU: Bob > Chad > Alice
Alice (A): MU > UNL > KU
UNL: Chad > Alice > Bob
Bob (B): UNL > KU > MU
KU: Alice > Bob > Chad
Chad (C): KU > MU > UNL
If we run the Gale-Shapley algorithm, the outcome changes drastically depending on who does the proposing.
Hospitals Offer
1. MU offers Bob, UNL offers Chad, KU offers Alice. 2. Nobody to reject. Algorithm terminates! Result: Hospitals get their 1st choice. Students get their 3rd choice.
Students Offer
1. Alice offers MU, Bob offers UNL, Chad offers KU. 2. Similar pattern. Algorithm terminates! Result: Students get their 1st choice. Hospitals get their 3rd choice.
6. Graph Coloring
Basic Definitions and Examples
A proper vertex coloring of a graph \( G \) is a function \( c \) that maps \( V(G) \) to some set of colors \( S \) in such a way that if \( uv \in E(G) \), then \( c(u) \neq c(v) \).
When the context is clear, we simply use the term coloring.
We say \( c \) is a \( k \)-coloring if \( \# S \le k \).
The chromatic number of \( G \), denoted by \( \chi(G) \), is the smallest positive integer \( k \) such that \( G \) has a \( k \)-coloring.
Notice the following:
\( \chi(G) = 1 \iff E(G) = \emptyset \)
\( \chi(G) \le 2 \iff G \) is bipartite. (Indeed, if \( G \) is bipartite, then all edges have the form \(ab \) with \( a \in A, b \in B\), and we may use one color for \(A \) vertices and another for \(B \) vertices. Conversely, given a \( 2 \) coloring of \( G\)'s vertices, we can set \( A \) to be the set of all vertices receiving one color and \( B\) to be the set of vertices receiving the other color.)
For \( k > 2 \), it is unlikely that a simple, complete characterization of graphs \(G \) with \( \chi (G) \le k \) exists.
Graphs with larger chromatic numbers do show up in nature, however.
Below is a famous graph whose chromatic number is \(3\), known as the Petersen graph.
Perhaps the most famous result in graph theory originated from map coloring. If we treat each region of a map as a vertex, and connect bordering regions with an edge, map coloring becomes vertex coloring. Maps drawn on a flat plane or a sphere naturally correspond to planar graphs, which we study more carefully later.
The Four-Color Theorem (Appel-Haken, 1976): Every planar graph is 4-colorable.
All known proofs of this theorem are very difficult, relying on extensive computer calculations. You can learn more about the fascinating history of this result by clicking the link below.
Greedy Coloring and Bounds on the Chromatic Number
A simple way to color a graph is to order the vertices \( v_1, v_2, \dots, v_n \). Having colored \( v_1, \dots, v_{i-1} \), we color \( v_i \) using the least available color (the smallest positive integer not already used by its neighbors).
Theorem: Let \( k := \displaystyle\max_{\substack{H \subseteq G\\ \text{ induced}}} \delta(H) \). Then \( \chi(G) \le k + 1 \).
Proof: Since \( \delta(G) \le k \), let \( x_n \) be a vertex of degree \( \le k \). Then the subgraph \( G \setminus \{x_n\} \) also has minimum degree \( \le k \). Let \( x_{n-1} \) be a vertex of degree \( \le k \) in \( G \setminus \{x_n\} \). Continuing this process constructs a linear ordering \( x_1, x_2, \dots, x_n \) of \( V(G) \).
If we run the greedy algorithm on this ordering, when we go to color \( x_i \), it has at most \( k \) neighbors that precede it in the ordering. Therefore, at most \( k \) colors are forbidden, guaranteeing that a color from the set \( \{1, 2, \dots, k+1\} \) will always be available. The greedy algorithm will use at most \( k+1 \) colors.
Corollary: Since the maximum degree \( \Delta(G) \ge \delta(H) \) for all subgraphs \( H \), it immediately follows that \( \chi(G) \le \Delta(G) + 1 \).
The bound \( \chi(G) \le \Delta(G) + 1 \) is tight for complete graphs and odd cycles, but for most other graphs, we can do better.
Brooks' Theorem: If \( G \) is connected, not complete, and not an odd cycle, then \( \chi(G) \le \Delta(G) \).
The assumptions of Brooks' theorem are necessary, since \( \chi (K_n) = n > n-1 = \Delta (K_n) \), and for odd \( n \) we have \( \chi (C_n) = 3 > 2 = \Delta (C_n) \). To prove Brooks' theorem, we will need two lemmas.
Lemma 1: Brooks' theorem holds under the additional assumption that \( \delta (G) < \Delta (G) \).
Proof: Recall that by greedy coloring we have
$$
\chi (G) \le \displaystyle\max_{\substack{H \subseteq G\\ \text{ induced}}} \delta(H) + 1
$$
Consider the induced subgraph \( H\) which maximizes the right-hand side. If \( H \ne G \), then since \(G \) is connected there exists an edge \( uv \in E(G) \) with \( u \in V(H) \) and \( v \notin V(H) \). Since \( u \) has at most \( \Delta (G) -1 \) neighbors in \(H \), we have
$$
\chi (G) \le \delta (H) + 1 \le d_H (u) + 1 \le (\Delta (G) - 1) + 1 \le \Delta (G).
$$
It remains to consider the case \( H =G\) : here, our assumption that \( \delta (G) < \Delta (G) \) gives us
$$
\chi (G) \le \delta (H) + 1 = \delta (G) + 1 \le (\Delta (G) -1 ) + 1 = \Delta (G).
$$
Lemma 1 reduces the proof Brooks' Theorem to the case where all vertices have the same degree. Such graphs are said to be regular. The next lemma will be used to construct a vertex ordering for regular graphs satisfying the hypotheses of Brooks' theorem.
Lemma 2
If \( G \) is a \( 2 \)-connected regular graph which is not complete, then there exist vertices \( v_1, v_2, v_n \in V(G) \) such that the following conditions hold:
\( v_1v_n , v_2 v_n \in E(G) \)
\( v_1v_2 \notin E(G) \)
\( G \setminus \{ v_1, v_2 \} \) is connected.
First, we show that properties 1 and 2 above are satisfied for some triple of vertices. To see that this is the case, note first that since \(G \) is not complete there must exist a vertex \( v_1 \) with \( \Gamma (v_1) < \# V(G) -1 \). Much like in Lemma 1 above, there is some cut edge \(v_2 v_n \in E(G)\) with \( v_n \in \Gamma (v_1) \) and \( v_2 \notin \Gamma (v_1) \).
Now, if \( G \) is \( 3 \)-connected, then we automatically have that \( G \setminus \{ v_1, v_2 \} \) is connected, completing the proof.
So, it remains to consider the case where \(G \) is \( 2 \)-connected but not \( 3 \)-connected. In this case, we may choose \( v_n \) such that \( G \setminus v_n \) has more than one block.
If we choose two blocks \( B_1 \) and \( B_2 \) which are distinct leaves in the block structure of \(G \), then each \(B_i \) must then contain a vertex \( v_i \) with \( v_i v_n \in E(G) \), completing the proof.
Proof of Brooks' Theorem
Lemma 1 above shows that we may assume \( G\) is regular. We may also assume that \( G \) is \( 2 \)-connected; otherwise, if \( B \subset G \) is a block of maximal chromatic number, the result will follow from
$$
\chi (G) = \chi (B) \le \Delta (B) \le \Delta (G).
$$
Thus, we may assume that \( G\) contains vertices \(v_1, v_2, v_n\) satisfying the conditions of Lemma 2. Since \( G \) is \( 2 \)-connected, we have \( \Delta (G) \ge 2 \).
In fact, we may assume \( \Delta (G) \ge 3 \).
This is because a \( 2 \)-regular connected graph must be a cycle; if the length of this cycle is even, then we already know \( \chi (G) = \Delta (G) =2 \), and if the length is odd then the hypotheses of Brooks' Theorem do not apply.
With all of the assumptions above, we may now construct an ordering used to greedily color \(G \) with \( \Delta (G) \) colors. First, choose \( v_{n-1} \in \Gamma (v_n) \). Note that this is possible since \( \Delta (G) \ge 3.\) Next, we choose \( v_{n-2} \in \Gamma (v_{n-1} ) \cup \Gamma (v_n) \) . Continuing in this manner, we obtain the vertex ordering
$$
v_1 , v_2, \ldots , v_{n-1}, v_n.
$$
Consider now the greedy coloring algorithm using this ordering.
The first two vertices \(v_1, v_2 \) get the same color.
The vertices \( v_3, \ldots , v_{n-1} \) have the property that at least one neighbor appears later: thus, at most \( \Delta (G) \) colors are used for these vertices.
Finally, for \( v_n \), since \( v_1, v_2 \in \Gamma (v_n )\) receive the same color, there is at least one color available among the \( \Delta (G) \) that were already used.
Greedy coloring and Brooks' Theorem give us upper bounds on the chromati number. It is also natural to ask for lower bounds. One simple bound is provided by the independence number \( \alpha (G) \). This relies on the notion of an independent set \( S \subset V(G) \), a set of pairwise nonadjacent vertices. Given any \(k\)-coloring with \( k = \chi (G) \), each set of vertices \( C_i \) receiving a specific color \( i \) must form an independent set. Thus, if we define \( \alpha (G) \) to be the largest size of an independent set in \( G\), we must have
$$
\chi (G) \alpha(G) = k \alpha (G) \ge \# C_1 + \ldots + \# C_k = \# V(G)
\quad
\Rightarrow
\quad
\chi (G) \ge \displaystyle\frac{\# V(G) }{\alpha (G)}.
$$
Another simple lower bound is given by the size of the largest clique in \(G \), known as the clique number \( \omega (G).\) This is easy to see, since each vertex in a clique must receive a different color.
Thus
$$
\chi (G) \ge \max \left( \omega(G) , \displaystyle\frac{\# V(G) }{\alpha (G)} \right)
$$
The Chromatic Polynomial
While the chromatic number tells us the minimum number of colors required to color a graph, we can also ask a broader combinatorial question: given a set of \( k \) available colors, in how many distinct ways can we properly vertex-color the graph? This counting function is denoted by \( \chi_G(k) \). For any graph \( G \), \( \chi_G(k) \) can be expressed as a polynomial in the variable \( k \), and is thus known as the chromatic polynomial.
The chromatic polynomial satisfies a fundamental recursive relation that allows it to be calculated for any graph.
To state this recursion, it will be convenient to define \( k \)-colorings for multigraphs. To do this, we simply require \( c(u) \ne c(v) \) whenever \( u \) and \( v \) are distinct adjacent vertices; in other words, loops can be ignored.
Deletion-Contraction Principle: For any graph \( G \) and any edge \( e \in E(G) \),
$$ \chi_G(k) = \chi_{G \setminus e}(k) - \chi_{G/e}(k) $$
where \( G \setminus e \) is the graph with edge \( e \) deleted, and \( G/e \) is the multigraph obtained by contracting edge \( e \).
Proof:
This is pretty much the same idea as delection-contraction for counting spanning trees. Any proper coloring of \( G \setminus e \) either assigns the same color to both ends of \( e \), or it doesn't. Colorings which do assign the same color corresponding bijectively to colorings in \( G / e \), and colorings which don't assign the same color correspond bijectively with colorings of \( G \).
Using the deletion-contraction principle, we can inductively prove that the chromatic polynomial of any graph \(n \)-vertex, \(m\)-edge graph has a very specific form.
Chromatic polynomial For any graph \( G \) with \( n \) vertices, \( m \) edges, and \( t \) triangles (subgraphs isomorphic to \( K_3 \), and any edge \( e\in E(G) \), there exists a degree-\(n \) polynomial \( \chi_G ( x ) \) with \( \chi_G (k) \) equal to the number of proper \( k \)-colorings of \( G\) for all positive integers \( k \ge 0\), and this polynomial has the form
$$
\chi_G(x) = x^n - m x^{n-1} + \left( \binom{m}{2} - t\right) x^{n-2} + \ldots .
$$
Note: The lower-order coefficients of \( \chi_G (x) \) also have (more complicated) combinatorial interpretations.
To prove this theorem, we will prove a slightly more general statement for multigraphs.
If \( G \) is any multigraph, let \( G' \) denote the simple multigraph obtained by deleting any loops and parallel edges from \( G\).
We write \( m(G) = \# E(G') \) and \( t(G) \) for the number of triangles in \( G'\).
We will show that if \( G \) is any multigraph and \( e\in E(G) \) is a non-parallel edge, we have
$$
\chi_G(x) = x^n - m(G) x^{n-1} + \left( \binom{m(G)}{2} - t(G)\right)x^{n-2} + \ldots .
$$
To prove this, we induct on \( m(G) \).
The base cases are easy to check.
Now, if \( e \in E(G) \) is a non-parallel edge, observe that both \( m(G \setminus e) < m(G) \) and \( m(G/e) < m(G) \).
Thus, the inductive hypotheses apply to both \( G \setminus e \) and \( G / e \), and we may write
$$
\chi_{G/e}(x) = x^{n-1} - m(G/e) x^{n-2} + \ldots ,
$$
and
$$
\chi_{G\setminus e}(x) = x^{n} - m(G \setminus e) x^{n-1} + \left(\binom{m(G\setminus e)}{2} - t(G\setminus e) \right) x^{n-2} + \ldots
$$
By deletion-contraction,
$$
\chi_G (x) = x^n - \left( m(G \setminus e) + 1 \right) x^{n-1} +
\left(\binom{m(G\setminus e)}{2} - t(G\setminus e) + m( G /e)\right) x^{n-2} + \ldots
$$
To see that this is what we want, observe first that $$ m(G\setminus e) = m(G) - 1 .$$
This follows since \( e \) is a non-parallel edge.
As for the \( x^{n-2} \) coefficient, we first observe that
$$
m (G / e) = m(G) - 1 - \# \left( \text{triangles in } G' \text{ containing } e \right),
$$
as any triangle in \( G' \) containing \( e\) contributes two parallel edges to \( G / e \). On the other hand, \( t(G\setminus e) \) counts the triangles in \(G ' \) which do not contain \( e \). Putting it all together, we see that
$$
\binom{m(G\setminus e)}{2} - t(G\setminus e) + m( G /e)
=
\binom{m(G)-1}{2} - t(G) + m(G) - 1 = \binom{m(G)}{2} - t(G),
$$
as needed.
Examples:
Complete Graph \( K_n \): Every vertex is adjacent to every other vertex, meaning all \( n \) vertices must receive a different color. The first vertex has \( k \) available choices, the second has \( k-1 \), the third has \( k-2 \), and so forth. Thus, the chromatic polynomial is \( \chi_{K_n}(k) = k(k-1)(k-2)\cdots(k-n+1) \).
Empty Graph \( \overline{K_n} \): Because there are no edges present, the color choice for any vertex is completely independent of the others. Each of the \( n \) vertices has \( k \) unrestricted choices. Thus, \( \chi_{\overline{K_n}}(k) = k^n \).
Trees: For any tree \( T \) on \( n \) vertices, we can pick an arbitrary root and color it in \( k \) ways. We then color the remaining vertices by traversing outward from the root. Because a tree contains no cycles, each new vertex we visit is adjacent to exactly 1 already-colored vertex (its parent), leaving exactly \( k-1 \) valid color choices. Thus, \( \chi_T(k) = k(k-1)^{n-1} \).
Planar Graphs
A plane graph is a graph \( G \) satisfying the following topological properties:
\( V(G) \subseteq \mathbb{R}^2 \).
For every edge \( e \in E(G) \) with ends \( u \) and \( v \), there exists a continuous curve \( C_e \) with ends \( u \) and \( v \) such that \( e = C_e \setminus \{u,v\} \subseteq \mathbb{R}^2 \setminus V(G) \).
If \( e, e' \in E(G) \) are distinct, then their intersection is empty (\( e \cap e' = \emptyset \)).
Consequently, an edge of a plane graph is a subset of the plane that includes no vertices, not even its own endpoints.
A graph is planar if it is isomorphic to a plane graph, which we refer to as a planar drawing.
The faces of a plane graph \( G \), denoted \( F(G) \), are the connected components of \( \mathbb{R}^2 \setminus G \).
(Note: Our proofs in this section depend on an intuitive grasp of "connected sets" in \( \mathbb{R}^2 \). The term "connected" can be formalized using the language of topology.)
Non-Planar Drawing of \( K_4 \) Edges cross in the center
→
Planar Drawing of \( K_4 \) Isomorphic, but no edge crossings!
If \( G \) has no cycles, then it is a tree. A plane graph that is a forest has exactly one face. Since \( \# E(G) = \# V(G) - 1 \) for a tree, substituting \( \# F(G) = 1 \) yields the formula.
We may therefore assume that \( G \) has a cycle \( C \). Let \( e \in E(C) \), and let \( f_1, f_2 \in F(G) \) be the two faces incident with \( e \). Because \( e \) is part of a cycle, \( f_1 \) and \( f_2 \) must be distinct faces.
When we remove the edge \( e \), the point set \( f_{12} = f_1 \cup e \cup f_2 \) becomes a single face of the new graph \( G \setminus e \), and all other faces remain unchanged. Thus, \( G \setminus e \) has one fewer edge and one fewer face than \( G \). Applying the inductive hypothesis to \( G \setminus e \) completes the proof.
Example of Euler's Formula in Action
Euler's Formula: \( 4 - 5 + 3 = 2 \).
We can use Euler's theorem to prove that all planar graphs are \( 6 \)-colorable.
We can also use Euler's theorem to prove that a graph is non-planar if it has too many edges. The basic tool for this is the following result.
Number of Edges in Planar Graphs
Any planar \( n\)-vertex graph \( G\) must satisfy
$$
\# E(G) \le 3n -6,
$$
and if \( G\) is bipartite then
$$
\# E(G) \le 2n -4.
$$
In the general case, every face is bounded by at least \( 3 \) edges, and each edge bounds at most \( 2 \) faces, so
$$
3 \# F(G) \le 2 \# E(G),
$$
and Euler's formula yields
$$
\# E (G) = \# V(G) + \# F(G) - 2 \le (2/3) \# E(G) + \# V(G) - 2,
$$
so
$$
(1/3) \# E (G) \le \# V(G) - 2,
$$
which gives the result.
In the bipartite case, every face is bounded by at least \( 4 \) vertices, so
$$
4 \# F(G) \le 2 \# E(G),
$$
and we may conclude as in the previous proof.
This last result is already enough to get us "close" to the 4-color theorem.
Corollary
Any planar graph \(G \) is \( 6 \)-colorable, i.e. \( \chi (G) \le 6. \)
We induct on \( n = \# V(G)\), the case \( n =1 \) being trivial.
Using the handshaking lemma and the previous result, we have
$$
\displaystyle\sum_{v\in V(G)} d(v) \le 6n - 12 < 6n,
$$
which implies
$$
\displaystyle\frac{1}{n} \displaystyle\sum_{v\in V(G)} d(v) < 6.
$$
This formula says the average degree of a vertex in \( G\) is less than \( 6\). It follows that \( G \) must have some vertex \( v \) of degree less than \( 6\).
Inductively, there exists a \( 6 \)-coloring \( G \setminus v \), and since \( d (v) < 6 \) this may extended to a \( 6 \)-coloring of \( G\).
Euler's theorem may also be used to show that certain graphs are non-planar. Consider, for example, the complete graph \( K_5 \), shown below.
Since
$$
\# E(G) = 10 > 3 \cdot 5 - 6 = 3 \# V(G) - 6,
$$
we see immediately that \( K_5 \) is non-planar.
As another non-planar example, consider the complete bipartite graph \( K_{3,3} \) shown below:
Here, we have
$$
\# E (G) = 9 > 2 \cdot 6 - 4.
$$
Surprisingly, \(K_5 \) and \(K_{3,3} \) are, in some sense, universal examples of non-planar graphs.
This is the content of Kuratowski's Theorem, which we now state without proof.
A subdivision of a graph \( H \) is obtained by replacing its edges with internally disjoint paths of nonzero length. An \( H \)-subdivision in \( G \) is a subgraph of \( G \) isomorphic to a subdivision of \( H \).
Kuratowski's Theorem For a graph \( G \), the following conditions are equivalent:
\( G \) is planar.
\( G \) has neither any \( K_5 \)-subdivision nor \( K_{3,3} \)-subdivision.
Ramsey Theory
Observation (The Party Problem): Out of 6 people at a party, either some 3 know each other, or some 3 don't know each other.
In graph-theoretic terms, if \( |V(G)| = 6 \), then either \( \omega(G) \ge 3 \) (a clique of size 3) or \( \alpha(G) \ge 3 \) (an independent set of size 3).
Here, \( n = 6 \) is the absolute "best possible" (smallest) number to guarantee this property. If we only have 5 people, it is possible to construct a graph with neither a \( K_3 \) nor an independent set of size 3. The standard counterexample is the 5-cycle (\( C_5 \)).
Alternatively, one may phrase this result in terms of non-proper \(2\)-colorings of the line graph \( L(K_n) \). This is the graph with vertex set \( E(K_n) \), where \( e, e' \in E(K_n) \) are adjacent if they share an end in \( K_n \). The result then states that any (non-proper) \( 2 \)-coloring of \( L(K_n) \) for \( n \ge 6 \) must contain a monochromatic triangle, while for \( n < 6 \) a monochromatic triangle need not exist.
Why \( n=5 \) is not enough
In \( C_5 \), the blue edges contain no triangle, and the red "non-edges" also form a \( C_5 \), containing no triangle.
Definition: Given integers \( k, l \), let the Ramsey Number \( r(k, l) \) denote the smallest integer \( n \) such that every graph \( G \) on \( n \) vertices has either \( \omega(G) \ge k \) or \( \alpha(G) \ge l \).
The party problem establishes that \( r(3, 3) = 6 \). We also have trivial base cases: \( r(k, 1) = 1 \) and \( r(k, 2) = k \) (for \( k \ge 2 \)). Furthermore, by symmetry, \( r(k, l) = r(l, k) \).
Theorem (Ramsey): For all integers \( k, l \ge 2 \), the number \( r(k, l) \) is well-defined and satisfies the recursive bound:
$$ r(k, l) \le r(k, l-1) + r(k-1, l) $$
Proof: We proceed by induction on \( k + l \). We need to show that every graph \( G \) on \( N := r(k, l-1) + r(k-1, l) \) vertices satisfies \( \omega(G) \ge k \) or \( \alpha(G) \ge l \).
Pick an arbitrary vertex \( v \in V(G) \). Because the total number of other vertices is \( n - 1 = r(k, l-1) + r(k-1, l) - 1 \), the Pigeonhole Principle dictates that \( v \) must either have at least \( r(k-1, l) \) neighbors, or it must have at least \( r(k, l-1) \) non-neighbors.
Case 1: \( v \) has \( \ge r(k, l-1) \) non-neighbors.
Let \( H \) be the subgraph of \( G \) induced by the non-neighbors of \( v \). By our inductive hypothesis, \( H \) must contain either a clique of size \( k \) or an independent set of size \( l-1 \). If it contains a clique of size \( k \), we are done. If it contains an independent set of size \( l-1 \), we simply add \( v \) to this set. Since \( v \) is not connected to any vertex in \( H \), the new set is an independent set of size \( l \) in \( G \).
Case 2: \( v \) has \( \ge r(k-1, l) \) neighbors.
The argument is entirely analogous. The subgraph induced by the neighbors of \( v \) must contain an independent set of size \( l \) (in which case we are done) or a clique of size \( k-1 \). We add \( v \) to the clique of size \( k-1 \) to form a clique of size \( k \), completing the proof.
Very little is known about the exact values of Ramsey numbers. For example, when \( k = l = 5 \), it has been shown with the help of computer search that
$$
43 \le r(5,5) \le 46.
$$
See here for a recent development.
Still, despite substantial effort, the exact value is still unknown.