0% found this document useful (0 votes)
82 views83 pages

4MTH312 Lecture Notes-7

Notes

Uploaded by

yandisayayadeyi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views83 pages

4MTH312 Lecture Notes-7

Notes

Uploaded by

yandisayayadeyi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

Lecture Notes: Graph Theory

Mr. Philani R. Majozi

University of Zululand
15 July 2024

Contents
1 Overview of the Module 3
1.1 Learning Unit 1: Basic Concepts . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Learning Unit 2: Connectivity . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Learning Unit 3: The Shortest Path Algorithm . . . . . . . . . . . . . . . 4
1.4 Learning Unit 4: Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Learning Unit 5: Eulerian and Hamiltonian Graphs . . . . . . . . . . . . 4
1.6 Learning Unit 6: Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . 5
1.7 Learning Unit 7: Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.8 Assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.9 DP Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.10 Recommended Texts and Resources . . . . . . . . . . . . . . . . . . . . . 5

2 Learning Unit 1: Basic Concepts 6


2.1 Overview of Graph Theory and its Applications . . . . . . . . . . . . . . 6
2.2 Definition and Examples of Graphs . . . . . . . . . . . . . . . . . . . . . 6
2.3 Examples of Graphs, Orders, and Sizes . . . . . . . . . . . . . . . . . . . 7
2.4 Adjacency and Incidence . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Subgraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Isomorphism of Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6.1 Example of Graph Isomorphism . . . . . . . . . . . . . . . . . . . 10
2.7 Matrix Representation of a Graph . . . . . . . . . . . . . . . . . . . . . . 10
2.8 Function Representation of a Graph . . . . . . . . . . . . . . . . . . . . . 11
2.9 Operations on Graphs: Union and Complement . . . . . . . . . . . . . . 12
2.10 Join, Intersection, and Cartesian Products of Graphs . . . . . . . . . . . 13
2.11 The Degree of a Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.12 TUTORIAL ONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3 Learning Unit 2: Connectivity 18


3.1 Connected Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Whitney’s Theorem on Connectivity and Edge Connectivity . . . . . . . 19
3.2.1 Example of Vertex Connectivity (κ) . . . . . . . . . . . . . . . . . 19
3.2.2 Examples Illustrating Minimum Degree . . . . . . . . . . . . . . . 19
3.2.3 Example of Edge Connectivity (λ) . . . . . . . . . . . . . . . . . 20

1
3.3 Expansion Properties and Spectral Gap . . . . . . . . . . . . . . . . . . . 21
3.3.1 Examples of d-Regular Graphs . . . . . . . . . . . . . . . . . . . . 21
3.4 Highly Connected Graphs and Super Connectivity . . . . . . . . . . . . . 24
3.5 Distances in Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.6 Cut-vertices and Bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.7 Degree Sequences and Graphical Representations . . . . . . . . . . . . . 30
3.8 Menger’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.9 TUTORIAL TWO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.10 TUTORIAL TWO SOLUTIONS . . . . . . . . . . . . . . . . . . . . . . 35

4 Learning Unit 3: The Shortest Path Algorithm, Eulerian and Hamilto-


nian Graphs 40
4.1 Walk, Trail, Path, Circuits, Eulerian, Hamiltonian . . . . . . . . . . . . . 40
4.2 The Traveling Salesman Problem (TSP) . . . . . . . . . . . . . . . . . . 47
4.2.1 Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.2.2 Applications and Significance . . . . . . . . . . . . . . . . . . . . 47
4.3 Distance in Weighted Graphs . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4 Dijkstra’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.5 Detailed Implementation of Dijkstra’s Algorithm . . . . . . . . . . . . . . 50
4.6 Practical Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.7 Limitations and Challenges . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.8 TUTORIAL THREE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.9 TUTORIAL THREE SOLUTION . . . . . . . . . . . . . . . . . . . . . . 61

5 Learning Unit 4: Trees 67


5.1 Definition of a Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.2 Properties of Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.3 Example of a Simple Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.4 Example of a Tree with Six Vertices . . . . . . . . . . . . . . . . . . . . . 68
5.5 Minimum Spanning Trees . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.6 Kruskal’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.6.1 Steps of Kruskal’s Algorithm . . . . . . . . . . . . . . . . . . . . . 69
5.6.2 Example 1: Kruskal’s Algorithm . . . . . . . . . . . . . . . . . . . 69
5.6.3 Example 2: Graph with Six Vertices . . . . . . . . . . . . . . . . 70
5.6.4 Example 3: Complete Graph with Four Vertices . . . . . . . . . . 71
5.6.5 Example 4: Sparse Graph . . . . . . . . . . . . . . . . . . . . . . 71
5.6.6 Example 5: Weighted Cycle Graph . . . . . . . . . . . . . . . . . 72
5.7 Prim’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.7.1 Steps of Prim’s Algorithm . . . . . . . . . . . . . . . . . . . . . . 72
5.7.2 Example of Prim’s Algorithm . . . . . . . . . . . . . . . . . . . . 72

6 Planar Graphs and Graph Colouring 77


6.1 Application to Common Polyhedra . . . . . . . . . . . . . . . . . . . . . 78
6.2 Constraints on Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . 79
6.3 Graph Coloring Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

2
Course Information
ˆ Title: Graph Theory

ˆ Code: SMTH312

ˆ Department: Mathematical Sciences

ˆ Prerequisites: SMTH221, SMTH222

ˆ Co-requisites: None

Aim
This module aims to provide students with a deep understanding of graph theory, focusing
on its theoretical concepts and practical applications in various fields such as computer
science, engineering, and social sciences.

1 Overview of the Module


1.1 Learning Unit 1: Basic Concepts
ˆ Learning Outcomes: Students will understand the basic terms and definitions of
graph theory, including examples of graphs, and operations like union and comple-
ment.

ˆ Topics Covered:

– Overview of graph theory and its applications


– Definition and examples of graphs
– Types of graphs
– Operations on graphs: union and complement
– The degree of a vertex
– Isomorphism of a graph

ˆ Assessment Activities: Assignment and quizzes.

1.2 Learning Unit 2: Connectivity


ˆ Learning Outcomes: Basics of connected graphs, distances in graphs, cut-vertices,
bridges, and the Menger theorem.

ˆ Topics Covered:

– Connected graphs
– Distances in graphs
– Cut-vertices and bridges
– Havel-hakimi Theorem

3
– Menger theorem

ˆ Assessment Activities: Quizzes and a test.

1.3 Learning Unit 3: The Shortest Path Algorithm


This unit explores the strategic process of finding the shortest paths within weighted
graphs, focusing particularly on Dijkstra’s algorithm. The goal is to equip students with
both the theoretical understanding and practical skills necessary to apply these methods
to real-world problems in network traffic, logistics, and urban planning.

Learning Outcomes
By the end of this unit, students should be able to:

ˆ Define and understand key terms such as paths, weights, and shortest paths in the
context of weighted graphs.

ˆ Implement Dijkstra’s algorithm and understand its computational mechanics.

ˆ Evaluate the efficiency of the algorithm under various conditions and understand
its practical applications and limitations.

1.4 Learning Unit 4: Trees


ˆ Learning Outcomes: Definition and properties of trees, and constructing mini-
mum spanning trees.

ˆ Topics Covered:

– Definition of a tree
– Properties of trees
– Constructing minimum spanning trees

ˆ Assessment Activities: Quizzes.

1.5 Learning Unit 5: Eulerian and Hamiltonian Graphs


ˆ Learning Outcomes: Basic terms and definitions of Eulerian graphs, Fleury’s
algorithm, and the Chinese postman problem.

ˆ Topics Covered:

– Introduction to Eulerian graphs


– Fleury’s algorithm
– The Chinese postman problem

ˆ Assessment Activities: Quizzes and a test.

4
1.6 Learning Unit 6: Planar Graphs
ˆ Learning Outcomes: Basics of planar and Hamiltonian graphs, their properties,
the four-color problem, and the closure function.
ˆ Topics Covered:
– Planar and Hamiltonian graphs
– Properties of planar and Hamiltonian graphs
– The four-color problem
– The closure function
ˆ Assessment Activities: Quizzes and a test.

1.7 Learning Unit 7: Networks


ˆ Learning Outcomes: Basics of network theory, digraphs, the max-flow min-cut
theorem, and algorithm.
ˆ Topics Covered:
– Introduction to networks
– The maximum flow, minimum cut theorem
– The maximum flow, minimum cut algorithm
ˆ Assessment Activities: Quizzes and a test.

1.8 Assessment
ˆ Continuous Assessment (50%): (40% quizzes, assignments) and (60% periodic
tests).
ˆ Final Examination (50%): A comprehensive 3-hour written exam.

1.9 DP Requirement
ˆ Continuous Assessment Mark: Minimum of 40%
ˆ Attendance: Mandatory 90% attendance in lectures, practicals, and tutorials.

1.10 Recommended Texts and Resources


ˆ Introduction to Graph Theory by Richard J. Trudeau
ˆ Graph Theory and Its Applications by Jonathan L. Gross and Jay Yellen
ˆ Modern Graph Theory by Bela Bollobas
ˆ Graph Theory by Reinhard Diestel
ˆ Discrete Mathematics with Graph Theory by Edgar G. Goodaire and Michael M.
Parmenter
ˆ Introduction to Graph Theory by West, D.B.

5
2 Learning Unit 1: Basic Concepts
This unit introduces the foundational concepts of graph theory, covering essential defini-
tions, theorems, and operations on graphs.

2.1 Overview of Graph Theory and its Applications


Graph theory is a branch of discrete mathematics that studies the structure of graphs
mathematical constructs consisting of nodes (or vertices) connected by edges. This field
traces its formal origins to the work of Leonhard Euler, who in 1736 addressed the
Königsberg bridge problem, sparking the development of graph theory as a rigorous
mathematical discipline.
The city of Königsberg, now Kaliningrad, featured seven bridges linking various parts
of the city. Euler’s challenge was to find a route that would cross each bridge exactly
once and return to the starting point. This problem can be abstracted to a graph where
landmasses are represented as vertices and bridges as edges. Euler’s negative solution to
this problem not only proved that no such walk was possible but also laid the groundwork
for the concept of Eulerian paths and circuits in graph theory—a path or circuit that
visits every edge in a graph exactly once.
Euler’s solution involved checking the degree (the number of edges connected to a
vertex) of each vertex, leading to the formulation of the now fundamental Eulerian graph
criteria: A connected graph can contain an Eulerian circuit if and only if every vertex
has an even degree, and it can contain an Eulerian path if and only if exactly zero or two
vertices have an odd degree.
This result has profound implications beyond recreational math problems. In modern
applications, graph theory is fundamental to computer science, particularly in the fields
of data structures and algorithms, where problems often involve searching graphs (e.g.,
finding the shortest path between points in a network). In biology, graph theoretical
concepts are used to model the complex interconnections within ecosystems or between
proteins in the cell. Social scientists use graphs to study networks of social interactions,
examining how information spreads and how social structures evolve.
Moreover, the study of graphs intersects significantly with other areas of pure math-
ematics, including algebra and probability. Graphs can be represented in various forms
such as adjacency matrices and incidence matrices, which connect graph theory to lin-
ear algebra and spectral theory. This versatility makes graph theory an essential area
of study, informing both theoretical research and practical applications across diverse
scientific fields.

2.2 Definition and Examples of Graphs


Definition 2.1 (Graph). A graph G is defined as an ordered pair G = (V, E) where V is
a set of elements called vertices, and E is a set of ordered or unordered pairs of vertices,
known as edges. The nature of the pairs (ordered or unordered) determines whether the
graph is directed or undirected.

Definition 2.2 (Order of a Graph). The order of a graph refers to the number of vertices
in the graph. For a graph G = (V, E), the order is given by |V |, the cardinality of the set
V.

6
Definition 2.3 (Size of a Graph). The size of a graph refers to the number of edges in
the graph. For a graph G = (V, E), the size is given by |E|, the cardinality of the set E.

2.3 Examples of Graphs, Orders, and Sizes


Example 2.4 (Simple Undirected Graph). Consider the graph G = (V, E) where V =
{1, 2, 3} and E = {{1, 2}, {2, 3}, {3, 1}}. This graph is undirected, with no multiple edges
or loops, and is known as a cycle graph.

The order of G is 3, and the size of G is 3.

Example 2.5 (Directed Graph). Let V = {a, b, c, d} and E = {(a, b), (b, c), (c, d), (d, a)}.
This graph is directed and forms a cycle, where each vertex points to another in a closed
loop.

d c

a b

The order of this graph is 4, and the size is 4.

Example 2.6 (Weighted Graph). Suppose V = {x, y, z} and E = {(x, y, 5), (y, z, 15), (z, x, 10)}.
Each edge here carries a weight that could represent distance, cost, or some other mea-
surable quantity between vertices.

z
10 15
x y
5

The graph is undirected and weighted, with an order of 3 and a size of 3.

2.4 Adjacency and Incidence


Definition 2.7 (Adjacent). Two vertices are said to be adjacent if there is an edge
connecting them in the graph.

Definition 2.8 (Incident). A vertex and an edge are incident if the vertex is an endpoint
of the edge.

7
Examples to Illustrate Adjacency and Incidence

A B C
ˆ Adjacency in an Undirected Graph:
Here, vertices A and B are adjacent, as are B and C.
e
X Y
ˆ Incidence in a Directed Graph:
In this directed graph, the edge e is incident with vertex X at the tail and vertex
Y at the head.

2.5 Subgraphs
Definition 2.9 (Subgraph). A subgraph S of a graph G = (V, E) is a graph consisting
of a subset of the vertices of V and a subset of the edges of E that connect vertices in
this subset.

Examples to Illustrate Subgraphs


ˆ Example of a Subgraph: Consider a graph G = (V, E) where V = {a, b, c, d} and
E = {{a, b}, {b, c}, {c, d}, {d, a}, {b, d}}. A subgraph S can be formed by selecting
a subset of vertices and edges, for example, V ′ = {b, c, d} and E ′ = {{b, c}, {c, d}}.

a b c b c

d d
Subgraph S

In this visual representation, the left diagram shows the original graph G, and the
right diagram highlights the subgraph S, clearly indicating which vertices and edges
are included in S.

Types of Graphs and Their Characteristics


Graphs can be categorized into several types based on their properties and the rules that
govern their structure. Here are some common types of graphs, each illustrated to aid in
understanding their unique features:

ˆ Simple Graph: A graph without loops or multiple edges.

1 2

ˆ Complete Graph: A simple graph in which every pair of distinct vertices is


connected by a unique edge.

8
2

ˆ Directed Graph (Digraph): A graph where the edges have a direction associated
with them.

1 2

ˆ Bipartite Graph: A graph whose vertices can be divided into two disjoint sets
such that no two graph vertices within the same set are adjacent.

2 4

1 3

ˆ Complete Bipartite Graph: A bipartite graph in which every vertex of the first
set is connected to every vertex of the second set.

B 2

A 1

ˆ Weighted Graph: A graph in which each edge is assigned a weight or cost.

5.2
1 2

ˆ Multigraph: A graph which may have multiple edges between the same pair of
vertices.

1 2

ˆ Empty Graph: A graph with vertices but no edges.

1 2

9
2.6 Isomorphism of Graphs
Definition 2.10 (Isomorphism). Two graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are iso-
morphic if there exists a bijection f : V1 → V2 such that any two vertices u and v in
V1 are adjacent in G1 if and only if f (u) and f (v) are adjacent in G2 . This bijection is
called an isomorphism between the graphs.

2.6.1 Example of Graph Isomorphism


Consider two graphs, G1 and G2 , defined as follows:

ˆ G1 has vertices V1 = {a, b, c} and edges E1 = {{a, b}, {b, c}}.

ˆ G2 has vertices V2 = {1, 2, 3} and edges E2 = {{1, 2}, {2, 3}}.

An isomorphism between these graphs can be defined by the bijection f where f (a) =
1, f (b) = 2, and f (c) = 3.

Isomorphism f
a b c 1 2 3
G1 G2

In this example, you can see that the mapping preserves adjacency: {a, b} corresponds
to {1, 2} and {b, c} to {2, 3}, reflecting the definition of isomorphism accurately.
This example and definition highlight how graph isomorphism is not just about one-
to-one correspondence between vertices but also about preserving the structure of con-
nections (edges) between those vertices.

2.7 Matrix Representation of a Graph


