Find the next augmenting path for Edmonds-Karp

In the Edmonds-Karp algorithm , the set of augmenting paths to choose from is well defined. Which of the following options will be the next augmenting path chosen by Edmonds-Karp?

The following graph shows a set of vertices and edges. Each edge shows two numbers: its current flow divided by its capacity. In this implementation, vertices are processed in alphabetical order for search.

Graph in the middle of Edmonds-Karp Graph in the middle of Edmonds-Karp

{source, A, D, sink} {source, C, B, D, sink} {source, C, D, sink} {source, A, B, C, D, sink}

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Kshitij Tyagi
Jun 26, 2017

Doing breadth first search, first iterates all the neighbours of source. Both edges source-A and source-C have available flow. Hence both vertices A and C are added to queue (going alphabetically) : [(s)A,(s)C]. Next, A is picked from the queue, and we find edges A-B and A-D available; we add these two to the queue : [(s)C,(sA)B,(sA)D]. Next C is picked and its available edges are backward edge to vertex B and forward edge to D. We add these to queue : [(sA)B,(sA)D,(sC)B,(sC)D]. Next B is picked with edges going to C and D, changing queue to : [(sA)D,(sC)B,(sC)D,(sAB)C,(sAB)D]. Next we pick D, with forward edge to sink, and backward edges to B and C. Since sink is found we stop with our desired shortest path : s-A-D-s. (Parenthesis in queue are used to save the path).

Is there a reason other than alphabetical picking of nodes that the answer is source, A, D, sink instead of source, C, D, sink?

Anya Johnson - 3 years, 6 months ago

I wonder the same thing

Anders Vestergaard - 1 year, 2 months ago

It seems like C/D/sink would also work?

Ariel Traver - 1 year, 1 month ago

Log in to reply

Yes. that was my answer as well

Anders Vestergaard - 1 year, 1 month ago

bfs seems to give different answer with respect to the vertex added first in the queue if C would have been added before B then the answer would have been {source, C, D , sink}.

Asra Jawaid - 5 months, 1 week ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...