How to find subgraphs in a directed graph without converting to undirected graph?

前端 未结 2 991
臣服心动
臣服心动 2021-01-06 16:53

I have a graph that has many subgraphs. I have some edges that connect two nodes in both directions, that is, A-->B and B-->A. The bidirectionality is important, as it repre

2条回答
  •  既然无缘
    2021-01-06 17:38

    You are looking for SCC of the graph, that are strongy connected component s. They can be found with a variant of DFS (depth first search).

    You should take a look at the wiki article.

提交回复
热议问题