1

I am trying to find a minimum cut of the following network enter image description here

I am using the following algorithm:

  1. Run Ford-Fulkerson algorithm and consider the final residual graph.

  2. Find the set of vertices that are reachable from source in the residual graph.

  3. All edges which are from a reachable vertex to non-reachable vertex are minimum cut edges. Print all such edges.

In the first step, my algorithm finds 3 paths:

 - s->b->h->t  **value: 1** 
 - s->d->e->t  **value: 1**
 - s->c->h->i->m->d->g->t  **value: 0.5**

So the maximum flow (and therefore minimum cut) is equal to 2.5.

However, when I later try to eliminate the aforementioned paths from the network I end up with something like this: enter image description here

The reachable vertices are s, c and h, which form a cut equal to 3.5.

What am I missing? Why can't I traverse the graph like I would normally to get the minimum cut?

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Simon
  • 2,643
  • 3
  • 40
  • 61
  • *"The reachable vertices are s, c and h, which form a cut equal to 3.5."* – Is the weight of this cut not zero? Can you elaborate where 3.5 comes from? – Anton Sep 11 '17 at 01:10
  • @user3290797 I marked the result of the BFS traversal on the second picture - this cut is of value 3.5 in the real network. – Simon Sep 11 '17 at 05:03

2 Answers2

1

Every time you increase the capacity of an edge in the residual graph, you need to increase the capacity of the opposite edge by the same amount.

Example graph:

enter image description here

Here is the residual graph without backward edges and the the set of the vertices reachable from S (which do not constitute a min-cut):

enter image description here

And the correct residual graph with the min-cut:

enter image description here

Anton
  • 3,113
  • 14
  • 12
0

I assume, that your definition of residual graph is that you put edge A->B in residual graph if:

a) There is some different between flow and capacity in direction A->B (aka forward edge) b) There is some flow in direction B->A (aka backward edge)

In this definition your step 2 is wrong.

To find minimum cut, you only walk through forward edges from start. Now you can denote vertices reachable from start as set R and rest as set R'. Now the cut is made by edges between R and R'. And the size of the cut is flow between R and R'.

usamec
  • 2,156
  • 3
  • 20
  • 27
  • I don't think I understand you, what is exactly wrong with the residual graph I gave? I make the residual graph by erasing the paths I listed. Then I traverse the residual graph in a bfs manner. Could you elaborate? – Simon Sep 11 '17 at 09:24