Graph theory
It's just dots and lines
An example
Consider the following graph:
The vertex set is \(\{A,B,C,D,E\}\)
The edge set is \(\{AB, AE, BC, CE, ED\}\)
Yes! A graph is connected if for any two vertices \(u\) and \(w\), there is a list of vertices \(u,v_{1},v_{2},\ldots,v_{k},w\) such that each consecutive pair in the list is adjacent in the graph.
What does connected mean? Is this graph connected?
An example
An extremely useful way to represent a graph is called the adjacency matrix. This is the matrix with rows and columns labeled by the vertices (in the same order). The matrix has a \(1\) if the row and column indices are adjacent, and zero otherwise.
An example
\(\leadsto\)
An example
\(\leadsto\)
An example
A Disconnected example
\(x_{0} = \begin{bmatrix}1\\0\\0\\0\\0\end{bmatrix}\) or \(x_{0} = \begin{bmatrix}0\\0\\0\\1\\0\end{bmatrix}\)
Consider the previous algorithm starting with:
Is it Connected?
The graph is connected!
How many edges do we need to delete to make it disconnected?
The graph has 16 edges, so we could delete each edge, then test again...
There are 120 pairs of edges, so we could delete each pair and test again...
What if that fails?
Is it Connected?
The Graph Laplacian
For a graph with vertices \(v_{1},v_{2},v_{3},\ldots,v_{n}\) the adjacency matrix \(A\) is given by
\[A_{i,j} = \begin{cases} 1 & v_i\text{ is adjacent to }v_{j},\\ 0 & \text{otherwise}.\end{cases}\]
The degree of vertex \(v_{i}\), denoted \(d(v_{i})\) is the number of edges incident with \(v_{i}\), that is \[d(v_{i}) = \sum_{i=1}^{n}A_{i,j}.\]
The Laplacian is the \(n\times n\) matrix \(L\) given by
\[L_{i,j} = \begin{cases} d(v_{i}) & i=j,\\ -A_{i,j} & i\neq j.\end{cases} \]
Consider the previous example:
For any vector \(x\in\mathbb{R}^{n}\) we have
\[x^{\top}Lx = [x_{1}\ \ x_{2}\ \ x_{3}\ \ \cdots\ \ x_{n}]\left[\begin{array}{ccccc}L_{1,1} & L_{1,2} & L_{1,3} & \cdots & L_{1,n}\\ L_{2,1} & L_{2,2} & L_{2,3} & \cdots & L_{2,n}\\[-1ex] L_{3,1} & L_{3,2} & L_{3,3} & & \vdots\\ \vdots & \vdots & & \ddots & \vdots\\ L_{n,1} & L_{n,2} & \cdots & \cdots & L_{n,n}\end{array}\right]\left[\begin{array}{c}x_{1}\\ x_{2}\\ x_{3}\\ \vdots \\ x_{n}\end{array}\right]\]
\[= \sum_{i=1}^{n}\sum_{j=1}^{n}x_{i}x_{j}L_{i,j} = \sum_{i=1}^{n}x_{i}^{2}L_{i,i} - \sum_{i=1}^{n}\sum_{j=1}^{n}x_{i}x_{j}A_{i,j}\]
\[\left[\begin{array}{ccccc}d(v_{1}) & -A_{1,2} & -A_{1,3} & \cdots & -A_{1,n}\\ -A_{2,1} & d(v_{2}) & -A_{2,3} & \cdots & -A_{2,n}\\ -A_{3,1} & -A_{3,2} & d(v_{3}) & & \vdots\\ \vdots & \vdots & & \ddots & \vdots\\ -A_{n,1} & -A_{n,2} & \cdots & \cdots & d(v_{n})\end{array}\right]\]
\[= \sum_{i=1}^{n}x_{i}^{2}\sum_{j=1}^{n}A_{i,j} - \sum_{i=1}^{n}\sum_{i=1}^{n}x_{i}x_{j}A_{i,j} = \sum_{i=1}^{n}\sum_{j=1}^{n}(x_{i}^{2}-x_{i}x_{j})A_{i,j}\]
Thus, since \(A_{i,j} = A_{j,i}\) we have
\[x^{\top}Lx = \sum_{i=1}^{n}\sum_{j=1}^{n}(x_{i}^{2}-x_{i}x_{j})A_{i,j} = \sum_{i=1}^{n}\sum_{j=1}^{n}(x_{j}^{2}-x_{i}x_{j})A_{i,j}\]
Hence
\[x^{\top}Lx = \frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n}(x_{i}^{2}-2x_{i}x_{j}+x_{j}^{2})A_{i,j} = \frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n}(x_{i}-x_{j})^{2}A_{i,j}.\]
For which vectors \(x\) is it the case that
\[x^{\top}Lx = \frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n}(x_{i}-x_{j})^{2}A_{i,j} = 0?\]
This occurs if and only if \(x_{i}=x_{j}\) for all \(i\) and \(j\) such that \(A_{i,j} = 1\).
Thus, \(x^{\top}Lx=0\) if and only if \(x\) is "constant on connected components".
In particular,
\(Lx=0\) \(\Rightarrow\) \(x^{\top}Lx = 0\)\(\Rightarrow\) \(x\) is constant on connected components.
Example
For this vector \(Lx = 0\):
For a connected graph:
Instead of \(Lx=0\), we look for \(x\neq 0\) such that \(Lx=\lambda x\) for the smallest \(\lambda\).
w/ \(\lambda = 0.3033351\)
\(A=\)



