Lecture 05 Graph Theory
Lecture 05 Graph Theory
Connectedness of Graphs
A walk can end on the same vertex on which it began or on a different vertex. A walk can
travel over any edge and any vertex any number of times.
Definition 3.1.2 — Trails and Tours. A trail is a walk that does not pass over the same
edge twice. A trail might visit the same vertex twice, but only if it comes and goes from a
different edge each time. A tour is a trail that begins and ends on the same vertex.
Definition 3.1.3 — Paths and Cycles. A path is a walk that does not include any vertex
twice, except that its first vertex might be the same as its last. A cycle or a circuit is a path
that begins and ends on the same vertex.
Definition 3.1.4 — Length of Paths and Cycles. The length of a walk or circuit or path
or cycle is the number of edges in it.
A cycle having odd length is usually called an odd cycle and a cycle having even length
is called an even cycle.
Definition 3.1.5 — Distance between two vertices. The distance between two vertices
u and v in a graph G, denoted by dG (u, v) or simply d(u, v), is the length (number of edges)
of a shortest path (also called a graph geodesic) connecting them. This distance is also
known as the geodesic distance.
Here, note that the diameter of a graph need not be twice its radius unlike in geometry. We
can even see many graphs having same radius and diameter. Complete graphs are examples
of the graphs with radius equals to diameter.
For a general graph, there may be several centers and a center is not necessarily on a
diameter.
The distances between vertices in the above graph are given in Table 3.1. Note that a
vertex vi is represented by i in the table (to save the space).
Note that the radius of G is given by r(G) = minε(v) = 4 and the diameter of G is
given by diam(G) = maxε(v) = 6 and all eight central vertices are represented by white
vertices in Figure 3.1.
Definition 3.1.11 — Geodetic Graph. A graph in which any two vertices are connected
by a unique shortest path is called a geodetic graph.
Lecture Notes on Graph Theory 25
v10 v9 v8 v7 v6
v16
v13
v1 v2 v3 v4 v5
v 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ε
1 0 1 2 3 4 6 5 4 3 4 2 3 3 4 4 4 6
2 1 0 1 2 3 5 4 3 2 3 1 2 2 3 3 3 5
3 2 1 0 1 2 4 3 4 3 4 2 2 1 1 2 3 4
4 3 2 1 0 1 3 2 3 4 5 5 3 2 2 1 3 5
5 4 3 2 1 0 4 3 4 5 6 4 4 3 3 2 4 6
6 6 5 4 3 4 0 1 2 3 4 4 4 4 3 2 3 6
7 5 4 3 2 3 1 0 1 2 3 3 3 3 2 1 2 5
8 4 3 4 3 4 2 1 0 1 2 2 2 3 2 2 1 4
9 3 2 3 4 5 3 2 1 0 1 1 2 3 3 3 2 5
10 4 3 4 5 6 4 3 2 1 0 2 3 4 4 4 3 6
11 2 1 2 3 4 4 3 2 1 1 0 1 2 3 4 2 4
12 3 2 2 3 4 4 2 1 2 3 1 0 1 2 3 1 4
13 3 2 1 2 3 4 3 3 3 4 2 1 0 1 2 2 4
14 4 3 2 2 3 3 2 2 3 4 3 2 1 0 1 1 4
15 4 3 2 1 2 2 1 2 3 4 4 3 2 1 0 2 4
16 4 3 3 3 4 3 2 1 2 3 2 3 2 1 2 0 4
Proof. If diam(G) ≥ 3, then there exist at least two non-adjacent vertices u and v in G
such that u and v have no common neighbours in G. Hence, every vertex x in G − u, v is
non-adjacent to u or v or both in G. This makes x adjacent to u or v or both in Ḡ. Moreover,
uv ∈ E(Ḡ). So, for every pair of vertices x, y, there is an x, y path of length at most 3 in Ḡ
through the edge uv. Hence, diam(Ḡ) ≤ 3.
Each vertex belongs to exactly one connected component, as does each edge. A connected
graph has only one component.
A graph having more than one component is a disconnected graph (In other words, a
disconnected graph is a graph which is not connected). The number of components of a graph
G is denoted by (G).
In view of the above notions, the following theorem characterises bipartite graphs.
Theorem 3.2.1 A connected graph G is bipartite if and only if G has no odd cycles.
Proof. Suppose that G is a bipartite graph with bipartition (X,Y ). Assume for contradiction
that there exists a cycle v1 , v2 , v3 , , vk , v1 in G with k odd. Without loss of generality, we
may additionally assume that v1 ∈ X. Since G is bipartite, v2 ∈ Y , v3 ∈ X, v4 ∈ Y and so on.
That is, vi ∈ X for odd values of i and vi ∈ Y for even values of i. Therefore, vk ∈ X. But,
then the edge vk , v1 ∈ E is an edge with both endpoints in X, which contradicts the fact that
G is bipartite. Hence, a bipartite graph G has no odd cycles.
Conversely, assume that G is a graph with no odd cycles. Let d(u, v) denote the distance
between two vertices u and v in G. Pick an arbitrary vertex u ∈ V and define X = x ∈
V (G) : d(x, u) is even. Clearly, u ∈ X as d(u, u) = 0. Now, define another Y = y ∈ V (G) :
d(u, y) is odd. That is, Y = V − X. If possible, assume that there exists an edge vw ∈ E(G)
such that v, w ∈ X (or v, w ∈ Y ). Then, by construction d(u, v) and d(u, w) are both even (or
odd). Let P(u, w) and P(u, v) be the shortest paths connecting u to w, and u to v respectively.
Then, the cycle given by P(u, w) wv P(v, u) has odd length 1 + d(u, w) + d(u, v), which
is a contradiction. Therefore, no such edge wv may exist and G is bipartite.
Theorem 3.2.2 A graph G is disconnected if and only if its vertex set V can be partitioned
into two non-empty, disjoint subsets V1 and V2 such that there exists no edge in G whose
one end vertex is in subset V1 and the other in the subset V2 .
Proof. Suppose that such a partitioning exists. Consider two arbitrary vertices u and v of
G, such that u ∈ V1 and v ∈ V2 . No path can exist between vertices u and v; otherwise, there
would be at least one edge whose one end vertex would be in V1 and the other in V2 . Hence,
if a partition exists, G is not connected.
Conversely, assume that G is a disconnected graph. Consider a vertex u in G. Let V1
be the set of all vertices that are joined by paths to u. Since G is disconnected, V1 does not
include all vertices of G. The remaining vertices will form a (nonempty) set V2 . No vertex in
V1 is joined to any vertex in V2 by an edge. Hence, we get the required partition.
Lecture Notes on Graph Theory 27
Theorem 3.2.3 If a graph has exactly has two vertices of odd degree, then there exists a
path joining these two vertices.
Proof. Let G be a graph with two vertices v1 and v2 of odd degree and all other vertices of
even degree. Then, by Theorem 1.2.3, both of them should lie in the same component of G.
Since every component of G must be connected, there must be a path between v1 and v2 .
Theorem 3.2.4 Let G be a graph with n vertices and k components. Then, G has at most
1
2 (n − k)(n − k + 1) edges.
Proof. Let G be a graph with n vertices and k components. Let the number of vertices in
each of the k components of G be n1 , n2 , , nk respectively. Then we have,
n1 + n2 + + nk = n; ni ≥ 1 (3.1)
First, note that any connected graph on n vertices must have at least n − 1 edges. The proof
k
of the theorem is based on the inequality ∑ n2i ≤ n2 − (k − 1)(2n − k), which can be proved
i=1
as follows.
k
∑ (ni − 1) = n−k
i=1
( )2
k
∑ (ni − 1) = (n − k)2
i=1
k
∑ (n2i − 2ni ) + k + non-negative cross terms = n2 + k2 − 2nk
i=1
k k
∑ n2i − 2 ∑ ni + k ≤ n2 + k2 − 2nk
i=1 i=1
k
∑ n2i − 2n + k ≤ n2 + k2 − 2nk
i=1
k
∑ n2i ≤ n2 + k2 − 2nk + 2n − k
i=1
k
∴ ∑ n2i ≤ n2 − (k − 1)(2n − k)
i=1
Hence, we have
k
∑ n2i ≤ n2 − (k − 1)(2n − k) (3.2)
i=1
number of edges in G is
k k
ni (ni − 1) n2i − ni
∑ 2 = ∑ 2
i=1 i=1
1 k 2
= ∑ (ni − ni )
2 i=1
1 k 2 k
= ∑ ni − ∑ ni
2 i=1 i=1
1 2
≤ n − (k − 1)(2n − k) − n (By Eq. (3.1) and Ineq. (3.2))
2
1 2
= n − 2nk + k2 + 2n − k − n
2
1 2
= n − 2nk + k2 + n − k
2
1
= (n − k)2 + (n − k)
2
1
= (n − k)(n − k + 1)
2
Problem 3.1 Show that an acyclic graph on n vertices and k components has n − k edges.
Solution. The solution follows directly from the first part of the above theorem.
(n−1)(n−2)
Problem 3.2 Show that every graph on n vertices having more than 2 edges is
connected.
Solution. Consider the complete graph Kn and v be an arbitrary vertex of Kn . Now remove all
n − 1 edges of Kn incident on v so that it becomes disconnected with Kn−1 as one component
and the isolated vertex v as the second component. Clearly, this disconnected graph has
(n−1)(n−2)
2 edges (all of which belong to the first component). Since all pairs of vertices in
the first component Kn−1 are any adjacent to each other, any new edge drawn must be joining
a vertex in Kn−1 and the isolated vertex v, making the revised graph connected.
v10 v5
v5
v10
v9 v4 v1 v6 v9 v4 v1 v6
v8 v7 v8
v7
v3 v2 v3 v2
(a) G (b) G′ = G − v1 v6 , v2 v4 , v2 v7 .
obtained from G by removing all vertices in W and all edges incident to those vertices.
See Figure 3.3 for illustration of a vertex-deleted subgraph of a given graph.
v10 v5 v10
v9 v4 v1 v6 v9 v4
v8 v7 v8
v7
v3 v2 v3 v2
(a) G (b) G′ = G − v1 , v5 , v6 .
Proof. Let e = uv be a cut edge of G. Then, the vertices u and v must be in different
components of G − e. If possible, let e is contained in cycle C in G. Then, C − e is a path
between u and v in G − e, a contradiction to the fact that u and v are in different components
of G − e. Therefore, e can not be in any cycle of G.
30 Chapter 3. Connectedness of Graphs
v2 v6 v2 v6
v1 v8 v1 v8
v4 v5 v4 v5
v3 v7 v3 v7
(a) Connected graph G (b) G ◦ uv
Conversely, assume that e is not in any cycle of G. Then, there is no (u, v)-path other than
e. Therefore, u and v are in different components of G − e. That is, G − e is disconnected and
hence e is a cut-edge of G.
v2 v6 v2 v6
v1 v8 v1 v8
v4 v5 v5
v3 v7 v3 v7
(a) Connected graph G (b) G ◦ uv
3.4 Exercises
1. Show that every uv-walk contains a uv-path.
2. Show that every closed walk contains a cycle.
Lecture Notes on Graph Theory 31
3. Show that every graph with n vertices and k edges, n > k has n − k components.
4. If every vertex of a graph G has degree greater than or equal to 2, then G has some
cycles.
5. If G is a simple graph with d(v) ≥ k, ∀ v ∈ V (G), then G contains a path of length at
least k. If k ≥ 2, then G contains a cycle of length k + 1.
6. Show that if G is simple and δ (G) ≥ k, then G has a path of length k.
7. If a connected graph G is decomposed into two subgraphs G1 and G2 , then show that
there must be at least one common vertex between G1 and G2 .
8. If we remove an edge e from a graph G and G − e is still connected, then show that e
lies along some cycle of G.
9. If the intersection of two paths is a disconnected graph, then show that the union of the
two paths has at least one circuit.
10. If P1 and P2 are two different paths between two given vertices of a graph G, then show
that P1 ⊕ P2 is a circuit or a set of circuits in G.
11. Show that the complement of a complete bipartite graph is the disjoint union of two
complete graphs.
12. For a simple graph G, with n vertices, if δ (G) = n−12 , then G is connected.
13. Show that any two longest paths in a connected graph have a vertex in common.
14. For k ≥ 2, prove that a k-regular bipartite graph has no cut-edge.
15. Determine the maximum number of edges in a bipartite subgraph of the Petersen graph.
16. If H is a subgraph of G, then show that dG (u, v) ≤ dH (u, v).
17. Prove that if a connected graph G has equal order and size, then G is a cycle.
18. Show that eccentricities of adjacent vertices differ by at most 1.
19. Prove that if a graph has more edges than vertices then it must possess at least one
cycle.
20. If the intersection of two paths is a disconnected graph, then show that the union of the
two paths has at least one cycle.
21. The radius and diameter of a graph are related as rad(G) ≤ diam(G) ≤ 2r(G).
22. Find the eccentricity of the vertices and the radius, the diameter and center(s) of the
following graphs:
32 Chapter 3. Connectedness of Graphs