Tutorial Sheet 8
Tutorial Sheet 8
TUTORIAL SHEET 8
1. [KT-Chapter7] Consider the following problem. You are given a flow network with
unit-capacity edges: it consists of a directed graph G = (V, E), a source s and a sink
t, and ue = 1 for every edge e. You are also given a parameter k. The goal is delete k
edges so as to reduce the maximum s − t flow in G by as much as possible. In other
words, you should find a set of edges F ⊆ E so that |F | = k and the maximum s − t
flow in the graph G0 = (V, E \ F ) is as small as possible. Give a polynomial-time
algorithm to solve this problem.
Solution: First observe that by removing any k edges in a graph, we reduce the
capacity of any cut by at most k, and so, the min-cut will reduce by at most k.
Therefore, the max-flow will reduce by at most k. Now we show that one can in fact
reduce the max-flow by k. To achieve this, we take a min-cut X and remove k edges
going out of it. The capacity of this cut will now become f − k, where f is the value
of the max-flow. Therefore, the min-cut becomes f − k, and so, the max-flow becomes
f − k.
1
pairs of rows and some of the pairs of columns (in any sequence) so that after all the
swapping, all the diagonal entries of M are equal to 1.
(a) Give an example of a matrix M which is not re-arrangeable, but for which at least
one entry in each row and each column is equal to 1.
(b) Give a polynomial-time algorithm that determines whether a matrix M with 0-1
entries, is re-arrangeable.
Solution: Try (a) yourself. Draw a bipartite graph G where we have n vertices on
both sides. We have an edge between vertex i (on the left side) and vertex j (on the
right side) iff M (i, j) is 1. Now, show that such a swapping exists iff G has a perfect
matching.
4. Show that any s − t flow can be written as a sum of flows along at most m s − t paths
and cycles.
Solution: Consider the edges which have positive flow – let this graph be H. If there
is a cycle in H, let δ be the minimum flow along any edge in this cycle. We first remove
δ units of flow along this cycle. This will reduce the flow along any edge in this cycle
by δ units (and note that flow-conservation will still hold). Note that flow along some
edge will become 0, and so, we will remove such edge(s) from H. Similarly, if we find
a path from s to t in H we can remove δ units of flow along such a path, where δ is
the minimum flow along any edge in this path. Again, flow on some edge will become
0. Thus, this process of removing a path or a cycle will happen at most m times.
5. Consider the following modification to the Ford Fulkerson algorithm: among all pos-
sible s-t paths in the residual graph, pick the one such that the maximum amount of
flow can be sent along this path. How will you find such a path ? Show that you will
need at most log(nU ) iterations. What is the overall running time ?
Solution: Let v ? be the max-flow value in G. Suppose we have a flow f of value v
in the graph G, and let Gf be the residual graph. Then, the max-flow in Gf is v ? − v.
Using the above problem, we know that there is a path from s to t in Gf where we can
send at least (v ? − v)/m units of flow. Thus the max flow in new residual graph will
be at most (1 − 1/m)(v ? − v). From this we can see that after i iterations, the max
flow in the residual graph will be at most v ? (1 − 1/m)i . Since everything is integral,
we will stop when v ? (1 − 1/m)i becomes less than 1. Since v ? ≤ nU , we see that
i ≤ O(m log(nU )).
2
clients can be connected to any single base station. Your goal is to design a polynomial
time algorithm for the following problem – given the above data, decide whether it is
possible to assign every client to a base station subject to the two constraints.
Solution: This is an application of max flow problem. Have one vertex for every
client and one vertex for every base station. Add two extra vertices s and t. Now,
add an edge from s to every client vertex and capacity of this edge is 1. Similarly add
edges from every base station vertex to t of capacity L. Finally, add an edge from a
client vertex to a base station vertex if the client can be assigned to this base station.
The capacity is infinity (or 1, does not matter).
(a) Give a polynomial time algorithm that finds a feasible flow of minimum possible
value (Hint: Start with any flow from s to t which obeys the lower bounds, and
try to send a maximum flow from t to s in a suitable modification of the graph
G).
(b) Prove an analogue of the max- flow min-cut theorem for this problem.
Solution: For part (a), first send a flow from s to t such that all lower bounds are
satisfied. We can easily do this as follows: for every edge e = (u, v) find a path from s
to t which goes through (u, v), and send le amount of flow on this path. Let f denote
this flow. Now that we have a feasible flow, we will try to reduce the flow as much as
possible, but we do not want to reduce the flow on an edge below le . Therefore, we
reverse every edge, and make it’s capacity equal to fe − le . Now we send a max flow
from t to s in this “reversed” graph.