graph algorithms figure ggf gr if initial action is to add three units of flow along sadt--algorithm terminates after one more step with suboptimal solution failed to find an optimal solution this is an example of greedy algorithm that does not work figure shows why the algorithm fails in order to make this algorithm workwe need to allow the algorithm to change its mind to do thisfor every edge (vwwith flow fv, in the flow graphwe will add an edge in the residual graph (wvof capacity fv, in effectwe are allowing the algorithm to undo its decisions by sending flow back in the opposite direction this is best seen by example starting from our original graph and selecting the augmenting path sadtwe obtain the graphs in figure notice that in the residual graphthere are edges in both directions between and either one more unit of flow can be pushed from to dor up to three units can be pushed back--we can undo flow now the algorithm finds the augmenting path sbdactof flow by pushing two units of flow from to athe algorithm takes two units of flow away from the edge (adand is essentially changing its mind figure shows the new graphs figure graphs after three units of flow added along sadt using correct algorithm