Definition 2.11 (Adjacency Matrix). The adjacency matrix of a graph G = (V, E) with
n vertices is an n × n matrix A where Aij = 1 if there is an edge between the ith and j th
vertex, and Aij = 0 otherwise.

Example 1: Simple Graph


Consider a simple undirected graph G with vertices V = {1, 2, 3} and edges E =
{{1, 2}, {2, 3}}.

1 2 3

The adjacency matrix A for this graph is:


 
0 1 0
A = 1 0 1
0 1 0

10
Example 2: Directed Graph
Consider a directed graph G with vertices V = {1, 2, 3} and directed edges E = {(1, 2), (2, 3), (3, 1)}.

1 2

The adjacency matrix A for this directed graph is:


 
0 1 0
A= 0  0 1
1 0 0

Example 3: Graph with Self-loops


Consider a graph G with vertices V = {1, 2} and edges including self-loops E = {{1, 1}, {2, 2}, {1, 2}}.

1 2

The adjacency matrix A for this graph is:


 
1 1
A=
1 1

2.8 Function Representation of a Graph


Definition 2.12 (Incidence Function). An incidence function for a graph G = (V, E)
is a function f : E → {(u, v)|u, v ∈ V } that maps each edge to the pair of vertices it
connects.

Example 1: Simple Undirected Graph


Consider a simple undirected graph G with vertices V = {1, 2, 3} and edges E =
{{1, 2}, {2, 3}, {3, 1}}.

1 2

The incidence function f for this graph can be defined as:

f ({1, 2}) = (1, 2), f ({2, 3}) = (2, 3), f ({3, 1}) = (3, 1)

11
Example 2: Directed Graph
Consider a directed graph G with vertices V = {a, b, c} and directed edges E = {(a, b), (b, c), (c, a)}.

a b

The incidence function f for this graph can be defined as:

f ((a, b)) = (a, b), f ((b, c)) = (b, c), f ((c, a)) = (c, a)

2.9 Operations on Graphs: Union and Complement


Example 1: Union of Two Simple Graphs
Graph G1 : Vertices V1 = {1, 2, 3}, Edges E1 = {{1, 2}, {2, 3}}.

1 2 3

Graph G2 : Vertices V2 = {3, 4}, Edges E2 = {{3, 4}}.

3 4

Union of G1 and G2 :

1 2 3 4

Example 2: Union of Directed Graphs


Graph G1 : Vertices V1 = {a, b}, Directed Edges E1 = {(a, b)}.

a b

Graph G2 : Vertices V2 = {b, c}, Directed Edges E2 = {(b, c)}.

b c

Union of G1 and G2 :

a b c

Definition 2.13 (Complement of a Graph). The complement of a graph G = (V, E) is


a graph Gc on the same vertex set V but with an edge between two vertices if and only if
there is no edge between those vertices in G.

12
Example 1: Complement of a Simple Graph
Consider a simple graph G with vertices V = {1, 2, 3} and edges E = {{1, 2}, {2, 3}}.

Graph G:

1 2 3

Complement Gc : In the complement, the edge {1, 3} is present because it is not in G.

1 2 3

Example 2: Complement of a Triangle Graph


Consider a complete graph (triangle) G with vertices V = {a, b, c} and edges E =
{{a, b}, {b, c}, {c, a}}.

Graph G:

a b

Complement Gc : The complement of a complete graph has no edges, as every possible


edge is already in G.

a b

2.10 Join, Intersection, and Cartesian Products of Graphs


Join of G1 and G2 : Vertices of the join Vjoin = V1 ∪ V2 , Edges Ejoin include all edges
from G1 and G2 and all additional edges connecting vertices of G1 to vertices of G2 not
already connected.

a b c

Intersection of G1 and G2 : Vertices Vintersection = V1 ∩ V2 , Edges Eintersection include


edges that appear in both G1 and G2 .

13
Cartesian Product of G1 and G2 : Vertices Vproduct = V1 ×V2 . An edge exists between
(u, v) and (u′ , v ′ ) if u = u′ and vv ′ ∈ E2 or v = v ′ and uu′ ∈ E1 .

a,c b,c

a,b b,b

2.11 The Degree of a Vertex


Definition 2.14 (Degree). The degree of a vertex in a graph is the number of edges
connected to it. For the vertex v, this is denoted as deg(v).

Example 1: Degree in a Simple Graph


Consider a simple graph G with vertices V = {1, 2, 3, 4} and edges
E = {{1, 2}, {2, 3}, {3, 4}, {4, 1}, {1, 3}}.

Graph G:

4 3

1 2

ˆ Degree of vertex 1: deg(1) = 3 (edges connecting 1 to 2, 4, and 3)

ˆ Degree of vertex 2: deg(2) = 2 (edges connecting 2 to 1 and 3)

ˆ Degree of vertex 3: deg(3) = 3 (edges connecting 3 to 2, 4, and 1)

ˆ Degree of vertex 4: deg(4) = 2 (edges connecting 4 to 1 and 3)

Example 2: Degree in a Directed Graph


Consider a directed graph H with vertices V = {a, b, c} and directed edges
E = {(a, b), (b, c), (c, a), (b, a)}.

Graph H:

a b

ˆ Degree of vertex a: deg(a) = 3 (incoming from c, outgoing to b, incoming from b)

14
ˆ Degree of vertex b: deg(b) = 3 (incoming from a, outgoing to c, outgoing to a)

ˆ Degree of vertex c: deg(c) = 2 (incoming from b, outgoing to a)

Lemma 2.15 (Handshaking Lemma). In any graph, P the sum of the degrees of all the
vertices is twice the number of edges. Mathematically, v∈V deg(v) = 2|E|.
Proof. Each edge contributes exactly 2 to the total degree count, once for each of its
endpoints.

Example: Handshaking Lemma in Practice


Consider a graph G with six vertices and various connecting edges. We will calculate the
sum of the degrees and verify that it equals twice the number of edges.

Graph G: Vertices V = {1, 2, 3, 4, 5, 6}, and let’s assume the following edge connec-
tions:
E = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 1}, {1, 3}, {2, 4}, {3, 5}, {4, 6}}

3 2

4 1

5 6

Degree Calculation and Verification:


ˆ Degree of each vertex deg(1) = 3, deg(2) = 3, deg(3) = 4, deg(4) = 4, deg(5) = 3,
deg(6) = 3.
ˆ Sum of the degrees: deg(1) + deg(2) + deg(3) + deg(4) + deg(5) + deg(6) = 3 + 3 +
4 + 4 + 3 + 3 = 20.
ˆ Total number of edges |E| = 10.

ˆ Twice the number of edges 2|E| = 20, which matches the sum of the degrees,
confirming the Handshaking Lemma.
Corollary 2.16. The number of vertices of odd degree in a graph is even.
P
Proof. From the handshaking lemma, since the sum of degrees v∈V deg(v) is even (as
it equals 2|E|), and since the sum of an odd number of odd numbers is odd, there must
be an even number of vertices with odd degree.

Example: Demonstrating the Corollary


Consider a simple graph G where we ensure an even number of vertices have an odd
degree. Let’s define the graph with vertices V = {1, 2, 3, 4, 5, 6} and edges
E = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {1, 6}}, forming a simple cycle.

15
Graph G:

3 2

4 1

5 6

Degree Calculation:
ˆ Each vertex in this cycle has exactly 2 edges connected to it, meaning every vertex
has an even degree.

ˆ Let’s modify this graph by adding another edge between vertices 2 and 5, making
their degrees odd.

3 2

4 1

5 6

ˆ Now, vertices 2 and 5 have an odd degree (3 each). The rest remain even. We still
maintain an even number (two) of vertices with odd degrees, thus satisfying the
corollary.

2.12 TUTORIAL ONE


1. Discuss the mathematical implications of the Königsberg bridge problem and how
Leonhard Euler’s approach laid the foundation for modern graph theory.

2. Create a simple graph with 4 vertices and 6 edges, then analyze its completeness.
Provide a proof of your conclusion based on the properties of complete graphs.

3. Construct the graph union of G1 with vertices {a, b, c} and edges {{a, b}, {b, c}}
and G2 with vertices {d, e} and edge {{d, e}}. Provide a detailed illustration and
enumerate the vertices and edges of G1 ∪ G2 .

4. Calculate and visualize the complement of a cycle graph with 4 vertices. Discuss
the properties of the resulting graph in terms of connectivity and planarity.

5. Analyze a star graph with vertices {1, 2, 3, 4, 5} and describe the degrees of all
vertices. Explore the implications of these degrees on the graph’s topology and its
center vertex.

16
6. Evaluate the isomorphism between two graphs G1 with vertices {a, b, c} and edges
{{a, b}, {b, c}}, and G2 with vertices {1, 2, 3} and edges {{1, 2}, {2, 3}}. Develop a
detailed argument supporting the presence or absence of an isomorphism.
7. Derive the adjacency matrix for a path graph consisting of three vertices. Discuss
the matrix’s characteristics and what they reveal about the graph’s structure.
8. Identify and draw a subgraph within graph G with vertices {a, b, c, d} and edges
{{a, b}, {b, c}, {c, d}, {d, a}} that includes vertices {b, c, d}. Explain your choice of
subgraph and its relevance to the main graph.
9. Model a real-world problem involving a bipartite graph that represents a job as-
signment system, matching employees to roles based on their skills. Analyze the
model’s effectiveness in optimizing job assignments.
10. Investigate the isomorphic relationship between the graphs G1 and G2 described
above. Suggest a mapping that might demonstrate their isomorphism and discuss
the implications of this relationship.
11. Use the Handshaking Lemma to verify that a graph with 5 vertices connected to
form a cycle upholds this theorem. Provide a detailed explanation of your process.
12. Using Euler’s criterion, evaluate whether a graph with vertices {1, 2, 3, 4} and edges
{{1, 2}, {2, 3}, {3, 4}, {4, 1}, {2, 4}} supports an Eulerian circuit.
13. From the given adjacency matrix, construct a directed graph and analyze it to
determine the presence of cycles. Discuss your findings and the methodology used:
 
0 1 0
0 0 1
1 0 0
14. Illustrate and analyze a weighted graph with vertices {a, b, c} and the following
weighted edges: {(a, b, 3), (b, c, 5), (c, a, 4)}. Discuss the graph’s potential applica-
tions.
15. Explore the union of graphs G1 and G2 with specified vertices and edges. Draw the
resulting graph and discuss any notable properties or patterns observed.
16. Examine how graph theory can enhance the scheduling system in a university set-
ting, focusing on the optimal linkage of courses, time slots, and classroom alloca-
tions.
17. Classify a graph with vertices {1, 2, 3, 4} and all possible edges except {1, 3} and
{2, 4}. Discuss the graph’s type and the implications of its structure.
18. Discuss the significance of vertex degree in social network analysis, particularly
focusing on centrality and influence within the network.
19. Draw and analyze the complement of a bipartite graph with vertex sets {1, 2} and
{3, 4}, exploring the implications of internal and cross-set connections.
20. From a circular graph with vertices {1, 2, 3, 4, 5, 6}, identify and illustrate a sub-
graph containing vertices {1, 3, 5} and discuss the significance of the selected sub-
graph.

17
3 Learning Unit 2: Connectivity
Learning Outcomes: Students will understand the foundational aspects of graph con-
nectivity, the role of cut-vertices and bridges, and the implications of the Menger theorem
for network reliability and design.

3.1 Connected Graphs


Definition 3.1. A connected graph is one in which there is a path between every pair of
vertices. A strongly connected graph (for directed graphs) requires a directed path from
every vertex to every other vertex.

Example 1: Simple Connected Graph

a b c

d e

Strongly Connected Graph: Consider the following directed graph:

1 2

4 3

In this graph, every vertex has direct or indirect routes to every other vertex and vice
versa. For example: - From vertex 1 to 3: The path is 1 → 2 → 3 - From vertex 3 to 1:
The path is 3 → 4 → 1
This graph clearly shows that each vertex can reach every other vertex following the
directed paths.

Theorem 3.2 (Path Connectivity). A graph is connected if and only if for every partition
of its vertices into two nonempty subsets, there is an edge with one endpoint in each subset.

Proof. We consider two directions: necessity and sufficiency.


Necessity: Assume the graph is connected. Consider any partition of the vertex set
V into two nonempty subsets A and B. Since the graph is connected, there exists a path
between any vertex in A and any vertex in B. Let this path be v1 , v2 , . . . , vk where v1 ∈ A
and vk ∈ B. If v1 and v2 are in different subsets, then the edge (v1 , v2 ) is the required
edge crossing between A and B. Otherwise, continue along the path until the first time
it crosses from A to B, say at (vi−1 , vi ) where vi−1 ∈ A and vi ∈ B. Thus, an edge always
exists that connects the two subsets.

18
Sufficiency: Assume that for every partition of V into two nonempty subsets A and
B, there exists at least one edge with one endpoint in A and the other in B. Suppose for
contradiction that the graph is not connected. Then there exist at least two components
in the graph. Let A be the set of vertices in one component, and B the set of vertices
in all other components. By assumption, there should be an edge between A and B,
but this contradicts the definition of components being disconnected. Therefore, no such
partition exists, and the graph must be connected.
Thus, a graph is connected if and only if it is impossible to partition its vertices into
two nonempty subsets without an edge crossing between them.

3.2 Whitney’s Theorem on Connectivity and Edge Connectiv-


ity
Definition 3.3 (Vertex Connectivity κ). The vertex connectivity κ(G) of a graph G is
the minimum number of vertices that need to be removed to disconnect the remaining
graph or reduce it to a single vertex. Formally, for a connected graph G with more
than two vertices, κ(G) is the size of the smallest vertex set whose removal results in a
graph that is either disconnected or consists of a single vertex. If G is complete, then
κ(G) = |V (G)| − 1, where |V (G)| is the number of vertices in G.

3.2.1 Example of Vertex Connectivity (κ)


Consider the graph G with vertices a, b, c, d, e connected as follows:

a b c

d e

In this graph, removing the vertex b and d results in the graph being disconnected as
no path remains between a and e. Therefore, κ(G) = 2.

Definition 3.4 (Minimum Degree δ). In a graph G = (V, E), the minimum degree δ(G)
is the smallest degree of any vertex in the graph. Formally, if V is the set of vertices in
G, then:
δ(G) = min deg(v)
v∈V

where deg(v) denotes the degree of the vertex v, i.e., the number of edges incident to v.

3.2.2 Examples Illustrating Minimum Degree


Example 1: Graph with Varying Degrees Consider a graph with vertices a, b, c, d
where a is connected to all other vertices, b and c are connected to a and each other, and
d is connected only to a.

19
a b

d c

In this graph, the degrees of the vertices are as follows: - deg(a) = 4, - deg(b) = 2, -
deg(c) = 2, - deg(d) = 1.
Thus, the minimum degree δ(G) = 1, corresponding to vertex d.

Example 2: Regular Graph A 3-regular graph, where each vertex has exactly three
connections. In this case, the minimum degree is also three, illustrating a scenario where
every vertex shares the same degree.

1 2

4 3

Definition 3.5 (Edge Connectivity λ). The edge connectivity λ(G) of a graph G is defined
as the minimum number of edges that need to be removed to make the graph disconnected
or trivial. It is denoted as λ(G) and is an indicator of the ’robustness’ of the graph against
edge failures. For any graph G, λ(G) cannot exceed the minimum degree of G, denoted
δ(G), i.e., λ(G) ≤ δ(G).

3.2.3 Example of Edge Connectivity (λ)


Using the same graph G from the vertex connectivity example:

a b c

d e

In this graph, removing any two of the edges connecting a − b and d − a disconnects
vertex a from the rest of the graph. Thus, λ(G) = 2.

Theorem 3.6 (Whitney’s Theorem). For any connected graph, the vertex connectivity κ
and edge connectivity λ satisfy κ ≤ λ ≤ δ, where δ is the minimum degree of the graph.

Proof. (Sketch) Vertex connectivity κ is less than or equal to edge connectivity λ because
removing κ vertices removes at least κ edges, but not all sets of κ edges are incident to
κ vertices. Edge connectivity λ is less than or equal to the minimum degree δ because
removing all edges incident to a vertex of minimum degree disconnects that vertex from
the graph.

