Summary of connected graphs

Source: Internet
Author: User

Connectivity Graph Summary A Summary for Connected graph Ⅰ. ConceptStrong connectivity
Strong connectivity: U,v (u,v) exists u→v, v→u u\to v,\ v\to u Two paths, called (u,v) (U,V) for strong connected strong connected graphs: any two vertices in the direction graph strongly connected strong connected components: The strongly connected sub-graphs of the undirected graphs are weakly connected
Weak connectivity: The path of the U−v u-v exists in undirected graph (u,v) (U,V), which says (U,v) (U,V) is weakly connected weakly connected graph: Any two vertices in undirected graphs are weakly connected, (a directed graph with ignoring direction can be considered as undirected graph) [weakly] connected components: maximal [weakly] connected sub-graph cut point and bridge of undirected graph
Cut point: undirected graph midpoint u u, delete the number of connected components increased (connected graph so that the diagram is no longer connected), said U U is a cut-point bridge: undirected graph in the Edge (u,v) (u,v), the number of connected components deleted after the increase (connected graph makes the diagram no longer connected), said (U,v) (u,v) for the bridge
Point-to-double connectivity: There are at least two "point-not-repeat" paths in undirected graph (u,v) (U,V), which is called (U,V) (u,v) as point-double-connected
This requirement is equivalent to any two edges in the same simple ring, that is, the internal non-cutting point of the double-connected component: undirected graph of the maximal point double-connected sub-graph. Properties:
undirected graph each edge happens to belong to a point two connected components may have a common point between the two connected components, at most only one and must be cut point arbitrary cut point is at least two different points of the two connected components of the common point-edge double connectivity
Edge-to-double connectivity: undirected graph (u,v) (u,v) There are at least two "edges not repeating" path, called (u,v) (u,v) for the side of the double-connected
This requirement is low and requires that each edge be at least one simple ring, i.e. all edges are not bridge-side two-connected components: The maximal-edge double-connected sub-graph of undirected graphs. Properties:
In addition to the bridge does not belong to any side of the two connected components, each of the other side exactly belongs to one side of the two connected components after all the bridges are deleted, each connected component corresponds to one side of the original image of the two connected componentsⅡ. Connected Graph AlgorithmConnected Components Connected Component connected\ Component
To solve the connected component only need DFS Dfs or BFS BFS to search the picture again, of course, and check set is also possible.
Generally non-explosive stack situation, DFS Dfs good write applicability strong

Connected components
vector<int> g[n];
int id[n], CC;

void Dfs (int u) {
    Id[u] = cc;
    for (int v:g[u]) {
        if (id[v]) continue;
        DFS (v);
    }
}

void Findcc () {
    cc = 0;
    for (int i = 1; I <= n; ++i) {
        if (id[i]) continue;
        ++CC;
        DFS (i);
    }
}
Cut the cut cut.
Tarjan Tarjan algorithm based on DFS DFS timestamp
dfn[u]:= dfn[u]:=

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.