



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
[Week 10] Flow Network, Minimum Cut vs Maximum Flow, Ford-Fulkerson
Typology: Exercises
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Algorithms 9007 Tutorial questions 2019 Semester 1 Tutorial 8
The University of Sydney School of Computer Science
Do you know the basic concepts of this week's lecture content? These questions are only to test yourself. They will not be explicitly discussed in the tutorial, and no solutions will be given to them.
(a) Is G directed or undirected? (b) What does it mean that an edge has a capacity? (c) What is a ow f in G? (d) Why is the ow of an edge bounded by the capacity of an edge? (e) What are the capacity and conservation constraints?
(a) What is a cut (A, B) of G? (b) What is the capacity of a cut? (c) What is the ow of a cut?
(a) Why is the value of a cut an upper bound on the maximum ow? (b) What does the Min Cut - Max Flow theorem state?
(a) The Ford-Fulkerson algorithm iteratively increases the ow. How is this done in each iteration? (b) Can you upper bound the number of iterations performed by the Ford-Fulkerson algorithm?
Problem 1 Let G = (V, E) be an arbitrary ow network, with source s, sink t, and edge capacities c : E → Z+. Decide whether each of the following statements are true of false. If it is true, give a short explanation. If it is false, give a counterexample.
Solution: 1. This is False. The following graphs is a counter example.
Problem 2 The gure below shows a ow network on which an s − t ow is shown. The capacity of each edge appears as a label next to the edge, and the numbers in boxes give the amount of ow sent on each edge. (Edges without boxed numbers have no ow being sent on them.)
s
u
t
w
Solution: First, there are exactly four possible cuts in the graph. These are (recalling that the cut must separate s and t):
(a) {s}, {u, w, t},
(b) {s, u}, {w, t},
(c) {s, w}, {u, t}, and
(d) {s, u, w}, {t}.
It is a simple matter to determine the capacity of each of these cuts, and nd those that are minimum cuts. In the order given above, the capacities of the cuts are 4, 6, 4, and 4. So we see that there are three minimum cuts in this graph, namely
(a) {s}, {u, w, t},
(b) {s, w}, {u, t}, and
(c) {s, u, w}, {t}.
Problem 4 Design a linear time algorithm that given a ow f veri es that f is maximum. If the ow is maximum your algorithm should output \yes", otherwise, it should output \no". No other action is required.
Solution: Given the input graph G and f , construct Gf in linear time and check if there is an s-t path. If there is an s-t path then we could use the path to push one extra unit of ow, so f is not maximum. Otherwise, we reach the termination criterion of the Ford-Fulkerson algorithm, which means that f is maximum.
Problem 5 Consider a generalization of the maximum ow problem where vertices have capacities. An instance is de ned by a directed graph G = (V, E), a pair of vertices s and t, and vertex capacities c : V → Z+. A ow f : E → Z+^ is feasible if f out(u) ≤ c(u). The objective is to nd a maximum feasible s-t ow. Design an efficient algorithm for this problem.
Solution: The high level idea is to enforce the vertex capacity with a standard edge capacity. To achieve this, we split every vertex u into two nodes (uin^ and uout) and connect them using and edge with capacity c(u). For every edge (u, v) in the input graph, we create an edge (uout, vin) with capacity +∞. The following picture shows how a vertex u and its incoming and outgoing edges are transformed by the reduction. Let G = (V, E) be the input graph and G′^ the graph obtained by the reduction. Let f be an s-t ow in G obeying the vertex constraints. We de ne a ow f ′^ in G′^ as follows. For each (u, v) ∈ E set f ′(uout, vin) = f (u, v); for each vertex u ∈ V set f ′(uin, uout) = f out(u). It is easy to show that this is a feasible sout-tin^ ow in G′^ with the same value as f. Similarly, given a feasible ow sout-tin^ ow f ′^ in G′, we can nd a feasible s-t ow in G with the same value as f ′. Therefore, solving the edge-capacitated maximum ow problem in G′ is equivalent to the vertex-capacitated maximum ow problem in G.
x
y
u c(u)
v
∞
∞
∞
xout
yout
uin c(u)
uout^ vin
Problem 6 Consider a generalization of the minimum cut problem where we want to separate two sets of vertices. An instance is de ned by a graph G = (V, E), a pair of disjoint subsets of vertices S, T ⊆ V , and edge capacities c : E → Z+. The objective is to nd a minimum capacity cut (A, B) such that S ⊆ A and T ⊆ B. Design an efficient algorithm for this problem.
Solution: Let G′^ be the graph obtained from G by adding two new vertices s and t and edges {(s, u) : u ∈ S} ∪ {(v, t) : v ∈ T } with capacity ∞. Let (A′, B′) be an s-t cut in G′. If S ⊆ A′^ and T ⊆ B′^ the capacity of (A′, B′) equals the capacity of (A′^ − s, B′^ − t); otherwise, the capacity is +∞. Therefore, there is a one-to-one correspondence between minimum s-t cuts in G′^ and minimum S-T cuts in G.