Network Flow:

 

¨     Flow Network:

            Given a directed graph G(V,E), and a function w: E(G) à R+.

            We say w(e) is the edgecapacity of the edge e. We can suppose w(e)>0,

            Otherwise we can remove the edge e from the graph.

    ¨ Source and Sink:

We have two special vertices s, and t, where s denotes the source and t the sink vertex, with the property, that there is no edge to s and no edge from t.     ¨ Flow: Flow is a real valued function f: E(G) à R+, such that the following conditions satisfied:

(a) capacity constraint: 0 £ f(e) £ c(e) for each edge e.

                    (b) flow conservation: For each v Î V(G) with v ¹ s,t we have å f(e) = å f(e), where the first summation is for the edges                     in form (u,v), the second in form (v,u).
 

¨     Remark:

          We have å f(s,u) = å f(u,t).

¨     Flow value:

The value of the flow is å f(s,u), where the summation over the vertices of the neighborhoods of s. ¨     Example 1:
 

        This flow has value 8.

 

¨     The residual network Gf for a flow f.

Let Gf be the following graph: Gf has the same vertex set as G, but we consider each edge in both direction. Let us give the capacity of the edges of Gf in the following way:

If (a,b) Î E(Gf) was originally orientated that direction in G, then

v(a,b):= w(a,b)-f(a,b), and v(b,a):=f(a,b). Note, that if (a,b) and (b,a) were both edges of G, then in Gf there are two (a,b) and two (b,a) edges.

¨        Example 2

If there is a path P = (s, a1), (a1, a2), {a2, a3), . . . , (al, t), and c>0 is the minimum weight of these edges in the residual graph, then do the following changes on the weights:

f?(s, a1):= f(s, a1) + c; ?. f?(al, t).

For each edge (a, b) of the path gives the following change of the weigtht on the residual graph:

v(a, b):= v(a, b) -c; v(b, a):= v(b, a) + c.

This method stops, if there is know path in the residual graph from s to t, with positive weigth on each edge.

The Ford- Fulkerson- Method (G, c, s, t)
 

    1. initialize flow f to 0
    2. while there exists an augmenting path p do
    3. augment flow f along p
    4. return f
 

¨       Correctness

In each step, when we increase the flow, we get always a regular flow.

The value of the flow is always increases, because we have only outgoing edges from s. If we have no more augmenting path, then it is the case, that there exists a cut with fully-flowed edges from s to t, and by the max-flow= min-cut theorem we reached a maximal flow. For more details see the book.
 

¨       Time Complexity If we have bad luck, as the Example 3 shows us, we can have arbitrary large time complexity. If we modify the algorithm by always considering the shortest augmenting path we have polynomial bound. For more details see the book. ¨                     Example 3
      The initial flow is the all 0- flow. Each odd choice for the augmenting path let sabt, each even choice let sbat.

      After 2i steps we have the following flow state and the following residual state:

      After 2i+1 steps the flow:

      The residual graph after 2i+1 steps

                So the time complexity 2m.

                 Easy to see, if we rather choose paths sat and sbt, then two steps are enough.