An overview of strong connected branching algorithms

Source: Internet
Author: User

Depth-First search has a classic application: to decompose a graph into strong connected branches. Many algorithms for the direction graph begin with this step. (Algorithm introduction P338, feel concise and exquisite, share)

Strongly-connected-components (G)

1 call DFS (G) to compute finishing times F[u] for each vertex u

2 Compute GT

3 Call DFS (GT). But in the main loop of DFS, consider the vertices in order of decreasing f[u] (as computed in line 1)

4 output the vertices of the Depth-first forest formed in Line3 as a separate strongly connected component

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

DFS (g): Depth traversal, GT for Figure G Transpose, F[u] is the second time stamp, when the vertex U is first discovered in the depth traversal, the first time stamp D[u] is recorded and the second time stamp is recorded when the adjacency table of U is checked, as shown in Figure 13/14, 13 is d[u[,14 f[u.

Lemma: Set C and C ' as two different strongly connected branches in the g= (v,e). Suppose that there is an edge (u,v) belonging to E, where u belongs to c,v belonging to C ', then f (c) >f (c ')

Corollary: To set C and C ' as two different strongly connected branches of the g= (v,e), assuming that there is an edge (u,v) belonging to ET, where u belongs to the c,v belongs to C ', then f (c) <f (c ')

To understand why Strongly-connected-components (G) can work properly? First, for a strongly connected branch C, assume that its completion time F (c) is the largest. The search begins at the beginning of a vertex x and accesses all the vertices in C, and, by inference, there is no edge from C to any other connected branch in the GT (should be f (C) the largest), so the search from X does not access vertices in any other branch. Then, by analogy, all the strongly connected branches are obtained.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.