20
3.3 Expansion Properties and Spectral Gap
Definition 3.7 (d-Regular Graph). A graph G = (V, E) is said to be d-regular if every
vertex v ∈ V has the same degree d, i.e., the number of edges incident to each vertex is
exactly d. This means that for all vertices v, the degree deg(v) = d.

3.3.1 Examples of d-Regular Graphs


Example 1: A 3-Regular Graph (Cubic Graph) Consider a simple cycle with four
vertices where each vertex is also connected to the vertex diagonally opposite to it. This
setup results in each vertex having exactly three connections, making the graph 3-regular.

a b

d c

Example 2: A 2-Regular Graph A simple cycle involving any number of vertices,


where each vertex is connected only to its two immediate neighbors, is 2-regular. For
example, a triangle (cycle with three vertices) is a 2-regular graph.

a c

Definition 3.8 (Laplacian Matrix). The Laplacian matrix L of a graph G with n vertices
is defined as L = D −A, where A is the adjacency matrix of the graph and D is the degree
matrix. The degree matrix D is a diagonal matrix where each diagonal element Dii is the
degree of the i-th vertex, and A is the adjacency matrix where each element Aij is 1 if
there is an edge between the i-th and j-th vertices, and 0 otherwise.
Formally, the elements of the Laplacian matrix L are given by:

di
 if i = j
Lij = −1 if i ̸= j and there is an edge between vertex i and vertex j

0 otherwise

where di is the degree of vertex i.

The Laplacian matrix has several important properties that make it useful:

ˆ Semi-definite: The Laplacian matrix is symmetric and positive semi-definite.

ˆ Eigenvalues: The smallest eigenvalue of L is zero, and the corresponding eigen-


vector is the constant one vector. The multiplicity of the zero eigenvalue equals the
number of connected components in the graph.

ˆ Kirchhoff ’s Matrix-Tree Theorem: The number of spanning trees of the graph


can be determined from the cofactors of the Laplacian matrix.

21
ˆ Random Walks: The Laplacian matrix is used to describe the behavior of random
walks on the graph, particularly in determining the mixing rate.

Example 3.9. Consider a simple graph with four vertices connected as follows:

ˆ Vertex 1 is connected to Vertex 2 and Vertex 4.

ˆ Vertex 2 is connected to Vertex 1 and Vertex 3.

ˆ Vertex 3 is connected to Vertex 2.

ˆ Vertex 4 is connected to Vertex 1.

Graph Representation:

1 2

4 3

Adjacency Matrix (A): The adjacency matrix A for this graph is:
 
0 1 0 1
1 0 1 0
A= 0 1

0 0
1 0 0 0

Degree Matrix (D): The degree matrix D, which is diagonal, where each diagonal
entry indicates the number of connections for each vertex:
 
2 0 0 0
0 2 0 0
D= 0 0 1 0

0 0 0 1

Laplacian Matrix (L): Using the definition L = D − A, the Laplacian matrix is:
 
2 −1 0 −1
−1 2 −1 0 
L=  0 −1 1

0
−1 0 0 1

Explanation:

ˆ Diagonal Entries: Each diagonal entry Lii reflects the degree of vertex i, showing
the total number of edges incident to that vertex.

ˆ Off-diagonal Entries: Each off-diagonal entry Lij (where i ̸= j) is −1 if there is


an edge between vertex i and vertex j, and 0 otherwise, representing the connectivity
or lack thereof between vertices.

22
Definition 3.10 (Spectral Gap). The spectral gap of a graph is defined as the difference
between the largest eigenvalue and the second largest eigenvalue of its adjacency matrix,
or equivalently, the smallest non-zero eigenvalue of its Laplacian matrix. Formally, if
λ1 ≥ λ2 ≥ . . . ≥ λn are the eigenvalues of the adjacency matrix of a graph, then the
spectral gap is λ1 − λ2 . For the Laplacian matrix, where the eigenvalues are µ0 ≤ µ1 ≤
. . . ≤ µn−1 with µ0 = 0, the spectral gap is µ1 .

The spectral gap provides valuable information about the graph’s structure and dy-
namics:

ˆ Connectivity: A larger spectral gap indicates stronger connectivity. A connected


graph has a positive spectral gap, while a disconnected graph has a spectral gap of
zero.

ˆ Expansion Properties: The spectral gap is a measure of the graph’s expansion,


reflecting how well-connected different parts of the graph are. Expander graphs,
which have good expansion properties, are characterized by a large spectral gap.

ˆ Mixing Time: In random walks and Markov chains associated with graphs, the
spectral gap influences the mixing time—the time it takes for the process to become
close to its steady state. A larger spectral gap typically results in a faster mixing
time.

Definition 3.11 (Expansion Constant). The expansion constant h of a graph is defined


as:
|∂S|
h= min
S⊂V,|S|≤ 2 |S|
|V |

where ∂S denotes the edge boundary of S, consisting of edges with exactly one endpoint
in S.

Here, h measures the smallest ratio of the number of edges leaving S to the
number of vertices in S, minimized over all subsets S whose sizes are at most
half the total number of vertices in the graph. This ratio is a crucial indicator
of the graph’s connectivity and robustness.

Definition 3.12 (Rayleigh Quotient). For a real symmetric matrix A and a non-zero
vector x, the Rayleigh Quotient R(A, x) is defined as the ratio of the quadratic form
xT Ax to the squared norm xT x, expressed mathematically as:

xT Ax
R(A, x) =
xT x
This quotient helps in estimating the maximum and minimum eigenvalues of the matrix
A.

Theorem 3.13 (Cheeger’s Inequality for d-regular graphs). For a d-regular graph, the
expansion h of the graph is bounded by its spectral gap λ:

h2
2h ≥ λ ≥
2d

23
Part 1: 2h ≥ λ
Lemma 3.14. The second smallest eigenvalue λ2 of the Laplacian matrix L, which is
equivalent to λ for the adjacency matrix in a d-regular graph, is related to the graph
structure by:
2
P
{u,v}∈E (f (u) − f (v))
λ2 = min P 2
v∈V f (v)
f ⊥1
f ̸=0

where 1 is the vector of all ones, ensuring f is orthogonal to 1.

Consider the function f defined by f (v) = 1 for v ∈ S and f (v) = −1 for v ∈


/ S.
Applying this test function, we analyze the Rayleigh quotient and obtain:

|∂S|
λ2 ≤
|S|

By minimizing over all such S, we find 2h ≥ λ.

h2
Part 2: λ ≥ 2d

Lemma 3.15. The conductance of the graph provides a lower bound for the spectral gap:

h2
λ≥
2d
This conclusion is drawn from the relationship between the mixing time of random walks
on the graph and its conductance, where a higher conductance implies a larger spectral
gap and thus faster mixing.

3.4 Highly Connected Graphs and Super Connectivity


Definition 3.16 (Super Connectivity). A graph is super-κ if it remains connected upon
the removal of any fewer than κ vertices, even if one of the vertices removed is of minimum
degree.

Theorem 3.17 (Super Connectivity and Minimum Degree). A super-κ graph with min-
imum degree δ satisfies κ ≥ δ.

Proof. (Sketch] In a super-κ graph, removing any set of vertices fewer than κ must not
disconnect the graph. If a vertex of minimum degree δ can be removed without disconnect-
ing the graph, then the graph’s connectivity is at least δ, asserting a strong relationship
between minimum degree and connectivity.

3.5 Distances in Graphs


Definition 3.18. The distance between two vertices in a graph is the number of edges in
the shortest path connecting them.

Theorem 3.19 (Triangle Inequality in Graphs). For any three vertices u, v, and w in a
graph, the distance between u and w is at most the sum of the distances between u and v
and between v and w.

24
Proof. Let d(x, y) denote the distance between vertices x and y in the graph, defined as
the length of the shortest path connecting them. We will prove the triangle inequality,
which states that for any vertices u, v, and w:

d(u, w) ≤ d(u, v) + d(v, w)


Consider any shortest path from u to v and any shortest path from v to w. If these
paths are Puv and Pvw , respectively, then we can construct a path from u to w by following
Puv from u to v and then Pvw from v to w.
The length of this combined path is the sum of the lengths of Puv and Pvw , which is
d(u, v) + d(v, w). Since the distance d(u, w) is defined as the length of the shortest path
from u to w, it cannot be greater than the length of any particular path from u to w,
including the one we have constructed. Hence, we have:

d(u, w) ≤ d(u, v) + d(v, w)


as required.

Example 2: Weighted Graph Distance

3 4
a b c

2
5
d e
1

Theorem 3.20 (Relationship Between Radius and Diameter). In any graph, the radius
r and the diameter d are related by the inequality:

r ≤ d ≤ 2r

Proof. The proof consists of two parts based on the definitions of radius and diameter:

1. Radius less than or equal to Diameter: Since radius is the minimum eccen-
tricity and diameter is the maximum eccentricity among all vertices in a graph, it
is trivial that r ≤ d.

2. Diameter less than or equal to twice the Radius: Consider two vertices u
and v where the distance d(u, v) equals the diameter d. Let w be a vertex such
that ϵ(w) = r (i.e., w is a central vertex with minimum eccentricity). Then by the
triangle inequality:
d(u, v) ≤ d(u, w) + d(w, v)
Since d(u, w) ≤ r and d(w, v) ≤ r (by the definition of radius as the minimum
eccentricity), we have:
d ≤ r + r = 2r

This completes the proof, establishing that r ≤ d ≤ 2r in any graph.

Corollary 3.21. The center of a graph, which is the set of all vertices with eccentricity
equal to the radius, is non-empty and forms a subgraph.

25
Proof. Since every graph has a vertex with minimum eccentricity, there exists at least
one vertex v such that ϵ(v) = r. Thus, the center, defined as the set of all such vertices, is
non-empty. Additionally, if two vertices u and v are in the center, then the path between
them must also consist of central vertices, otherwise, there would exist a vertex on the
path with higher eccentricity, contradicting the definition of the center. Thus, the center
forms a subgraph.

Corollary 3.22. If a graph has diameter d and radius r such that d = 2r, then the graph
contains a path of length d as its longest shortest path.

Proof. This follows directly from the earlier proof where we established that the maximum
distance between any two vertices u and v achieving the diameter d can be at most 2r.
If d = 2r, then the path that includes the central vertex w and extends to both u and v
achieving maximum distance will have length 2r, thus coinciding with the longest shortest
path in the graph.

3.6 Cut-vertices and Bridges


Definition 3.23. A cut-vertex is a vertex whose removal increases the number of con-
nected components of the graph.

Definition 3.24. A bridge is an edge whose removal increases the number of connected
components of the graph.

Example 1: Identifying a Cut-Vertex Consider the following graph:

a b c

In this graph, vertex b is a cut-vertex because its removal disconnects the graph,
separating vertices a, c, and d from each other.

Example 2: Identifying a Cut-Vertex Consider the following graph:

e d

a b c

In this graph, vertex b is a cut-vertex because its removal disconnects the graph,
leaving a, c, and d in separate components.

26
Example 3: Identifying a Bridge Consider the following graph:

a b c

In this graph, the edge (b, c) is a bridge because its removal increases the number of
connected components by disconnecting vertex c from the rest of the graph.

Example 4: Identifying a Bridge Consider the following graph:

d e f

a b c

In this graph, the edge (b, e) is a bridge because its removal increases the number of
connected components, disconnecting e from the rest of the graph.
Definition 3.25. A cut-vertex is a vertex whose removal increases the number of con-
nected components of the graph.
Definition 3.26. A bridge is an edge whose removal increases the number of connected
components of the graph.

Example 1: Identifying a Cut-Vertex Consider the following graph:

a b c

In this graph, vertex b is a cut-vertex because its removal disconnects the graph,
separating vertices a, c, and d from each other.

Example 2: Identifying a Cut-Vertex Consider the following graph:

e d

a b c

In this graph, vertex b is a cut-vertex because its removal disconnects the graph,
leaving a, c, and d in separate components.

27
Example 3: Identifying a Bridge Consider the following graph:

a b c

In this graph, the edge (b, c) is a bridge because its removal increases the number of
connected components by disconnecting vertex c from the rest of the graph.

Example 4: Identifying a Bridge Consider the following graph:

d e f

a b c

In this graph, the edge (b, e) is a bridge because its removal increases the number of
connected components, disconnecting e from the rest of the graph.

Example 5: Identifying a Cut-Vertex Consider the following graph:

d e

a b c

In this graph, vertex b is a cut-vertex because its removal disconnects the graph into
two components: one containing a and d, and the other containing c and e.

Example 6: Identifying a Bridge Consider the following graph:

d e f

a b c

In this graph, the edge (a, d) is a bridge because its removal increases the number of
connected components by disconnecting vertex d from the rest of the graph.

28
Example 7: Identifying a Cut-Vertex Consider the following graph:

d e

a b c f

In this graph, vertex c is a cut-vertex because its removal disconnects the graph into
two components: one containing a, b, and d, and the other containing e and f .

Example 8: Identifying a Bridge Consider the following graph:

d e

a b c f

In this graph, the edge (c, f ) is a bridge because its removal increases the number of
connected components by disconnecting vertex f from the rest of the graph.

Example 9: Identifying a Cut-Vertex Consider the following graph:

d e g

a b c f

In this graph, vertex c is a cut-vertex because its removal disconnects the graph into
two components: one containing a, b, and d, and the other containing e, f, and g.

Theorem 3.27. In any connected graph with at least two vertices, the removal of a
vertex v results in more connected components than the original graph if and only if v is
a cut-vertex.

Proof. (⇒) Suppose v is a cut-vertex in a connected graph G. By definition, the removal


of v from G increases the number of connected components. This means that the graph
G − v has more connected components than G.
(⇐) Suppose that removing a vertex v from a connected graph G results in a graph
G − v with more connected components than G. This implies that v was a vertex whose
removal increased the number of connected components, which is precisely the definition
of a cut-vertex.

Theorem 3.28. In any connected graph, the removal of an edge e results in more con-
nected components than the original graph if and only if e is a bridge.

29
Proof. (⇒) Suppose e is a bridge in a connected graph G. By definition, removing e from
G increases the number of connected components. This means that the graph G − e has
more connected components than G.
(⇐) Suppose that removing an edge e from a connected graph G results in a graph
G − e with more connected components than G. This implies that e was an edge whose
removal increased the number of connected components, which is precisely the definition
of a bridge.

3.7 Degree Sequences and Graphical Representations


Definition 3.29 (Graphical Sequence). A sequence of integers is graphical if it is the
degree sequence of some graph. More formally, a sequence of non-negative integers
d1 , d2 , . . . , dn is graphical if there exists a graph G with vertices v1 , v2 , . . . , vn such that
each vertex vi has degree di .

Definition 3.30 (Realization of a Sequence). A graph G that corresponds to a given


graphical sequence s is called a realization of s. This means that G has vertices with
degrees exactly as specified by the sequence s.

Havel-Hakimi Theorem
Theorem 3.31 (Havel-Hakimi Algorithm). The Havel-Hakimi Algorithm provides a
method to determine whether a given degree sequence is graphical. The theorem states
that a non-increasing sequence of non-negative integers s = (d1 , d2 , . . . , dn ) is graphical if
and only if the sequence obtained by deleting the first term d1 and subtracting 1 from the
next d1 terms of the remaining sequence is graphical.

Proof. We employ a sequence of manipulative steps on a given degree sequence s. Initially,


we sort s in non-increasing order. We then remove the first element d1 and decrease each
of the next d1 elements by 1. If this adjustment results in any negative numbers, s is
deemed not graphical. We continue this process with the newly formed sequence, aiming
to reduce all elements to zero. Achieving a sequence of all zeros confirms that s is
graphical. However, if we encounter a sequence that cannot be further reduced without
negatives appearing, s is not graphical. This methodology hinges on the principle that
removing a vertex of degree d1 , and thus diminishing the degrees of its d1 adjacent vertices,
simulates the removal of the corresponding vertex and its connecting edges in a graph,
which tests the graphical nature of s.

Havel-Hakimi Algorithm
The Havel-Hakimi algorithm is used to determine if a given degree sequence can represent
a simple graph. Here are the steps of the algorithm:

1. Sort the degree sequence in non-increasing order.

2. Remove the first element d1 of the sequence and subtract 1 from the next d1 elements
of the list.

3. If the sequence contains any negative numbers after this operation, the sequence is
not graphical.

30
4. Repeat the process with the new sequence obtained after the subtraction.