Part 1:
Fundamental Concepts
Graphs
Definition 1.1.2. A graph \(G\) is a triple consisting of a vertex set \(V(G)\), an edge set \(E(G)\), and a relation that associates with each edge two vertices (not necessarily distinct) called its endpoints.
Example. Note that the vertex set is \(\{v_{1},v_{2},v_{3},v_{4},v_{5}\}\) and the edge set is \(\{e_{1},e_{2},e_{3},e_{4},e_{5}\}\).
The endpoints of \(e_{4}\) are \(v_{3}\) and \(v_{4}\).
Example. The vertex set is \(\{v_{1},v_{2},v_{3},v_{4},v_{5}\}\) and the edge set is \(\{e_{1},e_{2},e_{3},e_{4},e_{5},e_{6}\}\).
Both \(e_{1}\) and \(e_{6}\) have endpoints \(v_{1}\) and \(v_{2}\), thus they are multiple edges.
Example. Note that the vertex set is \(\{v_{1},v_{2},v_{3},v_{4},v_{5}\}\) and the edge set is \(\{e_{1},e_{2},e_{3},e_{4},e_{5},e_{6},e_{7}\}\).
The edge \(e_{7}\) has only one endpoint, this type of edge is called a loop.
If \(u\) and \(v\) are endpoints of an edge, they are adjacent and are neighbors, and we write \(u\leftrightarrow v\)
Simple Graphs
A graph without multiple edges and without loops is called a simple graph.
In a simple graph we can name the edges by their endpoints:
In the following graph, the edge set is \(\{v_{1}v_{2},v_{1}v_{3},v_{2}v_{4}, v_{3}v_{4}, v_{4}v_{5}\}\)
Definition 1.1.8.
- The complement \(\overline{G}\) of a simple graph \(G\) is the simple graph with vertex set \(V(G)\) defined by \(uv\in E(\overline{G})\) if and only if \(uv\notin E(G)\).
- A clique in a graph is a set of pariwise adjacent vertices.
- An independent set (or stable set) in a graph is a set of pairwise nonadjacent vertices.
Example.
\(G\)
\(\overline{G}\)
\(\{v_{2},v_{3},v_{5}\}\) is a clique in \(\overline{G}\)
\(\{v_{2},v_{3},v_{5}\}\) is an independent set in \(G\)
Example 1.1.7. Consider a group of 5 people. Is there always a group of three who are all mutual acquaintances or mutual strangers? In other words, for every simple graph on 5 vertices \(G\), does either \(G\) or \(\overline{G}\) contain a clique of size 3?
\(G\)
\(\overline{G}\)
What about in a group of 6 people?
Definition 1.1.10. A graph \(G\) is bipartite if \(V(G)\) is the union of two disjoint (possibly empty) independent sets called partite sets of \(G\).
Example.
Definition 1.1.15.
- A path is a simple graph whose vertices can be ordered so that two vertices are adjacent if and only if they are consecutive in the list.
- A cycle is a graph with an equal number of vertices and edges whose vertices can be placed around a circle so that two vertices are adjacent if and only if they appear consecutively along a circle.
Path
Path
Cycle
Cycle
Neither
Definition 1.1.16.
- A subgraph of a graph \(G\) is a graph \(H\) such that \(V(H)\subseteq V(G)\) and \(E(H)\subseteq E(G)\) and the assignment of endpoints in \(H\) is the same as in \(G\). We write \(H\subseteq G\) and say "\(G\) contains \(H\)".
- A graph \(G\) is connected if each pair of vertices in \(G\) belongs to a path contained in \(G\).
Example. The red vertices and edges are a subgraph. This subgraph is a path.
Example.
Matrices and IsoMorphism
Consider the simple graph with
\[V(G) = \{a,b,c,d,e\}\quad\text{and}\quad E(G) = \{ab,bc,cd,ac,ae\}\]
Consider the graph \(H\) where \[V(H) = \{a,b,c,d,e\}\quad\text{and}\quad E(H) = \{bc,cd,de,bd,ba\}.\]
Definition 1.1.17. Let \(G\) be a loopless graph with vertex set \(V(G) = \{v_{1},\ldots,v_{n}\}\) and edge set \(E(G) = \{e_{1},\ldots,e_{m}\}\). The adjacency matrix of \(G\), written \(A(G)\) is the \(n\times n\) matrix with entry in row \(i\), column \(j\) is the number of edges in \(G\) with endpoints \(\{v_{i},v_{j}\}\). The incidence matrix \(M(G)\) is the \(n\times m\) matrix in which the entry in row \(i\), column \(j\) is \(1\) if \(v_{i}\) is an endpoint of edge \(e_{j}\), and zero otherwise.
If vertex \(v\) is an endpoint of edge \(e\), then \(v\) and \(e\) are incident. The degree of a vertex (in a loopless graph) is the number of incident edges.
Example. Consider the simple graph with
\[V(G) = \{a,b,c,d,e\}\quad\text{and}\quad E(G) = \{ab,bc,cd,ac,ae\}\]
\[A(G) = \left[\begin{array}{ccccc} 0 & 1 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0\end{array}\right]\]
\[M(G) = \left[\begin{array}{ccccc} 1 & 0 & 0 & 1 & 1\\ 1 & 1 & 0 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 1\end{array}\right]\]
\[A(G_{1}) = \left[ \begin{array}{cccccc} 0 & 1 & 1 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \end{array} \right] \]
\[A(G_{2}) = \left[ \begin{array}{cccccc} 0 & 1 & 1 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \end{array} \right]\]
Are these graphs "the same"?
Graph isomorphism
Definition 1.1.20. An isomorphism from a simple graph \(G\) to a simple graph \(H\) is a bijection \(f:V(G)\to V(H)\) such that \(uv\in E(G)\) if and only if \(f(u)f(v)\in E(H)\). We say that "\(G\) is isomorphic to \(H\)", written \(G\cong H\), if there is an isomorphism from \(G\) to \(H\).
Consider the simple graph \(G\) with \[V(G) = \{a,b,c,d,e\}\] and \[E(G) = \{ab,bc,cd,ac,ae\}\]
Consider the simple graph \(H\) with \[V(H) = \{a,b,c,d,e\}\] and \[E(H) = \{bc,cd,de,bd,ba\}.\]
The function \(f:V(G)\to V(H)\) such that
\[f(a)=b\]
\[f(b)=c\]
\[f(c)=d\]
\[f(d)=e\]
\[f(e)=a\]
is an isomorphism from \(G\) to \(H\).
Proposition. If \(f\) is an isomorphism from \(G\) and \(H\), then for any \(v\in V(G)\) the degrees of \(v\) and \(f(v)\) are the same. Moreover, if
\[d_{1},d_{2},\ldots,d_{n}\quad\text{and}\quad d_{1}',d_{2}',\ldots,d_{n}'\]
are the lists of the degrees of their vertices of \(G\) and \(H\), respectively, listed in nonincreasing order, then these lists are identical.
Proof. Consider a vertex \(v\in V(G)\) with degree \(d\). This means that there are \(d\) other vertices \(v_{1},v_{2},\ldots, v_{d}\) that are adjacent to \(v\), that is \(vv_{i}\in E(G)\) for each \(i\in\{1,2,\ldots,d\}\). By the definition of an isomorphism, the vertices adjacent to \(f(v)\) are exactly \(f(v_{1}),\ldots,f(v_{d})\). Thus \(f(v)\) has degree \(d\). \(\Box\)
Example. None of the following graphs are isomorphic:
Definition. A permutation matrix is a square matrix with entries in \(\{0,1\}\) and exactly one \(1\) in each row and each column.
Example. Some permutation matrices:
\[\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}\]
\[\begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix}\]
\[\begin{bmatrix} 0 & 1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1\end{bmatrix}\]
\[\begin{bmatrix} 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0\end{bmatrix}\]
Multiplying a matrix by a permutation on the left permutes the rows:
\[\begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 1 & 0 & 0\end{bmatrix}\begin{bmatrix} a & b & c\\ d & e & f\\ g & h & i\end{bmatrix} = \begin{bmatrix} d & e & f\\ g & h & i\\ a & b & c\end{bmatrix}\]
Multiplying a matrix by a permutation on the right permutes the columns:
\[\begin{bmatrix} a & b & c\\ d & e & f\\ g & h & i\end{bmatrix}\begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 1 & 0 & 0\end{bmatrix} = \begin{bmatrix} c & a & b\\ f & d & e\\ i & g & h\end{bmatrix}\]
Permutation matrices
Rows: \((1,2,3)\mapsto (3,1,2)\)
Columns: \((1,2,3)\mapsto (2,3,1)\)
\[\begin{bmatrix} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0\end{bmatrix}\begin{bmatrix} a & b & c\\ d & e & f\\ g & h & i\end{bmatrix} \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 1 & 0 & 0\end{bmatrix}= \begin{bmatrix} i & g & h\\ c & a & b\\ f & d & e\end{bmatrix}\]
\(1\)
\(2\)
\(3\)
\(1\)
\(2\)
\(3\)
If we multiply by \(P\) on the right and \(P^{\top}\) on the left, then we permute the rows and columns in the same way:
Isomorphism: \((1,2,3)\mapsto (2,3,1)\)
\[\begin{bmatrix} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0\end{bmatrix}\begin{bmatrix} 0 & 1 & 1\\ 1 & 0 & 0\\ 1 & 0 & 0\end{bmatrix} \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 1 & 0 & 0\end{bmatrix}= \begin{bmatrix} 0 & 1 & 0\\ 1 & 0 & 1\\ 0 & 1 & 0\end{bmatrix}\]
Consider permuting the rows and columns of an adjacency matrix:
Theorem. Two simple graphs \(G\) and \(H\) are isomorphic if and only if there is a permutation matrix \(P\) such that
\[A(H) = P^{\top}A(G)P.\]
Thus, if we can find a permutation matrix such that \(A(H) = P^{\top}A(G)P\), we can conclude \(G\) and \(H\) are isomorphic. If \(G\) and \(H\) are not isomorphic, it is harder to prove.
Definition 1.1.25. An isomorphism class of graphs is an equivalence class of graphs under the isomorphism relation.
Example. Every simple graph on \(2\) vertices is isomorphic to one of the following:
So, there are two isomorphism classes of graphs on \(2\) vertices.
Example. How many isomorphism classes are there on \(3\) vertices?
The "structural" properties of a graph are the same for all isomorphic graphs. For example, number of edges, number of vertices, degree of vertices (already proven), sizes of cliques, sizes of independent sets, etc.
independent set of size \(4\)
NO independent set of size \(4\)
\(\not\cong\)
Connection
in
Graphs
Definition 1.2.2.
- A walk is a list \(v_{0},e_{1},v_{1},\ldots,e_{k},v_{k}\) of vertices and edges such that, for \(i\in\{1,2,\ldots,k\}\), the edge \(e_{i}\) has endpoints \(v_{i-1}\) and \(v_{i}\).
- A trail is a walk with no repeated edge.
- A \(u,v\)-walk or \(u,v\)-trail has first vertex \(u\) and last vertex \(v\); the vertices \(u\) and \(v\) are called its endpoints.
- A \(u,v\)-path is a path whose endpoints are \(u\) and \(v\); the other vertices are called internal vertices.
- The length of a walk, trail, path, or cycle is its number of edges. A walk or trail is closed if its endpoints are the same.
Lemma 1.2.5. Every \(u,v\)-walk contains a \(u,v\)-path.
Proof. (On the board)
Example. A walk with a repeated vertex:
Definition 1.2.6. A graph is connected if for every pair of vertices \(u\) and \(v\), there is a \(u,v\)-path contained in the graph. Otherwise, we say that the graph is disconnected.
If \(G\) has a \(u,v\)-path, then we say that \(u\) is connected to \(v\) in \(G\).
Definition 1.2.8. The components of a graph \(G\) are its maximal connected subgraphs. A component is trivial if it has no edges otherwise it is nontrivial. An isolated vertex is a vertex of degree \(0\).
Proposition 1.2.11. Every graph with \(n\) vertices and \(k\) edges has at least \(n-k\) components.
Note, if a graph \(G\) contains a \(u,v\)-path and a \(v,w\)-path, it is not clear that \(G\) contains a \(u,w\)-path. However, if we concatenate these paths, then we get a \(u,w\)-walk which contains a \(u,w\)-path by Lemma 1.2.5. Thus, the connection relation on vertices is transitive. It is also reflexive (vertices are connected to themselves), and symmetric (since paths are reversible).
Proof. Adding an edge to a graph decreases the number of connected components by at most \(1\). \(\Box\)
Definition 1.2.12.
- A cut-edge or cut-vertex of a graph is an edge or vertex, respectively, whose deletion increases the number of components.
- We write \(G-e\) or \(G-M\) for the subgraph of \(G\) obtained by deleting an edge \(e\) or a set of edges \(M\).
- We write \(G-v\) or \(G-S\) for the subgraph obtained by deleting a vertex \(v\) or a set of vertices \(S\).
- An induced subgraph is a subgraph obtained by deleting a set of vertices.
- We write \(G[T]\) for \(G-\overline{T}\), where \(\overline{T} = V(G)-T\); this is called the subgraph of \(G\) induced by \(T\).
Cut-edges: \(ab\)
Cut-vertices: \(b, d\)
If \(T = \{a,b,c,e,f\}\) then \(G[T]\) is shown in red.
Theorem 1.2.14. An edge is a cut-edge if and only if it belongs to no cycle.
Proof. (On the board)
Note that this theorem is the statemet that the following two implications about an edge \(e\) in a graph \(G\) both hold:
\(e\) is a cut-edge \(\Rightarrow\) \(e\) belongs to no cycle
and
\(e\) belongs to no cycle \(\Rightarrow\) \(e\) is a cut-edge
Given an implication \(A\Rightarrow B\), it is often useful to consider the equivalent statement \(\sim B\Rightarrow \sim A\), which is called the contrapositive. (Here \(\sim A\) is the statement "\(A\) does not hold".)
Thus, we could instead prove the contrapositives of the above implications
\(e\) belongs to a cycle \(\Rightarrow\) \(e\) is not a cut-edge
and
\(e\) is a not a cut-edge \(\Rightarrow\) \(e\) belongs to a cycle
Eulerian Circuits

