04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

420<br />

Chapter 7 Network Flow<br />

11.<br />

Now suppose we pick a specific edge e* ~ E and reduce its capacity<br />

by 1 unit. Show how to find a maximum flow in the resulting capacitated<br />

graph in time O(m + n), where m is the number of edges in G and n is the<br />

12.<br />

number of nodes.<br />

Your friends have written a very fast piece of maximum-flow code based<br />

on repeatedly finding augmenting paths as in Section 7.1. However, after<br />

you’ve looked at a bit of out-put from it, you realize that it’s not always<br />

finding a flow of maximum value. The bug turns out to be pretty easy<br />

to find; your friends hadn’t really gotten into the whole backward-edge<br />

thing when writing the code, and so their implementation builds a variant<br />

of the residual graph that only includes the forward edges. In other words,<br />

it searches for s-t paths in a graph df consisting only of edges e for which<br />

f(e) < ce, and it terminates when there is no augmenting path consisting<br />

entirely of such edges. We’ll call this the Forward-Edge-OnlY <strong>Algorithm</strong>.<br />

(Note that we do not try to prescribe how this algorithm chooses its<br />

forward-edge paths; it may choose them in any fashion it wants, provided<br />

that it terminates only when there are no forward-edge paths.)<br />

13.<br />

It’s hard to convince your friends they need to reimplement the<br />

code. In addition to its blazing speed, they claim, in fact, that it never<br />

returns a flow whose value is less than a fLxed fraction of optimal. Do you<br />

believe this? The crux of their claim can be made precise in the following<br />

statement.<br />

There is an absolute constant b > 1 (independent of the particular input<br />

flow network), so that on every instance of the Maximum-Flow Problem, the<br />

Forward-Edge-Only <strong>Algorithm</strong> is guaranteed to find a flow of value at least 1/b<br />

times the maximum-flow value (regardless of how it chooses its forward-edge<br />

paths).<br />

Decide whether you think this statement is true or false, and give a proof<br />

of either the statement or its negation.<br />

Consider the following problem. You are given a flow network with unitcapacity<br />

edges: It consists of a directed graph G = (V, E), a source s ~ V,<br />

and a sink t ~ V; and ce = 1 for every e ~ E. You are also given a parameter k.<br />

The goal is to delete k edges so as to reduce the maximum s-t flow in<br />

G by as much as possible. In other words, you should find a set of edges<br />

F ___ E so that IFI = k and the maximum s-t flow in G’ = (V, E - F) is as small<br />

as possible subject to this.<br />

Give a polynomial-time algorithm to solve this problem.<br />

in a standard s-t Maximum-Flow Problem, we assume edges have capacities,<br />

and there is no limit on how much flow is allowed to pass through a<br />

14.<br />

15.<br />

Exercises<br />

node. In this problem, we consider the variant of the Maximum-Flow and<br />

Minimum-Cut problems with node capacities.<br />

Let G = (V, E) be a directed graph, with source s ~ V; sink t ~ V, and<br />

normegative node capacities {cu > 0} for each v ~ V. Given a flow f in this<br />

graph, the flow though a node v is defined as fin(v). We say that a flow<br />

is feasible if it satisfies the usual flow-conservation constraints and the<br />

node-capacity constraints: fin(v) _< Cu for all nodes.<br />

Give a polynomial-time algorithm to find an s-t maximum flow in<br />

such a node-capacitated network. Define an s-t cut for node-capacitated<br />

networks, and show that the analogue of the Max-Flow Min-Cut Theorem<br />

holds true.<br />

We define the Escape Problem as follows. We are given a directed graph<br />

G = (V, E) (picture a network of roads). A certain collection of nodes X c V:<br />

are designated as populated nodes, and a certain other collection S c V<br />

are designated as safe nodes. (Assume that X and S are disjoint.) In case<br />

of an emergency, we want evacuation routes from the popnlated nodes<br />

to the safe nodes. A set of evacuation routes is defined as a set of paths<br />

in G so that (i) each node in X is the taft of one path, (ii) the last node on<br />

each path lies in S, and (iii) the paths do not share any edges. Such a set of<br />

paths gives a way for the occupants of the populated nodes to "escape"<br />

to S, without overly congesting any edge in G.<br />

(a)<br />

Given G, X, and S, show how to decide in polynomial time whether<br />

such a set of evacuation routes exists.<br />

Suppose we have exactly the same problem as in (a), but we want to<br />

enforce an even stronger version of the "no congestion" condition<br />

(iii). Thus we change (iii) to say "the paths do not share any nodes."<br />

With this new condition, show how to decide in polynomial lime<br />

whether such a set of evacuation routes exists.<br />

Also, provide an example with the same G, X, and S, in which the<br />

answer is yes to the question in (a) but no to the question in (b).<br />

Suppose you and your friend Alanis live, together with n - 2 other people,<br />

at a popular off-campus cooperative apartment, the Upson Collective.<br />

Over the next n nights, each of you is supposed to cook dinner for the<br />

co-op exactly once, so that someone cooks on each of the nights.<br />

Of course, everyone has scheduling conflicts with some of the nights<br />

(e.g., exams, concerts, etc.), so deciding who should cook on which night<br />

becomes a tricky task. For concreteness, let’s label the people<br />

421

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!