Scheduling with Release Times and Deadlines on a Minimum Number of Machines
Mark Cieliebak , Thomas Erlebach , Fabian Hennecke , Birgitta Weber , Peter Widmayer
Institute of Theoretical Computer Science, ETH Zurich, cielieba|hennecke|weberb|widmayer @inf.ethz.ch
Computer Engineering and Networks Laboratory (TIK), ETH Zurich,
[email protected] Abstract. In this paper we investigate a scheduling problem motivated by a variety of practical applications: We are given jobs with integer release times, deadlines, and processing times. The goal is to find a non-preemptive schedule such that all jobs meet their deadlines and the number of machines used to process all jobs is minimum. If all jobs have equal release times and equal deadlines, we have the classical bin packing problem. Therefore, we are interested in solving this problem for instances where the window (interval from release time to deadline) is just slightly larger than the processing time. For the case that this difference is at most , we present a polynomial-complete already if differences up to time algorithm, on the other hand we show that the problem becomes are allowed. Moreover, we present two dynamic programs and several approximation algorithms. We explain how filling machine by machine leads to an -approximation and develop a greedy approximation algorithm which has a constant approximation ratio if the problem instance is restricted. For general instances we show that its solution can differ from the optimum solution by a factor of . Finally, we present constant approximation algorithms for instances with restrictions on the release times and deadlines.
Keywords: Scheduling, Algorithms and Data Structures
1 Introduction In this paper, we study the S CHEDULING WITH R ELEASE T IMES AND D EADLINES ON A M INIMUM N UMBER OF M ACHINES (SRDM) problem: Given jobs, each associated with a release time, a deadline, and a processing time, what is the minimum number of identical machines that a non-preemptive schedule needs such that all jobs meet their deadlines? The task to process all given jobs within certain time frames and minimise the number of machines occurs in a variety of practical applications including train scheduling [6], scheduling of maintenance work for trains in a service station, and runway scheduling. If the release times for all jobs are equal and so are the deadlines, SRDM is the classical bin packing problem [5, 9]. On the other hand, if the difference between the deadline and release time of every job is exactly its processing time, the number of needed machines is obviously the same as the clique number of the corresponding interval graph. The choice of a schedule implies for each job that we consider shifting an interval (for the processing time) into a position within a larger interval (from release time to deadline). Therefore, we use the notation of interval graphs and shiftable intervals to model the problem.
Model and Notation Each job of the input is associated with a release time , a deadline , and a processing time , where , , and are integers and . The interval is the window in
!" #$&%('
) +*,.-
0
/"
which an interval of size will be placed. If the size of the window is equal to the job occupies the whole window. If for all jobs the size of the window is exactly its processing time they represent a finite collection of intervals and can be interpreted as an interval graph . Every interval in is mapped to a distinct node in . Two nodes in are adjacent if and only if their corresponding intervals overlap. Since one machine can process only one job at a time, the maximum number of overlapping intervals corresponds to the minimum number of machines needed to process all jobs. This value is equal to the size of a maximum clique of the interval graph and can be determined in time [10] where is the number of intervals. The maximum number of overlapping intervals is refered to as height of and is denoted by . If the window of a job is greater than its processing time the job cannot be represented by an interval but by a shiftable interval . The difference is the slack and corresponds to the maximum amount the interval of size can be moved within its window. The flexibility of an interval in , to be used in future considerations. its window is described by the ratio For every interval we have to select a legitimate position within its window. This position is described . The processing interval according to a placement is denoted by by a placement . The range within the window, that the interval will occupy for any placement, is the core. If the slack is less than the processing time the core is the interval , otherwise the core is empty. For an -tuple of shiftable intervals, defines a placement, where the value is the placement of the shiftable interval . Both and together describe a for finite collection of intervals . Again the height of can be determined easily. Our goal is to find a placement such than is minimum. We denote the minimum height over all placements by . The S CHEDULING WITH R ELEASE T IMES AND D EADLINES ON A M INIMUM N UMBER OF M A CHINES (SRDM) problem is defined as follows:
1
1
1
> 30 -
24357698;: 35n - y| £ > 35n Example 1. We are given three shiftable intervals ? @¾BF'.*`¿* G , ? @¾B *`§*`¿bG , and ?µÀk@RB Á*wÂ* G . The shiftable intervals ? and ? have slack 1. The problem is to decide if it is possible to schedule all jobs on one machine. A maximum flow of size is depicted by the thick gray edges.
4
£
ÃÅÄ
-Hardness of SRDM with Maximum Slack Æ
IT 3 æ -
The start points of the literals are defined either by a generator or by a copy gadget. The value is . To not exceed this value, at most of the literals can be shifted to the right (FALSE). Hence, at least one literal must not be shifted - and represents a TRUE literal. A clause gadget has its left starting point at an appropriate position to be defined later. The value has to be the same value for all clauses in . Copy Gadget for Values of Literals: In a literal can occur more than once. The construction of has to ensure that all shiftable intervals representing the same literal have the same value. A copy gadget is displayed in Figure 4 and 5 and has the following form:
¿
ç]è
é C @ 3HØ BÝç*¹ç Q Ø BÝç Q f 3à F* · -
æ
.è
Î
Î
n
f ¹* TÙ ç Ú Q &ç= ? @A for all integers :9 and inductively define 9D 6B7 C9 F6B7 F2 F2 G7 H2 :9 BI %7 G7 H2
7 2E J 2 9 BI 2 F6B7
7 G7 2
7
v} «
recursion above. So we have the following
35-
Iv this subset can be partitioned into at most 35n{- sets *_^_^_^+* ® such that the height of V} is 1. By s } . Using an averaging argument we know that for the placement s there exists one ÐmY³[µx
*_^_^_^]*iwa with F3 *ij-o# £!f . The number · of elements in > must be at least £df . Consider a placement of the shiftable intervals in with F3 -@x . W.l.o.g. assume the elements in are sorted such that +}~, f 8} (v} ¯ } f } ¯ for z½@px
*_^_^_^]*`·gox . We consider Ì Ì Ì the points KZ@( fP f #| I and ´@( f y\ fÔI Ì . By definition of at least £ intervals £ Lj . Since all windows in contain we know can be placed between K and , hence ,KÕ#Õ. %\#| Ì . We obtain £ Li~k< y Koy\ Ì f«I Ì |3F "I - oI Ì f|I y L]I ^]*iJLk » do 3 0 *ij> JXNR @ N~[ 53 n-Ef×x n
Theorem 9. For a SRDM instance , such that ¤L .
s
0 ? @B5D*,E*FHG ´ X
with equal processing times the GBF algorithm returns a placement
> @ > 30 > > 3 -¶@ > x
0 > 3q[;? c a -¶@ > > 3 V*iE-
Proof. Let be the intervals placed by the GBF algorithm. Denote . Consider the first shiftable interval in whose placement increases the height to . Denote by `<X the set of all ~ and ` for intervals which have been placed so far, not including , i.e. F` all placements . The size of ’s window is K . Figure 8 shows the height function F` and illustrates the situation before processing .
n
?
¥§¦ ¨ ¦© ¨
@±4$
?
í
í ª
?
¥G¦ ©
¬
Fig. 8. Interference range of « .
¥G¦
¬
¬e
Fig. 9. Peaks within the window of « .
) +*,.-
Let ` ®eX¯` denote the subset of intervals which have a non-empty intersection with and denote . Since the size of the windows of all intervals in ` ® is not greater than K , even by ° the work of ` ® in an optimal solution has to place them between K and ,K . It follows ²5± ³ . To obtain a lower bound on ° , we construct a set of intervals `® ® which has the following properties: the height of ` ® ® is , any placement of increases the height to , and the work of ` ® ® is minimal. Since the placement of increases the height, there is no range of length between and with height at . Hence, there must be peaks of height at least every points within the interval most & ³ (Figure 9). Thus ` ® ® consists of ´ ¶µ and width and we get a lower $ ¸· peaks of height bound ° ×x ?
#
J
?
;3 > ³x]- q
gf
>
> 35n-{# À
! "x ) +*, W > @ S W S S Kx oy ;3 4$x]-jfN/³x7y´3 tf\x]- q > 35n-# ° # ´Z 3 > \x]- # > «x ¿ K D¿ 3 ´¾fKx]¤ > "x
since ´ is a positive integer. The idea of the proof above can be extended to instances with different processing times by constructand calculating their work as if they were of size . Then we ing the peaks of intervals of size & & ³ ³ · · g F i j µ µ need ´ peaks of height and we get a lower bound on the work $ $ giFj giFj
@
W ¯ SW W S S
#
j ×x
12
3 > \x]- i
#
(y3 \x L ~ ^ ¿ K ¿D3 ´RfKx]- Gw*_^_^_^BF'.*,µr*F~r.Gi- > the Divide Best Fit algorithm re> 35n - y 3uÂfbá Áµ-L 53 n{- fKxø÷(¦D^¨§îL 35n{-EfKx .
Theorem 13. For a SRDM instance turns a placement , such that
s
Obviously, the Divide Best Fit algorithm can be adapted to solve problem instances where the release times differ and all deadlines are equal. Window Graph Is a Clique Next we want to consider problem instances of SRDM where all windows have a common point . This generalises the problem discussed in the previous section. The input is given by a tuple with for . We partition into three disjoint subsets ³ , »ù and »ú . The set »³ contains all members of whose cores do not contain and for which the part of the window left of is larger than the part to the right of ( ). Similarly, . The the set »ù contains all members of whose cores do not contain and for which remaining shiftable intervals are in ú and have cores overlapping in . We transform ù into ùû by setting all release times to , and B³ into ³§û by setting all deadlines to . Now we use the Divide Best Fit algorithm to place ³§û and ù»û independently. Finally, we place the intervals in ú arbitrarily. To analyse the approximation ratio of the described algorithm, we first show that the height of the optimum solution for ùû is at most three times the optimal height for ù .
3iB5 *, F* Gw*_^_^_^+*]B5vr*,br*F~rDGin n n n ?} n n n n
]}y« \µ}
n
xJy«z½y« n ?} n ½7µ}H%|b}TJ n kN
}y\µ}D n n n n n n n > > Lemma 3. The minimum height of n ù»û can be bounded by 35n ù»û -y|¿ 35n»ù- . n ù such that the resulting placement is feasible for the Proof. We change the optimum placement for restricted instance n ùû and its height only increases by a factor of three. We change the placements for all shiftable intervals, which are placed left of . If an interval is placed completely to the left of we replace it with its mirror image where the mirror is at . This is feasible since the part of the window to the right of is larger than its remaining part. This operation, carried out for all intervals to which it applies, increases the height of the placement by a factor of at most . If the interval is placed such that it contains , it is shifted to the right of . This shifting can increase the height > n ù- . We have a new placement where all intervals are placed to the right of and its height by another 35» is at most ¤ ¿ Li > 35»n ù- . The analogous result holds for n ³Gû , too. The height of the optimal placement for n is at least the minimum height for every single set B n ³ , »n ù , and Uë> ú . Using Theorem 13, the placement computed by the algorithm for n ù»û has height at most 3uÂü f á Á)- L¿ 35n ù -f|x , and similarly for n ³Gû . Since the domains of n ³§û and n ù»û are non-overlapping, the height of the overall solution computed by the algorithm is at most 3uÂb f á ÁbB- L#W[+¿w > 35ën ³-w*`¿ > 35»n ùH-`a{fKx½f »n ú y 3 ¿gf«ð¿ á ÁbB- L, > 35n-hfKÈx ÷xT¦D^¨¤ > 35n-hfKx . This gives the following theorem.
n
3 g¿ fZ¿ Áb-Ý > 35n- f×x
Theorem 14. For SRDM instances where the window graph is a clique, there exists an approximation ðá algorithm such that the resulting height is at most . 16
7 Conclusion We studied the SRDM problem, a scheduling problem motivated by a variety of practical applications. We presented positive and negative results, but there are still open questions: – Is there an approximation algorithm with a constant approximation ratio for arbitrary problem instances? - approx– Is there an asymptotic PTAS for the SRDM problem? Even if we cannot hope for a imation algorithm, an asymptotic PTAS like the one for bin packing [8] could still exist.
3 L©
-
Acknowledgement We would like to thank Riko Jacob for many helpful comments and suggestions.
References 1. A. Bar-Noy, R. Bar-Yehuda, A. Freund, J.S. Naor, and B. Schieber. A unified approach to approximating resource allocation and scheduling. Journal of the ACM, 48(5):1069–1090, 2001. 2. A. Bar-Noy, S. Guha, J.S. Naor, and B. Schieber. Approximating the throughput of multiple machines in real-time scheduling. SIAM Journal on Computing, 31(2):331–352, 2001. 3. P. Berman and B. DasGupta. Multi-phase algorithms for throughput maximization for real-time scheduling. Journal of Combinatorial Optimization, 4(3):307–323, 2000. 4. J. Chuzhoy, R. Ostrovsky, and Y. Rabani. Approximation algorithms for the job interval selection problem and related scheduling problems. In IEEE Symposium on Foundations of Computer Science, pages 348–356, 2001. 5. E.G. Coffman Jr., M.R. Garey, and D.S. Johnson. Approximation algorithms for bin packing: A survey. In D. Hochbaum, editor, Approximation Algorithms for NP-hard Problems. PWS, 1996. 6. S. Eidenbenz, A. Pagourtzis, and P. Widmayer. Flexible train rostering. In International Symposium on Algorithms and Computation (ISAAC). Springer-Verlag LNCS, 2003. to appear. 7. T. Erlebach and F.C.R. Spieksma. Interval selection: Applications, algorithms, and lower bounds. Journal of Algorithms, 46(1):27–53, 2003. 8. W. Fernandez de la Vega and G.S. Lueker. Bin packing can be solved within 1+ ý in linear time. Combinatorica, 1(4):349– 355, 1981. 9. M.R. Garey and D.S. Johnson. Computers and Intractability. W.H. Freeman and Company, New York, 1979. 10. F. Gavril. Algorithms for minimum coloring, maximum cliques, and maximum independent set of a chordal graph. SIAM Journal on Computing, 1(2):180–187, 1972. 11. E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan, and D.B. Shmoys. Sequencing and scheduling: Algorithms and complexity. In S.C Graves, A.H.G Rinnooy Kan, and P. Zipkin, editors, Handbooks in Operations Research and Management Science, volume 4, pages 445–522. North-Holland, 1993. 12. F. Malucelli and S. Nicoloso. Shiftable interval graphs. In Proc. 6th International Conference on Graph Theory, 2000. 13. F.C.R. Spieksma. Approximating an interval scheduling problem. In Proc. 1st International Workshop on Approximation Algorithms for Combinatorial Optimization Problems (APPROX98), pages 169–180. Springer-Verlag LNCS 1444, 1998.
17