5. If the process ends with a sequence of all zeros, then the original sequence is graph-
ical.

Example 1: Sequence [4, 3, 3, 2, 1]


Original sequence: [4, 3, 3, 2, 1]

1. Sort (already sorted): [4, 3, 3, 2, 1]

2. Remove the first element (4) and subtract 1 from the next 4 elements:

[3, 3, 2, 1] → [2, 2, 1, 0]

3. Sorted result after step: [2, 2, 1, 0]

4. Remove the first element (2) and subtract 1 from the next 2 elements:

[2, 1, 0] → [0, 0]

5. Sorted result after step: [0, 0] (all zeros)

6. The sequence is graphical as it reduces to all zeros.

Example 2: Sequence [4, 3, 3, 1, 1]


Original sequence: [4, 3, 3, 1, 1]

1. Sort (already sorted): [4, 3, 3, 1, 1]

2. Remove the first element (4) and subtract 1 from the next 4 elements:

[3, 3, 1, 1] → [2, 2, 0, 0]

3. Sorted result after step: [2, 2, 0, 0]

4. Remove the first element (2) and subtract 1 from the next 2 elements:

[2, 0, 0] → [0, 0]

5. Sorted result after step: [0, 0] (all zeros)

6. The sequence is graphical as it reduces to all zeros.

31
Example 3: Sequence [3, 3, 2, 2, 2]
Original sequence: [3, 3, 2, 2, 2]
1. Sort (already sorted): [3, 3, 2, 2, 2]
2. Remove the first element (3) and subtract 1 from the next 3 elements:

[3, 2, 2, 2] → [2, 1, 1, 2]

3. Sorted result after step: [2, 2, 1, 1]


4. Remove the first element (2) and subtract 1 from the next 2 elements:

[2, 1, 1] → [0, 0, 1]

5. Sorted result after step: [1, 0, 0]


6. Remove the first element (1) and subtract 1 from the next element:

[0, 0]

7. Sorted result after step: [0, 0] (all zeros)


8. The sequence is graphical as it reduces to all zeros.

Example 4: Sequence [5, 3, 3, 2, 2]


Original sequence: [5, 3, 3, 2, 2]
1. Sort (already sorted): [5, 3, 3, 2, 2]
2. Attempt to remove the first element (5) and subtract 1 from the next 5 elements
fails as there are only 4 remaining elements.
3. The sequence is not graphical since there are insufficient terms for subtraction.

Example 5: Sequence [3, 3, 2, 1, 0]


Original sequence: [3, 3, 2, 1, 0]
1. Sort (already sorted): [3, 3, 2, 1, 0]
2. Remove the first element (3) and subtract 1 from the next 3 elements:

[3, 2, 1, 0] → [2, 1, 0, 0]

3. Sorted result after step: [2, 1, 0, 0]


4. Remove the first element (2) and subtract 1 from the next 2 elements:

[1, 0, 0] → [0, 0, 0]

5. Sorted result after step: [0, 0, 0] (all zeros)


6. The sequence is graphical as it reduces to all zeros.

32
3.8 Menger’s Theorem
Theorem 3.32 (Menger’s Theorem). [Read this after Network Section] For any pair of
non-adjacent vertices u and v in a graph, the minimum number of vertices whose removal
disconnects u from v equals the maximum number of vertex-disjoint paths from u to v.

Proof. Consider a flow network where each vertex in the graph, except u and v, is replaced
by two vertices: one for incoming edges and one for outgoing edges, connected by an edge
of capacity one. This transformation ensures that cutting a vertex in the original graph
corresponds to cutting this capacity one edge in the flow network.
Define a flow where each edge in this network has a capacity of one. By the max-flow
min-cut theorem, the maximum value of an s-t flow (from u to v in this context) is equal to
the minimum capacity of an s-t cut in the network. Here, each flow path corresponds to a
vertex-disjoint path in the original graph, and the capacity of a minimum cut corresponds
to the minimum number of vertices needed to disconnect u from v.
Thus, the maximum number of vertex-disjoint paths between u and v (maximum flow
value) is equal to the minimum number of vertices whose removal disconnects u from v
(minimum cut capacity).

Application of Menger’s Theorem


Consider the graph with vertices arranged as follows and edges defined between them:

u a b v

Analysis of vertex-disjoint paths and minimum vertex cut provides: - Only one vertex-
disjoint path, u → v. - To disconnect u from v, removing either vertex (impractical as
these are endpoints) or blocking this direct path would be necessary.

3.9 TUTORIAL TWO


Connected Graphs
1. Define a connected graph and provide an example with five vertices.

2. Explain the difference between a connected graph and a strongly connected graph
with a diagram.

3. Draw a simple connected graph and compute the number of paths between two
vertices of your choice.

4. How does adding an edge affect the connectivity of a graph? Illustrate with a graph
example, and calculate its number of connected components before and after the
addition.

33
Cut-vertices and Bridges
5. Define a cut-vertex and a bridge. Use a specific graph to show their roles compu-
tationally.

6. Provide a graph that contains both a cut-vertex and a bridge. Perform a compu-
tational analysis to show the effect of removing each.

7. Remove a cut-vertex from the provided graph and describe computationally the
new graph structure.

8. Discuss the computational impact of removing a bridge from a graph on the graph’s
connectivity.

9. Identify the cut-vertices in the graph defined by:


Vertices: a, b, c, d, e; Edges: ab, bc, cd, de, ea. Use an algorithmic
approach in your identification.

Graph Properties
10. Calculate the degree of each vertex in a given graph and explain its significance in
connectivity.

11. Provide the adjacency matrix and the degree matrix for the graph used in the
previous question.

12. Compute the Laplacian matrix for the same graph and discuss its implications in
connectivity.

13. Calculate the edge connectivity of a given graph and relate it to the graph’s mini-
mum degree.

14. Using the concept of vertex-disjoint paths, design an algorithm to ensure robust
communication in a network topology presented in a diagram.

Applications and Miscellaneous


15. Prove that for any connected graph, there exists at least one pair of vertices such
that removing the edge between them (if any) does not disconnect the graph.

16. Prove that in any graph, adding edges never decreases the number of connected
components.

17. Prove that every connected graph with at least two vertices has an edge.

18. Prove that a graph with n vertices and n − 1 edges is connected if and only if it
does not contain cycles.

19. Prove that every connected graph has a vertex whose removal does not disconnect
the graph.

34
Havel-Hakimi Algorithm Applications
20. Determine if the degree sequence [4, 3, 2, 2, 1] is graphical using the Havel-Hakimi
algorithm.

21. Apply the Havel-Hakimi algorithm to the sequence [4, 3, 3, 3, 2, 2, 1] and identify
if it’s graphical.

22. Analyze the graphical nature of the sequence [5, 4, 3, 2, 2] using the Havel-Hakimi
algorithm.

23. Verify if the degree sequence [1, 1, 1, 1, 4] can represent a simple graph through
the Havel-Hakimi algorithm.

24. Use the Havel-Hakimi algorithm to examine whether the sequence [3, 3, 3, 3, 3]
forms a simple graph.

25. Determine the graphical properties of the sequence [2, 2, 2, 2, 1, 1] by employing


the Havel-Hakimi method.

3.10 TUTORIAL TWO SOLUTIONS


Connected Graphs
1. Define a connected graph and provide an example with five vertices.
A connected graph is a graph in which there is a path between every pair of vertices.
An example of a connected graph with five vertices is shown below:

d e
c

a b

2. Explain the difference between a connected graph and a strongly con-


nected graph with a diagram.
A connected graph is an undirected graph in which there is a path between every
pair of vertices. A strongly connected graph is a directed graph in which there is a
directed path from any vertex to every other vertex. The diagrams below illustrate
these concepts:

d e d e
c c

a b a b

3. Draw a simple connected graph and compute the number of paths be-
tween two vertices of your choice.

35
d e
c

a b

Let’s compute the number of paths between vertices a and d:


ˆ Path 1: a → c → d
ˆ Path 2: a → b → c → d
There are 2 paths between vertices a and d.
4. How does adding an edge affect the connectivity of a graph? Illustrate
with a graph example, and calculate its number of connected components
before and after the addition.
c d c d

a b a b

Before adding the edge {b, c}, there are 2 connected components. After adding the
edge {b, c}, there is only 1 connected component, making the graph connected.

Cut-vertices and Bridges


5. Define a cut-vertex and a bridge. Use a specific graph to show their roles
computationally.
A cut-vertex (or articulation point) is a vertex that, when removed, increases the
number of connected components. A bridge (or cut-edge) is an edge that, when
removed, increases the number of connected components.

a b c

In this graph, b is a cut-vertex and {b, c} is a bridge. Removing b or the edge {b, c}
will increase the number of connected components.
6. Provide a graph that contains both a cut-vertex and a bridge. Perform
a computational analysis to show the effect of removing each.
e d

a b c

36
In this graph, b is a cut-vertex and {b, c} is a bridge. Removing b splits the graph
into two disconnected components: {a, e} and {c, d}. Removing the bridge {b, c}
splits the graph into two components: {a, b, d, e} and {c}.

7. Remove a cut-vertex from the provided graph and describe computa-


tionally the new graph structure. Removing b from the graph:

e d

a c

The new graph structure has two disconnected components: {a, e} and {c, d}.

8. Discuss the computational impact of removing a bridge from a graph on


the graph’s connectivity. Removing a bridge increases the number of connected
components of the graph. It separates the graph into two subgraphs, making it less
connected.

9. Identify the cut-vertices in the graph defined by: Vertices: a, b, c,


d, e; Edges: ab, bc, cd, de, ea. Use an algorithmic approach in your
identification.

d c

a b

Using an algorithmic approach, such as DFS, we find that the cut-vertex is c.


Removing c increases the number of connected components.

Graph Properties
10. Calculate the degree of each vertex in a given graph and explain its
significance in connectivity.

d c

a b

Degrees: deg(a) = 2, deg(b) = 2, deg(c) = 2, deg(d) = 2, deg(e) = 2. Each vertex


has a degree of 2, indicating that the graph is regular and each vertex contributes
equally to connectivity.

37
11. Provide the adjacency matrix and the degree matrix for the graph used
in the previous question. Adjacency matrix:
 
0 1 0 0 1
1 0 1 0 0 
 
0 1 0 1 0 
 
0 0 1 0 1 
1 0 0 1 0

Degree matrix:  
2 0 0 0 0
0 2 0 0 0
 
0 0 2 0 0
 
0 0 0 2 0
0 0 0 0 2

12. Compute the Laplacian matrix for the same graph and discuss its impli-
cations in connectivity. Laplacian matrix L = D − A:
 
2 −1 0 0 −1
−1 2 −1 0 0
 
 0 −1 2 −1 0 
 
0 0 −1 2 −1
−1 0 0 −1 2

The Laplacian matrix indicates the degree of each vertex and the adjacency between
them. Its eigenvalues can provide insights into the graph’s connectivity and the
presence of connected components.

13. Calculate the edge connectivity of a given graph and relate it to the
graph’s minimum degree. Edge connectivity is the minimum number of edges
that must be removed to disconnect the graph. For the given graph, edge connec-
tivity is 2, which is equal to the minimum degree of the vertices.

14. Using the concept of vertex-disjoint paths, design an algorithm to ensure


robust communication in a network topology presented in a diagram. To
ensure robust communication, we can use the Max-Flow Min-Cut Theorem to find
the maximum number of vertex-disjoint paths. This will determine the network’s
resilience to vertex failures.

Applications and Miscellaneous


15. Prove that for any connected graph, there exists at least one pair of
vertices such that removing the edge between them (if any) does not
disconnect the graph.
Proof: In any connected graph, consider a spanning tree T . Since T is acyclic and
connected, removing any leaf edge of T will not disconnect the original graph.

16. Prove that in any graph, adding edges never decreases the number of
connected components.

38
Proof: Adding an edge can only connect previously disconnected vertices or add
a redundant connection between already connected vertices. Thus, the number of
connected components cannot decrease.

17. Prove that every connected graph with at least two vertices has an edge.
Proof: By the definition of a connected graph, there must be a path between any
two vertices. A path implies the presence of at least one edge.

18. Prove that a graph with n vertices and n − 1 edges is connected if and
only if it does not contain cycles.
Proof: If a graph has n vertices and n − 1 edges and contains no cycles, it must
be a tree, which is connected. Conversely, a connected graph with n vertices and
n − 1 edges is a tree and contains no cycles.

19. Prove that every connected graph has a vertex whose removal does not
disconnect the graph.
Proof: In a connected graph, consider a vertex with the highest degree. Removing
this vertex may reduce connectivity but will not completely disconnect the graph
if other paths exist between remaining vertices.

Havel-Hakimi Algorithm Applications


20. Sequence [4, 3, 2, 2, 1]:

ˆ Original sequence: [4, 3, 2, 2, 1]


ˆ Remove the first element (4) and subtract 1 from the next four elements:
[3, 2, 2, 1] → [2, 1, 1, 0].
ˆ Continue the process: [2, 1, 1, 0] → [1, 0, 0] → [0, 0].
ˆ Since the sequence reduces to all zeros, it is graphical.

21. Sequence [4, 3, 3, 3, 2, 2, 1]:

ˆ Original sequence: [4, 3, 3, 3, 2, 2, 1]


ˆ Remove the first element (4) and subtract 1 from the next four elements:
[3, 3, 3, 2, 2, 1] → [2, 2, 2, 1, 1, 0].
ˆ Continue the process: [2, 2, 2, 1, 1, 0] → [1, 1, 1, 0, 0] → [0, 0, 0].
ˆ Since the sequence reduces to all zeros, it is graphical.

22. Sequence [5, 4, 3, 2, 2]:

ˆ Original sequence: [5, 4, 3, 2, 2]


ˆ Remove the first element (5), but attempting to subtract 1 from the next five
elements fails due to insufficient elements, thus it is not graphical.

23. Sequence [1, 1, 1, 1, 4]:

ˆ Original sequence: [4, 1, 1, 1, 1]

39
ˆ Remove the first element (4) and subtract 1 from the next four elements:
[1, 1, 1, 1] → [0, 0, 0, 0].
ˆ Since the sequence reduces to all zeros, it appears graphical, but it implies an
impossible graph topology in simple graphs.

24. Sequence [3, 3, 3, 3, 3]:

ˆ Original sequence: [3, 3, 3, 3, 3]


ˆ Remove the first element (3) and subtract 1 from the next three elements:
[3, 3, 3, 3] → [2, 2, 2, 2].
ˆ No amount of iterations successfully reduces the sequence to all zeros, thus it
is not graphical.

25. Sequence [2, 2, 2, 2, 1, 1]:

ˆ Original sequence: [2, 2, 2, 2, 1, 1]


ˆ Remove the first element (2) and subtract 1 from the next two elements:
[2, 2, 2, 1, 1] → [1, 1, 2, 1, 0].
ˆ Continue the process: [1, 1, 2, 1, 0] → [0, 1, 1, 0] → [0, 0, 0].
ˆ Since the sequence reduces to all zeros, it is graphical.

4 Learning Unit 3: The Shortest Path Algorithm,


Eulerian and Hamiltonian Graphs
This unit explores the strategic process of finding the shortest paths within weighted
graphs, focusing particularly on Dijkstra’s algorithm. A fundamental understanding of
key graph theory concepts—such as walks, trails, paths, circuits, Eulerian and Hamil-
tonian cycles—is essential for this exploration. In graph theory, a walk is a sequence
of vertices and edges, possibly with repetitions, that represents any traversal through a
graph. A trail is a walk without repeated edges, highlighting distinct routes. A path
further refines this by eliminating both repeated vertices and edges, thus defining unique
routes within a graph. Circuits are trails that return to their starting vertex, forming
closed loops. Eulerian circuits are special circuits that visit every edge exactly once, which
are particularly useful in optimizing scenarios such as Eulerian paths. Hamiltonian cy-
cles, on the other hand, are cycles that visit every vertex exactly once, playing a crucial
role in solving complex optimization problems like the Traveling Salesman Problem. By
understanding these foundational concepts, students will gain the theoretical insight and
practical skills necessary to apply these methods to real-world problems in network traffic,
logistics, and urban planning. Dijkstra’s algorithm and other shortest path algorithms
leverage these fundamental ideas to efficiently navigate and optimize complex networks.

4.1 Walk, Trail, Path, Circuits, Eulerian, Hamiltonian


