{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L06 - Another application of DFS Strongly connected...

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
CS0250, Set 6 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.
Image of page 2
CS0250, Set 6 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.
Image of page 3

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

View Full Document Right Arrow Icon
CS0250, Set 6 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.
Image of page 4
CS0250, Set 6 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.
Image of page 5

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

View Full Document Right Arrow Icon
CS0250, Set 6 Definition G G T
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
Image of page 7

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

View Full Document Right 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? Thedirected graph G v
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?
Image of page 9

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern