Docsity

Graph Connectivity-Discrete Mathematics-Lecture Slides, Slides of Discrete Mathematics

Toggle sidebar
bg1
1
Graph Connectivity
Discrete Mathematics
Path and Simple path
• A path from v1 to vk is a sequence of nodes v1, v2, …,
vk that are connected by edges (v1, v2), (v2, v3), …, (vk-
1, vk)
• A path is called a simple path if every node appears at
most once.
•
v2 v3 v4 v2 v1 is a path
•
v2
,
v3
,
v4
,
v2
,
v1 is a path
• v2, v3, v4, v5 is a path, also it is a simple path
v1v2
v4
v3
v5
Cycle and Simple Cycle
• A cycle is a path that begins and ends at the same node
• A simple cycle is a cycle if every node appears at most
once, except for the first and the last nodes
– v2, v3, v4, v5 , v3, v2 is a cycle
– v2, v3, v4, v2 is a cycle, it is also a simple cycle
v1
v2
v4
v3
v5
Paths in Undirected Graphs
• In an undirected graph, a path of length n from u to v is a
sequence of adjacent edges going from vertex u to
vertex v.
• A path is a circuit if u=v.
• A path traverses the vertices along it.
A th i i l if it t i d th
•
A
pa
th i
s
s
i
mp
l
e
if it
con
t
a
i
ns
no
e
d
ge
more
th
an
once.
6/1/2009
Paths in Directed Graphs
• Same as in undirected graphs, but the path must go in the
direction of the arrows.
Connected Graph
• Two nodes are connected if there is a path between
them. A graph G is connected if there exists path
between every pair of distinct nodes; otherwise, it is
disconnected
v
2
• This is a connected graph because there exists path
between every pair of nodes
v1
v4
v3
v5
2
docsity.com
pf3
pf4

Partial preview of the text

Download Graph Connectivity-Discrete Mathematics-Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Graph Connectivity

Discrete Mathematics

Path and Simple path

  • A path from v1 to vk is a sequence of nodes v1, v2, …, vk that are connected by edges (v1, v2), (v2, v3), …, (vk- 1, vk)
  • A path is called a simple path if every node appears at most once.
  • • v2 v3 v4 v2 v1 is a pathv2, v3, v4, v2, v1 is a path
  • v2, v3, v4, v5 is a path, also it is a simple path

v 1

v 2

v 4

v 3

v 5

Cycle and Simple Cycle

  • A cycle is a path that begins and ends at the same node
  • A simple cycle is a cycle if every node appears at most once, except for the first and the last nodes - v2, v3, v4, v5 , v3, v2 is a cycle - v2, v3, v4, v2 is a cycle, it is also a simple cycle

v 1

v 2

v 4

v 3

v 5

Paths in Undirected Graphs

  • In an undirected graph, a path of length n from u to v is a sequence of adjacent edges going from vertex u to vertex v.
  • A path is a circuit if u=v.
  • A path traverses the vertices along it.
  • AA path is simple if it contains no edge more than once. th i i l if it t i d th

6/1/

Paths in Directed Graphs

  • Same as in undirected graphs, but the path must go in the direction of the arrows.

Connected Graph

  • Two nodes are connected if there is a path between them. A graph G is connected if there exists path between every pair of distinct nodes; otherwise, it is disconnected

v 2

  • This is a connected graph because there exists path between every pair of nodes

v 1

v 4

v 3

v 5

2

docsity.com

Connected Graph

  • Are the following graphs connected?

d

a

b

c

e

Yes

d

b a

c

e

No

7

Yes. No.

d

a b

c

e

Yes.

d

b a

c

e

f No.

Disconnected Graph

Example:

v 1 v^2 v^3 v^7 v 8

v 4 v 5

This is a disconnected graph because there does not exist path between some pair of nodes, says, v 1 and v 7

v 6 v 9

Connected Component

  • If a graph is disconnect, it can be partitioned into a number of graphs such that each of them is connected. Each such graph is called a connected component.

v 1

v 4

v 3

v 5

v 2 v 7

v 6

v 8

v 9

Connectedness in Undirected Graphs

  • An undirected graph is connected iff there is a path between every pair of distinct vertices in the graph.
  • Theorem:
    • There is a simple path between any pair of vertices in a connected undirected graph.
  • CConnected component: connected subgraph t d t t d b h

10

Connectedness in Directed Graphs

  • A directed graph is strongly connected iff there is a directed path from u to v and from v to u for any two vertices u and v.
  • An directed graph is weakly connected if there is a path between any two vertices in the underlying undirected graph.graph.

11

Connectivity

  • Are the following directed graphs strongly or weakly connected?

a b d

Weakly connected, because, for example, there is no path from b to d.

12

c

d

a b

c

d

Strongly connected, because there are paths between all possible pairs of vertices.

docsity.com

Euler Paths and Circuits

Example:

  • Which of the following graphs have an Euler circuit? Which have an Euler path?

a b a b a b

e

d

a

c

b

e

d

a

c

b

c e

a

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.

Summary

Property Euler Hamilton Repeated visits to a given node allowed? YES^ NO Repeated traversals of a given edge allowed? Omitted nodes allowed? Omitted edges allowed?

YES NO

NO NO

NO NO

NO YES

docsity.com