Kosaraju algorithm of strong Unicom component

Source: Internet
Author: User

First define: The strong Unicom component is the largest node set of the graph g= (V, E), satisfies any pair of nodes in the Set V and U, and the path vu and UV exist simultaneously.

The Kosaraju algorithm is used to search for strong unicom components. For figure G, it first randomly find a node Dfs, the last time each of the nodes to access the timestamp f (x), and then we set up the inverse of the GT, and then according to the reverse timestamp of the DFS per node, each Dfs to the node set is a strong unicom component. In fact, the idea of this algorithm is similar to the topological sort.

Let's prove it (note that the image here refers to the original picture, not the inverse):

Lemma: For G in two strong Unicom components C and C ', if the point u belongs to C, point v belongs to C ', and there is an edge (u,v), then f (c) >f (C ').

The proof should be very good to think. If you first visit C, then you must first access C ' again. If you first access C ' because of the nature of the strong Unicom component, C must not be in the depth-first search tree of C '.

Inference: For the two strong unicom components in G C and C ', if the point u belongs to C, point v belongs to C ', if f (c) >f (c '), then there can be no edge (V,u)

Because if there is an edge (v,u), Access C ' must be accessed to C, then C exits first. If you first access C, then F (c) is still less than F (c ')

Proof: If the DFS node is based on the reverse time stamp, then the last node must belong to the last end access of the strong Unicom component C ' (because the order that C ' is accessed is determined by the timestamp of the last node), that is, F (c ') >f (any c). According to the inference, there can be no edge in the original image, and it is connected to it from other strong unicom components. That is, for the inverse graph, DFS will only be the strongly connected component of Dfs to the last end access from the current node. Then, in reverse order to find the second non-visited point, it belongs to the second end of the last access to the strong Unicom component, and according to the original image, there may be a previous access to the strong Unicom component to its edge, so it can only access their own strong unicom components. And so on, can prove the correctness of the algorithm.

The point of this proof is that , in reverse order, the first points that have not been visited are the new components to be handled.

Kosaraju algorithm of strong Unicom component

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.