Why must back-edges be taken into account in Edmonds-Karp Maximum Flow?
<p>I was trying to implement <a href="https://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm" rel="noreferrer"><strong>Edmonds-Karp</strong></a> in C++ for maximum flow, and I wrote it slightly differently:</p>

<ol>
<li>Instead of going through all edges in residual graph, I only went through the edges that are present in the original graph, using the adjacency list.</li>
<li>I did not update any back-edges when updating the residual graph with min flow.</li>
</ol>

<p>Interestingly, when I ran my code, it gave me correct results. So I went to <a href="https://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm#Example" rel="noreferrer">Wikipedia's example</a>, where it <em>specifically show how a back-edge is being used</em>. When I fed this graph to my code, <em>I got the correct answer again</em>.
I also checked the <em>resultant flow matrix</em>, and it was identical to Wikipedia's.</p>

<p>Can someone explain why we must <em>add and update back-edges</em>, and maybe give an example where they are critical?</p>

<p><a href="https://github.com/prakharsingh95/Graph-Implementations/blob/master/src/max_flow_ford_fulkerson.cpp" rel="noreferrer">Here</a>'s the code that I wrote (updated to include back edges):</p>