0% found this document useful (0 votes)
50 views46 pages

Pciu Final Graph - Part - 3

This document summarizes key concepts about paths, circuits, and connectivity in graphs from discrete mathematics. 1) It defines different types of paths in graphs like simple paths, circuits, and trails. It also discusses the properties of walks, paths, and cycles. 2) It covers connectivity in graphs, including definitions for connected, disconnected, and weakly/strongly connected graphs. It provides examples of finding cut vertices and edges. 3) It discusses Euler paths and circuits, and provides the necessary and sufficient conditions for a graph to have an Euler path or circuit. It also discusses finding Euler paths and circuits in directed graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views46 pages

Pciu Final Graph - Part - 3

This document summarizes key concepts about paths, circuits, and connectivity in graphs from discrete mathematics. 1) It defines different types of paths in graphs like simple paths, circuits, and trails. It also discusses the properties of walks, paths, and cycles. 2) It covers connectivity in graphs, including definitions for connected, disconnected, and weakly/strongly connected graphs. It provides examples of finding cut vertices and edges. 3) It discusses Euler paths and circuits, and provides the necessary and sufficient conditions for a graph to have an Euler path or circuit. It also discusses finding Euler paths and circuits in directed graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 46

Discrete Mathematics

Chapter 8.4
Connectivity
Paths in Undirected Graphs
• There is a path from vertex v0 to vertex vn if
there is a sequence of edges from v0 to vn
– This path is labeled as v0,v1,v2,…,vn and
has a length of n.
• The path is a circuit if the path begins and
ends with the same vertex.
• A path is simple if it does not contain the
same edge more than once.
Graph Theoretic Foundations
• Paths and Cycles:
• Walk in a graph G is v0, e1, v1, …, vl-1, el, vl
Graph Theoretic Foundations
• Paths and Cycles:
• IF v0, v1, …, vl are distinct (except possible v0,vl) then
the walk is a path.
• Denoted by v0, v1, …, vl or e1, e2, …, el
• Length of path is l
Paths, Cycles, and Trails
• A trail is a walk with no repeated edge.
Graph Theoretic Foundations
• Paths and Cycles:
• A path or walk is closed if v0 = vl
• A closed path containing at least one edge is
called a cycle.
Paths in Undirected Graphs
• A path or circuit is said to pass through the
vertices v0, v1, v2, …, vn or traverse the
edges e1, e2, …, en.
Example
• u1, u4, u2, u3
u1 u2
– Is it simple?
– yes

– What is the length?


u5 u4 u3 –3

– Does it have any circuits?


– no
Example
• u1, u5, u4, u1, u2, u3

– Is it simple?
u1 u2 – yes

u5 u3
– What is the length?
u4 –5

– Does it have any circuits?


– Yes; u1, u5, u4, u1
Example
• u1 , u2 , u5 , u4 , u3

– Is it simple?
– yes
u1 u2

– What is the length?


u5 u3 –4
u4
– Does it have any circuits?
– no
Connectedness
• An undirected graph is called connected if
there is a path between every pair of distinct
vertices of the graph.

• There is a simple path between every pair of


distinct vertices of a connected undirected
graph.
Example
Are the following graphs connected?

a b a b

c e

f d c

g e d f

Yes No
Connectedness (Cont.)

• A graph that is not connected is the union


of two or more disjoint connected
subgraphs (called the connected
components of the graph).
Example
• What are the connected components of
the following graph?

b d e f

a c h g
Example
• What are the connected components of
the following graph?

b d e f

a c h g

{a, b, c}, {d, e}, {f, g, h}


Cut edges and vertices
• If one can remove a vertex (and all
incident edges) and produce a graph
with more connected components, the
vertex is called a cut vertex.

• If removal of an edge creates more


connected components the edge is
called a cut edge or bridge.
Example
• Find the cut vertices and cut edges in the
following graph.

a d f g

b c e h
Example
• Find the cut vertices and cut edges in the
following graph.

a d f g

b c e h

Cut vertices: c and e


Cut edge: (c, e)
Graph Theoretic Foundations
• Connectivity:
• Connectivity (G) of graph G is …
• G is k connected if (G)  k
• Separator or vertex-cut Cut
vertex

Separation
pair
Graph Theoretic Foundations
• Trees and Forests:
• Tree – connected graph without any cycle
• Forest – a graph without any cycle
Connectedness in Directed Graphs
• A directed graph is strongly connected if
there is a directed path between every
pair of vertices.

• A directed graph is weakly connected if


