Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding minimum cut edges in a graph

Given a random undirected graph, I must find 'bottleneck edges' (edit: minimum cut edges) to get from one vertex to another.

What I call 'bottleneck edges' (edit: minimum cut edges) -- suppose I have the following undirected graph:

    A
  / | \
 B--C--D
 |     |
 E--F--G
  \ | /
    H

To get from A to H independently of the chosen path edges BE and DG must always be traversed, therefore making a 'bottleneck' (edit: minimum cut).

Is there a polynomial time algorithm for this?

like image 535
Noros Avatar asked Apr 27 '11 21:04

Noros


People also ask

How do you find all min cuts on a graph?

To find all minimum cuts in graph G, the algorithm chooses an edge e = (s, t) in G and uses a maximum flow f to find the minimum s-t-cut λ(s, t). If λ(s, t) > λ there is no minimum cut that separates s and t and thus e can be contracted.

How do you calculate minimum cuts?

The minimum cut is a partition of the nodes into two groups. Once you find the max flow, the minimum cut can be found by creating the residual graph, and when traversing this residual network from the source to all reachable nodes, these nodes define one part of the partition.

What is the minimum number of cuts that a graph with n vertices can have?

Namely, given that a graph may have more than one minimum cut, what is the largest number of minimum cuts that a graph with N vertices can have? We know the answer is at least N-1.

What is a minimum vertex cut?

A minimum vertex cut of a graph is a vertex cut of smallest possible size. A vertex cut set of size 1 in a connected graph corresponds to an articulation vertex. The size of a minimum vertex cut in a connected graph gives the vertex connectivity .


2 Answers

Sounds like you need minimum cut, the minimal set of edges removing which will separate your graph into two pieces.

http://en.wikipedia.org/wiki/Minimum_cut

like image 151
unbeli Avatar answered Oct 08 '22 17:10

unbeli


What you are looking for is a cut. Given a graph, a cut is a set of edges that partitions the vertices into two disjoint subsets.

Assuming you are trying to get the smallest cut possible, this is the classic min-cut problem. Here is a pseudo code version of the Ford-fulkerson algorithm, reworked for your case (undirected, unweighted graphs). I'm pretty sure it should work, but I am not sure I'm being the most efficient / idiomatic here.

reorganize your graph into a directed graph,
  with two directed edges (u->v, v->u) for each original edge (u-v)

while there is a path P from A to H:
  (hint: use breadth first search to find paths - long story here)
  //augment the path P:
  for each edge (u->v) in P:
    remove (u->v) from the graph and add (v->u) to it
    (if v->u isn't there already)

Label all vertices as reacheable or not reacheable from A.

The bottleneck edges is the set of edges
  that connect a reacheable and a unreacheable vertex

For example, in your case BFS would give us the path A-B-E-H. After removing these edges, we would still be able to find the path A-D-G-H. After these edges are removed, the graph is partitioned into the reacheable vertices {A,B,C,D} and the unreacheable {E,F,G,H}. The edges that have a vertex from each (B-E and D-G) set are the bottleneck edges.

like image 27
hugomg Avatar answered Oct 08 '22 18:10

hugomg