Paths and Cycles
Paths and Cycles
Definitions:
1. A path in a graph is a finite sequence of vertices and edges, beginning
and ending with vertices, such that each edge is incident on the vertex
preceding and following it.
a
e1 e3
b e2 c
In this graph “ a e1 b e2 c e2 b” is a path, but “ a e1 b e2 c ” is a simple path
3. The no of edges in a path is called the length of the path.
4. If the initial and final vertices are the same then the path is called a
circuit or a cycle.
5. If the initial and final vertices of a simple path of non-zero length are
the same, then the path is called a simple circuit or a simple cycle.
u v a b
z w d e
Y x c f
G1 G2
2. U1 V1
U5 U2 V5 V2
U4 U3 V4 V3
A B
C D
Thus there are 6 paths from ‘a to c’ of length 4 and 4 path of length 4 from
‘b to d’
Different paths ‘a to c’ Different paths from ‘b to d’
1. A –B– A- D–C 1. B – A – C – A - D
2. A –C– A –D– C 2. B – A - D - A - D
3. A –C– D– A– C 3. B – A – B – A - D
4. A –D– C– D–C 4. B – A – C – A - D
5. A –D– A– D– C
6. A –D- C–A -C
Problems
1. Find which of the following vertex sequence are simple paths, paths,
closed paths, and simple circuits.
A B
C
D E
1. A – D - E – B – C
2. A – D – B – C – E
3. A – E – C – B – E – A
4. C – B – D – A – E – C
5. A – D – B – E – C – B
2. Find all simple paths from A to F and all circuits in the graph
B C
A F
D E
Four vertices each, 6 edges each and degree of each vertex is three.
Therefore, necessary conditions for isomorphism are satisfied.
In G 1 and G 2, there are 4 cycles each of length3, one cycle of length 4.
Thus, the given graphs are isomorphic.
4. Find the no paths of length 4 from vertex ‘D to E’ and “‘A to E’ in the
undirected graph shown below. Identify those paths from the graph.
A B
G= C
D E
𝟎 𝟏 𝟎 𝟏 𝟎
𝟏 𝟎 𝟏 𝟎 𝟏
A= 𝟎 𝟏 𝟎 𝟏 𝟏,
𝟏 𝟎 𝟏 𝟎 𝟎
[𝟎 𝟏 𝟏 𝟎 𝟎]
𝟐 𝟎 𝟐 𝟎 𝟏
𝟎 𝟑 𝟏 𝟐 𝟏
2
A = 𝟐 𝟏 𝟑 𝟎 𝟏,
𝟎 𝟐 𝟎 𝟐 𝟏
[𝟏 𝟏 𝟏 𝟏 𝟐]
𝟗 𝟑 𝟏𝟏 𝟏 𝟔
𝟑 𝟏𝟓 𝟕 𝟏𝟏 𝟖
4
A = 𝟏𝟏 𝟕 𝟏𝟓 𝟑 𝟖
𝟏 𝟏𝟏 𝟑 𝟗 𝟔
[𝟔 𝟖 𝟖 𝟔 𝟖]