Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qj1zsa
via LifeLong Community
Geek: Kosaraju's Algorithm to Find Strongly Connected Components
1) G is a directed graph and S is a stack.
2) While S does not contain all vertices perform step 3.
3)choose a random vertex v and perform depth first search on it. Each time DFS finishes expanding vertex v, push v on to the stack S. (This guarantees that the vertex with maximum finish time will more closer to the top of the stack).
4) Obtain a transpose of the G by reversing the direction of the edge.
5)While S is not empty perform step 6.
6) Remove v=top of S and again perform DFS on it The set of all visited vertices will give the strongly connected components containing v. Remove all visited vertices from stack.
http://ift.tt/1qj1BQM
http://ift.tt/1nLZvDt
1) G is a directed graph and S is a stack.
2) While S does not contain all vertices perform step 3.
3)choose a random vertex v and perform depth first search on it. Each time DFS finishes expanding vertex v, push v on to the stack S. (This guarantees that the vertex with maximum finish time will more closer to the top of the stack).
4) Obtain a transpose of the G by reversing the direction of the edge.
5)While S is not empty perform step 6.
6) Remove v=top of S and again perform DFS on it The set of all visited vertices will give the strongly connected components containing v. Remove all visited vertices from stack.
http://ift.tt/1qj1BQM
http://ift.tt/1nLZvDt
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qj1zsa
via LifeLong Community
No comments:
Post a Comment