M222 Graphs
M222 Graphs
• The set E (or E(G) to emphasize as above) is called the edge set of G.
• The edge e is said to be incident with u (and v), and vice versa.
• We write uv (or vu) to denote the edge {u, v}, on the understanding
that no order is implied.
• E(G) is a set. This means that two vertices either are adjacent or are
not adjacent. There is no possibility of more than one edge joining a
pair of vertices.
Graphs are usually represented pictorially with a point (or dot) in the plane
corresponding to each vertex and a line segment (or curve of some sort) join-
ing the corresponding points for each pair of adjacent vertices. The picture
tells you what the graph is, that is, it tells you what the vertices are, and
what the edges are.
The adjacency matrix of a graph G with V (G) = {v1 , v2 , . . . , vn } is the n × n
matrix A whose (i, j) entry, Aij , is 1 if vi vj ∈ E and 0 if vi vj 6∈ E.
• Aij is the truth value of the statement “vi and vj are adjacent”.
1
• The matrix A is symmetric.
• Isomorphic graphs are identical in every respect other than the names
given to the vertices.
• A way to prove two graphs are not isomorphic, find a property that
one graph has and the other one doesn’t have.
3 Special graphs
A graph is complete if any two different vertices are adjacent. Since any two
such graphs on the same number of vertices are isomorphic, we talk about
the complete graph on n vertices and denote it by Kn .
A graph G is bipartite if there exist disjoint sets X, Y ⊆ V such that X ∪Y =
V and every edge has one end in X and the other in Y . The ordered pair
(X, Y ) is called a bipartition of G.
A bipartite graph with bipartition (X, Y ) is a complete bipartite graph if every
vertex in X is adjacent to every vertex in Y . Since any two such graphs with
m = |X| and n = |Y | are isomorphic, we talk about the complete bipartite
graph and denote it by Km,n .
2
4 Vertex degrees
The degree of a vertex v ∈ V , denoted by deg(v) (or degG (v)), is the number
of vertices adjacent to v.
Proof. Every edge of G is counted twice on the RHS. Since an edge xy con-
tributes one to deg(x) and one to deg(y), every edge is also counted twice on
the LHS. Therefore LHS = RHS.
Proposition 4.2. If a graph G has at least two vertices, then it has two
vertices of the same degree.
Proof. Suppose the graph G has n > 1 vertices, then 0 ≤ deg(v) ≤ n − 1 for
any vertex v. But a vertex of degree 0 is not adjacent to any other vertex,
while a vertex of degree n − 1 is adjacent to every other vertex. Thus a graph
with n ≥ 2 vertices can not have both a vertex of degree 0 and a vertex of
degree n − 1. It follows that either 0 ≤ deg(v) ≤ n − 2 for any vertex v, or
1 ≤ deg(v) ≤ n − 1 for any vertex v. In either case, there are n − 1 possible
value for a collection of n integers, so two of the integers must be equal.
3
A degree sequence of a graph G with n vertices is a sequence of length n
whose elements are the degrees of the vertices of G (in some order).
• if n > 1 then both n − 1 and 0 can not both occur in the sequence.
5 Subgraphs
A graph H is a subgraph of a graph G = (V, E) if V (H) ⊆ V (G) and
E(H) ⊆ E(G).
A subgraph if a graph such that
4
• The number of spanning subgraphs of a graph G is 2|E(G)| .
• The number of subgraphs of the complete graph with vertex set {1, 2, . . . ,
n
n} is 2( 2 ) . (Many of these are isomorphic.)
• The term labelled means the names of the vertices is important.
• There are 23 = 8 labelled graphs on 3 vertices, but only 4 non-isomorphic
(or, unlabelled) graphs on 3 vertices.
The complement of a graph G, denoted G is the graph with the same vertex
set as G, and where distinct vertices x and y are adjacent in G if and only if
they are not adjacent in G.
• G = G.
• A graph is self-complementary if it is isomorphic to its complement.
Self complementary graphs exist if and only if the number of vertices
is congruent to 0 or 1 modulo 4.
5
• The integer n is the length of the walk. (It is the number of edges in
the walk.)
A walk is
• There are walks which are not trails, and trails which are not paths.
Proposition 6.1. If a graph G has an walk that starts at x and ends at y,
then it has a path that starts at x and ends at y.
Proof idea: If a vertex is repeated, then part of the walk can be deleted so
that a shorter walk from x to y is obtained. This a shortest walk from x to
y must be a path.
A cycle is a closed walk of length at least three in which the vertices are
distinct except the first and last.
A closed trail is called a circuit.
6
• Circuits can have repeated vertices other then the first and last, cycles
can’t.
• If G has a closed walk of odd length, then it has a cycle of odd length.
Proposition 6.2. Let G be a graph in which every vertex has degree at least
k. Then, G has a path of length at least k. Further, of k ≥ 2, then G has a
cycle of length at least k + 1.
Proof. We prove the first statement. The proof of the second statement is
similar. Let P = v0 , v1 , . . . , vp be a longest path in G. If some vertex adjacent
to v0 does not belong to P , then there is a longer path than P . Hence, every
vertex adjacent to v0 belongs to P . Since deg(v0 ) ≥ k we must have p ≥ k.
Thus G has a path of length at least k.
7
• A graph is connected if and only if it has only one component, and
disconnected if and only if it has at least two components.
8 Eulerian graphs
An Euler trail (or Eulerian trail) in a graph G is a trail that includes all of
the vertices and edges of G. A closed Euler trail is called an Euler tour or
Eulerian circuit. A graph is Eulerian if it has an Eulerian circuit.
8
Since G is connected and G − E(C) is not connected, some vertex x ∈
V (H) belongs to C. But then the circuit obtained by following C up to x,
then the Eulerian circuit of H, then the remainder of C is longer than C, a
contradiction. Therefore C is an Eulerian circuit.
The result now follows by induction.
• Theorem 8.1 gives an easy criteria for proving that a graph has/doesn’t
have an Eulerian circuit. If it does, describe the tour, and if it doesn’t
then show that it (the graph) is disconnected or has a vertex of odd
degree.
• The proof also gives an algorithm for constructing the trail when it
exists. Start at any vertex of odd degree, and construct a maximal
trail. If it contains all of the edges in the graph, then you’re done.
Otherwise, delete all of the edges in your trail. In each component of
the resulting graph, all vertices will have even degree. The graph is
necessarily disconnected because the trail contains all edges incident
with its last vertex (otherwise it would not be maximal!). There will
be a last vertex w on the trail which belongs to a component that has
edges. This component has an Eulerian circuit starting and ending
at w, and this “little tour” can be “added in” to your trail to give a
longer trail. The little tour can be be found using the same procedure
(or, assumed to exist by induction). Repeating this process for each
extended trail eventually results in an Eulerian circuit of the graph.
Corollary 8.2. A graph has an Euler trail if and only if it is connected and
has 0 or 2 vertices of odd degree.
Proof. If there are no vertices of odd degree, the result follows from Theorem
8.1. Suppose there are 2 vertices of odd degree; call them u and v.
Construct a new graph G0 by adding a new vertex, x, and joining it to u and
to v. Then every vertex of G0 has ever degree, so G0 has an Eulerian circuir.
Without loss of generality the circuits starts at x, and the first vertex after
x is u. Since x has degree 2, the penultimate vertex in the circuit (the next
to last vertex in the circuit) is v. Since G is obtained from G0 by deleting x,
it follows that G has an Euler trail that starts at u and ends at v.
9
• From the counting argument in the proof of Theorem 8.1, if G is con-
nected and has exactly 2 vertices of odd degree, then an Euler trail
must start at one of them and end at the other.
• The proof of Corollary 8.2, together with the proof of Theorem 8.1, tells
you how to find and Euler train an a connected graph with exactly 2
vertices of odd dergee.
9 Hamiltonian graphs
A Hamilton cycle (or Hamiltonian cycle) in a graph G s a cycle that con-
tains every vertex of G. A graph that has a hamilton cycle is said to be
Hamiltonian.
A Hamilton path (or Hamiltonian path) in a graph iG s a path that contains
every vertex of G.
• There are graphs with both a Hamilton cycle and an Eulerian circuit,
graphs with neither, and graphs with one but not the other.
Let n ≥ 0 be an integer. The n-cube is the graph, Qn , with vertex set equal
to the set of binary sequences of length n, and in which vertices (sequences)
s1 and s2 are adjacent if and only if they differ in exactly one place.
• |V (Qn )| = 2n .
• Qn is n-regular.
• |E(Qn )| = n2n−1 .
10
• Qn is bipartite.
For n > 0, let V0 be the set of vertices of Qn in which the first entry is 0,
and let V1 be the set in which the first entry is 1. Then V = V0 ∪ V1 . The
subgraph with vertex set V0 and all edges with both ends in V0 is isomorphic
to Qn−1 . The same holds for V1 . Thus, Qn can be constructed from 2 copies
of Qn−1 by prefixing the vertices of one copy with 0, prefixing the vertices of
the other copy with 1, and then joining 0s to 1s for each vertex s of Qn−1 .
Proof idea: use the recursive structure of Qn to piece together Hamilton cycles
in the two smaller cubes from which Qn is constructed.
10 Trees
A tree is a connected graph that has no cycles (i.e., a connected acyclic
graph).
By Proposition 6.2, a connected graph with no cycles can not have all vertices
of degree at least 2. Therefore there is a vertex of degree 1.
A leaf of a tree is a vertex of degree 1.
The following is proved by considering a longest path, and then using the
same idea as in the proof of Proposition 6.2, together with the fact that there
are no cycles, to show that its ends must have degree 1.
11
Proposition 10.1. A tree with at least 2 vertices has at least 2 vertices of
degree 1.
Leaves are useful because, if ` is a leaf, then it can not appear in a path
between two vertices u and v in V − {x}. Thus, if T is a tree, and x is a leaf,
then T − x (the subgraph obtained by deleting x and the edge incident with
it) is also a tree.
1. T is a tree.
Proof. (1) ⇒ (2). Since T is a tree, it is connected. We show that |E| = n−1
by induction on n. A tree with 1 vertex has no edges, so the statement is
true when n = 1. Suppose that every tree with k vertices has exactly k − 1
edges, for some k ≥ 1.
Let T be a tree with k + 1 vertices. By Proposition 10.1, the tree T has a
leaf, `. Since T − ` is a tree with k vertices, by the induction hypothesis it
has exactly k − 1 edges. Since T has 1 more edge than T − `, it has k edges.
The result now follows by induction.
(2) ⇒ (1). The proof is by induction on n. A graph with 1 vertex and no
edges is a tree. Suppose that every connected graph with k vertices and k − 1
edges is a tree, for some k ≥ 1.
Let T be a connected graph with k + 1 vertices and k edges. Since the sum
of vertex degrees is 2((k + 1) − 1) < 2(k + 1, the graph T has a vertex x of
degree less than 2. Since T is connected, the vertex x must have degree 1.
The graph T − x is connected and has k − 1 edges. Hence, by the induction
hypothesis, it is a tree.
But then T is also a tree. It is connected by hypothesis. A vertex of degree
1 can not be in a cycle, so it is acyclic (since T − x is acyclic, any cycle of T
must contain x). The result now follows by induction.
12
(1) ⇒ (3). Since T is connected, there is a path between any two vertices.
It remains to show uniqueness. Suppose that P : (x = v0 ), v1 , . . . , (vk = y)
and Q : (x = w0 ), w1 , . . . , (w` = y) are two different paths from x to y. Since
v0 = w0 and the paths are different, there exists a smallest subscript, i, such
that vi+1 6= wi+1 . Similarly, since w` = vk , there exists a smallest subscript
j > i + 1 such that wj belongs to P ; say wj = vt . Note that t > i since P
is a path. Then (vi = wi ), wi+1 , . . . , (wj = vt ), vt−1 , . . . , vi is a cycle in T , a
contradiction. Thus any two vertices of T are joined by a unique path.
(3) ⇒ (1). If any two vertices of T are joined by a unique path, then T
is connected. Since there are two different paths between any two vertices
belonging to a cycle, it follows that T is acyclic. Therefore, T is a tree.
11 Planar graphs
A graph is planar if it can be drawn in the plane so that edges meet only at
their ends. A plane embedding of a planar is a drawing of the graph in the
plane so that edges meet only at their ends. The term plane graph is used
to refer to a planar embedding of a planar graph.
v − e + f = 2.
13
• By Euler’s formula, any two plane embeddings of a planar graph have
the same number of faces.
Euler’s formula can be used to show K3,3 and K5 are not planar. We will see
later (Kuratowski’s theorem) that there is a sense in which any non-planar
graph “contains” one of them as a subgraph.
Proof idea: Use Euler’s formula to show that it has the wrong number of
edges.
Proof. Suppose K3,3 is planar. Since it has 6 vertices and 9 edges, by Euler’s
formula a plane embedding of K3,3 has 5 faces.
Since K3,3 is bipartite, it contains no cycle of length 3 (as a 3-cycle is not
bipartite). Thus the boundary of each face contains at least 4 edges. Since
every edge is incident with at most 2 faces, we have 4f ≤ 2e. With f = 5
and e = 9, this inequality is 20 < 18, a contradiction.
And the same idea again gives an upper bound on the number of edges in a
planar graph.
14
Proof. Since a connected graph with at most 3 vertices has at most 3 edges,
the theorem is true for all connected planar graphs with at most 3 vertices.
Assume v ≥ 4. If e < 3 then the desired inequality holds, so assume e ≥ 3.
The boundary of each face contains at least 3 edges. Since every edge is
incident with at most 2 faces, we have 3f ≤ 2e.
By Euler’s formula, 2 = v − e + f ≤ v − e + 2e/3 = v − e/3, so that 6 ≤ 3v − e.
Rearranging gives e ≤ 3v − 6.
Corollary 11.5. Every planar graph has a vertex of degree at most 5.
a contradiction.
12 Colouring
A k-colouring of a graph G is an assignment of k colours {1, 2, . . . , k} to the
vertices of G so that adjacent vertices are assigned different colours. A graph
15
G is called k-colourable if there exists a k-colouring of G. The chromatic
number of a graph G, denoted χ(G), is the smallest k such that G is k-
colourable. When G is clear in the context, we write χ instead of χ(G).
16
walk of odd length, and therefore has a cycle of odd length, a contradiction.
Hence G is bipartite.
• Every complete bipartite graph Km,n has chromatic number 2, but the
vertex degrees can all be much larger than 2.
Proposition 12.2. Let ∆(G) be the largest degree of a vertex of the graph
G. Then χ(G) ≤ 1 + ∆(G).
Proof. By induction on |V (G). The statement is true for all graphs with one
vertex as χ = 1 ≤ 0 + 1. Suppose that χ(G) ≤ 1 + ∆(G) for all graphs G
with k vertices, for some k ≥ 1.
Let G be a graph with k + 1 vertices, and let x ∈ V (G). Then the graph
G − x has k vertices, and ∆(G − x) ≤ ∆(G). By the induction hypothesis,
χ(G − x) ≤ 1 + ∆(G − x) ≤ 1 + ∆(G).
Consider a (1 + ∆(G))-colouring of G − x. Since x has degree at most
∆(G), at most ∆(G) colours appear on vertices adjacent to x. Thus, one of
the 1 + ∆(G) colours available does not appear on a vertex adjacent to x.
Assigning that colour to x gives a (1 + ∆(G))-colouring of G.
The result now follows by induction.
• It is known that complete graphs and odd cycles are the only graphs,
G, with χ(G) = 1 + ∆(G). This result is known as Brooks’ Theorem.
17