Definition 4.1 (Graph). A graph G = (V, E) consists of a set of vertices V and a set
of edges E, where each edge is a pair of vertices from V . Graphs can be directed or
undirected, depending on whether the edges have a direction.

40
Example 4.2. Consider a simple graph G = (V, E) where V = {a, b, c} and E =
{(a, b), (b, c), (c, a)}. This graph forms a triangle with vertices connected in a cycle.

a b

Example 4.3. Consider a directed graph G = (V, E) where V = {x, y, z, w} and E =


{(x, y), (y, z), (z, w)}. This graph is directed and does not form a cycle.

x y z w

Example 4.4. Consider a graph G = (V, E) where V = {1, 2, 3, 4, 5} and


E = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)}. This forms a pentagon, showing how graphs
can represent structures with more than three vertices.

5 3

1 2

Definition 4.5 (Walk). A walk in a graph G = (V, E) is a finite sequence of vertices and
edges, v0 , e1 , v1 , e2 , . . . , ek , vk , such that each edge ei = (vi−1 , vi ) for 1 ≤ i ≤ k. Vertices
and edges may repeat in a walk.

Example 4.6. In the graph G with V = {a, b, c, d} and E = {(a, b), (b, c), (c, d), (d, a)},
a walk could be a, (a, b), b, (b, c), c, (c, d), d.

c d
Walk: a, b, c, d

a b

Example 4.7. Consider the graph H with vertices {1, 2, 3, 4, 5} and edges
{(1, 2), (2, 3), (3, 4), (4, 1), (2, 4)}. A walk in H can be 1, (1, 2), 2, (2, 4), 4, (4, 3), 3.

4 5
Walk: 1, 2, 4, 3

1 2 3

41
Example 4.8. In the graph K with V = {P, Q, R, S} and E = {(P, Q), (Q, R), (R, S), (S, P )},
a walk can be P, (P, Q), Q, (Q, R), R, (R, S), S, (S, P ), P .

Walk: P, Q, R, S, P
R

P Q

Definition 4.9 (Trail). A trail is a walk in which all edges are distinct, meaning no edge
is traversed more than once. Vertices may repeat in a trail.

Example 4.10. In graph G with vertices {a, b, c, d} and edges {(a, b), (b, c), (c, d), (d, a), (b, d)},
a trail is a, (a, b), b, (b, d), d, (d, c).

c d
Trail: a, b, d, c

a b

Example 4.11. Consider the graph L with vertices {1, 2, 3, 4} and edges
{(1, 2), (2, 3), (3, 4), (4, 1), (2, 4)}. A trail can be 1, (1, 2), 2, (2, 4), 4, (4, 3).

4
Trail: 1, 2, 4, 3

1 2 3

Example 4.12. In the graph M with vertices {A, B, C, D, E} and edges


{(A, B), (B, C), (C, D), (D, E), (E, A)}, a trail could be A, (A, B), B, (B, C), C, (C, D).

E D
Trail: A, B, C, D

A B C

Definition 4.13 (Path). A path is a walk in which all vertices and edges are distinct,
meaning no vertex or edge is repeated. A path is a simple form of a walk.

Example 4.14. In graph N with vertices {x, y, z, w} and edges


{(x, y), (y, z), (z, w)}, a path is x, (x, y), y, (y, z), z, (z, w), w.

42
Path: x, y, z, w
x y z w

Example 4.15. Consider the graph P with vertices {A, B, C, D} and edges
{(A, B), (B, C), (C, D)}. A path can be A, (A, B), B, (B, C), C, (C, D), D.

Path: A, B, C, D

A B C D

Example 4.16. In the graph Q with vertices {1, 2, 3, 4, 5} and edges


{(1, 2), (2, 3), (3, 4), (4, 5)}, a path could be 1, (1, 2), 2, (2, 3), 3, (3, 4), 4, (4, 5), 5.

Path: 1, 2, 3, 4, 5

1 2 3 4 5

Definition 4.17 (Circuit). A circuit is a trail in which the first and last vertices are the
same. All edges in a circuit are distinct, but vertices (except the first and last) may be
repeated.
Example 4.18. In graph R with vertices {a, b, c, d} and edges
{(a, b), (b, c), (c, d), (d, a)}, a circuit is a, (a, b), b, (b, c), c, (c, d), d, (d, a), a.

c d
Circuit: a, b, c, d, a

a b

Example 4.19. Consider the graph S with vertices {x, y, z, u, v} and edges
{(x, y), (y, z), (z, x), (z, u), (u, v)}. A circuit could be x, (x, y), y, (y, z), z, (z, x), x.

z u
Circuit: x, y, z, x, v, u, z

x y

Example 4.20. In the graph T with vertices {1, 2, 3, 4, 5} and edges


{(1, 2), (2, 3), (3, 4), (4, 1), (3, 5), (5, 2)}, a circuit can be 1, (1, 2), 2, (2, 3), 3, (3, 4), 4, (4, 1), 1.

3 4
Circuit: 1, 2, 3, 4, 1

1 2 5

43
Eulerian and Hamiltonian Graphs
Definition 4.21 (Eulerian Path and Circuit). An Eulerian path is a trail that visits
every edge in the graph exactly once. An Eulerian circuit is an Eulerian path that starts
and ends at the same vertex.
Example 4.22. Consider a graph Q with vertices {A, B, C, D} and edges
{(A, B), (B, C), (C, D), (D, A), (A, C), (B, D)}. This graph has an Eulerian circuit.

C D
Eulerian Circuit

A B

Example 4.23. Consider a graph O with vertices {P, Q, R, S, T } and edges


{(P, Q), (Q, R), (R, S), (S, T ), (T, P ), (P, R), (Q, S)}. This graph has an Eulerian cir-
cuit.
S

Eulerian Circuit
T R

P Q

Example 4.24. Consider a graph P with vertices {X, Y, Z, W, V, U } and edges


{(X, Y ), (Y, Z), (Z, W ), (W, V ), (V, U ), (U, X), (Y, W ), (Z, V )}. This graph has an Eu-
lerian circuit since all vertices have even degree.

Eulerian Circuit
V Z

X Y U

Example 4.25. Consider a graph Q with vertices {A, B, C, D, E, F, G} and edges


{(A, B), (B, C), (C, D), (D, E), (E, F ), (F, G), (G, A), (B, D), (C, E)}. This graph has
an Eulerian circuit since all vertices have even degree.

Eulerian Circuit G
E C

A B F

44
Theorem 4.26 (Euler’s Theorem). A connected graph G has an Eulerian circuit if and
only if every vertex has an even degree.

Proof. (⇒) Assume G has an Eulerian circuit. Starting and ending at the same vertex
implies each time a vertex is entered, it must be exited, giving all vertices even degrees.
(⇐) If every vertex has an even degree, starting at any vertex and following a trail
until returning to the starting vertex, repeat for any remaining unvisited edges forms an
Eulerian circuit.

Example 4.27. The Königsberg Bridge Problem is a classic example where Euler deter-
mined that no Eulerian trail exists since more than two vertices have an odd degree.

C
No Eulerian Trail
D

A B

Remark 4.28. Eulerian circuits are useful in applications such as DNA sequencing,
where covering every segment exactly once is necessary.

Hamiltonian Paths and Cycles


Definition 4.29 (Hamiltonian Path). A Hamiltonian path is a path that visits every
vertex of the graph exactly once. It does not necessarily return to the starting vertex.

Example 4.30. In a graph with vertices {a, b, c, d} and edges {(a, b), (b, c), (c, d)}, a
Hamiltonian path is a, (a, b), b, (b, c), c, (c, d), d.

Hamiltonian Path
a b c d

Example 4.31. Consider a pentagon with vertices {1, 2, 3, 4, 5} and edges


{(1, 2), (2, 3), (3, 4), (4, 5)}. A Hamiltonian path is 1, (1, 2), 2, (2, 3), 3, (3, 4), 4, (4, 5), 5.

Hamiltonian Path

1 2 3 4 5

Example 4.32. Consider a hexagon with vertices {A, B, C, D, E, F } and edges


{(A, B), (B, C), (C, D), (D, E), (E, F )}. A Hamiltonian path is
A, (A, B), B, (B, C), C, (C, D), D, (D, E), E, (E, F ), F .

Hamiltonian Path

A B C D E F

45
Definition 4.33 (Hamiltonian Cycle). A Hamiltonian cycle is a cycle that visits every
vertex of the graph exactly once and returns to the starting vertex. A graph that contains
a Hamiltonian cycle is called Hamiltonian.
Example 4.34. In graph G with vertices {1, 2, 3, 4} and edges
{(1, 2), (2, 3), (3, 4), (4, 1)}, the Hamiltonian cycle is
1, (1, 2), 2, (2, 3), 3, (3, 4), 4, (4, 1), 1.

3 4
Hamiltonian Cycle

1 2

Example 4.35. Consider a graph with vertices {1, 2, 3, 4, 5} and edges forming a cycle:
{(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)}. This graph has a Hamiltonian cycle.

Hamiltonian Cycle
5 3

1 2

Example 4.36. Consider a hexagonal graph with vertices {A, B, C, D, E, F } and edges
forming a cycle:
{(A, B), (B, C), (C, D), (D, E), (E, F ), (F, A)}. This graph also contains a Hamilto-
nian cycle.

E D

Hamiltonian Cycle
F C

A B

Example 4.37. Consider a triangle with vertices {P, Q, R} and additional vertex S,
forming edges:
{(P, Q), (Q, R), (R, P ), (P, S), (Q, S), (R, S)}. This graph has a Hamiltonian cycle.

R Cycle
Hamiltonian

P Q

46
Theorem 4.38 (Dirac’s Theorem). If a graph G with n ≥ 3 vertices has the property
that every vertex has a degree of at least n/2, then G contains a Hamiltonian cycle.

Proof. For any vertex v in G, if deg(v) ≥ n/2, any path can extend by linking available
vertices, ensuring G covers all vertices at least once, closing the path to form a cycle.

Theorem 4.39 (Ore’s Theorem). If a graph G with n ≥ 3 vertices satisfies d(u) + d(v) ≥
n for every pair of non-adjacent vertices u and v, then G has a Hamiltonian cycle.

Proof. Starting from any vertex v, repeatedly extend the path to the largest degree vertex
in the neighborhood until all vertices are included, closing the cycle.

Remark 4.40. Hamiltonian cycles are used in solving the Traveling Salesman Problem,
optimizing routes to visit a series of locations exactly once.

4.2 The Traveling Salesman Problem (TSP)


The Traveling Salesman Problem (TSP) is a classic optimization problem in the field
of combinatorial optimization and theoretical computer science. It involves finding the
shortest possible route that visits each city exactly once and returns to the origin city.
TSP has significant applications in various domains, including logistics, manufacturing,
and circuit design, making it an essential problem for both theoretical exploration and
practical application.

4.2.1 Problem Formulation


Formally, the TSP can be described as follows: Given a set of n cities and a distance
matrix D = (dij ), where dij represents the distance between city i and city j, the objective
is to determine a permutation π of the cities that minimizes the total travel distance:
n
X
min dπ(i),π(i+1)
π
i=1

subject to the constraint that each city is visited exactly once, i.e., π(i) ̸= π(j) for
i ̸= j, and π(n + 1) = π(1) to return to the starting city.

4.2.2 Applications and Significance


The TSP is widely used in real-world applications where optimal routing is crucial. For
instance, in logistics, companies strive to minimize transportation costs by finding efficient
delivery routes. Similarly, in the manufacturing sector, TSP is applied to optimize the
movement of robotic arms that need to visit multiple points in a specified order. Moreover,
in electronic circuit design, TSP aids in minimizing the wiring required to connect various
components, thereby reducing production costs and enhancing performance.

Example 1: Four Cities Consider a delivery company that needs to plan a route for
its truck to deliver goods to four different cities, labeled A, B, C, and D. The distance
between each pair of cities is given in the following matrix:

47
A B C D
A 0 10 15 20
B 10 0 35 25
C 15 35 0 30
D 20 25 30 0
The objective is to find the shortest route that starts and ends at city A, visiting all
other cities exactly once.

30
D C

25
20 15 35

A B
10

Solution: To solve this TSP problem, we can enumerate all possible routes and
calculate their total distances, selecting the shortest one. The possible routes are:
- **Route 1**: A → B → C → D → A - Distance = 10 + 35 + 30 + 20 = 95
- **Route 2**: A → B → D → C → A - Distance = 10 + 25 + 30 + 15 = 80
- **Route 3**: A → C → B → D → A - Distance = 15 + 35 + 25 + 20 = 95
- **Route 4**: A → C → D → B → A - Distance = 15 + 30 + 25 + 10 = 80
- **Route 5**: A → D → B → C → A - Distance = 20 + 25 + 35 + 15 = 95
- **Route 6**: A → D → C → B → A - Distance = 20 + 30 + 35 + 10 = 95
The optimal route is Route 2: A → B → D → C → A with a total distance of 80.

ˆ Hamiltonian Cycle:

ˆ Path: A → B → D → C → A

ˆ Explanation:

– Visits each city (vertex) once: A, B, D, C


– Returns to the starting city A

ˆ This is a Hamiltonian cycle because it covers all vertices exactly once and returns
to the starting point.

Example 2: Five Cities A company must optimize the travel route for delivering
packages to five cities: P, Q, R, S, T . The distance between the cities is provided in the
following matrix:

P Q R S T
P 0 21 32 47 50
Q 21 0 45 60 29
R 32 45 0 55 43
S 47 60 55 0 28
T 50 29 43 28 0

48
The goal is to determine the shortest path that visits each city exactly once and
returns to the starting point.

T
28 43

S 55 R
50 29

47 32 45
60

P Q
21

Solution: For five cities, it’s practical to use heuristic methods like the Nearest
Neighbor or Minimum Spanning Tree approximation due to the exponential growth of
permutations. Here, we’ll use the Nearest Neighbor approach starting from city P:

1. Start at P. The nearest neighbor is Q with a distance of 21.

2. Go from Q to T, which is the nearest city to Q with a distance of 29.

3. Go from T to S, the nearest neighbor to T, with a distance of 28.

4. Go from S to R, the nearest neighbor to S, with a distance of 55.

5. Return to P from R with a distance of 32.

Total distance = 21 + 29 + 28 + 55 + 32 = 165.


The optimal heuristic path is P → Q → T → S → R → P with a total distance of
165.

ˆ Hamiltonian Cycle:

ˆ Path: P → Q → T → S → R → P

ˆ Explanation:

– Visits each city (vertex) once: P, Q, T, S, R


– Returns to the starting city P

ˆ This is a Hamiltonian cycle as it includes all vertices exactly once and returns to
the starting point.

Solving the TSP is known to be NP-hard, meaning that no polynomial-time algorithm


is known for solving all instances of TSP optimally. Therefore, various heuristic and
approximation methods are used, including:

ˆ Nearest Neighbor Algorithm: A simple heuristic that builds a path by repeat-


edly visiting the nearest unvisited city. This approach provides a fast, albeit not
always optimal, solution by selecting the closest city at each step.

49
ˆ Genetic Algorithms: A population-based metaheuristic that evolves solutions
over generations to find near-optimal paths. This approach mimics the process of
natural selection, using operations such as mutation, crossover, and selection to
explore the solution space.
ˆ Branch and Bound: An exact algorithm that systematically explores all possible
routes while pruning suboptimal solutions. This method reduces the search space
by eliminating paths that exceed a known upper bound, focusing computational
resources on promising routes.
ˆ Dynamic Programming: The Held-Karp algorithm, a dynamic programming
approach, solves the TSP in O(n2 2n ) time. This method uses a recursive strategy to
build up solutions for larger problems based on previously computed subproblems,
ensuring optimality at the expense of higher computational complexity for large
instances.

4.3 Distance in Weighted Graphs


Definition 4.41 (Weighted Graph). A weighted graph is a graph where each edge has
a numerical value or weight associated with it. These weights can represent distances,
costs, or any metric that quantifies the connection between vertices.
Definition 4.42 (Shortest Path). The shortest path between two vertices in a weighted
graph is defined as the path whose edges have the lowest cumulative weight.

4.4 Dijkstra’s Algorithm


