Algorithm Design
Algorithm Design
Algorithm Design
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
442<br />
Chapter 7 Network Flow<br />
tree one computes for G may not in fact be the "real" minimum spanning<br />
tree.<br />
Given error parameters ~ > 0 and/~ > 0, and a specific edge e’ = (u, v),<br />
you would like to be able to make a claim of the following form.<br />
(,) Even if the cost of each edge were to be changed by at most s (either<br />
increased or decreased), and the costs of k of the edges other than e’ were<br />
further changed to arbitrarily different values, the edge e’ would still not belong<br />
to any minimum spanning tree of G.<br />
Such a property provides a type of guarantee that e’ is not likely to belong<br />
to the minimum spanning tree, even assuming significant measurement<br />
error.<br />
Give a polynomial-time algorithm that takes G, e’, e, and k, and decides<br />
whether or not property (*) holds for e’.<br />
41. Suppose you’re managing a collection of processors and must schedule<br />
a sequence of jobs over time.<br />
The jobs have the following characteristics. Each job ] has an arrival<br />
time aj when it is first available for processing, a length g1 which indicates<br />
how much processing time it needs, and a deadline d i by which it must<br />
be finished. (We’ll assume 0 < ~i < d1 - ai.) Each job can be run on any<br />
of the processors, but only on one at a time; it can also be preempted<br />
and resumed from where it left off (possibly after a delay) on another<br />
processor.<br />
Moreover, the collection of processors is not entirely static either:<br />
You have an overall pool of k possible processors; but for each processor<br />
i, there is an interval of time % t~] during which it is available; it is<br />
unavailable at all other times.<br />
Given all this data about job requirements and processor availability,<br />
you’d like to decide whether the jobs can all be completed or not. Give a<br />
polynomial-time algorithm that either produces a schedule completing all<br />
jobs by their deadlines or reports (correctly) that no such schedule exists.<br />
You may assume that all the parameters associated with the problem are<br />
integers.<br />
Example. Suppose we have two jobs J1 and J2. J1 arrives at time 0, is due<br />
at time 4, and has length 3. J2 arrives at time 1, is due at time 3, and has<br />
length 2. We also have two processors P1 and P2. P~ is available between<br />
times 0 and 4; Pz is ava~able between Omes 2 and 3. In this case, there is<br />
a schedule that gets both jobs done.<br />
¯ At time 0, we start job J~ on processor P~.<br />
42.<br />
43.<br />
¯ At time 1, we preempt J1 to start J2 on P~.<br />
¯ At time 2, we resume J~ on P~. (J2 continues processing on P1.)<br />
Exercises<br />
¯ At time 3, J2 completes by its deadline. P2 ceases to be available, so<br />
we move J1 back to P1 to finish its remaining one unit of processing<br />
there.<br />
¯ At time 4, J1 completes its processing on P1.<br />
Notice that there is no solution that does not involve preemption and<br />
moving of jobs.<br />
Give a polynomial-time algorithm for the following minimization ana-<br />
!ogue of the Maximum-Flow Problem. You are given a directed graph<br />
G = (V, E), with a source s s V and sink t ~ V, and numbers (capacities)<br />
*(v, w) for each edge (v, w) ~ E. We define a flow f, and the value of a flow,<br />
as usual, requiring that all nodes except s and t satisfy flow conservation.<br />
However, the given numbers are lower bounds on edge flow--that<br />
is, they require that f(v, w) > ~.(v, w) for every edge (v, w) ~ E, and there is<br />
no upper bound on flow values on edges.<br />
(a) Give a polynomial-time algorithm that finds a feasible flow of minimum<br />
possible value.<br />
(b) Prove an analogue of the Max-Flow Min-Cut Theorem for this problem<br />
(i.e., does min-flow = max-cut?).<br />
You are trying to solve a circulation problem, but it is not feasible. The<br />
problem has demands, but no capacity limits on the edges. More formally,<br />
there is a graph G = (V, E), and demands dv for each node v (satisfying<br />
~v~v dv = 0), and the problem is to decide ff there is a flow f such that<br />
f(e) > 0 and f~n(v) - f°Ut(v) = du for all nodes v V. Note that this problem<br />
can be solved via the circulation algorithm from Section 7.7 by setting<br />
ce = +oo for all edges e ~ E. (Alternately, it is enough to set ce to be an<br />
extremely large number for each edge--say, larger than the total of all<br />
positive demands dv in the graph.)<br />
You want to fix up the graph to make the problem feasible, so it<br />
would be very useful to know why the problem is not feasible as it stands<br />
now. On a closer look, you see that there is a subset’U of nodes such that<br />
there is no edge into U, and yet ~v~u du > 0. You quickly realize that the<br />
existence of such a set immediately implies that the flow cannot exist:<br />
The set U has a positive total demand, and so needs incoming flow, and<br />
yet U has no edges into it. In trying to evaluate how far the problem is<br />
from being solvable, you wonder how big t~e demand of a set with no<br />
incoming edges can be.<br />
443