Question: Please help with this. Shortest augmenting path algorithm Input: A network with single source 1, single sink n, and positive integer capacities u on its

Please help with this.
Shortest augmenting path algorithm Input: A network with single source 1, single sink n, and positive integer capacities u on its edges (i,j) Output: A maximum flow assign zij 0 to every edge (i, j) in the network label the source with oo and add the source to the empty queue Q while not Empty (Q) do i Front (Q); Dequewe(Q) for every edge from i to j do //forward edges if j is unlabeled if rij 0 mintii, r label j with li,it Enqueue (Q,j) for every edge from j to i do //backward edges if j is unlabeled if 0 l, min fli, abel j with li,i ,r,il; Enqueue (Q,j) if the sink has been labeled //augment along the augmenting path found j n //start at the sink and move backwards using second labels while 1 the source hasn't been reached if the second label of vertex j is it else //the second label of vertex j is i erase all vertex labels except the ones of the source reinitialize Q with the source return //the current flow is maximum
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
