Fast Algorithms for Parametric Scheduling Come from ... - CiteSeerX

2 downloads 473 Views 274KB Size Report
machines, where jobs can be split among machines so that pieces of a single job can .... Tech(s). Chen's Models [6]. (Section 3). Single parameter, identical ma-.
Fast Algorithms for Parametric Scheduling Come from Extensions to Parametric Maximum Flow ∗ S. Thomas McCormick Faculty of Commerce and Business Administration University of British Columbia Vancouver, BC V6T 1Z2 Canada [email protected] July 1995, Revised February 1997, October 1997 UBC Faculty of Commerce Working Paper 95-MSC-009 Keywords: preemptive scheduling, applications of max flow, parametric flow

Abstract Chen [6] develops an attractive variant of the classical problem of preemptively scheduling independent jobs with release dates and due dates. Chen suggests that in practice one can often pay to reduce the processing requirement of a job. This leads to two parametric max flow problems. Serafini [26] considers scheduling independent jobs with due dates on multiple machines, where jobs can be split among machines so that pieces of a single job can execute in parallel. Minimizing the maximum tardiness again gives a parametric max flow problem. A third problem of this type is deciding how many more games a baseball team can lose partway through a season without being eliminated from finishing first (assuming a best possible distribution of wins and losses by other teams). A fourth such problem is an extended selection problem of Brumelle, Granot, and Liu [4], where we want to discount the costs of “tree-structured” tools as little as possible to be able to process all jobs at a profit. It is tempting to try to solve these problems with the parametric push-relabel max flow methods of Gallo, Grigoriadis and Tarjan (GGT) [10]. However, all of these applications appear to violate the conditions necessary to apply GGT. We extend GGT in three ways which allow it to be applied to all four of the above applications. We also consider some other applications where these ideas apply. Our extensions to GGT yield faster algorithms for all these applications.

1

Introduction

One of the oldest problems in scheduling (see [20] for a background in scheduling) is the following: We have n jobs, where job j has processing requirement pj , and due date dj . There are no precedence constraints among the jobs, and jobs can be preempted, i.e., the processing of any job can be split into pieces that execute at different times and/or on different machines. These n jobs are to be scheduled on m machines. The machines might be identical, meaning that they all have the same speed, or uniform, meaning that machine i has speed σi (i.e., if job j spends t time units on machine i, then σi t of its processing requirement is finished). Given some schedule, the completion time Cj ∗ This research was partially supported by an NSERC Operating Grant, an NSERC Grant for Research Abroad, and a UBC Killam Faculty Study Leave Fellowship. Parts of this research were done while the author was visiting Laboratoire ARTEMIS IMAG at Universit´ e Joseph Fourier de Grenoble, France.

1

of job j is the latest time that any piece of job j finishes. We usually prefer a schedule where every job finishes as early as possible. Two recent versions of this problem have appeared in the literature, one by Chen [6], the other by Serafini [26]. Both problems lead to maximum flow networks where some of the capacities are functions of one or more parameters. In both cases we are looking for minimum parameter values such that there is a max flow saturating the source in the network. There is a well-known algorithm for solving such problems called Newton’s Algorithm [24], or Dinkelbach’s Algorithm [7]. It involves solving the max flow network for an increasing sequence of target parameter values that converge to the optimum. One can often show that min cuts for successive target values are nested, so that only O(|N |) max flow computations need to be performed (we will reserve the symbol “n” for application-specific uses, and so will use |N | and |A| for the numbers of nodes and arcs respectively in derived networks). In a practically important special case, Gallo, Grigoriadis, and Tarjan (GGT) [10] showed how a sequence of parametric max flow problems for increasing values of the parameter can be solved in the same asymptotic time as one max flow problem. This speeds up Newton’s Algorithm for many applications by reducing the number of max flow computations from O(|N |) to only O(1). In trying to use GGT’s result for Chen and Serafini’s problems, three difficulties arise: capacity functions are piece-wise linear, there are multiple parameters, and some arcs not incident to the source nor sink have parametric capacities, all of which violates GGT’s assumptions. The main result of this paper is to extend GGT’s methods to cover all three of these difficulties. The paper also considers a number of other applications where these difficulties arise.

1.1

Overview of the Results

In the first motivating application, due to Chen [6], each job j also has a release date rj , and we do not allow Cj > dj . The machines are identical. If there is no feasible schedule, then we can pay to reduce the processing requirements. The object is to pay the least possible amount that allows a feasible schedule. This can be modeled as a max flow network whose capacities depend on one parameter (many parameters), namely the amount spent to reduce all the pj ’s (each pj ); see Section 3 for details. The first version has a single parameter, but capacities depend on it in a piece-wise linear fashion, whereas the capacities in all the applications in GGT depend on their parameter linearly. The second version has many parameters, whereas all applications in GGT use only a single parameter. We show how to overcome both these difficulties. Chen’s problems can be generalized by considering uniform machines. There is an extended network flow formulation in this case due to Federgruen and Groenevelt [8]. We can combine the ideas from the previous paragraph with Ahuja et al.’s version of GGT [2] for bipartite networks to get fast algorithms for this case. In the second motivating application, due to Serafini [26], we do allow Cj > dj , and try to minimize the largest such violation (tardiness). Serafini shows how to model this as a max flow network where the capacities depend on a target value τ of tardiness. The arcs whose capacities depend on τ might not all be incident to the source or sink of the network, but GGT’s basic model requires this. We show how to overcome this difficulty as well. By invoking a result of Radzik [24] we are able to answer a question posed by Serafini about the existence of a strongly polynomial algorithm for the case of weighted tardiness affirmatively. We then consider further applications of these extensions of GGT: The baseball elimination problem (see Section 5) can be formulated as a network flow problem in two ways. For Schwartz’s network [25], the specialization of GGT to bipartite networks of Ahuja et al. [2] runs fast. For Gusfield and Martel’s network [13], the piece-wise linear method used for Chen’s first problem leads to a fast algorithm. We also show that, when k is part of the input (not fixed), it is strongly NP-Complete to decide if the team of interest has been eliminated from k-th place. 2

The extended selection application from Brumelle, Granot, and Liu [4] concerns covering a set of jobs with positive values by tools with costs. When the sets of sub-tasks that the tools can perform are “tree-structured”, this can be formulated as a max flow problem. If we vary the costs of the tools superadditively (see Section 6), then we get a parametric max flow problem of the same type as Serafini’s problem, so it can be solved quickly by our extension of GGT. We give here a table summarizing our running times as compared to previous running times, along with information about |N | and |A| in terms of natural parameters for each application, and the techniques used to speed up its solution. In this table, n variously stands for number of jobs (Chen’s and Serafini’s models), number of teams (baseball elimination), number of jobs plus tools (extended selection), number of people (stable marriage), and number of nodes (network reliability). Symbol m always stands for the number of machines in the scheduling applications, not the number of arcs as is usual in network flow papers. Chen’s models, extended selection, and network reliability all yield networks whose density can vary, so here we use |A| for the number of arcs; for Chen’s models generalized to uniform machines, |A| refers to the number of arcs in the identical machine case (so our running times can more clearly reflect the fact that the number of arcs blows up by a factor of m when we model uniform machines). In all cases D is the largest input number; the log(nD) terms always arise from using binary search. Symbol E is the largest coefficient of the parameter on any arc. This paper is organized as follows. Section 2 reviews GGT’s methods, and presents our three extensions of those methods. Each of the following five sections briefly describes an application, how to formulate it as a parametric max flow problem, and how our extended GGT methods apply. Section 3 considers Chen’s [6] parametric scheduling models, and Section 4 considers Serafini’s [26] models for minimizing maximum tardiness. Section 5 considers baseball elimination problems, Section 6 considers the extended selection model of Brumelle, Granot, and Liu [4], and Section 7 briefly covers two more applications. Finally, Section 8 concludes with some open questions.

2 2.1

