L06 - Another application of DFS: Strongly connected...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CS0250, Set 6 Another application of DFS: Strongly connected components (Ch22.5) Consider any directed graph G. For any two vertices a, b, let u   v  denote the fact that there is a  directed path  from u to v. Let u, v be any two vertices of G. We say u, v are  strongly  connected  if u   v and v   u.  Note that if a, b are strongly connected, and b, c are strongly  connected, then a, c are strongly connected. a b c
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fact :  This “strongly connected” property partitions the vertices  into a number of (disjoint) groups C 1 , C 2 ,…,C k  such that  – for any pair of vertices u, v in the same group, then u, v are  strongly connected, – for any pair of vertices u, v in different groups, then u, v are  not strongly connected.
Background image of page 2
Fact :  This “strongly connected” property partitions the vertices  into a number of (disjoint) groups C 1 , C 2 ,…,C k  such that  – for any pair of vertices u, v in the same group, then u, v are  strongly connected, – for any pair of vertices u, v in different groups, then u, v are  not strongly connected.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fact :  This “strongly connected” property partitions the vertices  into a number of (disjoint) groups C 1 , C 2 ,…,C k  such that  – for any pair of vertices u, v in the same group, then u, v are  strongly connected, – for any pair of vertices u, v in different groups, then u, v are  not strongly connected.
Background image of page 4
Fact :  This “strongly connected” property partitions the vertices  into a number of (disjoint) groups C 1 , C 2 ,…,C k  such that  – for any pair of vertices u, v in the same group, then u, v are  strongly connected, – for any pair of vertices u, v in different groups, then u, v are  not strongly connected.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS0250, Set 6 Definition G G T
Background image of page 6
CS0250, Set 6 An algorithm for finding strongly connected components Strongly-Connected-Components(G) (1) Call DFS(G) to compute the finishing times f[u]  for each u; (2) Construct G T ; (3) Call DFS(G T ), but when we pick a new starting  vertex, we  choose the unexplored v with the largest  f[v]; (4) Each depth-first tree computed in the previous step  covers a strongly-connected component. Example
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS0250, Set 6 Suppose that we arbitrarily pick a vertex v and do a depth-first  search from this vertex.  What do we get? The directed graph G v
Background image of page 8
CS0250, Set 6 Suppose that we arbitrary pick a vertex v and do a depth-first  search from this vertex.  What do we get?
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/05/2008 for the course CS CSIS0250 taught by Professor Dr.hing-fungting during the Summer '08 term at HKU.

Page1 / 59

L06 - Another application of DFS: Strongly connected...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online