title: Ford-Fulkerson implementation java
body: <p>I'm trying to learn to implement the Ford-Fulkersons algorithm in java and found some help on the internet but I got stuck at this snippet of code</p>
  
  <pre><code>        // update residual capacities of the edges and
          // reverse edges along the path
          for (v=t; v != s; v=parent[v])
          {
              u = parent[v];
              rGraph[u][v] -= path_flow;
              rGraph[v][u] += path_flow;
          }
  </code></pre>
  
  <p>I sort of understand how it works thanks to the comment, but not completely sure why it's required. Why do you need to subtract?</p>
  
  <p>Source: <a href="http://www.geeksforgeeks.org/ford-fulkerson-algorithm-for-maximum-flow-problem/" rel="nofollow">http://www.geeksforgeeks.org/ford-fulkerson-algorithm-for-maximum-flow-problem/</a></p>