Extending GGT’s Methods Review of GGT’s Methods

The GGT model of a max flow network has the usual max flow network on a directed graph with source s, and sink t. The capacity uij (λ) on arc i → j is a function of a scalar parameter λ, where we assume that ( non-increasing in λ when i = s, uij (λ) is non-decreasing in λ when j = t, (1) constant in λ otherwise. This is reversed from the description of the model in [10], but most of our applications are formulated most naturally in this orientation. Suppose that we want max flows and min cuts for an increasing sequence of values of λ, say λ1 < λ2 < · · · < λk , with k = O(|N |). The λi are given on-line, i.e., we might not find out the value of λi+1 until after we compute the max flow for λi . GGT starts by computing a max flow for λ1 using the push-relabel algorithm of Goldberg and Tarjan [12]. Because (1) is reversed from [10], we must push flow from t to s instead of the normal s to t. This means that our description of how push-relabel works for GGT will be reversed from the description in [10]. Thus distance labels will be a lower bound on distance to s instead of distance from t, etc. It is often useful to think in terms of the residual network, which has a residual arc i → j whenever we have either an arc i → j in the original (reversed) graph with xij < uij (λ) (we can push forwards on i → j), or an arc j → i in the original (reversed) graph with xji > 0 (we can push backwards on j → i). The algorithm keeps a distance label li on each node i that measures the approximate 3

Problem

Previous Result

This Paper

Tech(s)

O(n4 )

O(n|A| log(n2 /|A|))

PWL

Multiple parameters, identical machines, |N | = Θ(n)

O(n4 log n)

O(n|A| log(n2 /|A|))

Mult

Single parameter, uniform machines, |N | = O(mn), |A0 | = O(m|A|)

(none)

O(mn|A| log(n2 /m|A|))

PWL, Bip

Multiple parameters, uniform machines, |N | = O(mn), |A0 | = O(m|A|)

(none)

O(mn|A| log(n2 /m|A|))

Mult, Bip

O(n2 m2 log(nm))

Tree

O(n2 m2 log(nm))

Tree

O(n2 m2 log(nm))

Tree

Chen’s Models [6] (Section 3) Single parameter, identical machines, |N | = Θ(n)

Serafini’s Models [26] (Section 4) min Tmax , |N |, |A| = O(mn) w min Tmax , compatible |N |, |A| = O(mn)

weights,

w lexico-optimal min Tmax , compatible weights, |N |, |A| = O(mn) w min Tmax , incompatible |N |, |A| = O(mn)

weights,

O(min(log(mnD), m)· n2 m2 log(mn)) O(log(mnD)· n2 m2 log(mn)) O(min(n log(mnD), mn)· n2 m2 log(mn)) O(log(mnD)· n2 m2 log(mn))

O(min(mn, log n+

Radzik

log(mnDE) )· 1+log log(mnDE)−log log(mnE) 2 2

m n log(mn))

Baseball Elimination [25, 16, 13] (Section 5) Maximum possible losses, Schwartz’s network, |N |, |A| = Θ(n2 ) Maximum possible losses, Gusfield and Martel’s network, |N | = Θ(n), |A| = Θ(n2 ) Can our team achieve k-th place?

(none)

O(n3 )

Bip

O(n3 + n2 log(nD))

O(n3 )

PWL

(none)

strongly NP Complete

NPC

2

Extended selection with superadditive costs [4] (Section 6), |N | = Θ(n)

(none)

O(n|A| log(n /|A|))

Tree

Parametric Stable Marriage [18, 13] (Section 7), |N |, |A| = Θ(n2 )

O(n4 log n)

O(n4 log n)

PWL

O(n|A| log(n2 /|A|))

Bip

Network Reliability Testing [13] (Section 7), |N | = Θ(n)

O(max(n, log(nD))· |A| log(n2 /|A|))

Table 1: Table of main results, network sizes, and techniques used to speed up algorithms. Technique “PWL” is the piece-wise linear extension of GGT in Section 2.2, “Mult” is the multiple parameter extension of GGT in Section 2.3, “Tree” is the extension of GGT to superadditive parameters on trees in Section 2.4, “Bip” is the extension of GGT to bipartite networks of Ahuja et al. [2], “Radzik” is the strongly polynomial bound on Newton’s Algorithm of Radzik [24], and “NPC” is the NP Completeness proof of Section 5.1.

4

length of the shortest augmenting path (shortest directed residual path) to s, and it maintains the properties that ls = 0, lt = |N |, and li ≤ lj + 1 for all residual arcs.

(2)

It also maintains the property that P P the excess ei ≡ j xij − k xki is non-negative for the current flow x.

(3)

Then GGT computes λ2 and updates the capacities. It then updates the flows x by setting xjt = ujt (λ2 ) for arcs j → t with lj < |N | (this update is given as xjt = max(xjt , ujt (λ2 )) in [10, 2], but it is easy to see that this expression always equals ujt (λ2 )), and xsi = min(xsi , usi (λ2 )). GGT then show that this new x satisfies (2) and (3) w.r.t. the distance labels at optimality for λ1 . Thus a max flow and min cut for λ2 can be computed starting from this new flow and the old distance labels. GGT continues in this way for all λ up to λk . Since the distance labels never decrease, when the number of parameter values is O(|N |) all this processing takes only the same time as a single max flow, or O(|N ||A| log(|N |2 /|A|)) time for the dynamic tree implementation of the push-relabel algorithm. Consider now the common case where we want to find a minimum non-negative parameter value λ∗ such that the network has a flow saturating s.

(4)

When λ∗ > 0, there are two other ways to interpret (4). First, we can decompose the capacity of any cut into a constant part (capacities of arcs that are constant in λ) and a parametric part (capacities of arcs that vary with λ). Then duality shows that (4) computes a cut that maximizes the ratio between its constant part and its parametric part, see, e.g., [10] (indeed, parametric optimization is a standard technique in fractional programming). Second, it is well-known that the capacity of a minimum cut as a function of λ is piece-wise linear and concave. The nesting property of min cuts shows that this cut function has at most |N | − 2 breakpoints. Then (4) is equivalent to finding the right-most breakpoint of the cut function [10]. When we apply Newton’s Algorithm to (4), it starts out by computing a max flow for λ = λ1 = 0. If this flow saturates s, then λ∗ = 0. Otherwise, define Qi as the node subset of the s-side of a min cut for parameter value λi . Since s is not saturated for λi , we have X usj (λi ). (5) cap(Qi ) < j

Note that when we increase λ from λi , because of (1) changes in arcs with tail s will cause the left side of (5) to decrease no more than its right side, and changes in arcs with head t will make the left side of (5) no smaller. Thus, as long as there exists a value of λ such that there is a flow saturating s, we can compute λi+1 as a value of λ that will satisfy (5) with equality when it is substituted for λi . We replace λi with λi+1 , update flows as indicated above, and compute a new max flow. We stop when we reach a flow where s is saturated. It can be shown [10] that λi+1 > λi , which implies that Q1 ⊇ Q2 ⊇ · · ·, and that there are at most |N | iterations. Thus, as long as we can find λ giving equality in (5) quickly, GGT push-relabel and Newton’s Algorithm solve (4) in O(|N ||A| log(|N |2 /|A|)) time. As pointed out in [10], all of this works equally well when the objective is to find a maximum λ which has a flow saturating t, which we will need in Section 5. In this case Newton’s Algorithm will run backwards, first choosing a value of λ so large that t is not saturated, then using the min cuts to iteratively decrease λ until the first step where t is saturated.

5

2.2

Piece-wise Linear Capacities

Suppose now that the uij (λ) satisfy (1), and are piece-wise linear. This is a minor extension of GGT’s methods since they consider only cases where the capacities are linear (affine). Gusfield and Martel [13] show how to deal with this case in the context of, e.g., binary search, but we show here that it is more straightforward, and a bit faster, to solve this case directly using Newton’s Algorithm. Section 2.1 showed that all we need to implement Newton’s Algorithm is a fast way to solve for a value of λ giving equality in (5). We can take advantage of the fact that the λi ’s in Newton’s Algorithm are monotone increasing in i. We start by sorting the B breakpoints of all non-constant uij (λ) in non-decreasing order as b1 ≤ b2 ≤ · · · ≤ bB , while keeping a pointer from each bl back to its arc. Since B is the number of slopes and breakpoints needed to specify the input, it is legal to use B in a strongly polynomial bound. In both of our applications B = O(|N |). As Newton’s Algorithm progresses and λi increases, we maintain a pointer into the sorted list of bl ’s so that, if bl is the current value pointed to, then bl−1 ≤ λi < bl . Since λi is monotone increasing, this pointer always moves forward. We also maintain the current value of the slope for each arc for the current value of λ (if λi equals a breakpoint, then the slope we record for that arc is the slope to the right of the breakpoint since the new λi+1 will be larger than λi ). Whenever we advance the breakpoint pointer, we update its corresponding arc’s slope. These updates take only O(B) total time. When the push-relabel algorithm identifies cut Qi for us, we mark the parametrized arcs contributing to cap(Qi ), and separately compute the parametrized and constant parts of cap(Qi ) (using the current slopes), which takes O(|A|) time. We then compute a trial value for λi+1 by using these capacities to solve for a λ giving equality in (5), which costs O(1) time. If this λi+1 is at most the next breakpoint bl , we accept it. Otherwise, advance the breakpoint pointer. If this changes a slope used by cap(Qi ) (we can decide this in O(1) time since Qi ’s arcs are marked and bl points to its arc), we update the parametric part of cap(Qi ) and re-compute a trial value of λi+1 using this new information, again in O(1) time. Continuing like this, we either discover a λi+1 achieving equality in (5) which is at most the next breakpoint, or we get beyond the last breakpoint and discover that no value of the parameter is large enough to saturate s. We have done only a constant amount of work per breakpoint, plus O(|A|) work per iteration of Newton’s Algorithm. This work is dominated by the time needed to sort the breakpoints and the GGT time for Newton’s Algorithm. Theorem 2.1 When we use GGT to implement Newton’s Algorithm when all capacities are piecewise linear with B total breakpoints, we can solve (4) in total time O(|N ||A| log(|N |2 /|A|)+ B log B). If B = O(|A|), this reduces to O(|N ||A| log(|N |2 /|A|). When the capacities are piece-wise linear, this same idea can be used to solve the more complicated versions of this problems mentioned in [10], such as finding all breakpoints of the cut capacity function, all with the same time bound as in Theorem 2.1. A full description of such an algorithm is in Section 6 of Hochbaum and Hong [15]. Their algorithm could, of course, be used to solve our simpler problem, but our algorithm is much simpler for (4) than theirs (though both have the same time bound). The methods of Gusfield and Martel [13] can also solve such problems, but they are also more complicated to implement, and generally have an extra log factor in their time bounds.

2.3

Multiple Parameters on One Side

Suppose that we have a network where every arc with tail s has its own parameter, and the capacity on each arc s → j is a decreasing linear function of parameter λj , say usj (λj ) = pj − aj λj with aj ≥ 0. All other capacities are constant. The problem here is to P min j λj subject to there being a flow that saturates s for these values of λj . (6) 6

Note that it can never be optimal to increase λj beyond pj /aj (piece-wise linearity is not a problem here). Thus we have multiple parameters, whereas [10] considers only a single parameter. Chen [6] noticed that one could deal with this case by adding a dummy node 0 as follows. Suppose that we have a set of values for λ1 , . . . , λn and a feasible flow x that saturates s w.r.t. these λj ’s, so that xsj = pj − aj λj . We then construct a modified network by changing the capacity of s → j from pj − aj λj to pj , adding new arcs j → 0 with capacity ∞ for each node j attached to s, and the new arc 0 → t with capacity Then flow x0 in the modified network by setting P we construct P ∞. 0 0 0 0 0 xsj = pj , xj0 = aj λj , x0t = j xj0 = j aj λj , and x = x elsewhere. Note that x0 saturates s in the modified network if and only if there is a corresponding x and set of λj ’s in the original network such than x saturates s w.r.t. the λj ’s. We modify Chen’s construction slightly by identifying node 0 with t (this might create parallel arcs if there existed previous j → t arcs) and deleting arc 0 P → t. Note that every max flow in the modified network saturates all arcs with tail s, i.e., has value j pj . If we put a cost of 1/aj on each new j → t arc, and cost zero for all other arcs, then this min-cost flow problem is equivalent to (6). This is the source of Chen’s bound. This min-cost flow problem has a special structure: we want a max flow at min cost, and all arcs with non-zero costs have head t. Recall that the set of feasible flows restricted to arcs with head t form a polymatroid (see, e.g., Fujishige’s book [9] for a background on polymatroids), and so we can solve this problem by using the Greedy Algorithm. This means that we construct an optimal flow by first sending as much flow as possible through the cheapest arcs, then the next cheapest, and so on. More formally, order the j’s with new j → t arcs as 1, 2, . . . , k such that 0 ≤ 1/a1 ≤ 1/a2 ≤ · · · ≤ 1/ak . The algorithm performs k + 1 iterations. At iteration 0, we set the capacities of all the new j → t arcs to zero and compute a max flow. At iteration j > 0, we change the capacity of new arc j → t from zero to ∞, and compute a max flow starting from the previous iteration’s flow. Note that iteration j will not change the flow on any new i → t arc with i < j. This is guaranteed to produce an optimal solution to (6) [9]. Now, note that the capacities on the arcs with head t are non-decreasing in successive iterations, so that the capacities seen by the successive max flows satisfy (1). Thus we can use GGT to compute the k + 1 max flows. Theorem 2.2 The multiple parameter problems considered in this section can be solved in O(|N ||A| log(|N |2 /|A|) time. This same idea can also be used to solve any max flow at min cost problem where the only non-zero costs are either on arcs with tail s, or on arcs with head t; this appears to be a new observation.

2.4

Superadditive Parameters on Trees

When linear parameters can appear on any arc, parametric min cuts have less structure than in the GGT case. The models considered in [10] all have parameters only on arcs with tail s or arcs with head t, which makes it is easy to change the flow at the end of one iteration to get an initial preflow for the next iteration that satisfies (2) and (3). But there is a more general structure that arises in at least two applications (see Sections 4 and 6) which also makes this easy to accomplish. Suppose that we have a max flow network with a distinguished out-arborescence (tree directed away from its root) S rooted at s, and an in-arborescence (tree directed towards its root) T rooted at t. We assume that T is arc-disjoint from S, and we consider S and T to contain both nodes and arcs. We further assume that if j ∈ S, j 6= s, then the only arc with head j is the one in S, and if i ∈ T , i 6= t, then the only arc with tail i is the one in T . 7

(7)

However, if j ∈ S then j can be the tail of many arcs not in S, and if i ∈ T then i can be the head of many arcs not in T . For simplicity we assume that all capacities are linear, of the form uij (λ) = pij + aij λ, and that uij (λ) ≥ 0 for all λ of interest. The properties we require of the capacities are that   ≤ 0 (non-increasing in λ) when i → j ∈ S, aij is ≥ 0 (non-decreasing in λ) when i → j ∈ T , (8)  = 0 (constant in λ) otherwise. and

P for all i → j ∈ S, aij ≤ P{ajk | j → k ∈ S}; for all i → j ∈ T , aij ≥ {aki | k → i ∈ T }.

(9)

Note that (7–9) reduce to (1) in the special case where S is the set of arcs with tail s and T is the set of arcs with head t. Equation (9) is a sort of superadditivity in the coefficients aij . Suppose that we have computed a max flow xk and a min cut whose s-side is Qk for λ = λk . Call i → j a cut arc if i ∈ Qk , j ∈ / Qk , i.e., i → j crosses the cut forwards, and so contributes to cap(Qk ). A generalization of [26, Lemma 10] is: Lemma 2.3 If arc i → j ∈ S (i → j ∈ T ) is a cut arc, then no other arc on the unique path in S from s to i (in T from j to t) can be a cut arc. Proof: We prove the first statement, the second is similar. The fact that i → j is a cut arc implies that xkij = uij (λk ) > 0. Because of (7), the only way for this flow to get to arc i → j is via the s to i path in S, call it P , so every arc on P has positive flow. If some other arc u → v on P is a cut arc, then there would have to be an arc of P between u → v and i → j crossing Qk backwards, and this arc would have flow zero, a contradiction. Corollary 2.4 (to Proof of Lemma 2.3) If i → j ∈ T has xij > 0, and v → w is an arc on the unique path in T from i → j to t, then xvw > 0 also, and similarly for arcs of S. In our extended GGT, we now compute the new capacities uij (λk+1 ). Working from the leaves of T towards t, if xkij = uij (λk ) then we set xk+1 = uij (λk+1 ). Otherwise (xkij < uij (λk )) we set ij xk+1 to be xkij plus the sum of the increases on arcs v → i. ij For each arc i → j ∈ S where j is a leaf of S, we set xk+1 = min{xkij , uij (λk+1 )}. When i → j ij is an arc of S where j is not a leaf, we first compute x0ij , which is xkij decreased by the sum of the decreases in arcs j → v ∈ S. Then xk+1 = min{x0ij , uij (λk+1 )}. ij Lemma 2.5 This xk+1 satisfies 0 ≤ xk+1 ≤ u(λk+1 ), and satisfies (2) and (3) w.r.t. the distance labels at the end of λk ’s max flow. Proof: Consider arc i → j ∈ S. Then xk+1 is clearly feasible except possibly that it might be ij P negative. By conservation, xkij ≥ j→v∈S xkjv . Since the decrease in flow on each arc j → v keeps ≥ 0. its flow non-negative by induction, we must have that x0ij ≥ 0, and so xk+1 ij k For an arc i → j ∈ T , xk+1 is clearly feasible, except possibly when x ij < uij (λk ). But using ij induction from the leaves of T toward t shows that on arcs with head i, xvi increases by at most avi (λk+1 − λk ). Then (9) shows that the total increase in the capacity of i → j is larger than the sum of the increases of the xvi , so xk+1 is also feasible. ij

8

Now consider the excess ei of node i 6= s, t. If i ∈ / S, T , then its excess remains at zero. If i ∈ S, then i is the head of arc v → i ∈ S. By conservation and construction of x0 and xk+1 , X xk+1 xk+1 ≤ x0vi = ij , vi i→j

so the new excess of i is non-negative. If i ∈ T , so that i is the tail of a unique arc i → j ∈ T , i’s excess can change only if xkij = uij (λk ). But by the induction above and (9), the new excess of i is non-negative. Thus the new x satisfies (3). Lastly consider (2). The only way that these changes can cause a violation of (2) is if a new residual arc is created. We need to worry only about arcs in S and T since only they had their flows and/or capacities changed. If i → j ∈ S, then, since xij only decreases, xij can’t increase from zero, and so no new backwards residual arc in S can be created. If xij does decrease, a similar induction to the above shows that the decrease in xij is at most |aij |(λk+1 − λk ). Thus if xkij = uij (λk ), then xk+1 must equal uij (λk+1 ), so no new forward residual arc in S can be created either. ij If i → j ∈ T , then xk+1 < uij (λk+1 ) only if xkij < uij (λk ), so no new forward residual arc can be ij created. If xij does increase, it does so because it is on a path in T from an arc at its upper bound to t. But Corollary 2.4 shows that this implies that xkij > 0, so that j → i was already a backwards residual arc. Thus (2) is satisfied. Now Lemma 2.5 shows that we can change from an optimal flow for λk to an initial flow for λk+1 while using the same distance labels. Once we are able to accomplish this key transformation, all of the GGT analysis will now work. In particular, the structural result that Qk ⊇ Qk+1 is true. This result could also be obtained as a special case of the very general result of Topkis [27], by restricting to the sub-lattice of cuts satisfying Lemma 2.3, and using conditions (8–9). Thus we can solve (4) for this case, and more generally we can find all breakpoints of the cut capacity function and so find a lexico-optimal flow sharing, all with the same time bound as O(1) max flows. We will need this more general version in Section 4.1. (Some of the GGT methods require doing flow computations on networks which have had one side of a min cut contracted. It is easy to use Lemma 2.3 to show that such networks also satisfy (7–9) w.r.t. the contracted S and T , so all of the GGT methods work correctly for this case.) This then gives Theorem 2.6 Extended GGT can solve parametric flow problems with parameters on trees of the type discussed above in O(|N ||A| log(|N |2 /|A|)) time.

3 3.1

Chen’s Models Chen’s Models with Identical Machines

In Chen’s problems [6], each job j also has a release date rj . No piece of any job can start before its release date, and every piece must finish before its due date, i.e., we must have Cj ≤ dj for all jobs j. For now we assume that the m machines are identical. There is no objective function, we ask only if a feasible schedule exists. Of course, if we can answer this problem in polynomial time, then we can, e.g., use binary search in polynomial time to minimize makespan (the largest completion time of any piece of any job). Horn [17] showed how to solve this problem by constructing a max flow network as follows. Sort the release times and due dates into a single increasing sequence t1 < t2 < · · · < tk+1 , where k ≤ 2n−1. These ti then define k time intervals I1 , . . . , Ik , where Ii = [ti , ti+1 ] has size ∆i = ti+1 −ti . Now the network has a node for each job j, a node for each interval i, a source s, and a sink t. For each job j, there is an arc s → j with capacity pj , and for each interval Ii contained in [rj , dj ], there is an arc j → i. Finally, each interval Ii has an arc i → t with capacity m∆i , see Figure 1. 9

h  A A

job nodes

interval nodes 1

job 1 2 3

rj 0 5 3

dj 10 12 15

pj 4 12 14 3

A A

A - 1h 2 - 2h ' A9 max(4 − λ, 0) A @ 5  @  @ A @ @6 A @  @ A @ @ @AAU Rh @ Rh @ 15 - 2h 5  sh max(12 − λ, 0) t 3    @2   @  6  @ 2  5 @   @  2 Rh @ 9 - 3h & 4 max(14 − λ, 0)  @ 3  @  @  @  @  Rh @ 5

Figure 1: Example of Chen’s network with three jobs and three machines. The given data yields five intervals, which in turn give the capacities indicated on the arcs from the job nodes to the interval nodes (capacity equals interval length), and from the interval nodes to t (capacity equals interval length times number of machines). The processing times give the parametric capacities on the arcs from s to the job nodes. There is no flow saturating s (processing all jobs) for λ = 0. The min cut comes from job 2 requiring 12 units of processing, but having access to only 2 + 5 = 7 units of machine capacity. Then Newton’s algorithm will change λ to 5, at which point there is a feasible flow. There are two possibilities for the capacity of arc j → i in this network. Here we consider the most common case, where two pieces of a job are not allowed to execute in parallel with each other, so that job j can be processed for at most ∆i time units during interval Ii , and the capacity of j → i is ∆i . In the less common case (which does happen in practice, see Serafini [26]), two pieces of a job are allowed to execute in parallel with each other, so that job j could be processed for as much as the total processing capacity available during Ii (namely m∆i ), so we can leave the capacity of j → i as ∞. In this second case Iwata, Matsui and McCormick [19] have an algorithm for solving the parametric problem that takes only O(n2 ) time, which is even faster than the algorithms considered in this paper. P Theorem 3.1 (Horn, [17]) The max flow value in the network of Figure 1 equals j pj (i.e., saturates the source) if and only if there is a feasible schedule. If there is no feasible schedule, Chen [6] suggests that what is often done in practice is to reduce the processing time necessary for some or all jobs by, e.g., outsourcing. This leads Chen to propose a model where the processing time of job j is max{0, pj − λaj }, where λ is the amount we pay to reduce pj . He proposed two models, one where paying λ simultaneously reduces all pj ’s and whose 10

objective is to minimize λ subject to having a feasible schedule. In this model the capacity of arc s → j is pj (λ) ≡ max{0, pj − λaj }, which satisfies (1). Theorem 2.1 applies here. The number of capacity breakpoints is O(n), so the time for sorting the capacity breakpoint values is dominated by the time for Newton’s Algorithm, and we get a total bound of O(n|A| log(n2 /m)) as reported in Table 1. (The bound of O(n5 ) on Chen’s algorithm given in [6] improves to the O(n4 ) of Table 1 by using a faster max flow subroutine in Chen’s algorithm.) P In Chen’s second model we pay λj separately for each job j, and the objective is to minimize j λj subject to having a feasible schedule. In this model the capacity of arc s → j is pj (λj ) ≡ pj − λj aj . Theorem 2.2 applies here, which yields the O(n|A| log(n2 /m)) time reported in Table 1.

3.2

Chen’s Models with Uniform Machines

When the machines are uniform we need a more complicated network, due to Federgruen and Groenevelt [8]. For simplicity assume that all speeds are distinct, and are ordered as σ1 > σ2 > · · · > σm > σm+1 ≡ 0. Now interval Ii will correspond to m interval nodes, (i, 1), (i, 2), . . . , (i, m). When [rj , dj ] ⊇ Ii , job node j is connected to interval node (i, k) by an arc of capacity ∆i (σk − σk+1 ) for 1 ≤ k ≤ m. Interval node (i, k) is connected to t by an arc with capacity k∆i (σk − σk+1 ). Theorem 3.2 (Federgruen and Groenevelt [8]) There is a flow saturating the source in this network if and only if there is a feasible schedule in which all jobs get processed. This network is bipartite with |S| = O(n) and |T | = O(mn), and the number of arcs A0 in this network is related to the number of arcs A in the network in the original network by |A0 | = O(m|A|). Thus, when we apply Theorem 2.1 and Ahuja et al.’s [2] bipartite parametric max flow algorithm to this problem, we get the bound O(mn|A| log(n2 /m|A|)) in Table 1 for the single parameter version of Chen’s problem. For the multiple parameter version of Chen’s problem, the network is “almost” bipartite, i.e., it is bipartite except for the arcs with positive costs. Ahuja et al. [2, Section 8] show that their algorithm applies also to this network (since the S nodes still form a vertex cover), so using Theorem 2.2 we again get the same bound. Thus the penalty we pay for generalizing to uniform machines is that the networks blow up by a factor of m, and so does the speed of the algorithms. When there are only r distinct speeds, then [8] shows that only r interval nodes are needed for each interval, so the “m”s in these rows of Table 1 could then be replaced by “r”s.

4

Serafini’s Models

Serafini [26] modified the generic scheduling problem for a practical problem in scheduling looms. Here all jobs are released at time zero (all rj = 0). We now allow Cj > dj , and define the tardiness of job j as Tj ≡ max{0, Cj − dj }. The machines could be identical or uniform. In Serafini’s application pj is the number of meters of fabric j required, and σi is the number of meters per minute that machine i can weave. For later use we define ρi to be the speed of machine i relative to machine 1, so that ρi = σi /σ1 . Define Ji to be the set of jobs that can be processed by machine i, and Mj as the set of machines that can process job j (so that Mj = {i | j ∈ Ji }). We assume that all these sets are non-empty. Furthermore, we allow job splitting, where pieces of a job are allowed to execute in parallel with each other on different machines. Following Serafini, we denote the problem of finding a schedule that minimizes Tmax ≡ maxj Tj (maximum tardiness) by T∗ . Sometimes each job has a weight wj , and we denote the problem of minimizing maxj wj Tj (maximum weighted tardiness) by T∗w . A common case in practice is where jobs with earlier due dates are more important, so that dj < dk implies that wj > wk ; we call such weights compatible. We will use Newton’s Algorithm with a parameter τ which is a guess at the maximum (weighted) tardiness. For T∗ , τ induces derived due dates dj ≡ dj + τ , and for T∗w they 11

are dj ≡ dj + τ /wj . In both cases, the maximum (weighted) tardiness is at most τ if and only if there is a feasible schedule for the due dates d. We choose equivalent processing time on machine 1 as our time scale, so the total processing time required by job j is then σ1 pj . Define xji to be the amount of the total processing time σ1 pj performed on machine i, for i ∈ Mj , so that X σ1 pj = xji . (10) i∈Mj

It is clearly best for the job pieces on machine i to execute with no idle time, and without preemption. All that remains is to choose the order of the job pieces on each machine. It is wellknown that putting the jobs in order of earliest due date first (EDD) minimizes tardiness on a single machine (see [20, 17]). When Newton’s Algorithm is testing a value of τ , the EDD order is w.r.t. derived due dates. For T∗ , and for T∗w with compatible weights, the EDD order with derived due dates is the same as for the original due dates. But for T∗w with general weights, the EDD order may depend on the value of τ ; we consider this hard case in Section 4.2. Pj For a value of τ and machine i, define π i to be an EDD order of the jobs in Ji . Then Cπi (j) = ρi k=1 xπi (k),i . Therefore, requiring Cπi (j) ≤ dπ(j) is equivalent to requiring j X

xπi (k),i ≤ (1/ρi )dπ(j) .

(11)

k=1

Now we can define Serafini’s network. For each machine i, make a path of |Ji | horizontal arcs, whose j-th arc is associated with job π i (j), and having capacity (1/ρi )dπ(j) . The paths for different machines are node disjoint, except that the head of the last horizontal arc in each path is a common node t (see Figure 2). Each job j is associated with a source node sj not on any machine path. For each i ∈ Mj , there is an arc from sj to the tail of the arc on machine i’s path associated with job j, with capacity ∞. Finally there is a distinct supersource node s connected to each sj by an arc with P capacity σ1 pj , see Figure 2. If we define r = j |Mj |, then both |N | and |A| are Θ(r) ≤ O(mn) for this network. If there is a feasible flow x in this network saturating s, define xπ(j),i to be the flow in the arc from sj to the tail of the j-th arc of machine i’s path. Since x saturates s, it satisfies (10). The flow P in the j-th arc of machine i’s path is jk=1 xπi (k),i , so x also satisfies (11). Conversely, a set of xji ’s corresponding to a feasible schedule can be turned into a flow in this network saturating s. This shows that: Theorem 4.1 (Serafini [26, Theorem 6]) There is a flow saturating s in the network of Figure 2 if and only if there is a feasible schedule for target tardiness value τ .

4.1

The Easy Cases of Serafini’s Models

Define the tree S to be the single node s, and the tree T to be the m paths of horizontal arcs. Then S and T are arborescences directed away from s and towards t respectively, and they clearly satisfy (7). The parametric (in τ ) capacities clearly satisfy (8). For the problem T∗ the capacities satisfy (9) because the avw on the path for machine i all equal 1/ρi . For the case of T∗w , the avw for the j-th horizontal arc on machine i’s path, which corresponds to job π i (j), equals 1/(ρi wπi (j) ). When the weights are compatible, these avw increase as we get closer to t as required by (9). Thus in these two cases Theorem 2.6 applies to give the running times reported in Table 1. Serafini points out that in practice, among optimal schedules we would prefer one where all jobs finish as early as possible. Serafini calls such a schedule unordered lexico-optimal and gives an 12

g

M1 nodes

M2 nodes

M3 nodes

job nodes

g g 6

d2 + τ

d1 + τ

d1 + τ

- g 6

d2 + τ

1g 2g I @ 6 @ p2 = 5 p1 =@ 6 @ @ sg

- g  @ @ d3 + τ @ @ R tg @  g d3 + τ  - g 6  3g 

d3 + τ

due dates d1 = 3 d2 = 4 d3 = 5

p3 = 7

Figure 2: Example of Serafini’s network with three jobs and three identical machines. Job 1 can be processed on M2 and M3 , job 2 on M1 and M3 , and job 3 on all three machines. The numbers on arcs are capacities; those not shown are ∞. For the given data there is no flow saturating s when τ = 0 since the capacity of the cut at t is 3d3 = 15, which is smaller P than j pj = 18. With a gap of 3 and τ changing on three arcs, Newton’s algorithm will next choose τ = 1. For this value of τ there will then be a feasible flow. algorithm for computing such schedules. Among the GGT methods is a way of computing what [10] calls lexicographically optimal flow sharing within the same time as ordinary GGT. This involves using the most sophisticated version of GGT to compute all breakpoints of the parametric cut capacity function. One can then define capacities relative to these breakpoints so that any max flow w.r.t. these capacities is lexico-optimal. It is easy to see that this method solves Serafini’s unordered lexico-optimal problem. Thus we get that even lexico-optimal schedules can be computed within the GGT time bound. Serafini’s networks can have as many as O(mn) nodes, but their number of arcs is only O(mn), which yields the O(m2 n2 log(mn)) time bound reported in Table 1. There is a slight difference in Newton’s Algorithm between problem T∗ , and T∗w with compatible weights. As Serafini shows [26, Theorem 11], for T∗ Newton’s Algorithm needs only O(m) iterations, whereas for T∗w with compatible weights Newton might need as many as O(mn) iterations, but (extended) GGT has the same time bound in both cases.

4.2

The Hard Case of Serafini’s Model

When the weights are not compatible in T∗w , the structure of the network can be different for different values of τ (because the EDD order of jobs on a machine might change). A critical value of τ happens d −d where dj = dk , or τ = wj wk wjj −wkk . There can be at most O(n2 ) such critical values. Now do binary search on critical values to find a pair of critical values bracketing the optimal value of τ , which costs O(log n · m2 n2 log(mn)) . Because the weights are not compatible, we cannot use our extended GGT, but we can still use Newton’s Algorithm where we re-start the max flow from scratch at each iteration. Define D to be the largest of the pj , dj , and σi , and E to be the largest of the σi and wj . Then Radzik [24] 13

showed that the number of iterations of Newton’s Algorithm when solving this sort of parametric log(mnDE) flow problem is at most O(min(mn, 1+log log(mnDE)−log log(mnE) )) iterations. (We could also get a strongly polynomial algorithm for this problem by using Megiddo’s parametric search [23], but with a slower running time.) This strongly polynomial algorithm answers an open question posed by Serafini.

5

Baseball Elimination Problems

We focus on “our” team, call it team 0. Suppose that there are n other teams, and that these teams have played a partial season. Then we have the data wi , the number of wins that team i has so far, and gij , the number of games left between team i and team j (so gij = gji ). We say that our team is eliminated [25] if, for all possible ways of playing out the rest of the season, there is always another team that ends up with more wins than our team (this is the strongest possible notion of “elimination”, and often leads to a team being eliminated before the “magic number” indicates it). The bestPpossible scenario for our team is to win all of its remaining games, and so end up with W ≡ w0 + j g0j wins. In order for team i > 0 not to eliminate our team, the number of games that i wins during the remainder of the season can be at most W − wi . This observation leads to the first network formulation, due to Schwartz [25]. Make a node for each unordered pair of teams {i, j} with i, j 6= 0, and a node for each team i 6= 0. Connect nodes i and j to node {i, j} by arcs with capacity ∞. Connect s to each node i by an arc with capacity W − wi . Finally, connect each node {i, j} to t by an arc with capacity gij , see Figure 3 (ignore node 0 and assume that λ = 0 for the moment). When we interpret the flow on arc i → {i, j} as being the number of the gij remaining games with j that i wins, then it is easy to see that there is a flow saturating t in this network if and only if there is a way to play out the season where our team is not eliminated. - 12h 1h  B@  @ @ B @ 6−λ @5 B @ @ @ B @ @ B Rh @ Rh @ 4 8−λ - 2h B sh t 13  @  A@ B  @ A@ B 6  @ A @B 7−λ  @ A B@ B@  @ A Rh @ R @ λ A B - 23h 3 B  A @ B  A @ B3  gij 0 1 2 3 @ 2A B 0 0 3 2 1  A 1 3 0 5 4 @1 B  2 2 5 0 6 @AAUNB  3 1 4 6 0 Rh @ W − wi 6 8 7 0 team nodes

game nodes

Figure 3: Example of Schwartz’s network with four teams. Capacities not shown on arcs are ∞. There is a flow saturating t when λ = 0, so team 0 is not eliminated. Here, since we want to saturate t, Newton’s algorithm starts out with a large λ. Since the capacity out of s must be at least as large as the capacity going into t to allow t to be saturated, we see that λ can be at most 3/2. It turns out that λ = 3/2 is optimal here.

14

It is unlikely that our team will really win all of its remaining games. So, when our team is not eliminated, an interesting question is: How many games can our team lose and still not be eliminated? To answer this, we modify the network. Define the parameter λ as the number of its remaining games that our team will lose. Add a new node 0 with arc 0 → t of capacity λ. Then connect node each node i to node 0 by an arc with capacity g0i , see Figure 3. Finally, modify the capacities of the s → i arcs to be (W − λ) − wi . Note that these parametric capacities satisfy (1). Node 0 then feasibly collects team 0’s λ losses as wins for the other teams, so we get: Theorem 5.1 There is a flow saturating t in the network of Figure 3 if and only if there is a way to play out the season where our team has λ losses and is not eliminated. An apparent drawback of the network in Figure 3 is that it has Θ(n2 ) nodes (but only Θ(n2 ) arcs). It is bipartite, with |S| = n, and |A| = O(n2 ). Thus we can use the bipartite specialization of GGT due to Ahuja et al. [2] on this network, achieving the O(n3 ) time bound in Table 1. A more compact network appears in Gusfield and Martel [13]. Now each team i (including team 0) has a left node i, and a right node i0 . We connect each node i to i0 by an arc with capacity ∞, and we connect each node i to every P j 0 with j < i by an arc of capacity gij . Connect s to each left node i by an arc withPcapacity min( j gij , W − wi ). Finally, connect each right node j 0 to t by an arc with capacity j>i gij , see Figure 4. Now, if we interpret the flow on i → i0 as being the number of games that i plays with higher-indexed teams won by i, and the flow on i → j 0 as being the number of the gij remaining games between i and j won by i, then the total flow out of each i is the number of wins for i in the rest of the season. Thus we get there is a flow saturating t in this network if and only if there is a way to play out the season where our team is not eliminated. ' - 0h∞

- 0h 0  A  A  A  A  A 3 min(12, 6 − λ)   - 1h - 1h∞ ' 0 A6   A  @    A  @    9 A @    A 2 @    A @  5   - h RAU h @ min(13, 8 − λ) 6 - 2h sh t 20 ∞        0  1 4  6   - 3h & - 3h∞ 0 left team nodes

right team nodes

min(6, 6 − λ)

min(11, 7 − λ)

Figure 4: Example of Gusfield and Martel’s network with four teams, using the same data as Figure 3. Thus this network also has λ = 3/2 as its optimal solution. Now we add parameterPλ to this network. In this case, all we need to do is to change the capacities works because the capacity of the s → i arcs to P min( j gij , (W − λ) − wi ), which satisfy (1). ThisP into node 0 is only j g0j − λ, whereas the capacity out of node 00 is j g0j , so team 0’s λ losses get distributed feasibly to the other teams. 15

Theorem 5.2 (Gusfield and Martel [13]) There is a flow saturating t in the network of Figure 4 if and only if there is a way to play out the season where our team has λ losses and is not eliminated. The network in Figure 4 now has only Θ(n) nodes (but still has Θ(n2 ) arcs). We can apply Theorem 2.1 to get the time bound of O(n3 ) reported in Table 1 (so there appears to be no advantage from using the more compact network). This is slightly better than Gusfield and Martel’s bound of O(n3 + n2 log(nD)) coming from binary search (here D is the number of games remaining for “our” team).

5.1

Deciding if Our Team is Eliminated from k-th Place is NP-Complete

If our team is eliminated from finishing first, what is the highest final placing we can hope for? We say that our team is not eliminated from k-th place if there is a way to play out the season where we end up with at least as many wins as all but k − 1 teams. Hoffman and Rivlin [16] gave a necessary and sufficient condition for not being eliminated from k-th place. First we need some definitions. We use Schwartz’s network. If S ⊆ {1, 2, . . . n} is a subset of teams, {{i, j} | i, j ∈ S} is the set of games among the teams in S. We call S blocking P then γ(S) ≡P if S (W − wj ) < γ(S) gij . When S is blocking, then S ∪ γ(S) ∪ {t} is the t-side of a cut with P capacity less than gij , i.e., S blocks flow from saturating t, so that at least one team in S must finish ahead of our team. We call a subset K of teams a cover if every blocking set of teams includes at least one member of K. Intuitively, a cover is a subset of teams that can finish ahead of our team. Theorem 5.3 (Hoffman and Rivlin [16]) Our team is not eliminated from k-th place if and only if there is a cover of size at most k − 1. We use this result to prove that deciding if our team is not eliminated from k-th place is strongly NP Complete. Note that k is given as part of the input; for a fixed k, we can use brute force search over the O(nk−1 ) subsets of size k − 1 to see if any is a cover. (To check if subset K is a cover, set the capacities of the arcs s → i to ∞ for teams i ∈ K and see if there is a flow saturating t. If there is such a flow, then K is indeed a cover.) We use a reduction from Minimum Node Cover (MNC): an instance is given by an undirected graph G = (V, E) and an integer c < |V |. The question is if there is a node cover C ⊂ V with |C| ≤ c, i.e., a subset of nodes that is incident to every edge in E. See Garey and Johnson [11] for a background in NP Completeness and a proof that MNC is NP Complete. Theorem 5.4 It is strongly NP Complete to decide if our team is not eliminated from k-th place. Proof: We transform an instance G, c of MNC to an instance of our problem as follows. The set of teams is {0} ∪ V . Set wi = 0 for all i ∈ V , and set W = 1. If {i, j} ∈ E then set gij = 3, otherwise set gij = 0. Then each {i, j} ∈ E is a blocking set. Set k = c + 1. Suppose that C is a node cover with |C| ≤ c. Then the corresponding set of teams K is a cover of size at most k − 1: Certainly K covers all the blocking sets e ∈ E. Suppose that B is some other blocking P set with B ∩ K = ∅. Then B corresponds to a node subset that is independent in G. But then γ(B) gij = 0, contradicting that B is blocking. Now suppose that K is a cover of size at most k − 1, with corresponding node subset C. Since K covers all blocking sets, in particular it covers all e ∈ E, so C is a node cover of size at most c.

16

6

The Extended Selection Problem

Brumelle, Granot, and Liu [4] develop the following model: We have n tasks (jobs), where we get benefit bj > 0 from performing job j. Each task j has a set of sub-tasks Sj ; the Sj are pair-wise disjoint. We have m tools, where tool i is capable of processing some subset Ti of sub-tasks (the subsets Ti are allowed to overlap, and we assume w.l.o.g. that they are distinct), and the cost of using tool i is ci > 0 (we incur cost ci no matter how many of its possible sub-tasks we use it to perform). The problem is to select a subset J of tasks and a subset U of P tools thatPis feasible (i.e., for all j ∈ J, all r ∈ Sj belong to Ti for some i ∈ U ), and that maximizes J bj − U ci . This problem is in general NP Hard (make all the bi very large so that any optimal solution must include all tasks; then we want to find a min-cost subset of tools that covers all sub-tasks, which is just Set Covering). However, it can be solved when, for all i, k, either Ti ⊂ Tk or Tk ⊂ Ti (the sets are nested), or Ti ∩ Tk = ∅ (the sets are disjoint). Such a family of sets is called tree-structured since it can be represented by a tree, see below. Brumelle, Granot, and Liu construct the following max flow network to solve this problem. Make a node j for each task, and connect the source s to each j by an arc with capacity bj . Make a node for each tool i. If Ti is maximal among the family of tool subsets, connect i to t by an arc with capacity ci . Otherwise, let k be such that Tk is a minimal tool subset satisfying Ti ⊂ Tk , and connect i to k by an arc with capacity ci . Finally, if r ∈ Sj , then the subset of tools capable of performing sub-task r form a nested chain. Connect node j to the node i corresponding to the minimal subset in r’s chain by an arc with capacity ∞, see Figure 5. - bh 1h  A  @ λcb  @ Aβ1 R @ b1  A 1 ah     A   @ λca  λcf A  @ α2  Rh @ b2 - 2h sh fh A t P P  β2 PAP   @  A PP λcd @ PP  q P A h d @ b3  A @  α3  A λce @  β3 AU Rh @ eh 3 γ job nodes

tool nodes

α1

3

Figure 5: Example of a network associated with an instance of the extended selection problem. Here the set of jobs is {1, 2, 3}, the set of tools is {a, b, d, e, f }, the sets of subtasks are S1 = {α1 , β1 }, S2 = {α2 , β2 }, and S3 = {α3 , β3 , γ3 }. The tools can perform the following subsets of sub-tasks: Ta = {α1 , α2 , α3 , β3 }, Tb = {α1 , α3 }, Td = {β1 , β2 , γ3 }, Te = {β1 , γ3 }, and Tf = {β3 }. Note that this family of tool subsets is tree-structured, as required. The benefit from job j is bj , and the cost of tool i is ci . The arcs from job nodes to tool nodes have capacity ∞; the sub-task labels are given for ease of understanding. The heavier arcs between the tool nodes form a tree. Theorem 6.1 (Brumelle, Granot, and Liu [4]) A min cut in the network of Figure 5 gives an optimal solution to the extended selection problem. Suppose that benefits and costs are measured in different units, and let λ be a parametric conversion factor from costs to benefits. If we want the largest conversion factor that will allow at least

17

one job to be performed economically, then we want to maximize λ subject to there being a flow that saturates s. Note that the network in Figure 5 satisfies (7) and (8) with S being {s} and T being the tree of arcs with capacities ci . Define Pk , the predecessors of tool k, to be the subset of tools i such that i → k is an arc ofP T . In order for (9) to be satisfied, we need to have superadditivity in the tool costs, i.e., we want Pk ci ≤ ck . This would be the case if the cost of a tool is (at least) a sum of costs associated with the sub-tasks it can perform. When (9) is satisfied, Theorem 2.6 applies to give the bound in Table 1. Technically, we could instead put parameter 1/λ on the s → i arcs and use regular GGT to solve this problem. However, with tree-structured jobs as well as tools (a generalization of this model also in [4]) this trick would not help. Also, our method here is more general than GGT and so can solve many other parametric variations of extended selection. When (9) is not satisfied, we can still use Newton’s Algorithm, computing each max flow from scratch, with Radzik’s time bound [24].

7

Other Applications

The Parametric Stable Marriage Problem [18, 13] looks for sets of “stable” marriages (perfect matchings in a bipartite graph between n men and women satisfying certain properties) that vary how much the men enjoy an advantage versus how much the women enjoy an advantage. This gives rise to a parametric max flow network with O(n2 ) nodes and arcs and piecewise linear capacities. We want to find all breakpoints of the optimal cut capacity function for this network, which can be accomplished using the methods in GGT. There are O(n2 ) capacity breakpoints in total. Thus we can solve this in O(n4 log n). This is the same as the time for Gusfield and Martel’s [13] algorithm, but using GGT with Newton’s Algorithm is simpler than their binary search. In Network Reliability Testing [13] we start with a graph on n nodes, each with a capacity for testing, and |A| edges, each with a need for testing. We want to find a minimum-time plan for testing all edges. This leads to a parametric max flow problem on a bipartite network with |S| = O(n) and O(|A|) arcs where we want the minimum value of λ such that there is a flow saturating t. Thus we can use Newton’s Algorithm together with the specialization of GGT to bipartite networks of Ahuja et al. [2] to solve this problem in O(n|A| log(n2 /|A|) time.

8

Open Problems

The most obvious question raised by this research is just how far we can push GGT. Brumelle, Granot, and Liu [5] give a partial answer to this. When considering only monotonicity properties such as (1) and (8) (but not constraints on the magnitudes of the capacity changes such as (9)), they give necessary and sufficient conditions to get “totally ordered” min cuts. This means that, as we increase the value of the parameter, new min cuts could be larger, smaller, or in between cuts already generated (as opposed to the “nested” case in this paper, where cuts always move in a single direction). In one such case Arai, Ueno, and Kajitani [3] have shown that a GGT-type algorithm can find all min cuts using only O(1) max flows. Our extended GGT methods should prove useful in extending models where ordinary GGT was used. For example, Hall and Vohra [14] give a model for equitably distributing flows at the sink of a network based on proportional upper and lower bounds on the flow on those arcs. If we want to also include hard upper and lower bounds on these flows, then this would lead to piece-wise linear parametric capacities, and our methods would support this extension. As Chen [6] points out, his two models are extreme cases of a more general model. Suppose that the set of jobs is partitioned into non-empty subsets S1 , S2 , . . . , Sk . Further suppose that if we pay $λi for subset Si , then the processing times of jobs j ∈ Si become pj (λi ) ≡ max{0, pj − λi aj }.

18

P Our objective is to minimize i λi . Chen’s first model is the case k = 1, his second model is the case k = n. At this point we know of no better way of solving the more general model than linear programming. Finally, we ask whether Newton’s Algorithm is useful in practice. In theory, Newton could cost O(|N |) max flows, but to be practically useful the number of iterations should be small. In [21] we report on a non-GGT version of Newton for computing max mean cuts that performed well. We have an implementation of Newton’s Algorithm using (ordinary) GGT that we have developed for an open-pit mining application [22] (a copy of this code can be obtained by emailing the author). Preliminary computational results from this code are quite encouraging.

Acknowledgements I thank Paolo Serafini for sending me an advance copy of his paper [26], Li Liu for giving me copies of [4, 5] and for helpful conversations, Maurice Queyranne for other helpful conversations, Akiyoshi Shioura for pointing out an error in the original version of Section 2.4, and an anonymous referee for very detailed comments on the first version of this paper.

References [1] Ahuja, R.K., T.L. Magnanti, and J.B. Orlin (1993). Network Flows: Theory, Algorithms and Applications. Prentice Hall, New York, NY. [2] Ahuja, R.K., J.B. Orlin, C. Stein, and R.E. Tarjan (1994). Improved Algorithms for Bipartite Network Flow. SIAM J. on Computing, 23, 906–933. [3] Arai, T., S. Ueno, and Y. Kajitani (1993). Generalization of a Theorem on the Parametric Maximum Flow Problem. Discrete Applied Mathematics, 41, 69–74. [4] Brumelle, S., D. Granot, and L. Liu (1995). An Extended Economic Selection Problem. Manuscript, UBC Faculty of Commerce, Vancouver, BC. [5] Brumelle, S., D. Granot, and L. Liu (1995). Totally Ordered Optimal Solutions and Parametric Maximum Flows. Manuscript, UBC Faculty of Commerce, Vancouver, BC. [6] Chen, Y.L. (1994). Scheduling Jobs to Minimize Total Cost. European J. of Operational Research, 74, 111–119. [7] Dinkelbach, W. (1967). On Nonlinear Fractional Programming. Management Science, 13, 492– 498. [8] Federgruen, A., and H. Groenevelt (1986). Preemptive Scheduling of Uniform Machines by Ordinary Network Flow Techniques. Management Science, 32, 341–349. [9] Fujishige, S. (1991). Submodular Functions and Optimization, Annals of Discrete Mathematics, Vol. 47, North-Holland. [10] Gallo, G., M.D. Grigoriadis, and R.E. Tarjan (1989). A Fast Parametric Maximum-Flow Algorithm and Applications. SIAM J. Comput. 18, 30–55. [11] Garey, M.R., and D.S. Johnson (1979). Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, New York. [12] Goldberg, A.V., and R.E. Tarjan (1988). A New Approach to the Maximum Flow Problem. JACM 35, no. 4, 921–940. 19

[13] Gusfield, D. and C. Martel (1992). A Fast Algorithm for the Generalized Parametric Minimum Cut Problem and Applications. Algorithmica, 7, 499–519. [14] Hall, N.G. and R.V. Vohra (1993). Towards Equitable Distribution via Proportional Equity Constraints. Math. Prog., 58, 287–294. [15] Hochbaum, D.S. and S-P. Hong (1995). About Strongly Polynomial Time Algorithms for Quadratic Optimization over Submodular Constraints. Math. Prog., 69, 269–309. [16] Hoffman, A. and J. Rivlin (1967). When is a Team “Mathematically” Eliminated. In Princeton Symposium on Math Programming, ed. by H.W. Kuhn, Princeton University Press, Princeton, NJ. [17] Horn, W.A. (1974). Some Simple Scheduling Algorithms. Naval Research Logistics Quarterly, 21, 177–185. [18] Irving, R.W., P. Leather, and D. Gusfield (1987). An Efficient Algorithm for the “Optimal” Stable Marriage. JACM, 34, 532–543. [19] Iwata, S., T. Matsui, and S.T. McCormick (1996). A Fast Bipartite Network Flow Algorithm for Selective Assembly. UBC Faculty of Commerce Working Paper MSC-96-001, Vancouver, BC, to appear in OR Letters. [20] Lawler, E.L., J.K. Lenstra, A.H.G. Rinooy Kan and D.B. Shmoys (1993). Sequencing and Scheduling: Algorithms and Complexity. In Handbooks in Operations Research and Management Science, Volume 4, Chapter 9, 445–522, ed. by S.C. Graves, A.H.G. Rinooy Kan and P. Zipkin, North Holland, Amsterdam. [21] McCormick, S.T. and L. Liu (1993). An Experimental Implementation of the Dual Cancel and Tighten Algorithm for Minimum Cost Network Flow. In Network Flows and Matching, D.S. Johnson and C.S McGeoch, eds., American Mathematical Society DIMACS Series in Discrete Mathematics and Theoretical Computer Science, Volume 12, 247–266. [22] McCormick, S.T., J. Sahni, and T. Stewart (1997). A Computational Study of Algorithms for Finding Ultimate Contours of Open-Pit Mines. In preparation. [23] Megiddo, N. (1983). Applying Parallel Computation Algorithms in the Design of Serial Algorithms. JACM 30, 852–865. [24] Radzik, T. (1992). Newton’s Method for Fractional Combinatorial Optimization. Proc. 33rd IEEE Annual Symp. of Foundations of Computer Science, 659–669; see also “Parametric Flows, Weighted Means of Cuts, and Fractional Combinatorial Optimization” in Complexity in Numerical Optimization, World Scientific (1993), ed. by P. Pardalos, 351–386. [25] Schwartz, B. (1966). Possible Winners in Partially Completed Tournaments. SIAM Review, 8, 302–308. [26] Serafini, P. (1996). Scheduling Jobs on Several Machines with the Job Splitting Property. Operations Research, 44, 617–628. [27] Topkis, Donald M. (1978). Minimizing a Submodular Function on a Lattice. Operations Research, 26, 305–321.

20

Suggest Documents