0% found this document useful (0 votes)
20 views

DSLec 14

The document defines various graph-related terms like walks, paths, circuits, Euler circuits, and Hamiltonian circuits. It provides examples and exercises to determine if graphs exhibit these properties. Closed and simple versions of walks, paths and circuits are also defined based on repeated edges and vertices. Connectedness of graphs is discussed.

Uploaded by

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

DSLec 14

The document defines various graph-related terms like walks, paths, circuits, Euler circuits, and Hamiltonian circuits. It provides examples and exercises to determine if graphs exhibit these properties. Closed and simple versions of walks, paths and circuits are also defined based on repeated edges and vertices. Connectedness of graphs is discussed.

Uploaded by

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

Discrete Structure

By
Syed Ijaz Hussain Bukhari
PATHS AND CIRCUITS
DEFINITIONS:
Let G be a graph and let v and w be vertices in graph G.

1. WALK
A walk from v to w is a finite alternating sequence of adjacent vertices and edges
of G.
Thus a walk has the form
v0e1v1e2 … vn-1envn
where the v’s represent vertices, the e’s represent edges v0=v , vn=w, and for all
i = 1, 2 … n, vi-1 and vi are endpoints of ei.

The trivial walk from v to v consists of the single vertex v.

2. CLOSED WALK
A closed walk is a walk that starts and ends at the same vertex.
3. CIRCUIT
A circuit is a closed walk that does not contain a repeated edge.
Thus a circuit is a walk of the form
v0e1v1e2 … vn-1 en vn
where v0 = vn and all the ei, s are distinct.

4. SIMPLE CIRCUIT
A simple circuit is a circuit that does not have any other
repeated vertex except the first and last.
Thus a simple circuit is a walk of the form
v0e1v1e2 … vn-1envn
where all the ei,s are distinct and all the vj,s are distinct except that v0 = vn
5. PATH
A path from v to w is a walk from v to w that does not contain a repeated
edge.
Thus a path from v to w is a walk of the form
v = v0e1v1e2 … vn-1envn = w
where all the ei,s are distinct (that is ei  ek for any i k).

6. SIMPLE PATH
A simple path from v to w is a path that does not contain a
repeated vertex.
Thus a simple path is a walk of the form
v = v0e1v1e2 … vn-1envn= w
where all the ei,s are distinct and all the vj,s are also distinct (that is, vj  vm for any
j  m).
Repeated Repeated Vertex Starts and Ends at Same Point
Edge

walk allowed Allowed allowed

closed walk allowed Allowed yes(means, where it starts also ends at that point)

circuit no Allowed yes

simple circuit no first and last only yes

path no Allowed allowed

simple path no no No
EXERCISE
In the graph below, determine whether the
following walks are paths, simple paths, closed
walks, circuits, simple circuits, or are just walks.
(a) v 1e 2v 2e 3v 3e 4v 4e 5v 2e 2v 1e 1v 0
(b) v 1v 2v 3v 4v 5v 2 v1 v3
e1 e2 e3
(c) v 4v 2v 3v 4v 5v 2v 4 e10
v0
e9
v2
e4
e7 e5
(d) v 2v 1v 5v 2v 3v 4v 2 e8

(e) v 0v 5v 2v 3v 4v 2v 1 v5 e6 v4

(f) v 5v 4v 2v 1
(a)

• SOLUTION: e1
v1
e2
v2
e3
v3

v0 e4
(a) v1e2v2e3v3e4v4e5v2e2v1e1v0 e5

v5 v4

This graph starts at vertex v1,then goes to v2


along edge e2,and moves continuously, at the
end it goes from v1 to v0 along e1.Note it that
the vertex v2 and the edge e2 is repeated
twice, and starting and ending, not at the
same points. Hence The graph is just a walk.
(b) v1v2v3v4v5v2 v1 v3

v0 v2

v5 v4
In this graph vertex v2 is repeated twice. As no edge is
repeated so the graph is a path
v v 3
(c) v4v2v3v4v5v2v4
1

v
v0 2

v5 v4

As vertices v2 & v4 are repeated and graph starts and ends at


the same point v4,also the edge(i.e. e5 )connecting v2 & v4 is
repeated, so the graph is a closed walk.
v3
(d) v2v1v5v2v3v4v2 v1

v0 v2

v5 v4

In this graph, vertex v2 is repeated and the graph starts and end at the
same vertex (i.e. at v2) and no edge is repeated, hence the above
graph is a circuit v1 v3
(e) v0v5v2v3v4v2v1 v2
v0

v5 v4

Here vertex v2 is repeated and no edge is repeated so the graph is a


path
(f) v5v4v2v1 v1 v3

v2
v0

v5 v4

Neither any vertex nor any edge is repeated so


the graph is a simple path.
CONNECTEDNESS
Let G be a graph. Two vertices v and w of G are
connected if, and only if, there is a walk from v
to w. The graph G is connected if, and only if,
given any two vertices v and w in G, there is a
walk from v to w.
EXAMPLE:
Which of the following graphs have a
connectedness?
(a) v4 (b) v3
v2 v3 v2 v4
v5
v1 v5
v1 v6
v6
(c) v2 v5 v6 (d) v4
v3
v4
v2
v1 v5
v1 v3 v v7 v6
8
EULER CIRCUITS
DEFINITION:
Let G be a graph. An Euler circuit for G is a circuit
that contains every vertex and every edge of G. That
is, an Euler circuit for G is sequence of adjacent
vertices and edges in G that starts and ends at the
same vertex uses every vertex of G at least once, and
used every edge of G exactly once.
THEOREM:
A graph G has an Euler circuit if, and only if, G is
connected and every vertex of G has an even degree.
EXERCISE
Determine whether the following graph has an
Euler circuit.
v3
v4
v6
v2
v1 v5
v0 v7

v8
v9

SOLUTION:
As deg (v1) =5, an odd degree so the graph
has not an Euler circuit.
EXERCISE:
Determine whether the following graph has Euler circuit.
c d
b
h g
a
f e
i
SOLUTION:
From above clearly deg(a)=2, deg(b)=4, deg(c)=4, deg(d)=4,
deg(e)=2, deg(f)=4, deg(g)=4, deg(h)=4, deg(i)=4
Since the degree of each vertex is even, and the graph has Euler Circuit.
One such circuit is:
abcdefgdfihcghbia
EULER PATH
DEFINITION:
Let G be a graph and let v and w be two vertices of G. An
Euler path from v to w is a sequence of adjacent edges and
vertices that starts at v, and end at w, passes through every
vertex of G at least once, and traverses every edge of G exactly
once.
COROLLARY
Let G be a graph and let v and w be two vertices of G. There is
an Euler path from v to w if, and only if, G is connected, v and w
have odd degree and all other vertices of G have even degree.
HAMILTONIAN CIRCUITS
DEFINITION:
Given a graph G, a Hamiltonian circuit for G is a
simple circuit that includes every vertex of G. That is,
a Hamiltonian circuit for G is a sequence of adjacent
vertices and distinct edges in which every vertex of G
appears exactly once.
EXERCISE:
Find Hamiltonian Circuit for the following graph.
b d

c
a h e

g f
SOLUTION:
The Hamiltonian Circuit for the following graph is:

abdefcgha
Another Hamiltonian Circuit for the following graph
could be:

abcdefgha

You might also like