







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this lecture are: Network Flows, Matching Problems, Storage Capacity, Directed Graph, Capacity Constraint, Real Numbers, Skew Symmetry, Flow Conservation, Edge Capacities, Pair of Nodes, Total Inbound Flow, Constraint Force
Typology: Study notes
1 / 13
This page cannot be seen from the preview
Don't miss anything!








A wide variety of problems, including the matching problems discussed in the previous lectures, can be described and analyzed in terms of Flow Networks. In this lecture, we introduce the basic forms and laws governing Flow Networks, and develop several theorems useful for their analysis.
A flow network G = (V, E) is a directed graph such that:
Figure 1 shows an example of a flow network.
A flow f in a network G is a function that assigns real numbers to edges such that following constraints are satisfied:
Figure 1: A flow network G = (V, E) with edge capacities specified.
f (u, v) = 0
Since c(u, v) is defined for each pair of nodes for which ∃(u, v) ∈ E, we can think of the capacity constraint as merely stating that no flow between two directly connected nodes can possibly exceed the capacity of the edge that exists between them.
The skew symmetry constraint follows from the fact that flow net- works are directed graphs. Another definition would be ∀u, v ∈ V, f (v, u) = −f (u, v), for only flows directed contrary to the underlying path direction will ever be labeled with negative values.
The flow conservation constraint applies to all nodes except source s and sink t, because the output potential of a source and input potential of a sink are both ∞. For all other nodes, however, the total outbound flow must always equal the total inbound flow (nodes have no storage capacity), and semantics imposed by the skew symmetry constraint force the sum of all flows to zero.
The total flow between two sets of nodes is the sum of the flows from any member of the first set to a member of the second set. When the sets are identical, total net flow is zero by the flow conservation constraint. When the sets are not identical, the total net flows from each set to the other have equal absolute value and opposing sign. When the two sets are disjoint, the total net flow from their union to any third set Z ⊆ V is the sum of their individual net flows to that subset, and vice versa.
Instead of viewing a flow network in terms of capacities in use, it can be useful to view it in terms of capacities remaining (unused capacities). This representation is called a residual network. Given a network G = (V, E) and a flow f in G, the residual network is Gf (V, Ef ) where:
So if there is no remaining capacity along an edge in the flow network, that edge should not appear in our chosen representation of Gf , an effect illus- trated in Figure 3.
We can also draw residual networks with a complete set of back edges, whose values maintain the residual network’s compliance with the flow con- servation constraint. For simplicity, these edges (call them Eb) are shown separately in Figure 4, these edges are called backward edges. The Gf is really defined by (V, Ef ∪ Eb).
It’s important to note that the values of the backward edges are not always simply the values of the forward flows in G. In cases where a network specifies forward edges (i, j) and (j, i) (as our network does between nodes A and C, for example), the values of the residual edges may be calculated. Given flows xij and xji, and unused capacities uij and uji respectively:
Figure 3: The forward edges of residual network resulting from the flow in Figure 2.
Figure 4: The backward edges of residual network resulting from the flow in Figure 2.
The capacity of a cut (S, T ) is:
c(S, T ) =
u∈S,v∈T
c(u, v) (7)
Claim 1.5.1 While the capacities of different cuts may be different, the total value of flow across a cut boundary is always constant.
()*+#
()*,# *+),-#
.).# *).#
*)/#
-)*-#
-).# -)(# 0)0#
Figure 6: Three cuts of a flow network.
We will not prove the claim here, but will try to bolster its intuitiveness with an example. Figure 6 shows cuts of our familiar flow network. We will calculate the capacity and flow across each cut separately.
Given (G, s, t), the Max-Flow problem is that of finding a maximal-capacity flow in G from source s to sink t. We call the value of this maximal flow f ∗.
The Max-Flow Min-Cut theorem states that f ∗, the value of the maximum flow, is equal to the minimum cut capacity out of all possible cuts of G.
Theorem 2.1.1 (Maxflow/Mincut Theorem) Given a network, G, and a flow, f , the following are equivalent:
Proof.
12
13 4/
9 7
16/
12/
4/10 4
4/
12/
(c) 10
13
12
4
6 8 9 7
8
4
(d)
16 12
14
13 4
10 4 9 7
12/
12/ 12/
(a)
14
13
4
12
4
10 4 9 7
8
(b)
12
Figure 7: Flows in G and its residual network.
Claim 2.2.1 The Ford-Fulkerson algorithm always terminates and always returns a maximum flow.
2.2.1 Time Complexity of Ford-Fulkerson Algorithm
Initialization of f and the construction of Gf are both O(|E|), as is the process of finding an augmenting path. The while loop is executed at most |f ∗| times, since the augmenting path increases flow by at least one unit each iteration. It is therefore easily seen that worst case bounds are O(|f ∗||E|).
Now, consider the flow in Figure 8. In (a), a flow of 1 unit follows the path of dotted lines and, (b) shows the resulting residual network. Now, suppose the next augmenting path is that highlighted in (b); once again, an increase in flow of 1 unit will result, and this alternating pattern can continue |f ∗| times, exhibiting the worst case performance. For improved performance, we next sketch the Edmonds-Karp algorithm.
(b)
1/
1/1,000,000 1,000,
1,000,000 (^) 1/1,000,
(a)
1
1,000,000 (^) 999,
1
999,999 1,000,
1
Figure 8: Worst case flow in Ford-Fulkerson
Instead of choosing any augmenting path each time through the while loop, we might instead choose, among augmenting paths to choose, a path that optimizes some criteria. The Edmonds-Karp algorithm always chooses a path with the minimum number of comprising edges. It makes a new network from residual network where edge weights are replace by ’1’ and then employs a breadth-first search to choose the shortest augmenting path from s to t. That shortest augmenting path corresponds to an augmented path in the residual network with the f ewest number of edges. Referring to Figure 8, choosing path with the fewest number of edges(namely the paths of two edges of 1,000,000 along the top and bottom of the graph) would have readily achieved the 2,000,000 capacity maximum flow by avoiding the extra edge of capacity 1 (the bottleneck). Moreover, maximum flow would then have been realized in two iterations of the while loop instead of 2,000, by Ford-Fulkerson!
2.3.1 Time Complexity of Edmonds-Karp Algorithm
Lemma 2.3.1 If the E-K algorithm is run on a flow network with source s and sink t, then for all verticie v ∈ V − {s, t}, the shortest path distance can only increase in the residual network.
Let u, v be vertices in V connected by an edge in E. We claim that from the time (u, v) is critical to the next time it becomes critical again, its distance to s must increase by 2.
Let f be the flow when its f irst critical: df (s, v) = df (s, u) + 1 (since augmenting paths are shortest paths). Then (u, v) disappears from residual network can not appear again until (u, v) appears on an augmenting path. For some flow f ′:
df ′^ (s, u) = df ′^ (s, v) + 1 ≥ df ′ (s, u) + 1 = df (s, u) + 2 →←