Dijkstra’s algorithm is a cornerstone of graph theory used to find the shortest path from
a single source vertex to all other vertices in a graph with non-negative edge weights.
Theorem 4.43 (Correctness of Dijkstra’s Algorithm). Dijkstra’s algorithm will always
yield the correct shortest paths from a single source vertex to all other vertices in a graph,
provided that the edge weights are non-negative.
Proof. The proof utilizes a greedy strategy and induction based on the number of vertices
processed. It relies on the consistent choice of the nearest unprocessed vertex, ensuring
that each path’s optimality is preserved throughout the algorithm.
Corollary 4.44. Dijkstra‘s algorithm is not suitable for graphs with negative edge weights,
as the algorithm may fail to find the shortest path in such cases.

4.5 Detailed Implementation of Dijkstra’s Algorithm


The algorithm uses a priority queue to efficiently select the next vertex to process based
on the shortest tentative distance.

Algorithm Steps
1. Initialize the distance to the source vertex to zero and all other vertices to infinity.
2. Set all vertices as unprocessed; this typically involves a priority queue where the
vertex with the lowest tentative distance is dequeued first.

50
3. Repeat until the priority queue is empty:

(a) Select the vertex u with the smallest tentative distance.


(b) Update the distance for each neighbor v of u: if the sum of the tentative
distance of u and the weight of the edge (u, v) is less than the tentative distance
of v, update it.
(c) Mark u as processed; once processed, a vertex’s distance from the source does
not change.

4.6 Practical Applications


Dijkstra’s algorithm is vital in many practical fields:

ˆ In computer networks, it helps in routing by finding the shortest path for data
packets.

ˆ In GPS navigation systems, it finds the shortest driving routes between destinations.

ˆ In urban planning, it assists in determining the optimal placement of facilities to


minimize travel time.

4.7 Limitations and Challenges


Despite its broad usage, Dijkstra’s algorithm does not accommodate graphs with negative
weight edges, which can occur in applications like financial modeling where costs might
reduce over certain transactions. For such scenarios, algorithms like Bellman-Ford or
Floyd-Warshall are used.

Example 1: Simple Network


Graph
The graph consists of the following vertices and weighted edges:

1→2 :6
1→3 :7
2→3 :5
2→4 :4
3→4 :3
3→5 :4
4→5 :6
5→1 :7

51
4
2 4
6 5 3

7
1 3
6
4
7
5

Steps to Find Shortest Path from Node 1

1. Initialization:

ˆ Set the distance to node 1 to 0: d(1) = 0.


ˆ Set the distance to all other nodes to infinity: d(2) = d(3) = d(4) = d(5) = ∞.
ˆ Mark all nodes as unvisited.

2. Visit Node 1:

ˆ Update distances to its adjacent nodes:


– d(2) = min(∞, 0 + 6) = 6
– d(3) = min(∞, 0 + 7) = 7
ˆ Mark node 1 as visited.

3. Visit Node 2 (nearest unvisited node with minimum distance):

ˆ Update distances to its adjacent nodes:


– d(3) = min(7, 6 + 5) = 7 (no change)
– d(4) = min(∞, 6 + 4) = 10
ˆ Mark node 2 as visited.

4. Visit Node 3 (next nearest unvisited node):

ˆ Update distances to its adjacent nodes:


– d(4) = min(10, 7 + 3) = 10 (no change)
– d(5) = min(∞, 7 + 4) = 11
ˆ Mark node 3 as visited.

5. Visit Node 4:

ˆ Update distances to its adjacent nodes:


– d(5) = min(11, 10 + 6) = 11 (no change)
ˆ Mark node 4 as visited.

6. Visit Node 5:

ˆ Mark node 5 as visited.

52
Table of Distances

Step Visited Node Distance to 1 From Node Shortest Path Found


Initial − 0 − 1 : 0, 2 : ∞, 3 : ∞, 4 : ∞, 5 : ∞
1 1 0 − 1 : 0, 2 : 6, 3 : 7, 4 : ∞, 5 : ∞
2 2 6 1 1 : 0, 2 : 6, 3 : 7, 4 : 10, 5 : ∞
3 3 7 1 1 : 0, 2 : 6, 3 : 7, 4 : 10, 5 : 11
4 4 10 2 1 : 0, 2 : 6, 3 : 7, 4 : 10, 5 : 11
5 5 11 3 1 : 0, 2 : 6, 3 : 7, 4 : 10, 5 : 11

Final shortest paths:

ˆ Node 1: 0

ˆ Node 2: 6

ˆ Node 3: 7

ˆ Node 4: 10

ˆ Node 5: 11

53
Example 2: Complex Network
Graph Edges

P →Q :1
P →R :4
Q→R :2
Q→S :5
R→S :3
Steps to Find Shortest Path from Node P
1. Initialization:
ˆ Set the distance to node P to 0: d(P ) = 0.
ˆ Set the distance to all other nodes to infinity: d(Q) = d(R) = d(S) = ∞.
ˆ Mark all nodes as unvisited.
2. Visit Node P:
ˆ Update distances to its adjacent nodes:
– d(Q) = min(∞, 0 + 1) = 1
– d(R) = min(∞, 0 + 4) = 4
ˆ Mark node P as visited.
3. Visit Node Q (nearest unvisited node with minimum distance):
ˆ Update distances to its adjacent nodes:
– d(R) = min(4, 1 + 2) = 3
– d(S) = min(∞, 1 + 5) = 6
ˆ Mark node Q as visited.
4. Visit Node R (next nearest unvisited node):
ˆ Update distances to its adjacent nodes:
– d(S) = min(6, 3 + 3) = 6 (no change)
ˆ Mark node R as visited.
5. Visit Node S:
ˆ Mark node S as visited.
Table of Distances

Step Visited Node Distance to P From Node Shortest Path Found


Initial − 0 − P : 0, Q : ∞, R : ∞, S : ∞
1 P 0 − P : 0, Q : 1, R : 4, S : ∞
2 Q 1 P P : 0, Q : 1, R : 3, S : 6
3 R 3 Q P : 0, Q : 1, R : 3, S : 6
4 S 6 Q P : 0, Q : 1, R : 3, S : 6
Final shortest paths:

54
ˆ Node P: 0

ˆ Node Q: 1

ˆ Node R: 3

ˆ Node S: 6

55
Example 3: Another Complex Network
Graph Edges

X → Y : 10
X → Z : 15
Y →Z :5
Z → Y : 20
Steps to Find Shortest Path from Node X

1. Initialization:

ˆ Set the distance to node X to 0: d(X) = 0.


ˆ Set the distance to all other nodes to infinity: d(Y ) = d(Z) = ∞.
ˆ Mark all nodes as unvisited.

2. Visit Node X:

ˆ Update distances to its adjacent nodes:


– d(Y ) = min(∞, 0 + 10) = 10
– d(Z) = min(∞, 0 + 15) = 15
ˆ Mark node X as visited.

3. Visit Node Y (nearest unvisited node with minimum distance):

ˆ Update distances to its adjacent nodes:


– d(Z) = min(15, 10 + 5) = 15 (no change)
ˆ Mark node Y as visited.

4. Visit Node Z:

ˆ No changes in distances, as Z → Y gives 10 + 20 = 30 > 10.


ˆ Mark node Z as visited.

Table of Distances

Step Visited Node Distance to X From Node Shortest Path Found


Initial − 0 − X : 0, Y : ∞, Z : ∞
1 X 0 − X : 0, Y : 10, Z : 15
2 Y 10 X X : 0, Y : 10, Z : 15
3 Z 15 X X : 0, Y : 10, Z : 15

Final shortest paths:


ˆ Node X: 0

ˆ Node Y: 10

ˆ Node Z: 15

56
Example 4: Advanced Network
Graph Edges

M →N :6
M →O :8
N →O :9
N →P :5
O→P :7
Steps to Find Shortest Path from Node M
1. Initialization:
ˆ Set the distance to node M to 0: d(M ) = 0.
ˆ Set the distance to all other nodes to infinity: d(N ) = d(O) = d(P ) = ∞.
ˆ Mark all nodes as unvisited.
2. Visit Node M:
ˆ Update distances to its adjacent nodes:
– d(N ) = min(∞, 0 + 6) = 6
– d(O) = min(∞, 0 + 8) = 8
ˆ Mark node M as visited.
3. Visit Node N (nearest unvisited node with minimum distance):
ˆ Update distances to its adjacent nodes:
– d(O) = min(8, 6 + 9) = 8 (no change)
– d(P ) = min(∞, 6 + 5) = 11
ˆ Mark node N as visited.
4. Visit Node O (next nearest unvisited node):
ˆ Update distances to its adjacent nodes:
– d(P ) = min(11, 8 + 7) = 11 (no change)
ˆ Mark node O as visited.
5. Visit Node P:
ˆ Mark node P as visited.
Table of Distances

Step Visited Node Distance to M From Node Shortest Path Found


Initial − 0 − M : 0, N : ∞, O : ∞, P : ∞
1 M 0 − M : 0, N : 6, O : 8, P : ∞
2 N 6 M M : 0, N : 6, O : 8, P : 11
3 O 8 M M : 0, N : 6, O : 8, P : 11
4 P 11 N M : 0, N : 6, O : 8, P : 11
Final shortest paths:

57
ˆ Node M: 0

ˆ Node N: 6

ˆ Node O: 8

ˆ Node P: 11

4.8 TUTORIAL THREE


1. Graph Basics: Given the graph G = (V, E) with V = {A, B, C, D, E} and E =
{(A, B), (B, C), (C, D), (D, E), (E, A)}, identify a walk, a trail, and a path within the
graph. Explain your reasoning.

E C

A B

2. Trail Identification: For the graph H = (V, E) where V = {1, 2, 3, 4, 5, 6} and


E = {(1, 2), (2, 3), (3, 1), (3, 4), (4, 5), (5, 6), (6, 1)}, find a trail that includes all the edges.
Verify if it’s an Eulerian trail.

5 3

1 2

3. Path Analysis: Determine if a Hamiltonian path exists in the graph with vertices
{X, Y, Z, W, V } and edges {(X, Y ), (Y, Z), (Z, W ), (W, X), (Y, W ), (V, X)}.

V Z

X Y

4. Circuit Exploration: In the graph K = (V, E) where V = {M, N, O, P, Q}


and E = {(M, N ), (N, O), (O, P ), (P, M ), (M, O), (N, Q), (Q, O)}, find a circuit and de-
termine if it’s an Eulerian circuit.

58
P

Q O

M N

5. Dijkstra’s Algorithm - Basic: Given a graph with vertices {1, 2, 3, 4, 5} and


weighted edges {(1, 2, 7), (2, 3, 10), (3, 4, 3), (1, 3, 4), (4, 5, 2), (5, 1, 9)}, use Dijkstra’s Algo-
rithm to find the shortest path from vertex 1 to all other vertices.

4
3
2
5 3
4
9 10

1 2
7

6. Dijkstra’s Algorithm - Intermediate: Use Dijkstra’s Algorithm to deter-


mine the shortest path from vertex A to all other vertices in a graph with vertices
{A, B, C, D, E} and weights {(A, B, 2), (B, C, 3), (C, D, 4), (D, E, 5), (A, C, 8), (B, E, 7)}.

D
4
5
E C
8
7 3

A B
2

7. Weighted Graph Analysis: For the graph with edges


(X, Y, 5), (Y, Z, 10), (Z, X, 15), (X, W, 10), (W, Y, 8), find the shortest path from vertex
X to vertex W using Dijkstra’s Algorithm.

Z
8
10 15
10

X Y
5

59
8. Practical Application: Explain how Dijkstra’s Algorithm can be used to find
the shortest route in a city’s transportation network. Provide a simplified example with
at least five intersections.
9. Comparison with Bellman-Ford: Describe a scenario where the Bellman-
Ford algorithm would be preferred over Dijkstra’s Algorithm. Explain why Dijkstra’s
Algorithm is unsuitable for graphs with negative weights.
10.Connectivity Proof and Shortest Path Impact: Prove whether the graph
with vertices {1, 2, 3, 4, 5, 6} and edges {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (1, 6)} is connected.
Discuss its impact on finding the shortest path.

1 2 3 4 5 6

11. Eulerian Circuit Identification: Determine if the graph with vertices {P, Q, R, S, T }
and edges {(P, Q), (Q, R), (R, S), (S, T ), (T, P ), (P, R), (Q, S)} has an Eulerian circuit.

T R

P Q

12. Hamiltonian Cycle Detection: Find a Hamiltonian cycle in the graph with
vertices {A, B, C, D, E, F } and edges forming a complete cycle:
{(A, B), (B, C), (C, D), (D, E), (E, F ), (F, A), (B, D), (C, E)}.

E C

A B

13. Shortest Path in a Network: Apply Dijkstra’s Algorithm to find the shortest
path in a network with nodes {U, V, W, X, Y } and weighted edges
{(U, V, 6), (V, W, 9), (W, X, 3), (X, Y, 4), (U, W, 10), (V, X, 7)} starting from node U.

X 3
4
Y W
7
10 9

U V
6

60
14. Real-World Application: Discuss the real-world application of shortest path
algorithms in delivery services. How do they optimize delivery routes? Provide a practical
example involving five delivery points.
15. Graph Theory Concepts: Define and differentiate between walks, trails, paths,
and circuits. Provide examples of each from a graph with vertices {M, N, O, P, Q} and
edges {(M, N ), (N, O), (O, P ), (P, Q), (Q, M ), (N, P ), (O, Q)}.

Q O

M N

16. Algorithm Efficiency: Analyze the time complexity of Dijkstra’s Algorithm.


Compare it to other shortest path algorithms in terms of efficiency and suitability for
large networks.
17.Hamiltonian Path Exploration: Identify a Hamiltonian path in the graph with
vertices {1, 2, 3, 4, 5, 6} and edges {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 1), (1, 4), (2, 5), (3, 6)}.

5 3

1 2

18. Network Traffic Optimization: Describe how Dijkstra’s Algorithm can help
optimize network traffic. Use a simple network of intersections and roads as an example.
19. Limitations of Algorithms: Discuss the limitations of using Dijkstra’s Al-
gorithm in dynamic networks where weights may change over time. How can these
limitations be addressed?
20. Graph Representation: Explain how graphs can be represented in computer
memory. Discuss adjacency lists and matrices, and their advantages in implementing
shortest path algorithms.

4.9 TUTORIAL THREE SOLUTION


1. Graph Basics: Given the graph G = (V, E) with V = {A, B, C, D, E} and E =
{(A, B), (B, C), (C, D), (D, E), (E, A)}, identify a walk, a trail, and a path within the
graph. Explain your reasoning.

61
D

E C

A B

Solution:

ˆ Walk: A walk is a sequence of vertices and edges where vertices and edges can
repeat. For example, A → B → C → B → A is a walk.

ˆ Trail: A trail is a walk where no edge is repeated. For example, A → B → C →


D → E is a trail.

ˆ Path: A path is a trail where no vertex is repeated. For example, A → B → C →


D → E is a path.

2. Trail Identification: For the graph H = (V, E) where V = {1, 2, 3, 4, 5, 6} and


E = {(1, 2), (2, 3), (3, 1), (3, 4), (4, 5), (5, 6), (6, 1)}, find a trail that includes all the edges.
Verify if it’s an Eulerian trail.

5 3

1 2

Solution:
A trail that includes all the edges is 1 → 2 → 3 → 1 → 6 → 5 → 4 → 3. Since this
trail includes all the edges without repetition and starts and ends at different vertices, it
is not an Eulerian trail.
3. Path Analysis: Determine if a Hamiltonian path exists in the graph with vertices
{X, Y, Z, W, V } and edges {(X, Y ), (Y, Z), (Z, W ), (W, X), (Y, W ), (V, X)}.

V Z

X Y

62
Solution:
A Hamiltonian path is a path that visits every vertex exactly once. In this graph,
a Hamiltonian path exists: V → X → Y → Z → W . Therefore, this graph has a
Hamiltonian path.
4. Circuit Exploration: In the graph K = (V, E) where V = {M, N, O, P, Q}
and E = {(M, N ), (N, O), (O, P ), (P, M ), (M, O), (N, Q), (Q, O)}, find a circuit and de-
termine if it’s an Eulerian circuit.

Q O

M N

