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
Given a subset of edges of a graph G = (V,E), how can we check whether it is a valid cut-set of the graph or not? Note: A cut is a partition of the vertices of a graph into two disjoi开发者_开发知识库nt subsets. So, cut-set of the cut is the set of edges whose end points are in different subsets of the partition. I am interested to find an algorithm for this problem
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.
精彩评论