04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

446<br />

Chapter 7<br />

48.<br />

(d)<br />

Network Flow<br />

is a path from v to t in the residual graph of the current preflow. Let<br />

A = V-B. Prove that at the end of the algorithm, (A, B) is a minimumcapacity<br />

s-t cut.<br />

The algorithm in part (c) computes a minimum s-t cut but fails to find<br />

a maximum flow (as it ends with a preflow that has excesses). Give<br />

an algorithm that takes the preflow f at the end of the algorithm of<br />

part (c) and converts it into a maximum flow in at most O(mn) time.<br />

(Hint: Consider nodes with excess, and try to send the excess back<br />

to s using only edges that the flow came on.)<br />

In Section 7.4 we considered the Preflow-Push <strong>Algorithm</strong>, and discussed<br />

one particular selection rule for considering vertices. Here we will explore<br />

a different selection rule. We will also consider variants of the algorithm<br />

that terminate early (and find a cut that is close to the minimum possible).<br />

(a) Let f be any preflow. As f is not necessarily a valid flow, it is possible<br />

that the value four (s) is much higher than the maximum-flow value in<br />

G. Show, however, that fgn(t) is a lower bound on the maximum-flow<br />

value.<br />

(b) Consider a preflow f and a compatible labeling h. Recall that the set<br />

A = {v : There is an s-v path in the residual graph Gf}, and B = V-A<br />

defines an s-t cut for any preflow f that has a compatible labeling h.<br />

Show that the capacity of the cut (A, B) is equal to c(A, B)<br />

Combining (a) and (b) allows the algorithm to terminate early and<br />

return (A, B) as an approximately minimum-capacity cut, assmning<br />

c(A, B) - fin(t) is sufficiently small. Next we consider an implementation<br />

that will work on decreasing this value by trying to push flow<br />

(c)<br />

out of nodes that have a lot of excess.<br />

The scaling version of the Preflow-Push <strong>Algorithm</strong> mainta~s a scaling<br />

parameter A. We set A initially to be a large power of 2. The<br />

algorithm at each step selects a node with excess at least ~ with as<br />

small a height as possible. When no nodes (other than t) have excess<br />

at least ~, we divide ~ by 2, and continue. Note that this is<br />

a valid implementation of the generic Preflow-Push <strong>Algorithm</strong>. The<br />

algorithm runs in phases. A single phase continues as long as h is<br />

unchanged. Note that A starts out at the largest capacity, and the<br />

algorithm terminates when A = !. So there are at most O(log C) scaling<br />

phases. Show how to implement this variant of the algorithm so<br />

that the running time can be bounded by O(rnn + n !og C + K) ff the<br />

algorithm has K nonsaturating push operations.<br />

49.<br />

50.<br />

Exercises<br />

(d) Show that the number of nonsaturating push operations in the above<br />

algorithm is at most O(n 2 log C). Recall that O(log C) bounds the number<br />

of scaling phases. To bound the number of nonsaturating push<br />

operations in a single scaling phase, consider the potential function<br />

q~ = ~.~,v h(v)ef(v)/a. What is the effect of a nonsaturating push on<br />

~? Which operation(s) can make ¢ increase?<br />

Consider an assignment problem where we have a set of n Stations that<br />

can provide service, and there is a set of k requests for service. Say, for<br />

example, that the stations are cell towers and the requests are cell phones.<br />

Each request can be served by a given set of stations. The problem so far<br />

can be represented by a bipartite graph G: one side is the stations, the<br />

other the customers, and there is an edge (x, y) between customer x and<br />

station y if customer x can be served from station y. Assume that each<br />

station can serve at most one customer. Using a max-flow computation,<br />

we can decide whether or not all customers can be served, or can get an<br />

assignment of a subset of customers to stations maximizing the number<br />

of served customers.<br />

Here we consider a version of the problem with an additional complication:<br />

Each customer offers a different amount of money for the service.<br />

Let U be the set of customers, and assume that customer x ~ U is willing<br />

to pay vx _> 0 for being served. Now the goal is to find a subset X c U maximizing<br />

~xO: vx such that there is an assignment of the customers in X<br />

to stations.<br />

Consider the following greedy approach. We process customers in<br />

order of decreasing value (breaking ties arbitrarily). When considering<br />

customer x the algorithm will either "promise" service to x or reject x In<br />

the following greedy fashion. Let X be the set of customers that so far<br />

have been promised service. We add x to the set X if and ouly if there is<br />

a way to assign X u {x} to servers, and we reject x otherwise. Note that<br />

rejected customers will not be considered later. (This is viewed as an<br />

advantage: If we need to reject a high-paying customer, at least we can tell<br />

him/her early.) However, we do not assign accepted customers to servers<br />

in a greedy fashion: we ouly fix the assignment after the set of accepted<br />

customers is fixed. Does this greedy approach produce an optimal set of<br />

customers? Prove that it does, or provide a countere~ample.<br />

Consider the following scheduling problem. There are m machines, each<br />

of wkich can process jobs, one job at a time. The problem is to assign<br />

jobs to machines (each job needs to be assigned to exactly one machine)<br />

and order the jobs on machines so as to minimize a cost function.<br />

447

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

Saved successfully!

Ooh no, something went wrong!