Solution:
A circuit in this graph is M → N → O → P → M . However, this circuit does not
include all edges of the graph, so it is not an Eulerian circuit.
5. Graph Drawing and Analysis: Draw the graph with vertex set V = {v1 , v2 , v3 , v4 , v5 , v6 , v7 }
and edge set E = {v1 v2 , v1 v3 , v1 v6 , v2 v2 , v2 v4 , v3 v1 , v4 v5 , v4 v6 }. Identify all isolated ver-
tices, loops, and parallel edges, if any.

v2 v5

v1 v4 v7

v3 v6

Solution:

ˆ Isolated Vertex: v7

ˆ Loop: At vertex v2

ˆ Parallel Edges: Between vertices v1 and v3

6. Dijkstra’s Algorithm - Basic: Given a graph with vertices {1, 2, 3, 4, 5} and


weighted edges {(1, 2, 7), (2, 3, 10), (3, 4, 3), (1, 3, 4), (4, 5, 2), (5, 1, 9)}, use Dijkstra’s Algo-
rithm to find the shortest path from vertex 1 to all other vertices.

63
4
3
2
5 3
4
9 10

1 2
7

Solution:

ˆ From vertex 1:

– To vertex 2: 1 → 2 with weight 7.


– To vertex 3: 1 → 3 with weight 4.
– To vertex 4: 1 → 3 → 4 with weight 7.
– To vertex 5: 1 → 3 → 4 → 5 with weight 9.

7. Practical Application: Explain how Dijkstra’s Algorithm can be used to find


the shortest route in a city’s transportation network. Provide a simplified example with
at least five intersections.
Solution:
Dijkstra’s Algorithm can be applied to a city’s road network where intersections rep-
resent vertices and roads represent edges with weights corresponding to distances or
travel times. By starting from a source intersection, the algorithm systematically finds
the shortest path to every other intersection, which helps in planning optimal routes for
vehicles.
8. Practical Application: Explain how Dijkstra’s Algorithm can be used to find
the shortest route in a city’s transportation network. Provide a simplified example with
at least five intersections.
Solution:
Dijkstra’s Algorithm can be applied to a city’s road network where intersections are
vertices and roads are edges with weights representing distances or travel times. The
algorithm starts at a specific intersection and iteratively explores the shortest paths to
other intersections by selecting the closest unvisited vertex and updating distances. For
example, given intersections A, B, C, D, E with roads of different lengths, Dijkstra’s Al-
gorithm helps determine the shortest path from A to any other intersection by efficiently
calculating minimal travel times or distances.
9. Comparison with Bellman-Ford: Describe a scenario where the Bellman-
Ford algorithm would be preferred over Dijkstra’s Algorithm. Explain why Dijkstra’s
Algorithm is unsuitable for graphs with negative weights.
Solution:
The Bellman-Ford algorithm is preferred in scenarios where graphs have edges with
negative weights, such as networks with costs or debts. Unlike Dijkstra’s Algorithm,
which assumes all edge weights are non-negative, Bellman-Ford can handle negative
weights and detect negative weight cycles, providing correct shortest path solutions. Di-
jkstra’s Algorithm fails in such cases as it relies on a greedy strategy that doesn’t account
for the reduction in path weight due to a negative edge.

64
10. Connectivity Proof and Shortest Path Impact: Prove whether the graph
with vertices {1, 2, 3, 4, 5, 6} and edges {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (1, 6)} is connected.
Discuss its impact on finding the shortest path.
Solution:
The graph is connected because there is a path between every pair of vertices. For
example, to get from vertex 1 to any other vertex, a continuous sequence of edges can be
followed. This connectivity ensures that Dijkstra’s Algorithm can compute the shortest
path between any two vertices without any disconnection issues.
11. Eulerian Circuit Identification: Determine if the graph with vertices {P, Q, R, S, T }
and edges {(P, Q), (Q, R), (R, S), (S, T ), (T, P ), (P, R), (Q, S)} has an Eulerian circuit.

T R

P Q

Solution:
The graph has an Eulerian circuit because all vertices have an even degree: - P, Q, R, S, T
all have degree 2 or 4. An Eulerian circuit is possible since the graph is connected, and
all vertices have even degrees.
12. Hamiltonian Cycle Detection: Find a Hamiltonian cycle in the graph with
vertices {A, B, C, D, E, F } and edges forming a complete cycle:
{(A, B), (B, C), (C, D), (D, E), (E, F ), (F, A), (B, D), (C, E)}.

E C

A B

Solution:
A Hamiltonian cycle that visits every vertex exactly once is: A → B → C → D →
E → F → A. This cycle covers all vertices without repetition.
13. Shortest Path in a Network: Apply Dijkstra’s Algorithm to find the shortest
path in a network with nodes {U, V, W, X, Y } and weighted edges
{(U, V, 6), (V, W, 9), (W, X, 3), (X, Y, 4), (U, W, 10), (V, X, 7)} starting from node U.

X 3
4
Y W
7
10 9

U V
6

65
Solution:
1. Start at node U : - Distance to U = 0 (starting point) - Distance to V = 6 -
Distance to W = 10 (via U → W ) - Distance to X = 13 (via U → V → X) - Distance
to Y is undetermined initially.
2. Next, explore from V : - Update shortest paths: - U → V → W = 6 + 9 = 15 (no
change needed, U → W = 10 is shorter) - U → V → X = 6 + 7 = 13
3. Continue with X: - Shortest path to Y : U → V → X → Y = 13 + 4 = 17.
Final shortest paths from U : - U → U = 0 - U → V = 6 - U → W = 10 - U → X = 13
- U → Y = 17
14. Real-World Application: Discuss the real-world application of shortest path
algorithms in delivery services. How do they optimize delivery routes? Provide a practical
example involving five delivery points.
Solution:
Shortest path algorithms like Dijkstra’s help delivery services optimize routes by find-
ing the quickest path between multiple delivery points, minimizing travel time, fuel con-
sumption, and operational costs. For example, a delivery service with points A, B, C,
D, E can use Dijkstra’s to determine the most efficient route from a warehouse (A) to
deliver packages to B, C, D, and E in a way that minimizes the total distance traveled.
15. Graph Theory Concepts: Define and differentiate between walks, trails, paths,
and circuits. Provide examples of each from a graph with vertices {M, N, O, P, Q} and
edges {(M, N ), (N, O), (O, P ), (P, Q), (Q, M ), (N, P ), (O, Q)}.

Q O

M N

Solution:
- **Walk**: Any sequence of vertices and edges (repeats allowed). Example: M →
N → O → Q. - **Trail**: A walk without repeating edges. Example: M → N → O →
P → Q. - **Path**: A trail without repeating vertices. Example: M → N → O → P . -
**Circuit**: A trail that starts and ends at the same vertex. Example: M → N → P →
Q → M.
16. Algorithm Efficiency: Analyze the time complexity of Dijkstra’s Algorithm.
Compare it to other shortest path algorithms in terms of efficiency and suitability for
large networks.
Solution:
Dijkstra’s Algorithm has a time complexity of O(V 2 ) with an adjacency matrix and
O(E + V log V ) with a priority queue using an adjacency list. It is efficient for graphs
with non-negative weights but less suitable for graphs with negative weights or very large
sparse networks. The Bellman-Ford algorithm, with a complexity of O(V E), is better for
graphs with negative weights.
17. Hamiltonian Path Exploration: Identify a Hamiltonian path in the graph with
vertices {1, 2, 3, 4, 5, 6} and edges {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 1), (1, 4), (2, 5), (3, 6)}.

66
4

5 3

1 2

Solution:
A Hamiltonian path in this graph is: 1 → 2 → 3 → 6 → 5 → 4.
18. Network Traffic Optimization: Describe how Dijkstra’s Algorithm can help
optimize network traffic. Use a simple network of intersections and roads as an example.
Solution:
Dijkstra’s Algorithm can identify the shortest paths through a network of roads and
intersections, allowing for optimized routing to reduce traffic congestion. For instance,
in a city with intersections A, B, C, and D connected by roads with different lengths,
Dijkstra’s will determine the least congested or fastest route from A to D by minimizing
total travel time.
19. Limitations of Algorithms: Discuss the limitations of using Dijkstra’s Al-
gorithm in dynamic networks where weights may change over time. How can these
limitations be addressed?
Solution:
Dijkstra’s Algorithm is less effective in dynamic networks where edge weights (rep-
resenting traffic or congestion) change over time. It assumes static weights and cannot
efficiently update shortest paths in real-time. To address these limitations, adaptive algo-
rithms like the A* algorithm or dynamic routing protocols can be used, which can adjust
paths based on real-time data.
20. Graph Representation: Explain how graphs can be represented in computer
memory. Discuss adjacency lists and matrices, and their advantages in implementing
shortest path algorithms.
Solution:
Graphs are typically represented using: - **Adjacency Matrix**: A 2D array where
matrix entry (i, j) indicates the presence or weight of an edge between vertices i and j.
Efficient for dense graphs but consumes more space. - **Adjacency List**: An array of
lists where each list contains the neighbors of a vertex. More space-efficient for sparse
graphs and faster for algorithms like Dijkstra’s that need to traverse edges.

5 Learning Unit 4: Trees


5.1 Definition of a Tree
A tree is a connected undirected graph without cycles.

5.2 Properties of Trees


Theorem 5.1. A graph G is a tree if and only if the following conditions hold:

1. G is connected and acyclic.

67
2. G is connected, and removing any edge disconnects G.

3. G has n vertices and n − 1 edges.

4. Any two vertices in G are connected by exactly one path.

Proof. We prove each condition implies the next, and that the last implies the first,
completing a circular argument.
1 =⇒ 2: Assume G is connected and acyclic. Consider any edge e = (u, v) in
G. Since G contains no cycles, e does not participate in any cycle, thus it is a bridge.
Removing e disconnects u and v, and since G was connected, this removal disconnects
the graph.
2 =⇒ 3: Assume G is connected, and removing any edge disconnects G. Each edge
must therefore be a bridge. Initiate a spanning tree algorithm (like BFS or DFS) from
any vertex; each visited edge is necessary to maintain connectivity, leading to a structure
with n−1 edges for n vertices. Adding any more edges would create a cycle, contradicting
the premise that removing any edge disconnects G. Thus, G must have exactly n − 1
edges.
3 =⇒ 4: Assume G has n vertices and n − 1 edges. To show G is connected and has
exactly one path between any pair of vertices, start from any vertex v and connect to all
others. If some vertices cannot be reached, adding edges to connect them would exceed
n − 1 edges, contradicting our premise. Hence, G must be connected.
Moreover, more than one path between any two vertices would imply a cycle (by
traversing one path forward and the other backward), which is impossible under our edge
constraint. This ensures the uniqueness of each path.
4 =⇒ 1: Assume any two vertices in G are connected by exactly one path. This
implies G is connected. If G contained a cycle, there would exist at least two distinct
paths between some vertices (around the cycle in different directions), contradicting the
given condition. Hence, G must also be acyclic.
This circular proof shows that the conditions are equivalent, each characterizing a
graph G as a tree.

5.3 Example of a Simple Tree


c

a b

5.4 Example of a Tree with Six Vertices


2 4 6

1 3 5

68
5.5 Minimum Spanning Trees
ˆ Kruskal’s Algorithm involves sorting the edges and adding the smallest edge that
doesn’t form a cycle.

ˆ Prim’s Algorithm starts from a vertex and grows the MST by adding the cheapest
adjacent edge not already in the MST.

5.6 Kruskal’s Algorithm


Kruskal’s algorithm is an efficient method used to find the minimum spanning tree (MST)
of a given graph. It operates by sorting all the edges of the graph in non-decreasing order
of their weight and then picking the smallest edge, checking if it forms a cycle with the
spanning tree formed so far. If the cycle is not formed, it includes this edge. Else, it
discards it. This process is repeated until there are n − 1 edges in the spanning tree,
where n is the number of vertices in the graph.

5.6.1 Steps of Kruskal’s Algorithm


1. Sort all the edges in non-decreasing order of their weight.

2. Initialize a forest F (a set of trees), where each vertex in the graph is a separate
tree.

3. Initialize the MST T to be empty.

4. For each edge e in the sorted edge list:

ˆ If the edge e connects two different trees, then add it to the MST T , and merge
the two trees into a single tree.
ˆ Otherwise, discard e.

5. Repeat step 4 until T has n − 1 edges or until all edges have been checked.

5.6.2 Example 1: Kruskal’s Algorithm


Consider a graph G with vertices A, B, C, D, E and the following edges with weights in
parentheses: AB(1), BC(3), AC(2), AD(4), BD(5), CE(6), DE(7).

69
C

2
3

1 6
A B

4
5

D E
7

1. Sort the edges by weights: AB(1), AC(2), BC(3), AD(4), BD(5), CE(6), DE(7).

2. Each vertex is a separate tree initially: A, B, C, D, E.

3. Initialize MST T = {}.

4. Process each edge in order:

ˆ Add AB to T , merge A and B.


ˆ Add AC to T , merge C with A − B.
ˆ BC is discarded (since B and C are already connected through A).
ˆ Add AD to T , merge D with A − B − C.
ˆ BD is discarded (since B and D are already connected through A).
ˆ Add CE to T , merge E with A − B − C − D.
ˆ DE is discarded (since all vertices are already connected).

5. The MST T now includes the edges AB, AC, AD, CE with a total minimum cost
of 1 + 2 + 4 + 6 = 13.

5.6.3 Example 2: Graph with Six Vertices


Consider a graph H with vertices A, B, C, D, E, F and the following edges with weights
in parentheses: AB(3), BC(1), CD(4), DE(2), EF (5), F A(6), AC(7), BD(8).

1. Sort the edges by weights: BC(1), DE(2), AB(3), CD(4), EF (5), F A(6), AC(7), BD(8).

2. Initialize each vertex as a separate tree: A, B, C, D, E, F .

3. Initialize MST T = {}.

4. Process each edge:

ˆ Add BC to T , merge B and C.


ˆ Add DE to T , merge D and E.

70
ˆ Add AB to T , merge A with B − C.
ˆ Add CD to T , merge C − D with B − E.
ˆ Add EF to T , merge E − F with A − B − C − D.

5. The MST T now includes BC, DE, AB, CD, EF with a total minimum cost of
1 + 2 + 3 + 4 + 5 = 15.

5.6.4 Example 3: Complete Graph with Four Vertices


Consider a complete graph I with vertices A, B, C, D and edges AB(1), AC(3), AD(4), BC(2), BD(5), CD

1. Sort the edges by weights: AB(1), BC(2), AC(3), AD(4), BD(5), CD(6).

2. Initialize each vertex as a separate tree.

3. Initialize MST T = {}.

4. Process each edge:

ˆ Add AB to T , merging A and B.


ˆ Add BC to T , merging C with A − B.
ˆ Add AC is discarded (since A and C are already connected).
ˆ Add AD to T , merging D with A − B − C.

5. The MST T now includes AB, BC, AD with a total minimum cost of 1 + 2 + 4 = 7.

5.6.5 Example 4: Sparse Graph


Consider a graph J with vertices A, B, C, D and edges AB(10), BC(15), CD(20).

1. Sort the edges by weights: AB(10), BC(15), CD(20).

2. Initialize each vertex as a separate tree.

3. Initialize MST T = {}.

4. Process each edge:

ˆ Add AB to T .
ˆ Add BC to T .
ˆ Add CD to T .

5. The MST T now includes AB, BC, CD with a total minimum cost of 10 + 15 + 20 =
45.

71
5.6.6 Example 5: Weighted Cycle Graph
Consider a cycle graph K with vertices A, B, C, D, E and edges AB(2), BC(3), CD(4), DE(5), EA(1).

1. Sort the edges by weights: EA(1), AB(2), BC(3), CD(4), DE(5).

2. Initialize each vertex as a separate tree.

3. Initialize MST T = {}.

4. Process each edge:

ˆ Add EA to T , merging E and A.


ˆ Add AB to T , merging A with E.
ˆ Add BC to T , merging B with A − E.
ˆ Add CD to T , merging C with B − A − E.

5. The MST T now includes EA, AB, BC, CD with a total minimum cost of 1 + 2 +
3 + 4 = 10.

5.7 Prim’s Algorithm


Prim’s algorithm is an efficient method used to find the minimum spanning tree (MST)
of a given graph. It starts from a selected vertex and grows the MST by adding the
cheapest edge from the tree to a new vertex at each step.

5.7.1 Steps of Prim’s Algorithm


1. Start with any vertex and consider it as the current MST.

