keymasterviriya1150

Ford-Fulkerson (FF) Algorithm

Apr 18th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. void FF(Graph G, Node s, Node t)
  2. {
  3.     initialize flows on all edges in G to 0;
  4.     change G into residual graph Gf;
  5.  
  6.     while (can find an augmented path P in Gf)
  7.     {
  8.         bottleneck b = minimum of edge weights in P;
  9.  
  10.         augment flow along P in G using b;
  11.  
  12.         regenerate Gf from updated G;
  13.     }
  14.     report maxflow f in G;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment