Algorithm: for G = (V,E), how to determine if the set of edges(e belong to E) is a valid cut set of a graph

谁都会走 提交于 2019-12-01 01:46:42

A simple algorithm would be to remove the suspected cut-edges from the graph, and see if you can still get from a node of a removed edge to its counterpart. If you still can, it was not a full cut. So if you remove E2 which had nodes A and D, you can use breadth first search from A and see if you ever get to D. It should be linear in space requirements and complexity since we store all the nodes we've visited so we don't backtrack and visit any node twice. This wiki page has some nice pictures that might help: http://en.wikipedia.org/wiki/Cut_%28graph_theory%29

It's a valid cut set if, with that edge subset removed, it's no longer a connected graph.

If you're asking for algorithms, you should be able to start at any node and see if you can reach all other nodes via depth first search. If so, it's not a valid cut set, if it can't, it's a valid cut set.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!