2. At each step, select the edge with the minimum weight that connects a vertex in
the tree to a vertex outside the tree.

3. Add the selected edge and vertex to the MST.

4. Repeat step 2 until all vertices are included in the MST.

5.7.2 Example of Prim’s Algorithm


Consider a graph G with vertices A, B, C, D, E and the following edges with weights in
parentheses: AB(1), BC(3), AC(2), AD(4), BD(5), CE(6), DE(7).

72
C

2
3

1 6
A B

4
5

D E
7

1. Initialize:
ˆ Start with vertex A.
ˆ Possible edges to add are AB(1), AC(2), AD(4).
2. First Addition:
ˆ Choose AB(1) because it has the lowest weight.
ˆ MST now includes A − B.
ˆ Update possible edges to add: AC(2), AD(4), BC(3), BD(5).
3. Second Addition:
ˆ Choose AC(2) next (smallest connecting edge not forming a cycle).
ˆ MST now includes A − B − C.
ˆ Update possible edges: AD(4), BC(3), BD(5), CE(6).
4. Third Addition:
ˆ Choose BC(3) (next smallest edge, doesn’t create a cycle).
ˆ MST now includes A − B − C.
ˆ Remaining edges to consider: AD(4), BD(5), CE(6).
5. Fourth Addition:
ˆ Add CE(6) to connect C to E.
ˆ MST now includes A − B − C − E.
ˆ Last vertex D remains, possible edges: AD(4), BD(5), DE(7).
6. Final Addition:
ˆ Add AD(4) as it’s the cheapest way to include D.
ˆ MST now spans all vertices: A, B, C, D, E with edges AB, AC, BC, CE, AD.
Final MST: The MST formed is AB, AC, BC, CE, AD with a total cost of 1 + 2 +
3 + 6 + 4 = 16.

73
Example 2: Graph G1
Vertices: F, G, H, I, J
Edges with weights: F G(2), F H(6), GI(3), GH(10), HI(1), HJ(5), IJ(4)

1
H I
10
6 3
F 5 G
2 4

Steps:

1. Start from vertex F .

2. Select the smallest edge F G(2) and add to MST.

3. Next, add GI(3).

4. Add HI(1) to connect H.

5. Finally, connect HJ(5) to include J.

6. Resulting MST: Edges F G, GI, HI, HJ with total weight 11.

Example 3: Graph G2
Vertices: A, B, C, D, E
Edges with weights: AB(7), AC(8), BC(5), BD(6), CD(3), DE(2)

3
D C
2
8 5 E
6
A B
7

Steps:

1. Start from vertex A.

2. Add edge AB(7).

3. Connect B to C via BC(5).

4. Connect C to D via CD(3).

5. Finally, connect D to E via DE(2).

6. Resulting MST: Edges AB, BC, CD, DE with total weight 17.

74
Example 4: Graph G3
Vertices: K, L, M, N, O
Edges with weights: KL(4), KM (1), LN (2), M N (6), N O(5), M O(3)
6
M N
2
1
K L 5
43

Steps:
1. Start from vertex K.
2. Add KM (1) to the MST.
3. Add M O(3) to connect O.
4. Connect M to L via KL(4).
5. Connect L to N via LN (2).
6. Resulting MST: Edges KM, M O, KL, LN with total weight 10.

Example 5: Graph G4
Vertices: P, Q, R, S, T
Edges with weights: P Q(2), P R(6), QR(3), QS(7), RS(8), RT (1), ST (4)
8
S R

6 3
7
1
P 4 Q
2

Steps:
1. Start from vertex R.
2. Add RT (1) to the MST.
3. Connect R to Q via QR(3).
4. Connect Q to P via P Q(2).
5. Finally, connect R to S via RS(8).
6. Resulting MST: Edges RT, QR, P Q, RS with total weight 14.

75
Example 6: Graph G5
Vertices: U, V, W, X, Y
Edges with weights: U V (2), U W (3), V X(5), W X(6), W Y (4), XY (1)

W 6 X
5
3
4 1
U V
2

Steps:
1. Start from vertex U .
2. Add U V (2) to the MST.
3. Connect U to W via U W (3).
4. Connect W to Y via W Y (4).
5. Finally, connect X to Y via XY (1).
6. Resulting MST: Edges U V, U W, W Y, XY with total weight 10.

Example 7: Graph G6
Vertices: A, B, C, D, E, F
Edges with weights: AB(1), BC(2), CD(3), DE(4), EA(5), AF (6), F B(7), F C(8), F D(9), F E(10)
3
D C
9
8
F 2
7
6
4
A B
1
10
5
E

Steps:
1. Start from vertex A.
2. Add AB(1) to the MST.
3. Connect B to C via BC(2).
4. Connect C to D via CD(3).
5. Connect D to E via DE(4).
6. Resulting MST: Edges AB, BC, CD, DE with total weight 10.

76
5.8 TUTORIAL FOUR
1. Define a tree in the context of graph theory.

2. Prove that a tree with n vertices has exactly n − 1 edges.

3. Show that adding any edge to a tree creates exactly one cycle.

4. Given a tree with n vertices, if you remove any edge, how many components will
the graph have?

5. What is a leaf in a tree? Provide an example with a diagram.

6. Prove that every tree with at least two vertices has at least two leaves.

7. Draw all distinct trees with 5 vertices.

8. Why is every edge in a tree a bridge?

9. Prove that a connected graph is a tree if and only if it is acyclic.

10. Using Kruskal’s algorithm, find the MST for a graph with the following edges and
weights: AB(1), AC(2), BC(3), AD(3), CD(4).

11. Apply Prim’s algorithm to find the MST for the graph in the previous question,
starting from vertex A.

12. Explain why Kruskal’s algorithm might not yield a unique MST.

13. How does the removal of a leaf affect the status of a tree?

14. Verify that a tree is a bipartite graph.

15. Draw a tree with 6 vertices that has exactly 3 leaves.

16. Create a tree by adding one edge to a forest of three nodes.

17. Explain the role of a minimum cut in Kruskal’s and Prim’s algorithms.

18. Given a line tree (a tree in the form of a straight line) with vertices v1 , v2 , . . . , vn ,
write down all the edges.

19. Suppose you have a tree with vertices a, b, c, d, e such that removing vertex c divides
the tree into three disconnected trees. What can be said about vertex c?

20. Describe the process and draw the minimum spanning tree for a graph with ver-
tices A, B, C, D, E and edges AB(7), BC(8), CA(5), AD(6), DE(9), EC(10), BD(7)
using Kruskal’s Algorithm.

77
6 Planar Graphs and Graph Colouring
Definition 6.1. A planar graph is a graph that can be drawn on a plane without any of
its edges crossing, except at their endpoints (vertices). Such a drawing is called a plane
drawing. For convenience, a specific plane drawing of a planar graph is referred to as a
plane graph.
Example 6.2. Consider the complete graph K4 .

Non-Plane Drawing Plane Graph Plane Graph

ˆ First Drawing: This is a non-plane drawing of the complete graph K4 , where an


edge crossing occurs. Therefore, it is not a plane graph because it is not drawn in
a way that avoids edge intersections.
ˆ Second and Third Drawings: These are examples of plane graphs, where K4 is
drawn in such a way that no two edges intersect except at their endpoints. These
drawings show that while K4 is a planar graph, only certain representations qualify
as plane graphs.

Euler’s Formula in Planar Graphs


Theorem 6.3 (Euler, 1750). Let G be a plane drawing of a connected planar graph, and
let n, m, and f denote respectively the number of vertices, edges, and faces of G. Then
n − m + f = 2.
Proof. The proof is by induction on the number of edges of G.
Base case: If m = 0, then n = 1 (since G is connected) and f = 1 (the infinite face).
The theorem is therefore true in this case.
Inductive step: Now suppose that the theorem holds for all plane graphs with at
most m−1 edges, and let G be a plane graph with m edges. If G is a tree, then m = n−1
and f = 1, implying G − e is a connected plane graph with n vertices, m − 1 edges and
f − 1 faces. By the induction hypothesis,
n − (m − 1) + (f − 1) = 2.
It follows that
n − m + f = 2,
as required, completing the proof.

78
This formula is fundamental in the field of graph theory and provides insight into the
structural properties of planar graphs.

Explanation and Examples


Euler’s formula implies that for any plane drawing of a connected planar graph, the
graph divides the plane into regions called faces. Here, we analyze the given diagrams
to understand how the faces are formed and counted:

Example 6.4. Consider the plane graphs illustrated below with their respective numbers
of faces, including an unbounded face called the infinite face.

f4 f3
f5 f4
f1 f7
f2 f6 f1 f2

f8 f3

Observations:

ˆ Fig. 1: This graph has eight faces including the unbounded face f4 , demonstrating
the relationship V − E + F = 2.

ˆ Fig. 2: This graph has four faces, including an unbounded face, aligning with
Euler’s formula.

Theorem 6.5 (Euler’s Polyhedron Formula). For any convex polyhedron with n vertices,
m edges, and f faces, the following relationship holds:

n − m + f = 2.

6.1 Application to Common Polyhedra


Euler’s formula can be applied to any convex polyhedron, including well-known shapes
such as the cube.

Example 6.6. Consider a cube, a common three-dimensional polyhedron.

The cube has:

ˆ n = 8 vertices,

ˆ m = 12 edges,

79
ˆ f = 6 faces,
and applying Euler’s formula gives:
n − m + f = 8 − 12 + 6 = 2.
This verifies Euler’s formula for a cube.
Corollary 6.7. Let G be a polyhedral graph. Then, with the notation n for vertices, m
for edges, and f for faces, the relationship
n−m+f =2
holds true.
Corollary 6.8. Let G be a plane graph with n vertices, m edges, f faces, and k compo-
nents. Then
n − m + f = k + 1.
Proof. Apply Euler’s formula to each component of G separately, ensuring the infinite
face is counted only once.

6.2 Constraints on Planar Graphs


Corollary 6.9. If G is a simple connected planar graph with n ≥ 3 vertices and m edges,
then:
(i) m ≤ 3n − 6
(ii) If G has no triangles, m ≤ 2n − 4
Proof. (i) Each face in a simple planar graph is bounded by at least three edges. Counting
the total number of edges around all faces gives 3f ≤ 2m, where each edge is counted
twice. Combining this with Euler’s formula provides the result.
(ii) If there are no triangles, each face has at least four edges, hence 4f ≤ 2m, leading
to the stated bound.
Corollary 6.10. K5 and K3,3 are non-planar graphs.
Proof. For K5 with n = 5 and m = 10, applying (i) gives a contradiction since 10 ̸≤ 9.
Similarly, for K3,3 with n = 6 and m = 9, applying (ii) results in 9 ̸≤ 8.

6.3 Graph Coloring Theorem


Theorem 6.11. Every simple planar graph G contains a vertex of degree at most 5.
Proof. Assume G is connected with n ≥ 3. If every vertex has degree at least 6, then
6n ≤ 2m. From Corollary (i), 3n ≤ m leads to a contradiction, 3n ≤ 3n − 6, hence there
must be a vertex with degree at most 5.
Definition 6.12 (k-colorable Graph). A graph G without loops is k-colorable if it is
possible to assign one of k colors to each vertex so that no two adjacent vertices share the
same color. If G is k-colorable but not (k − 1)-colorable, then G is said to be k-chromatic,
and the chromatic number of G is k, denoted c(G) = k.
Theorem 6.13. The chromatic number of the complete graph Kn is n, meaning c(Kn ) =
n. Graphs can therefore have arbitrarily high chromatic numbers.

80
Example
Consider the graph shown in Figure below, which requires four different colors to properly
color its vertices, making it 4-chromatic.

γ
δ

α α

Coloring analysis:

ˆ The graph in Figure demonstrates that no fewer than four colors are required since
it includes structures that prevent a 3-coloring.

ˆ Each color represents a distinct group such that no two connected vertices share
the same color.

Properties of Chromatic Numbers


ˆ A graph is 1-chromatic if and only if it is a null graph (i.e., it has no edges).

ˆ A graph is 2-chromatic if and only if it is a non-null bipartite graph.

ˆ Every tree and any cycle graph with an even number of vertices is 2-colorable.

Theorem 6.14 (Vertex-degree Coloring). Let G be a simple graph with largest vertex-
degree D. Then G is (D + 1)-colorable.

Proof. We prove this Theorem by induction on the number of vertices, n, in the graph
G.
Base Case: If n = 1, then D = 0 since there are no adjacent vertices. The graph is
trivially (D + 1) = 1-colorable.
Inductive Step: Assume as an induction hypothesis that every simple graph with
n − 1 vertices and largest vertex-degree at most D is (D + 1)-colorable.
Consider a simple graph G with n vertices. Remove any vertex v with its incident
edges from G. The resulting graph, say G′ , has n − 1 vertices and a largest vertex-degree
at most D. By the induction hypothesis, G′ is (D + 1)-colorable.
To extend a (D + 1)-coloring of G′ to a (D + 1)-coloring of G, color v with a color
not used by its (at most D) adjacent vertices in G. This is always possible since there
are D + 1 colors available and at most D adjacent vertices to v, ensuring that there is at
least one color that can be assigned to v to achieve a proper coloring.
Thus, by mathematical induction, the theorem holds for all n.
Consider a simple graph where removing a vertex v significantly simplifies the graph
structure. Below is an example of this operation:

81
v

The vertex v is removed along with its incident edges. This results in a simpler
graph with fewer vertices and potentially fewer constraints on coloring. According to our
induction hypothesis, if the simpler graph can be colored with D + 1 colors, so can the
original graph by assigning a new, unique color to v that differs from those of its adjacent
vertices.
Theorem 6.15 (Brooks, 1941). Let G be a simple connected graph which is not a complete
graph nor an odd cycle. If the largest vertex-degree of G is D (where D ≥ 3), then G is
D-colourable.
Brooks’ theorem provides an important refinement to the general upper limit on the
chromatic number provided by previous Theorem. While the previous theorem suggests
that a graph G with maximum degree D is always (D + 1)-colourable, Brooks’ theorem
narrows this bound to D under specific conditions. This is particularly useful for certain
classes of graphs where the structure allows for a more efficient coloring.
Complete Graphs and Odd Cycles Exclusion: These are excluded in Brooks’
theorem because a complete graph Kn requires n colors (i.e., D + 1 where D = n − 1),
and an odd cycle requires 3 colors regardless of the number of vertices if more than 3.
Theorem 6.16 (Six-Colour Theorem). Every simple planar graph is 6-colourable.
Theorem 6.17 (Five-Colour Theorem). Every simple planar graph is 5-colourable.
Theorem 6.18 (Appel and Haken, 1976). Every simple planar graph is 4-colourable.

6.4 TUTORIAL FIVE


1. Define what makes a graph planar.

2. Explain with an example how a graph can be planar but not a plane graph.

3. Prove that a planar graph with n ≥ 3 vertices and no cycles has n − 1 edges.

4. Using Euler’s formula, find the number of faces for a planar graph with 6 vertices
and 10 edges.

5. Draw a planar graph with exactly 5 faces and explain why it fulfills Euler’s formula.

6. Show that adding any edge to a planar graph can affect its planarity.

7. Demonstrate how to transform a non-plane drawing of a graph into a plane graph.

8. Discuss the limitations of plane graphs when it comes to complex network repre-
sentations.

9. Use Euler’s formula to prove that K5 is not a planar graph.

10. Using graph coloring, explain why K4 is planar but K5 is not.

82
11. Apply the Five-Colour Theorem to color a simple planar graph with 7 vertices and
10 edges.

12. Construct a planar graph that requires exactly 6 colors and justify your coloring.

13. Illustrate a scenario where a planar graph can be colored with only two colors.

14. Solve for the chromatic number of a tree graph with 10 vertices.

15. Provide a step-by-step application of Kruskal’s algorithm to find an MST in a


weighted planar graph.

16. Draw a planar graph with n vertices, 3n − 6 edges, and prove it is maximal (no
more edges can be added without losing planarity).

17. Explain how the Four-Colour Theorem simplifies the process of map coloring.

18. Use Prim’s algorithm to find the MST for a planar graph and compare the result
with Kruskal’s algorithm.

19. Given a planar graph, devise a method to determine the minimum number of colors
needed (without using the Four-Colour Theorem).

20. Critically analyze the impact of graph density on the colorability and planarity of
a graph.

83

You might also like