FAL (2022-23) MAT1003 TH AP2022232000323 Reference Material I 09-Dec-2022 Module 6 Lecture
FAL (2022-23) MAT1003 TH AP2022232000323 Reference Material I 09-Dec-2022 Module 6 Lecture
Definition
An undirected graph is called connected if there is a path between every
pair of distinct vertices of the graph. An undirected graph that is not
connected is called disconnected. We say that we disconnect a graph when
we remove vertices or edges, or both, to produce a disconnected subgraph.
DMS (MAT1003) Dr. Nikunja 8/3
Connectedness in Undirected Graphs
Example
The graph G1 in the Figure is connected,
because for every pair of distinct vertices
there is a path between them. However,
the graph G2 is not connected. For
instance, there is no path in G2 between
vertices a and d.
Example
The graph G1 in the Figure is connected,
because for every pair of distinct vertices
there is a path between them. However,
the graph G2 is not connected. For
instance, there is no path in G2 between
vertices a and d.
Theorem
There is a simple path between every pair of distinct vertices of a
connected undirected graph.
Example
The graph G1 in the Figure is connected,
because for every pair of distinct vertices
there is a path between them. However,
the graph G2 is not connected. For
instance, there is no path in G2 between
vertices a and d.
Theorem
There is a simple path between every pair of distinct vertices of a
connected undirected graph.
Note: Paths and circuits can help determine whether two graphs are
isomorphic.
Answer Yes.
DMS (MAT1003) Dr. Nikunja 10 / 3
Counting Paths Between Vertices
Theorem
Let G be a graph with adjacency matrix A with respect to the ordering
v1 , v2 , . . . , vn of the vertices of the graph (with directed or undirected
edges, with multiple edges and loops allowed). The number of different
paths of length r from vi to vj , where r is a positive integer, equals the
(i, j)th entry of Ar .
Theorem
Let G be a graph with adjacency matrix A with respect to the ordering
v1 , v2 , . . . , vn of the vertices of the graph (with directed or undirected
edges, with multiple edges and loops allowed). The number of different
paths of length r from vi to vj , where r is a positive integer, equals the
(i, j)th entry of Ar .
Example How many paths of length four are there from a to d in the
simple graph G in the Figure?
Theorem
Let G be a graph with adjacency matrix A with respect to the ordering
v1 , v2 , . . . , vn of the vertices of the graph (with directed or undirected
edges, with multiple edges and loops allowed). The number of different
paths of length r from vi to vj , where r is a positive integer, equals the
(i, j)th entry of Ar .
Example How many paths of length four are there from a to d in the
simple graph G in the Figure?
Answer
a, b, a, b, d; a, b, a, c, d; a, b, d, b, d; a, b, d, c, d; a, c, a, b, d; a, c, a, c, d; a, c, d, b, d;
and a, c, d, c, d are the eight paths of length four from a to d.
DMS (MAT1003) Dr. Nikunja 11 / 3
Shortest-Path Problems
1 Step 0 Label the source node (node 1) with the permanent label
[0, −]. Set i=1.
2 Step i.
1 Compute the temporary labels [ui + dij , i] for each node j that can be
reached from node i, provided j is not permanently labeled.
If node j is already labeled with [uj , k] through another node k and if
ui + dij < uj , replace [uj , k] with [ui + dij , i].
2 If all the nodes permanent labels, stop. Otherwise, select the label
[ur , s] having the shortest distance (= ur ) among all the temporary
labels(break ties arbitrarily). Set i = r and repeat step i.
There are several different algorithms that find a shortest path between
two vertices in a weighted graph. We will present a greedy algorithm
discovered by the Dutch mathematician Edsger Dijkstra in 1959. The
version we will describe solves this problem in undirected weighted graphs
where all the weights are positive.
Theorem
Dijkstra’s algorithm finds the length of a shortest path between two
vertices in a connected simple undirected weighted graph.
DMS (MAT1003) Dr. Nikunja 14 / 3
Planar Graphs
Consider the problem of joining three houses to each of three separate
utilities, as shown in the Figure. Is it possible to join these houses and
utilities so that none of the connections cross?