Seven Bridges of Konigsberg
Is there a path that crosses all 7 bridges exactly once?

Seven Bridges of Konigsberg
Is there a path that crosses all 7 bridges exactly once?

Seven Bridges of Konigsberg
Is there a path that crosses all 7 bridges exactly once?
Definition 1.2.24.
- A graph is Eulerian if it has a closed trail containing all its edges.
- A circuit is a closed trail with vertices listed in cyclic order.
- An Eulerian circuit or Eulerian trail is a circuit or a trail (resp.) containing all the edges.
- An even graph is a graph with vertex degrees all even. We call a vertex odd or even when it has odd or even degree, respectively.
Lemma 1.2.25. If every vertex of a graph \(G\) has degree at least 2, then \(G\) contains a cycle.
Theorem 1.2.26. A graph \(G\) is Eulerian if and only if it has at most one nontrivial component, and all its vertices have even degree.
Proof idea. By Lemma 1.2.25 the graph \(G\) contains a cycle. If we delete all the edges in that cycle, then new graph has fewer edges, but each vertex still has even degree. Thus, we can use induction on the number of edges. (Details are on the board and in the text.)
Proof. (On the board and in the text.)
Consider a path \(P\) in a graph \(G\). If there is another path \(Q\neq P\) such that \[P\subseteq Q\subseteq G,\] then we call \(Q\) an extension of \(P\). Since \(G\) only has finitely many vertices, we cannot extend a path forever. If a path \(P\subseteq G\) has no extension, then we call \(P\) a maximal path.
Proposition 1.2.27. Every even graph decomposes into cycles.
Proposition 1.2.28. If \(G\) is a simple graph in which every vertex has degree at least \(k\), then \(G\) contains a path of length at least \(k\). If \(k\geq 2\), then \(G\) contains a cycle of length at least \(k+1\).
Proposition 1.2.29. Every graph with at least one nonloop edge has at least two vertices that are not cut vertices.
Theorem 1.2.33. For a connected nontrivial graph with exactly \(2k\) odd vertices, the minimum number of trails that decompose it is \(\max\{k,1\}\).
Note: This "decomposition" is a partition of the edges. The cycles may share vertices. Indeed, every vertex of degree \(\geq 2\) must be in more than one cycle.
Vertex Degrees and counting
Definition 1.3.1.
- The degree of a vertex \(v\) in a graph \(G\), written \(d_{G}(v)\) or \(d(v)\), is the number of edges incident to \(v\), except that each loop at \(v\) counts twice.
- The maximum degree is denoted \(\Delta(G)\), the minimum degree is denoted \(\delta(G)\), and \(G\) is regular if \(\Delta(G) = \delta(G)\).
- The graph \(G\) is \(k\)-regular if \(\Delta(G) = \delta(G) = k\).
- The neighborhood of \(v\), denoted \(N_{G}(v)\) or \(N(v)\), is the set of vertices adjacent to \(v\).
Regular graphs and Degree
\(1\)
\(1\)
\(2\)
\(2\)
\(2\)
\(4\)
\(\Delta(G) = 4\) and \(\delta(G) = 1\)
Example.
The Petersen Graph
Definition 1.1.36. The Petersen graph is the simple graph with vertices consisting of all \(2\)-element subsets of \(\{1,2,3,4,5\}\), that is,
\[V(G) = \big\{\{1,2\},\{1,3\},\{1,4\},\{1,5\}, \{2,3\}, \{2,4\}, \{2,5\}, \{3,4\},\{3,5\},\{4,5\}\big\},\]
and two vertices are adjacent if the sets are disjoint.
Note that
\(\Delta(G) = \delta(G) = 3\)
Thus, the Petersen graph is \(3\)-regular.
Definition 1.1.27.
- The path and cycle with \(n\) vertices are denoted \(P_{n}\) and \(C_{n}\), respectively. An \(n\)-cycle is a cycle with \(n\) vertices.
- A complete graph is a simple graph whose vertices are pairwise adjacent. The complete graph on \(n\) vertices is denoted \(K_{n}\)
- A complete bipartite graph or biclique is a simple bipartite graph such that two vertices are adjacent if and only if they are in different partite sets. When the partite sets have sizes \(r\) and \(s\), the graph is denoted \(K_{r,s}\)
Some important graphs
Definition 1.3.2.
- The order of a graph \(G\), written \(n(G)\), is the number of vertices in \(G\).
- An \(n\)-vertex graph is a graph of order \(n\).
- The size of a graph \(G\), written \(e(G)\), is the number of edges in \(G\).
- For \(n\in\mathbb{N}\), we define \([n]: = \{1,2,3,\ldots,n\}\).
Proposition 1.3.3. (Degree-Sum Formula) If \(G\) is a graph, then
\[\sum_{v\in V(G)}d(v) = 2e(G).\]
Proof. Recall that \(d(v)\) is the number of edges with endpoint \(v\). Since each edge has two endpoints, adding up all the degrees we count each edge twice. \(\Box\)
Corollary 1.3.4. In a graph \(G\), the average vertex degree is \(\frac{2e(G)}{n(G)}\), and hence
\[\delta(G)\leq \frac{2e(G)}{n(G)}\leq \Delta(G)\]
Corollary 1.3.5. Every graph has an even number of vertices of odd degree. No graph of odd order is regular with odd degree.
Corollary 1.3.6. A \(k\) regular graph with \(n\) vertices has \(nk/2\) edges.
Proposition 1.3.9. If \(k>0\), then a \(k\)-regular bipartite graph has the same number of vertices in each partite set.
regular bipartite graphs
\(X\)
\(Y\)
Example. Consider the \(2\)-regular bipartite graph below
- 4 vertices in \(X\)
- Each is incident with \(2\) edges
- This is all the edges!
- Same is true for \(Y\)
Proof. Let \(X\) and \(Y\) be the partite sets, then \[e(G) = k|X| = k|Y|.\] Thus \(|X| = |Y|\). \(\Box\)
6-cycles in the petersen graph
6-cycles in the petersen graph
Delete vertex \(\{i,j\}\) and the vertices adjacent to it.
The remaining vertices are the two element sets that contain either \(i\) or \(j\).
\[\{i,k_{1}\},\{i,k_{2}\},\{i,k_{3}\}\]
and
\[\{j,k_{1}\},\{j,k_{2}\},\{j,k_{3}\}\]
Cycle:
\[\{i,k_{1}\},\{j,k_{3}\},\{i,k_{2}\},\{j,k_{1}\}\{i,k_{3}\},\{j,k_{2}\}\]
\(\#\) cycles \(\geq \#\) vertices:
6-cycles in the petersen graph
Consider a 6-cycle \(F\) in the graph.
Cycle:
\[\{a_{1},b_{1}\},\{a_{2},b_{2}\},\{a_{3},b_{3}\},\]
\[\{a_{4},b_{4}\},\{a_{5},b_{5}\},\{a_{6},b_{6}\}\]
\(\#\) cycles \(\leq \#\) vertices:
Two \(i\) and \(j\) numbers show up three times on this list.
Hence, this cycle is the one we obtained by deleting vertex \(\{i,j\}\) and its neighbors.
Proposition 1.3.11 For a simple graph \(G\) with vertices \(v_{1},\ldots,v_{n}\) and \(n\geq 3\),
\[e(G) = \frac{1}{n-2}\sum_{i=1}^{n}e(G-v_{i})\quad\text{and}\quad d_{G}(v_{j}) = \frac{1}{n-2}\sum_{i=1}^{n} e(G-v_{i}) - e(G-v_{j})\]
Conjecture 1.3.12. (Reconstruction Conjecture) If \(G\) is a simple graph with at least three vertices, then \(G\) is uniquely determined by it's list of vertex-deleted subgraphs.
A subgraph obtained by deleting a single vertex is called a vertex-deleted subgraph.
Vertex-deleted subgraphs
Examples.
- The vertex-deleted subgraphs of the cycle of length \(n\), \(C_{n}\), are all \(P_{n-1}\).
- The vertex-deleted subgraphs of the path of length, \(P_{n}\), are \[P_{n-1},P_{1}+P_{n-2},P_{2}+P_{n-3},\ldots,P_{n-2}+P_{1},P_{n-1}.\]
Example. Consider the following vertex-deleted subgraphs:
What order 5 graph?
Example. Consider the graph \(G\) and its vertex-deleted subgraphs:
Extremal Problems
Proposition 1.3.13. The minimum number of edges in a connected graph with \(n\) vertices is \(n-1\).
Proposition 1.3.15. If \(G\) is a simple graph with \(n\) vertices and \[\delta(G)\geq (n-1)/2,\] then \(G\) is connected.
Example 1.3.16. We wish to show that the inequality in Proposition 1.3.15 is sharp, that is, for any \(n\) there exists an \(n\)-vertex graph \(G\) such that \(\delta(G)<(n-1)/2\) and \(G\) is disconnected.
For even \(n\) consider \(K_{n/2}+K_{n/2}\), for odd \(n\) consider \(K_{\frac{n-1}{2}} +K_{\frac{n+1}{2}}\).
Definition 1.3.17. The union of two graphs \(G\) and \(H\) with disjoint vertex sets, is called their disjoint union or sum, and it is denoted \(G+H\). The disjoint union of \(m\) copies of \(G\) is denoted \(mG\).
degree sequences
Definition 1.3.27. The degree sequence of a graph is the list of vertex degrees, usually written in nonincreasing order \(d_{1}\geq \cdots\geq d_{n}\).
If \(d_{1},\cdots, d_{n}\) is the degree sequence of a graph \(G\), then the vertex-sum formula implies \(\sum_{i=1}^{n}d_{i}\) is even.
To be a degree sequence, it is necessary that \(\sum_{i=1}^{n}d_{i}\) is even. Is this condition also sufficient?
w/o loops, but w/ multiple edges, things are more complicated:
Exercise 1.3.56. The nonnegative integers \(d_{1}\geq\ldots\geq d_{n}\) are the vertex degree of some graph if and only if \(\sum_{i=1}^{n}d_{i}\) is even and \(d_{1}\leq d_{2}+\ldots+d_{n}\).
With loops in our graphs, yes!
Proposition 1.3.28. The nonnegative integers \(d_{1},\ldots,d_{n}\) are the vertex degree of some graph if and only if \(\sum_{i=1}^{n}d_{i}\) is even.
Theorem 1.3.31. For \(n>1\), an integer list \(d\) of size \(n\) is graphic if and only if \(d'\) is graphic, where \(d'\) is obtained from \(d\) by deleting the largest element \(\Delta\) of \(d\) and subtracting \(1\) from each of its \(\Delta\) next largest elements. The only \(1\)-element graphic sequence is \(d_{1}=0\).
Definition 1.3.29. A graphic sequence is a list of nonnegative number that is the degree sequence of some simple graph.
Graphic sequences
What about degree sequences of simple graphs?
Example. The degree sequences of both graphs are \(3,2,2,1,1,1\)
But these are not isomorphic graphs!
\[\begin{array}{r|r|r|r|r|r|r|r|r}i & 1 & 2 & 3 & & \Delta+1 & \Delta+2 & & n\\\hline\\ d & \Delta = d_{1} & d_{2} & d_{3} & \ldots & d_{\Delta+1} & d_{\Delta+2} & \ldots, & d_{n}\\\\\hline\\d' & & d_{2}-1 & d_{3}-1 & \ldots & d_{\Delta+1}-1 & d_{\Delta+2} & \ldots & d_{n} \end{array}\]
\[\begin{array}{r|r|r|r|r|r|r|r|r}i & 1 & 2 & 3 & & \Delta+1 & \Delta+2 & & n\\\hline\\ d & \phantom{\Delta = }d_{1} & d_{2} & d_{3} & \ldots & d_{\Delta+1} & d_{\Delta+2} & \ldots, & d_{n}\\\\\hline \\ d' & & \phantom{d_{2}-1} & \phantom{d_{3}-1} & \phantom{\ldots} & \phantom{d_{\Delta+1}-1} & \phantom{d_{\Delta+2}} & \phantom{\ldots} & \phantom{d_{n}} \end{array}\]
Example. Consider the sequence \(d = (3,3,2,1,1)\).
\(d = (3,3,2,1,1)\ \leadsto\ d' = (2,1,0,1)\)
\(d' = (2,1,1,0)\ \leadsto\ d'' = (0,0,0)\)
\(\leadsto\)
Reorder
\(d' = (2,1,1,0)\ \phantom{\leadsto\ d'' = (0,0,0)}\)
How to build \(d'\) from \(d\): Suppose \(d_{1}\geq \cdots\geq d_{n}\)
The sequence \(d = (3,2,2,2,1)\) is graphic since:
Deleting the degree 3 \(\rightarrow\)
So \((2,1,1,0)\) is graphic, but why is \(d' = (1,1,1,1)\) graphic?
We want a graph with degree sequence \((3,\underbrace{2,2,2},1)\) AND...
these vertices
this one's neighbors are...
Why does \(d\) graphic \(\Rightarrow\) \(d'\) graphic?
\[\begin{array}{c|ccccc} \text{vertices} & v_{1} & v_{2} & v_{3} & v_{4} & v_{5}\\\hline \text{degrees} & 3 & 2 & 2 & 2 & 1\end{array}\]
\(N(v_{1}) = \{v_{2},v_{4},v_{5}\}\)
Modify the graph so that \(v_{3}\leftrightarrow v_{1}\) and \(v_{5}\not\leftrightarrow v_{1}\)
BUT, keep degrees the same
\(v_{1}\)
\(v_{2}\)
\(v_{3}\)
\(v_{4}\)
\(v_{5}\)
Add: \(v_{1}v_{3}\)
Delete: \(v_{1}v_{5}\)
Pick a vertex y:
\(y\leftrightarrow v_{3}\) and \(y\not\leftrightarrow v_{5}\)
Delete: \(yv_{3}\)
Add: \(yv_{5}\)
\(v_{1}\)
\(v_{2}\)
\(v_{3}\)
\(v_{4}\)
\(v_{5}\)
\(v_{1}\)
\(v_{2}\)
\(v_{3}\)
\(v_{4}\)
\(v_{5}\)
Directed graphs
Definition 1.4.2.
A directed graph or digraph \(G\) is a triple consisting of a vertex set \(V(G)\), an edge set \(E(G)\), and function assigning each edge an ordered pair of vertices. The first vertex in the ordered pair is the tail of the edge, and the second is the head; together, they are the endpoints. We say that an edge is from its tail to its head.
What is a Directed graph
Example. Let \(V(G) = \{v_{1},v_{2},v_{3},v_{4},v_{5}\}\) and \(E(G) = \{e_{1},e_{2},e_{3},e_{4},e_{5},e_{6}\}\)
and the function that assigns edges to points is given by
\[f(e_{1}) = (v_{1},v_{2}),\quad f(e_{2}) = (v_{2},v_{3}),\quad f(e_{3}) = (v_{3},v_{5})\]
\[f(e_{4}) = (v_{4},v_{4}),\quad f(e_{5}) = (v_{2},v_{1}),\quad f(e_{6}) = (v_{3},v_{5})\]
Definition 1.4.3. In a digraph:
- A loop is an edge whose endpoints are equal.
- Multiple edges are edges having the same ordered pair of endpoints.
- The digraph is simple if each ordered pair is the head and tail of at most one edge (Note: loops are allowed!)
In a simple digraph:
- We write \(uv\) for an edge with tail \(u\) and head \(v\).
- If \(u\neq v\), then the edges \(uv\) and \(vu\) are different.
- If there is an edge from \(u\) to \(v\), then \(u\) is a predecessor of \(v\), and \(v\) is a successor of \(u\).
- We use \(u\to v\) to denote "there is an edge from \(u\) to \(v\)."
Not simple!
Definition 1.4.6. A digraph \(G\) is a path if it is simple, and all of the vertices can be listed (without repetition) \[v_{1},v_{2},\ldots,v_{n}\] such that \[E(G) = \{v_{1}v_{2}\ ,\ v_{2}v_{3}\ ,\ v_{3}v_{4}\ ,\ \ldots\ ,\ v_{n-1}v_{n}\}\]
A digraph is a cycle if it is simple, and all of the vertices can be listed (without repetition) \[v_{1},v_{2},\ldots,v_{n}\] such that \[E(G) = \{v_{1}v_{2}\ ,\ v_{2}v_{3}\ ,\ v_{3}v_{4}\ ,\ \ldots\ ,\ v_{n-1}v_{n}\ ,\ v_{n}v_{1}\}\]
Cycle
Path
Neither
Example: Markov Chain
\[P=\left[\begin{array}{rrr}0 & 0.9 & 0.1\\ 1 & 0 & 0\\ 0.1 & 0.1 & 0.8 \end{array}\right]\]
Given a vector of nonnegative entries \[\mathbf{x} = [x_{A}\ \ x_{B}\ \ x_{C}]\quad\text{ such that }\quad x_{A}+x_{B}+x_{C}=1,\] we interpret \(x_{i}\) as the probability that we're in state \(i\)
Then \(\mathbf{x}P\) gives the probabilities that we're in each state after another step.
Example: Markov Chain
\[P=\left[\begin{array}{rrr}0 & 0.9 & 0.1\\ 1 & 0 & 0\\ 0.1 & 0.1 & 0.8 \end{array}\right]\]
Let \(\mathbf{x}_{n}\) be the vector of probabilities after \(n\) steps.
If we start at \(A\), then \(\mathbf{x}_{0} = [1\ \ 0\ \ 0]\), and
\[\mathbf{x}_{1} = \mathbf{x}_{0}P = [0\ \ 0.9\ \ 0.1]\]
\[\mathbf{x}_{2} =\mathbf{x}_{1}P = \mathbf{x}_{0}P^2 = [0.91\ \ 0.01\ \ 0.08]\]
\[\mathbf{x}_{3} =\mathbf{x}_{2}P = \mathbf{x}_{0}P^3 = [0.018\ \ 0.827\ \ 0.155]\]
\[\mathbf{x}_{100} = \mathbf{x}_{0}P^{100} \approx [0.410706\ \ 0.385357\ \ 0.203936]\]
\(\vdots\)
Digraph degrees
Definition 1.4.17. Let \(v\) be a vertex in a digraph.
- The outdegree \(d^{+}(v)\) is the number of edges with tail \(v\).
- The indegree is the number of edges with head \(v\).
- The out-neighborhood or successor set \(N^{+}(v)\) is the set \[\{x\in V(G) : v\to x\}.\]
- The in-neighborhood or predecessor set \(N^{-}(v)\) is the set \[\{x\in V(G) : x\to v\}.\]
- The minimum and maximum indegree are \(\delta^{-}(G)\) and \(\Delta^{-}(G)\); for outdegree we use \(\delta^{+}(G)\) and \(\Delta^{+}(G)\).
Proposition 1.4.18. In a digraph \(G\), \[\sum_{v\in V(G)}d^{+}(v) = e(G) = \sum_{v\in V(G)}d^{-}(v).\]
Proposition 1.4.19. A list of ordered pairs of nonnegative integers is realizable as the degree pairs of a digraph if and only if the sum of the first coordinates equals the sum of the second coordinates.
Eulerian Digraphs
Definition 1.4.22.
- An Eulerian trail in a digraph is a trail containing all edges.
- An Eulerian circuit is a closed trial containing all edges.
- A digraph is Eulerian if it has an Eulerian circuit.
Lemma 1.4.23. If \(G\) is a digraph with \(\delta^{+}(G)\geq 1\) or \(\delta^{-}(G)\geq 1\), then \(G\) contains a cycle.
Theorem 1.4.24. A digraph is Eulerian if and only if \(d^{+}(v) = d^{-}(v)\) for each vertex \(v\) and the underlying graph has at most one nontrivial component.
Definition 1.4.9. The underlying graph of a digraph \(D\) is the graph \(G\) obtained by treating the edges of \(D\) as unordered pairs.
We have already seen that graphs are Eulerian if and only if they are even. What about digraphs?
Trees
Definition 2.1.1.
- A graph with no cycle is acyclic.
- A forest is an acyclic graph.
- A tree is a connected acyclic graph.
- A leaf is a vertex of degree \(1\).
- A spanning subgraph of \(G\) is a subgraph with vertex set \(V(G)\).
- A spanning tree is a spanning subgraph that is also a tree.
Some floral definitions
\[\underbrace{\hspace*{1.6in}}\]
\[\underbrace{\hspace*{1.6in}}\]
\[\underbrace{\hspace*{1.2in}}\]
Forest
Tree
Tree
Each of these vertices is a leaf.
Lemma 2.1.3. Every tree with at least two vertices has at least two leaves. Deleting a leaf from an \(n\)-vertex tree produces a tree with \(n-1\) vertices.
Theorem 2.1.4. For an \(n\)-vertex graph \(G\) (with \(n\geq 1\)), the following are equivalent:
A) \(G\) is connected and has no cycles, that is, \(G\) is a tree.
B) \(G\) is connected and has \(n-1\) edges.
C) \(G\) has \(n-1\) edges and no cycles.
D) For \(u,v\in V(G)\), \(G\) has exactly one \(u,v\)-path.
The next theorem give several alternate characterizations of graphs that are trees. Note that each of A, B, and C is the statement that two of the following hold: 1) \(G\) is acyclic, 2) \(G\) is connected, 3) \(G\) has \(n-1\) edges.
Some other characterizations of trees
Corollary 2.1.5.
a) Every edge of a tree is a cut edge.
b) Adding one edge to a tree forms exactly one cycle.
c) Every connected graph contains a spanning tree.
Proposition 2.1.6. If \(T\) and \(T'\) are spanning trees of a connected graph \(G\), and \(e\in E(T)-E(T')\), then there is an edge \(e'\in E(T')-E(T)\) such that \(T-e+e'\) is a spanning tree of \(G\).
Proposition 2.1.7. If \(T\) and \(T'\) are spanning trees of a connected graph \(G\), and \(e\in E(T)-E(T')\), then there is an edge \(e'\in E(T')-E(T)\) such that \(T'+e-e'\) is a spanning tree of \(G\).
Spanning Trees
Suppose \(T\) is a tree and \(G\) is a simple graph. What must be true about \(T\) and \(G\) to ensure that \(T\) is a subgraph of \(G\).
If \(T\) has one vertex adjacent to all of the others, then \(T\) is called a star.
Clearly, \(T\) is a subgraph of \(G\) if and only if \(G\) has a vertex of degree \(e(T)\), that is, \(\Delta(G)\geq e(T)\).
Is is sufficient? No! \(P_{4}\) is not s subgraph of the star with \(4\) vertices.
What about \(\delta(G)\geq e(T)\)?
\(G\)
Not a subgraph of \(G\)
Subgraph of \(G\)
\(G\)
What about the other trees with 4 edges?
Proposition 2.1.8. If \(T\) is a tree with \(k\) edges, and \(G\) is a simple graph with \(\delta(G)\geq k\), then \(T\) is a subgraph of \(G\)
\(T\)
\(T'\)
Call its neighbor \(u\)
\(u\)
\(u\)
Pick a leaf \(v\)
\(u\)
Delete \(v\)
Find \(T'\) in \(G\)
Since \(d_{G}(u)\geq 4\)
and \(d_{T'}(u)\leq 3\)
\(\exists\,v\) adj. to \(u\), but not in \(T'\)
\(v\)
Proposition 2.1.8. If \(T\) is a tree with \(k\) edges, and \(G\) is a simple graph with \(\delta(G)\geq k\), then \(T\) is a subgraph of \(G\)
Proof outline. Use induction on \(k\):
- For \(k=0\) we have a tree \(T\) with no edges, that is, an isolated vertex.
- Clearly an isolated vertex is a subgraph of any graph.
Suppose that for some \(k\geq 1\) the claim holds for trees with \(<k\) edges. Let \(G\) be a graph with \(\delta(G)\geq k\), and let \(T\) be a tree with \(k\) edges.
- Let \(v\) be any leaf in \(T\) and let \(T'=T-v\).
- Let \(u\) be the neighbor of \(v\) in \(T\)
- \(T'\) is a tree with \(k-1\) edges.
- \(\delta(G)\geq k>k-1\)
- By the inductive hypothesis \(T'\) is a subgraph of \(G\).
- Since \(d_{G}(u)\geq k\), the vertex \(u\) has at least \(k\) neighbors in \(G\).
- Since \(T'\) has \(k-1\) edges, \(u\) has at most \(k-1\) neighbors in \(T'\).
- There exists a vertex \(\tilde{v}\in G-T'\) such that \(\tilde{v}\leftrightarrow u\)
- Make \(T\) by adding the edge between \(u\) and \(\tilde{v}\) to \(T'\).
Distance in Graphs
Definition 2.1.9.
- If \(G\) has a \(u,v\)-path, then the distance from \(u\) to \(v\), written \(d_{G}(u,v)\) or simply \(d(u,v)\), is the length of the shortest \(u,v\)-path.
- If there is no \(u,v\)-path in \(G\), then \(d(u,v) = \infty\).
- The diameter of \(G\) is given by \[\operatorname{diam}G = \max\{d(u,v) : u,v\in V(G)\}.\]
- The eccentricity of a vertex \(u\) is given by \[\epsilon(u) = \max\{d(u,v) : v\in V(G)\}.\]
- The radius of a graph \(G\) is given by \[\operatorname{rad}G = \min\{\epsilon(u) : u\in V(G)\}.\]
\(b\)
\(a\)
\(c\)
\(e\)
\(f\)
\(g\)
\(d(a,b)=1\)
\(d(a,c)=2\)
\(d(a,e)=3\)
\(d(a,f)=2\)
\(d(a,g)=1\)
\(d(a,a)=0\)
\(\operatorname{diam}G = 3\)
\(\epsilon(a) = 3\)
\(\operatorname{rad}G = 3\)
Example.
Theorem 2.1.11. Suppose \(G\) is a simple graph. If \(\operatorname{diam}G\geq 3\), then \(\operatorname{diam}\overline{G}\leq 3\).
Proof. Since \(\operatorname{diam}G>2\), there are two nonadjacent vertices \(u\) and \(v\) with no common neighbor.
Hence, for \(x\in V(G)-\{u,v\}\) either \(x\not\leftrightarrow u\) or \(x\not\leftrightarrow v\).
Note that \(u\) and \(v\) are adjacent in \(\overline{G}\). And any other vertex \(x\) is adjacent to either \(u\) or \(v\) in \(\overline{G}\).
Therefore, for any two vertices, there is a path of lenghth at most \(3\) in \(\overline{G}\). \(\Box\)
Definition 2.1.12. The center of a graph \(G\) is the subgraph induced by the vertices of minimum eccentricity.
Theorem 2.1.13. The center of a tree is either a vertex (\(K_{1}\)) or an edge (\(K_{2}\)).
the center
Proof. We use induction on the number of vertices in a tree \(T\).
Inductive step:
- Suppose \(n(T)>2\) and the theorem is true for trees with \(<n(T)\) vertices.
- Let \(T'\) be the graph obtained by deleting every leaf of \(T\).
- For \(u\in V(T)\) the farthest vertex was a leaf, thus \(\epsilon_{T'}(u)=\epsilon_{T}(u)-1\).
- Leaves of \(T\) are not in the center of \(T\).
- The center of \(T'\) is the same as the center of \(T\).
- By the inductive hypothesis the center of \(T'\) is a vertex or an edge. \(\Box\)
Basis step: \(n(T) \leq 2\), then \(T=K_{1}\) or \(K_{2}\) and the center is \(T\).
If we want a graph with all vertices close together, then we want a small diameter.
On the other hand, if we want a graph where most vertices are close together, then we might want the average distsnce between points to be small. That is, if \(G\) is a graph with \(n\) vertices, then we want
\[\frac{2}{n(n+1)}\sum_{v,u\in V(G)}d_{G}(v,u)\]
to be small. Equivalently, we want the Wiener index:
\[D(G): = \sum_{v,u\in V(G)}d_{G}(v,u)\]
to be small.
The next theorem gives us the extremes of this index among all trees.
Theorem 2.1.14. For trees with \(n\) vertices, the Wiener index is minimized by stars and maximized by paths, both uniquely. That is, if \(T\) is a tree with \(n\) vertices, then
\[ (n-1)^2\leq D(T)\leq {n+1\choose 3},\]
moreover, if \(D(T) = (n-1)^2\) then \(T\cong K_{1,n-1}\) and if \(D(T) = {n+1\choose 3}\) then \(T\cong P_{n}\).
Optimization and Trees
Weighted graphs
A weighted graph is a graph \(G\) together with a nonnegative number for each edge.
Our goals:
Find a minimum spanning tree: a spanning tree such that the sum of the edge weights is minimal
Find shortest path from \(u\) to \(v\):
The path from \(u\) to \(v\) such that the sum of the edge weights is minimal.
Kruskal's Algorithm
Define the subgraph \(H\) with \(V(H)=V(G)\) and \(E(H) = \varnothing\).
While it's possible
Add an edge to \(H\) from \(E(G)\) that does not create a cycle in \(H\), and has minimal weight among these.
Suppose \(G\) is a connected, weighted graph with \(n\) vertices:
End when no such edge exists
Theorem 2.3.3. In a connected weighted graph \(G\), Kruskal's Algorithm constructs a minimum-weight spanning tree.
- By construction, the graph \(H\) is acyclic at each step, and thus the final graph \(T\) is acyclic.
- If \(T\) has \(>1\) component, then a path in \(G\) between two components of \(T\) includes an edge with endpoints in different components.
- The algorithm terminated, so such an edge does not exist.
Suppose \(T^{\ast}\) is a spanning tree of minimum weight. If \(T=T^{\ast}\) then we're done.
- Let \(e\in E(T)\) denote the first edge that we added to \(T\) that is not in \(T^{\ast}\).
- (Proposition 2.1.7)There exists \(e'\in E(T^{\ast})-E(T)\) such that \(T^{\ast}+e-e'\) is a spanning tree.
- Since (when performing the algorithm) we chose \(e\) and not \(e'\) we know that the weight of \(e\) is at most the weight of \(e'\)
- Thus the weight of \(T^{\ast}+e-e'\) is at most the weight of \(T^{\ast}\).
- \(T^{\ast}+e-e'\) is minimum-weight, and agrees with \(T\) for one more step in the algorithm.
- Repeat to find a minimum-weight tree that agrees with \(T\). \(\Box\)
Proof. First, we see that the output, which we call \(T\), is a spanning tree
Dijkstra's Algorithm
\(v\)
\(u\)
What is the shortest path from vertex \(v\) to vertex \(u\)?
Start with a list of distances \(0\) for \(v\) and \(\infty\) for the rest.
- Pick unvisited vertex w/ smallest distance (currently)
- For all neighbors update distance to neighbors, if shorter

Dijkstra's Algorithm
More generally, take the distance between vertices \(d(u,v)\) to be the smallest sum of weights among all \(u,v\)-paths.
What is \(d(u,v)\)?
\(v\)
\(u\)
Start with a list of distances \(0\) for \(v\) and \(\infty\) for the rest.
- Pick unvisited vertex w/ smallest distance (currently)
- For all neighbors update distance to neighbors, if shorter
Theorem 2.3.7. Given a graph \(G\) and a vertex \(v\in V(G)\), Dijkstra's Algorithm computes \(d(v,z)\) for each vertex \(z\in V(G)\).
Dijkstra's Algorithm (It works!)
Proof. Let \(z_{k}\) denote the \(k\)th vertex visited, and let \(t_{k}(z)\) denote the "tentative distance" from \(v\) to \(z\), before the \(k\)th update. We will show by induction on \(k\), that \(t_{k}(z)\) is the length of the shortest \(v,z\)-path through the already visited vertices \(z_{1},\ldots,z_{k-1}\).
Since \(z_{1}=v\), \(t_{1}(v)=0\), and \(t_{1}(z)=\infty\) for \(z\neq v\), the base case is clear.
Suppose that there is a path \(P\) through vertices \(z_{1},\ldots,z_{k-1}\) whose length is less than \(t_{k}(z)\). Let \(z_{j}\) be the vertex adjacent to \(z\) in this path.
Now, we assume that there is some \(k\geq 2\) such that the claim is true for all \(j<k\), that is, \(t_{j}(z)\) is the length of the shortest \(v,z\)-path through the already visited vertices \(z_{1},\ldots,z_{j-1}\).
Dijkstra's Algorithm (It works!)
Proof continued.
- By induction \(t_{k-1}(z_{j})\) is the length of the shortest \(v,z_{j}\)-path through vertices \(z_{1},\ldots,z_{k-2}\).
- Since \(t_{k-1}(z_{k-1})\geq t_{k-1}(z_{j})\), the shortest \(v,z_{j}\)-path through \(z_{1},\ldots,z_{k-1}\) does not go through \(z_{k-1}\).
- Thus, \(t_{k-1}(z_{j})\) is the length of the shortest \(v,z_{j}\)-path through \(z_{1},\ldots,z_{k-1}\).
Thus, the length of the path \(P\) is \(t_{k}(z_{j}) + d(z_{j},z)\), and thus
\[t_{k}(z)> t_{k-1}(z_{j})+d(z_{j},z).\]
However, at iteration \(j\), we would have updated \(t_{k}(z)\), and thus we would have
\[t_{k}(z)\leq t_{k-1}(z_{j})+d(z_{j},z).\]
This is a contradiction. Thus \(t_{k}(z)\) is the length of the shortest \(v,z\)-path through the first \(k-1\) vertices visited. Thus, after \(n=n(G)\) iterations of the algorithm, we see that \(t_{n+1}(z)=d(v,z)\). \(\Box\)
Visited vertices
Breadth-first search
\(v\)
\(u\)
For an unweighted graph, Dijkstra's algorithm is called a Breadth-First search.
However, we just take the next unvisited vertex that we've "seen" instead of the vertex with smallest tentative weight.
Matchings and Covers
Definition 3.1.1.
- A matching in a graph \(G\) is a set of non-loop edges with no shared endpoints.
- The vertices incident to the edges of a matching \(M\) are saturated by \(M\); the others are unsaturated.
- A perfect matching in a graph is a matching that saturates every vertex.
Example.
The blue edges are a perfect matching
Are there other perfect matchings?
Example. If a graph has a vertex with degree \(0\), then it contains no perfect matching.
Give an example of a graph \(G\) such that \(\delta(G)\geq 1\), but no perfect matching?
The only star that contains a perfect matching is \(K_{2}\).
Stars!
Example 3.1.2. A perfect matching in \(K_{n,n}\) corresponds to a bijection of the partite sets.
If \(X = \{x_{1},x_{2},\ldots,x_{n}\}\) and \(Y=\{y_{1},y_{2},\ldots,y_{n}\}\) are the partite sets of vertices, then a bijection \(f:X\to Y\) gives a perfect matching, namely, the edges \(xf(x)\) for each \(x\in X\).
Conversely, given a perfect matching of edges, each edge has one endpoint in \(X\) and one in \(Y\), thus, for each edge \(xy\) in the perfect matching, we can define a bijection \(g:X\to Y\) by \(g(x) = y\) if and only if \(xy\) is in the perfect matching.
The number of bijections \(f:X\to Y\) is \(n!\), and thus there are \(n!\) perfect matchings in \(K_{n,n}\).
Corresponding bijection:
\(f(x_{1})=y_{2}\)
\(f(x_{2})=y_{1}\)
\(f(x_{3})=y_{4}\)
\(f(x_{4})=y_{5}\)
\(f(x_{5})=y_{3}\)
Example 3.1.3. Why is there no perfect matching in \(K_{3}\), \(K_{5}\), \(K_{7},\ldots\)?
If \(G\) has a perfect matching, then the order of \(G\) must be even!
Does \(K_{2n}\) have a perfect matching for each \(n\in\mathbb{N}\)?
YES! The set of perfect matchings of \(K_{2n}\) is in one-to-one correspondence with the partitions of \(\{1,2,3,\ldots,2n\}\) into \(n\) subsets of size \(2\). How many such partitions are there?
\[\frac{(2n)!}{2^{n}n!}\]
Partition: \(\{1,3\},\ \{2,4\},\ \{5,6\}\)
Definition 3.1.4. A maximal matching in a graph is a matching that cannot be enlarged by adding an edge. A maximum matching is a matching of maximum size among all matchings in the graph.
Maximal matching
(not maximum):
Maximum matching:
Definition 3.1.6. Given a matching \(M\), an \(M\)-alternating path is a path that alternates between edges in \(M\) and edges not in \(M\). An \(M\)-alternating path whose endpoints are unsaturated by \(M\) is an \(M\)-augmenting path.
Definition 3.1.7. If \(G\) and \(H\) are graphs with a common vertex set \(V\), then the symmetric difference \(G\triangle H\) is the graph with vertex set \(V\) whose edges are all those appearing in exactly one of \(G\) and \(H\). We similarly define the notion of symmetric difference for sets of edges.
Lemma 3.1.9. Every component of the symmetric difference of two matchings is a path or an even cycle.
\(\triangle\)
\(\triangle\)
\(=\)
\(=\)
Theorem 3.1.10. A matching \(M\) in a graph \(G\) is a maximum matching in \(G\) if and only if \(G\) has no \(M\)-augmenting path.
Consider the matching \(M\) in blue
the \(M\)-augmenting path \(P\) in red
and...
Replacing \(M\) with every other edge in \(P\) we obtain a matching with more edges:
Thus, if \(M\) is a maximum matching, then there is no \(M\)-augmenting path.
Saturating partite sets
Given a bipartite graph \(G\), and one of the partite sets \(X\), one might ask whether there is a matching that saturates \(X\).
Consider the following graph:
The blue edges are a matching that saturates \(X:=\{x_{1},x_{2},x_{3},x_{4},x_{5}\}\).
If \(S\subset X\), then clearly the number of vertices adjacent to \(S\) must be \(\geq\) the number of vertices in \(S\).
Theorem 3.1.11. (Hall's Theorem) An \(X,Y\)-bigraph \(G\) has a matching that saturates \(X\) if and only if \(|N(S)|\geq |S|\) for all \(S\subseteq X\).
Recall:
- A bipartite graph \(G\) with partite sets \(X\) and \(Y\) is called an \(X,Y\)-bigraph.
- Given a set of vertices \(S\), the set neighborhood of \(S\) is the set \[N(S) = \{v\in V(G) : v\leftrightarrow w\text{ for some }w\in S\}.\]
- Given a finite set \(X\), the cardinality of \(S\) is the number of elements in \(S\), denoted \(|S|\).
Hall's Matching condition
Corollary (the Marriage Theorem). An \(X,Y\)-bigraph \(G\) contains a perfect matching if and only if both of the following hold:
- \(|X|=|Y|\)
- For every \(S\subseteq X\), \(|N(S)|\geq |S|\).
Does the following bigraph have a perfect matching?
\(\underbrace{\hspace{1.8in}}\)
\(\overbrace{\hspace{1in}}\)
\(S\)
\(N(S)\)
Thus, the graph contains no perfect matching.
Corollary 3.1.13. For \(k>0\), every \(k\)-regular bipartite graph has a perfect matching.
Does the following bigraph have a perfect matching?
Since it is \(3\)-regular, by Corollary 3.1.13...YES!
Example. A group of 50 pets and 50 people meet one day and they decide whether they are compatible.
Each of the 50 pets is compatible 20 of the people, and each of the 50 people is compatible with 20 of the pets.
Is there a way to match all 50 people compatible pets?
Min-max Theorems
Definition 3.1.14. A vertex cover of a graph \(G\) is a set \(Q\subseteq V(G)\) that contains at least one endpoint of every edge. We say that the vertices in \(Q\) cover \(E(G)\).
Example. In each of the following graphs, the blue vertices comprise a vertex cover:
blue
Theorem 3.1.16. If \(G\) is a bipartite graph, then the maximum size of a matching in \(G\) equals the minimum size of a vertex cover of \(G\).
- The blue edges form a maximum matching \(M\).
- A vertex cover \(Q\) must include one endpoint of each of these edges.
- There might be more vertices, not incident with any edge in \(M\).
Extra vertex
\(\underbrace{\hspace{3in}}\)
One vertex in \(Q\) for each edge in \(M\).
Proof. First, we show that if \(Q\) is any vertex cover, and \(M\) is a maximum matching, then \(|Q|\geq |M|\). Therefore, a vertex cover of minimum size has at least as many vertices as the number of edges in a maximum matching.
Theorem 3.1.16. If \(G\) is a bipartite graph, then the maximum size of a matching in \(G\) equals the minimum size of a vertex cover of \(G\).
Proof. Suppose \(X\) and \(Y\) are the partite sets in \(G\). Let \(Q\) be a vertex cover of minimum size.
- Set \(R = Q\cap X\quad\text{and}\quad T = Q\cap Y\).
- Let \(H\) and \(H'\) be the subgraphs induced by \(R \cup (Y-T)\) and \(T\cup (X-R)\), respectively.
Theorem 3.1.16. If \(G\) is a bipartite graph, then the maximum size of a matching in \(G\) equals the minimum size of a vertex cover of \(G\).
We'll use Hall's theorem to find a matching in \(H\) that saturates \(R\) and a matching in \(H'\) that saturates \(T\).
Since \(Q=T\cup R\), together these matchings give a matching in \(G\) of size \(|Q|\).
Proof. For each \(S\subseteq R\) we consider \(N_{H}(S)\).
Theorem 3.1.16. If \(G\) is a bipartite graph, then the maximum size of a matching in \(G\) equals the minimum size of a vertex cover of \(G\).
If \(|N_{H}(S)|<|S|\), then we could replace \(S\) with \(|N_{H}(S)|\) in \(Q\) to obtain a smaller vertex cover.
The union of the matchings in \(H\) and \(H'\) is a matching with \(|Q|\) edges in it. \(\Box\)
Since \(Q\) is minimum size, we see \(|N_{H}(S)|\geq |S|\).
The same argument shows Hall's condition holds in \(H'\).
Minimal
By John Jasper
Minimal
- 162