there is a path between every pair of
vertices in the underlying undirected
graph.
Example
• Is the following graph strongly connected? Is
it weakly connected?
This graph is strongly
a b connected. Why?
Because there is a directed
path between every pair of
c
vertices.
If a directed graph is
e d strongly connected, then it
must also be weakly
connected.
Example
• Is the following graph strongly connected? Is
it weakly connected?
a b This graph is not strongly
connected. Why not?
Because there is no
c directed path between a
and b, a and e, etc.
However, it is weakly
e d connected. (Imagine this
graph as an undirected
graph.)
Connectedness in Directed Graphs

• The subgraphs of a directed graph G that


are strongly connected but not contained
in larger strongly connected subgraphs
(the maximal strongly connected
subgraphs) are called the strongly
connected components or strong
components of G.
Example
• What are the strongly connected components
of the following graph?
a b
This graph has three strongly
connected components:
• The vertex a
c
• The vertex e
• The graph consisting of
e d
V = {b, c, d} and
E = { (b, c), (c, d), (d, b)}
Distance in Trees and Graphs
Consider a connected graph G. The distance between vertices u and v in G,
written d(u, v), is the length of the shortest path between u and v. The
diameter of G, written diam(G), is the maximum distance between any two
points in G. For example, in Fig. 1-8(a), d(A,F) = 2 and diam(G) = 3, whereas
in Fig. 1-8(b), d(A, F) = 3 and diam(G) = 4
Distance in Trees and Graphs
• If G has a u, v-path, then the distance from u
to v, written dG(u, v) or simply d(u, v), is the
least length of u, v-path.
• The diameter (diam G) is maxu,vV(G)d(u,v)
Distance in Trees and Graphs
• Find the diameter, eccentricity, radius and
center of the given G.
CSE 211
Discrete Mathematics and Its Applications

Chapter 8.5
Euler and Hamilton Paths
Euler Paths and Circuits
• The Seven bridges of Königsberg

C
c

D
A
a d

B
b
Euler Paths and Circuits
• An Euler path is a path using every edge
of the graph G exactly once.
• An Euler circuit is an Euler path that
returns to its start.
C

Does this graph have an Euler circuit?


No. D
A

B
Necessary and Sufficient Conditions
• How about multigraphs?

• A connected multigraph has a Euler circuit


iff each of its vertices has an even degree.
• A connected multigraph has a Euler path
but not an Euler circuit iff it has exactly
two vertices of odd degree.
Example
• Which of the following graphs has an Euler circuit?

a b a b a b

e e

d c d c c d e

yes no no
(a, e, c, d, e, b, a)
Example
• Which of the following graphs has an Euler path?

a b a b a b

e e

d c d c c d e

yes no yes
(a, e, c, d, e, b, a ) (a, c, d, e, b, d, a, b)
Euler Circuit in Directed Graphs

NO (a, g, c, b, g, e, d, f, a) NO
Euler Path in Directed Graphs

NO (a, g, c, b, g, e, d, f, a) (c, a, b, c, d, b)
Hamilton Paths and Circuits

• A Hamilton path in a graph G is a path


which visits every vertex in G exactly once.

• A Hamilton circuit is a Hamilton path that


returns to its start.
Hamilton Circuits

Is there a circuit in this graph that passes through each


vertex exactly once?
Hamilton Circuits

Yes; this is a circuit that passes through each vertex


exactly once.
Finding Hamilton Circuits

Which of these three figures has a Hamilton circuit?


Of, if no Hamilton circuit, a Hamilton path?
Finding Hamilton Circuits

• G1 has a Hamilton circuit: a, b, c, d, e, a


• G2 does not have a Hamilton circuit, but does have a
Hamilton path: a, b, c, d
• G3 has neither.
Finding Hamilton Circuits

• Unlike the Euler circuit problem, finding


Hamilton circuits is hard.
• There is no simple set of necessary and
sufficient conditions, and no simple
algorithm.
Properties to look for ...
• No vertex of degree 1
• If a node has degree 2, then both edges
incident to it must be in any Hamilton
circuit.
• No smaller circuits contained in any
Hamilton circuit (the start/endpoint of any
smaller circuit would have to be visited
twice).
A Sufficient Condition
Let G be a connected simple graph with n
vertices with n  3.
G has a Hamilton circuit if the degree of
each vertex is  n/2.
Travelling Salesman Problem
A Hamilton circuit or path may be used to solve
practical problems that require visiting
“vertices”, such as:
road intersections
pipeline crossings
communication network nodes
A classic example is the Travelling Salesman
Problem – finding a Hamilton circuit in a
complete graph such that the total weight of its
edges is minimal.
Summary
Property Euler Hamilton
Repeated visits to a given Yes No
node allowed?
Repeated traversals of a No No
given edge allowed?
Omitted nodes allowed? No No

Omitted edges allowed? No Yes

You might also like