Dedicated To The Memory of Gene Lawler
Dedicated To The Memory of Gene Lawler
Dedicated To The Memory of Gene Lawler
Key words. scheduling, approximation algorithm, worst-case analysis, total flow time, release
time, single machine
PII. S0097539796305778
∗ Received by the editors June 12, 1996; accepted for publication (in revised form) May 2, 1997;
published electronically March 19, 1999. A preliminary version of this paper appeared in Proc. 28th
Annual ACM Symp. on the Theory of Computing, 1997.
http://www.siam.org/journals/sicomp/28-4/30577.html
† Institut für Statistik, Ökonometrie und Operations Research, Universitätsstrasse 15, Universität
many ([email protected]). This research was supported by DAAD (German Academic Exchange
Service).
§ TU Graz, Institut für Mathematik B, Steyrergasse 30, A-8010 Graz, Austria (gwoegi@
opt.math.tu-graz.ac.at). The research of this author was supported by a research fellowship of the
Euler Institute for Discrete Mathematics and Its Applications and by START project Y43-MAT of
the Austrian Ministry of Science.
1155
1156 H. KELLERER, T. TAUTENHAHN, AND G. WOEGINGER
P
Dessouky and Deogun [8]) developed branch-and-bound algorithms for 1|ri | Fi .
Other papers (Bianco and Ricciardelli [3], Dyer and Wolsey [10],PHariri and Potts
[13], and Posner [18]) gave branch-and-bound algorithms for 1|ri | wi Fi , the prob-
lem of minimizing the total weighted flow time. Gazmuri [12] designed asymptotically
optimal algorithms for minimizing total flow time under very general probability dis-
tributions of the job data.
P
The preemptive version 1|pmtn, ri | Fi of the problem can be solved in poly-
nomial time by the shortest remaining processing time (SRPT) rule (see, e.g., Baker
[2]). The objective value of the optimum preemptive schedule clearly is a lower bound
on the objective value of the nonpreemptive problem. Ahmadi P and Bagchi [1] have
shown that it dominates six other lower bounds for 1|ri | Fi that had been used in
the scheduling literature.
New results. The results of this paper are as follows. First we present a
polynomial-time
√ approximation algorithm with worst-case performance guarantee of
O( n). The algorithm starts from an optimum solution of the corresponding pre-
emptive instance. Then the preemptive schedule is transformed step by step into a
nonpreemptive one by successively resolving the preemptions. Our proof also demon-
strates that for any instance the minimum
√ total flow time of an optimum nonpreemp-
tive schedule is at most a factor of n larger than the corresponding minimum total
flow time of the optimum preemptive schedule.
MINIMIZING THE TOTAL FLOW TIME 1157
J1 J2 J3 J4 J2 J1
-
J1 J2 J3 J4
-
2.1. How√to handle small subtrees. A subtree T (i) is called small if it con-
tains at most n jobs. In this case we use the following procedure to resolve the
preemptions of job Ji and of all jobs contained in T (i).
Procedure SmallSubtree(i).
Let Si = Si0 < Si1 < · · · < Sik denote the starting times of the jobs in
T (i) in the current preemptive schedule. Remove all jobs and reinsert
them without preemptions in the ordering Ji , Ji1 , Ji2 , . . . , Jik .
For an illustration, see Figure 1. It is easy to see that SmallSubtree(i) does not
decrease the starting time of any job. Hence, the resulting schedule still obeys all
release times. Completion times of jobs outside of T (i) are not changed, and the
√ times of jobs in T (i) are all increased by less than Ci − ri . Since there are
completion
at most n jobs in T (i),
√
(1) ∆small (i) = nFi
J1 J2 J3 J4 J1 J5 J6 J7 J8 J9 J10 J11
-
J2 J3 J4 J5 J6 J7 J8 J1 J9 J10 J11
-
t0 t1 t2 t3
Finally, observe that in the new schedule Ji is processed entirely after its completion
time in the old schedule.
2.3. How to handle fathers and sons. Procedure FatherSon(i, j) described
below may be applied only if the jobs Ji and Jj fulfill the following four conditions:
(C1) Jj is a son of Ji .
(C2) All sons of Ji in T (i) that lie to the right of Jj are leaves (i.e., jobs without
preemption). √
(C3) There are less than n jobs that lie to the right of Jj in T (i).
(C4) Just before executing FatherSon(i, j), job Ji is removed and rescheduled en-
tirely after its old completion time.
Condition (C4) may be fulfilled if Ji is rescheduled by LastRoot(i) or (as we will
see) if it is rescheduled by FatherSon(k, i), where k was the father of i at that time.
Condition (C4) has the following consequences: At the moment as SRPT decided to
start processing Jj instead of Ji , it did so because the remaining processing time of
Ji was larger than pj . Hence, the total time that Ji is processed during [Cj , Ci ] is
at least pj , and in case Ji is moved to some place after Ci , there is sufficient empty
space in [Cj , Ci ] to schedule all of Jj .
Procedure FatherSon(i, j).
All jobs that are processed during [Cj , Cj + pj ] are shifted to the
right until their processing is disjoint from [Cj , Cj + pj ]. If necessary,
also, some later jobs are shifted to the right but without changing
1160 H. KELLERER, T. TAUTENHAHN, AND G. WOEGINGER
J1 J2 J3 J4 J5 J6 J7 J2 J8 J1 J9 J1
-
J3 J4 J5 J6 J7 J2 J8 J9
-
rmnls(i∗ ) does not exist. In the latter case, all sons of Ji∗ are leaves
√ and, according
first phase, their number must be greater than n. In either case,
to the result of the √
there are at least n leaves that formerly were preempting Ji∗ , the father of Ji∗ ,
its grandfather, and so on—the whole chain of ancestors to the formerly “last root.”
Since the execution of the√step removes all preemptions from this chain of ancestors,
it turns all these at least n leaves into trivial out-trees.
In the second phase of the algorithm the step described above is repeated over
and
√ over until all preemption have been removed. Since every step produces √ at least
n new trivial out-trees, the second phase terminates after at most n steps. This
completes the description of our approximation algorithm. P
Theorem 2.3. The approximation algorithm √ described for the problem 1|ri | Fi
has a worst-case performance guarantee of O( n), and it can be implemented to run
in O(n3/2 ) time. Moreover, there √ exist instances for which the algorithm yields a
schedule whose objective value is Ω( n) from the optimum.
Proof. To analyze the worst-case behavior of the algorithm, we define job classes
S, L, and F. Class S contains the jobs Ji for which SmallSubtree(i) is executed, L the
jobs Ji for which LastRoot(i) is executed, and F the jobs Jj for which FatherSon(i, j)
is executed. Since every procedure removes all preemptions of the corresponding job, √
every job is contained in at most one of the classes S, L, and F. Moreover, |L| ≤ n
holds, since LastRoot(i)
√ is executed exactly once per step in the second phase, and
there are at most n steps.
The constructed nonpreemptive schedule has an objective value F H which satisfies
X X X
F H ≤ Fpmtn
∗
+ ∆small (i) + ∆last (i) + ∆f son (i)
i∈S i∈L i∈F
X√ n
∗
X 3 √ X X√
≤ Fpmtn + nFi + n pi + pj + n pi .
2 j=1
i∈S i∈L i∈F
∗ ∗
holds. Since Fpmtn√ ≤ F , this proves that the algorithm has a worst-case performance
guarantee of O( n).
What about the time complexity? The SRPT schedule can be computed in
O(n log n) time.
√ Procedure SmallSubtree needs to be run only on the vertices which
have
√ at most n descendants and whose father is either nonexistent or has more than
n descendants. All these vertices can be located in a single O(n) time traversal of
the forest. Hence, procedures SmallSubtree √ and FatherSon are both executed only
O(n) times and always consider only O( n) of the jobs. Procedure
√ LastRoot may
have to deal with up to O(n) jobs, but it is executed only O( n) times. Summarizing,
this yields a time complexity of
√ √
|S| · O( n) + |L| · O(n) + |F| · O( n) ≤ O(n3/2 ).
√
To see that the algorithm can be a factor of Ω( n) from the optimum, consider
the instance of n = x2 jobs: The jobs Ji with 1 ≤ i ≤ x − 1 all have processing
1162 H. KELLERER, T. TAUTENHAHN, AND G. WOEGINGER
J1 J1 J1 J1 J1
-
∗
optimum preemptive schedule: Fpmtn = Θ(n)
J1
-
optimum nonpreemptive schedule: F ∗ = Θ(n3/2 )
time 1/(x − 1) and release times 1 + (i − 1)/(x − 1). Job Jx has processing time x2
and release time 0. The remaining x2 − x jobs are dummy jobs, all with processing
times 0 and release times 0. The forest corresponding to the optimum preemptive
schedule has a single nontrivial tree with root Jx and J1 , . . . , Jx−1 as leaves. Hence,
our algorithm calls SmallSubtree(x) and produces a schedule with F H = x3 − x + 2,
∗
whereas F √ = x2 + 3 holds. As x tends to infinity, the ratio F H /F ∗ grows like
Θ(x) = Θ( n).
Corollary 2.4. For any instance √ of n jobs with release times on a single ma-
chine, the inequality F ∗ /Fpmtn
∗
≤ 52 n + 1 holds. Moreover, for√every sufficiently
large n, there exists an instance In such that F ∗ (In )/Fpmtn
∗
(In ) ≈ n.
Proof. The upper bound follows from (4) and F ≤ F H . The
∗
√ lower bound follows
from the instance with n jobs where r1 = 0, p1 = n, ri = (i − 1) n, and pi = ε = 1/n
∗
for i ≥ 2. Then Fpmtn ≈ n and F ∗ ≈ n3/2 holds. (See Figure 4.)
3. The nonapproximability result. In this section, we will prove that no
polynomial-time approximation algorithm for minimizing the total flow time may have
worst-case performance guarantee O(n1/2−ε ) for any ε > 0. The proof is done by a
reduction from the following version of the NP-complete numerical three-dimensional
matching problem (see Garey and Johnson [11]).
Problem. Numerical three-dimensional matching (N3DM).
Pk
Instance. Positive integers ai , bi , and ci , 1 ≤ i ≤ k, with i=1 (ai + bi + ci ) = kD.
Question. Do there exist permutations π, ψ such that ai + bπ(i) + cψ(i) = D holds
for all i?
This problem remains NP-complete even if the numbers ai , bi , and ci are encoded
in unary and the total size of the input is Θ(kD). In the following discussion, we will
make use of this unary encoding. Consider an arbitrary instance of N3DM and let
0 < ε < 21 be some real number. Define numbers
Next we will construct from the N3DM instance and from the number ε a correspond-
ing scheduling instance with n jobs. For every number ai in the N3DM instance, we
introduce a corresponding job with processing time 2r + ai , for every bi we introduce
a job with processing time 4r + bi , and for every ci we introduce a job with processing
time 8r + ci . These 3k jobs are called the big jobs and they are all released at time 0.
Moreover, there will be a number of so-called tiny jobs. Tiny jobs occur only in
groups denoted by G(t; ℓ), where t and ℓ are positive integers. A group G(t; ℓ) consists
MINIMIZING THE TOTAL FLOW TIME 1163
of ℓ tiny jobs with processing time 1/ℓ. They are released at the times t + i/ℓ for
i = 0, . . . , ℓ − 1. Note that it is possible to process all jobs in G(t; ℓ) in a feasible
way during the time interval [t, t + 1] with a total flow time of 1. We introduce the
following groups of tiny jobs.
(T1) For 1 ≤ i ≤ k, we introduce the group G((14r + D + 1)i − 1; rg).
(T2) For 1 ≤ i ≤ g, we introduce the group G((14r + D + 1)k + ri − 1; g).
In a pictorial setting, the groups of type (T1) occur at regular intervals from time
14r + D to time (14r + D + 1)k. They leave k holes, where each hole has length
14r + D. Similarly, the groups of type (T2) occur in a regular pattern after time
(14r + D + 1)k. They leave holes of size r − 1.
So far we have introduced 3k big jobs and k + 100rk 2 groups of tiny jobs, which
amounts to an overall number of
(5)
k k k
X X X 3
k + 100rk 2 + 3 (ai + 2r) + 2 (bi + 4r) + (ci + 8r) + (14r + D + 1)k(k − 1).
i=1 i=1 i=1
2
Pk
Since i=1 (ai + bi + ci ) = kD and since D ≤ r, one easily gets an upper bound of
Our second claim is that in S ∗ none of the big jobs are processed during the time
interval that starts with release of the last group of type (T1) and ends with release of
the last group of type (T2). Suppose otherwise. The groups of type (T2) are released
at regular intervals of length r. Since big jobs all have processing times of at least 2r,
scheduling a big job somewhere between these groups would shift the jobs of at least
one group by at least r time units away from their release time. This would yield a
total flow time of at least gr = 100r2 k 2 and proves the second claim.
Our third claim is that in S ∗ one of the big jobs is processed after the last group
of tiny jobs. Suppose otherwise. There are two types of holes that are left free by the
tiny jobs for processing the big jobs: k holes of length 14r + D and 100rk 2 holes of
size r − 1. Since big jobs all have processing times of at least 2r, they must be packed
into the holes of size 14r + D ≤ 15r. Since two jobs corresponding to the numbers ci
and cj have total processing time at least 16r, every such hole must contain exactly
one job corresponding to some ci . By analogous arguments, we determine that every
hole of size 14r +D must contain exactly one job corresponding to some ai , bj , and ch ,
respectively. This implies that the corresponding three numbers fulfill ai +bj +ch ≤ D,
which in turn yields ai + bj + ch = D (since the total sum of these 3k numbers is
kD and the total size of the holes is kD). Hence, the N3DM instance would have a
solution; this contradiction shows that our third claim holds true.
Finally, observe that the last group of tiny jobs is processed at time t = (14r +
D + 1)k + 100r2 k 2 − 1. Hence, the big job that is processed after this last group has
a completion time of at least 100r2 k 2 , and since its release time is zero, its flow time
is at least 100r2 k 2 . This final contradiction completes the proof of the lemma.
Theorem 3.3. For all 0 < ε < 12 and 0 < α < 1, there does not exist a
polynomial-time approximation algorithm for the minimum total flow time problem
with worst-case approximation guarantee αn1/2−ε unless P = N P .
Proof. Suppose such an approximation algorithm H would exist for some fixed
0 < ε < 21 and 0 < α < 1. Take an instance of N3DM that is encoded in unary, and
perform the above construction. Since the instance is encoded in unary, the size of
the resulting scheduling instance is polynomial in the size of the N3DM instance.
Then apply algorithm H to the scheduling instance. In case the N3DM instance
has a solution, Lemma 3.1 and the worst-case performance guarantee of H imply that
r
F H ≤ αn1/2−ε · F ∗ < · 200rk 2 = 100r2 k 2 .
2
In case the N3DM instance does not have a solution, Lemma 3.2 implies that
F H ≥ F ∗ ≥ 100r2 k 2
holds. Hence, with the help of algorithm H we could distinguish between these two
possibilities in polynomial time, which would imply P = N P .
4. Concluding remarks. In this paper we investigated the problem of min-
imizing total flow time on a single machine. For this NP-complete problem, only
approximation algorithms with worst-case bounds of Ω(n) were known up to now.
We presented the first approximation algorithm with sublinear√ worst-case perfor-
mance guarantee. The algorithm has a tight worst-case of O( n). It is based on a
resolution of the interrupted jobs in the corresponding optimum preemptive sched-
ule. Moreover, we derived a lower bound on the worst-case performance guarantee
of polynomial-time approximation algorithms for this problem. We proved that no
MINIMIZING THE TOTAL FLOW TIME 1165
REFERENCES
[1] R.H. Ahmadi and U. Bagchi, Lower bounds for single-machine scheduling problems, Naval
Res. Logist., 37 (1990), pp. 967–979.
[2] K.R. Baker, Introduction to Sequencing and Scheduling, John Wiley, New York, 1974.
[3] L. Bianco and S. Ricciardelli, Scheduling of a single machine to minimize total weighted
completion time subject to release dates, Naval Res. Logist., 29 (1982), pp. 151–167.
[4] R. Chandra, On n|1|F dynamic deterministic problems, Naval Res. Logist., 26 (1979), pp.
537–544.
[5] C. Chu, Efficient heuristics to minimize total flow time with release dates, Oper. Res. Lett.,
12 (1992), pp. 321–330.
[6] C. Chu, A branch-and-bound algorithm to minimize total flow time with unequal release dates,
Naval Res. Logist., 39 (1992), pp. 859–875.
[7] J.S. Deogun, On scheduling with ready times to minimize mean flow time, Comput. J., 26
(1983), pp. 320–328.
[8] M.I. Dessouky and J.S. Deogun, Sequencing jobs with unequal ready times to minimize mean
flow time, SIAM J. Comput., 10 (1981), pp. 192–202.
[9] J. Du, J.Y.T. Leung, and G.H. Young, Minimizing mean flow time with release time con-
straint, Theoret. Comput. Sci., 75 (1990), pp. 347–355.
[10] M.E. Dyer and L.A. Wolsey, Formulating the single machine sequencing problem with release
dates as a mixed integer program, Discrete Appl. Math., 26 (1990), pp. 255–270.
[11] M.R. Garey and D.S. Johnson, Computers and Intractability, W. H. Freeman, San Francisco,
1979.
[12] P.G. Gazmuri, Probabilistic analysis of a machine scheduling problem, Math. Oper. Res., 10
(1985), pp. 328–339.
[13] A.M.A. Hariri and C.N. Potts, An algorithm for single machine sequencing with release
times to minimize total weighted completion time, Discrete Appl. Math., 5 (1983), pp.
99–109.
[14] J. Labetoulle, E.L. Lawler, J.K. Lenstra, and A.H.G. Rinnooy Kan, Preemptive schedul-
ing of uniform machines subject to release dates, in Progress in Combinatorial Optimiza-
tion, Academic Press, New York, 1984, pp. 245–261.
1166 H. KELLERER, T. TAUTENHAHN, AND G. WOEGINGER
[15] J.K. Lenstra, A.H.G. Rinnooy Kan, and P. Brucker, Complexity of machine scheduling
problems, Ann. Discrete Math., 1 (1977), pp. 343–362.
[16] S. Leonardi and D. Raz, Approximating total flow time on parallel machines, in Proc. 29th
Annual ACM Symposium on the Theory of Computing, El Paso, TX, 1997.
[17] W. Mao and A. Rifkin, On-line algorithms for a single machine scheduling problem, in The
Impact of Emerging Technologies on Computer Science and Operations Research, S. Nash
and A. Sofer, eds., Kluwer Academic Publishers, Norwell, MA, 1995, pp. 157–173.
[18] M.E. Posner, Minimizing weighted completion times with deadlines, Oper. Res., 33 (1985),
pp. 562–574.
[19] W.E. Smith, Various optimizers for single-state production, Naval Res. Logist. Quart., 3
(1956), pp. 56–66.