European Journal of Operational Research 59 (1992) 333-336 North-Holland
333
Theory and Methodology
A note on sequencing jobs with deadlines problem * Kxzysztof Dudzifiski and Krzysztof Szkatuta Systems Research Institute, Polish Academy of Sciences, Newelska 6, 01-447 Warsaw, Poland Received May 1990; Revised September 1990
Abstract: Two simple heuristic algorithms for sequencing jobs with deadlines problem are proposed. Computational results are reported. The algorithms are compared with the greedy algorithm recently presented by H.I. Stern and Z. Avivi in 1990. Keywords: Job scheduling; integer programming; heuristics 1. Introduction The sequencing jobs with deadlines problem is to maximize the weighted number of jobs processed before their deadlines. Each job j ( j = 1. . . . . n) is to be processed on a single machine. It requires a processing time tj and has a deadline dj. If the job is processed before its deadline a profit pj is earned. The objective is to maximize the total profit. Provided that dl <_d2 <_ "'"
(1)
the problem can be formulated as a 0-1 programming problem, Lawler and Moore [4] (SJD) max
~ pjxj
(2)
j=l i
s.t.
~ tjxj
i= l ..... n,
(3)
deadline. Jobs on time should be processed according to (1), while the late jobs may be processed in an arbitrary order. Without loss of generality we assume
OO,
j=l
. . . . . n.
SJD is an NP-hard problem, however it can be solved in a pseudopolynomial time by the dynamic programming method of Sahni [6]. In this paper we are interested in a very simple heuristic algorithms. To compute a heuristic solution to the problem in form (2)-(4) at least preprocessing time 0(n log n) is required to sort jobs according to (1). In Section 2 we present two heuristic algorithms H1 and H2 with complexity O(n) (the p r e p r o c e s s i n g time is not included) and O(n log n), respectively. In Section 3 computational experience is reported and our algorithms are compared with the O(n 2) greedy algorithm presented by Stern and Avivi [7].
j~l
xj=Oor 1, j = l . . . . . n,
(4)
2. Heuristic algorithms where Xy = 1 only if job j is processed before its * Research supported by CPBP 02.15.
We present a threshold algorithm H1 and algorithm H2 based on the linear programming relax-
0377-2217/92/$05.00 © 1992 - Elsevier Science Publishers B.V. All rights reserved
K. Dudzinsky, K~ Szkatula / A note on sequencingjobs with deadlinesproblem
334
ation.
We assume that jobs are ordered according
Algorithm HI.
Step 1. Step 2.
Algorithm H2.
Step 1.
to (1).
Select a threshold value A between minimum and maximum value of ratios pjtj. For i = 1. . . . , n, set 2~i = 1 if pi/ti >__A and the resulting solution is feasible i.e.
Step
i-1
Step
Y'~ tj2j + t i < di, j=l
Compute an optimal solution $ to LP relaxation of the problem (where in place of (4) we require 0 _ A and the resulting solution is feasible, i.e.,
and set 2i = 0 otherwise.
k
tj2y+ti
Generally A is not known a priori, but can often be calculated analytically for a class of probabilistic SJD problems. If Pi, tj are realizations of random variables and their distribution functions, the deadlines d r satisfy some assumptions (see Szkatu~a [8] for details), and /~n is a solution of the equation
~
\ pj/tj>~An
j= ~tiXY>-i}l
(5)
j=l
E(
Step 1 has complexity O(n log n) if we use algorithm of Potts and van Wassenhove [5] or Dudzifiski and walukiewicz [2,3] (see Dudzifiski [1] for implementation details). Step 2 is O(n) and Step 3 can be implemented in O(n) if it is performed for i from n down to 1 and the above inequalities are expressed as
ti+
n
f o r k = / . . . . . n.
j= l,j4:i
ti)=d .,
(6)
!
Finally, algorithm H2 has complexity O(n log n). The threshold value defined in Step 2 is suggested by our computational experience. Additionally, in algorithm H2 the upper bound of the LP relaxation is computed. Therefore, we get a bound on the relative error of any heuristic algorithm (v* -
<_ ( v -
)lV
where v* is the value of the optimal solution, t3 is a value of a heuristic solution and ~ of the LP relaxation.
then the threshold solution for A = A, is asymptotically optimal in the average case, i.e., 3. Computational results
lirn Prob{lim
(v*/On):
1} = 1
and (5) is satisfied, where v* and z3n are the optimal and threshold solution values for the problem of size n. In practice, for a given instance of the problem, the best threshold solution of several different values A close to An (both less and greater than A,) should be updated.
We consider uncorrelated problems when profits pj and processing times tj are generated as real numbers randomly in (0, 1] with a uniform distribution function and correlated problems considered by Stern and Avivi [7], when ti are random integers between 5 and 45, and pj = 11.08ti - 0.15t~.
K. Dudzinsky, K. Szkatula / A note on sequencingjobs with deadlinesproblem
335
Table 1 Uncorrelated problems n
Mean relative error bound [%]
Mean running time [s]
10 20 50 100 200 500 1000 2000 5000 10000
H1
H2
greedy
H1
H2
greedy
0.01 0.03 0.06 0.10 0.19 0.50 1.01 2.00 5.09 10.15
0.01 0.03 0.06 0.16 0.35 0.95 2.05 4.33 11.79 24.89
0.01 0.03 0.13 0.43 1.53 8.77 33.93 133.65 * *
14.7203 6.8063 3.8576 2.6872 1.5784 1.1338 0.5732 0.4233 0.1564 0.1566
11.7185 4.4555 1.5752 0.6350 0.1878 0.0983 0.0401 0.0269 0.0096 0.0040
10.4778 4.3123 1.3515 0.4258 0.1183 0.0729 0.0383 0.0177 , ,
In both cases d e a d l i n e dates d i were g e n e r a t e d uniformly in the interval
w h e r e 0 < o~ < / 3 < 1. W e c h o o s e a = 0.2 a n d / 3 = 0.4 as the hardest case s u g g e s t e d by Potts and van W a s s e n h o v e [5]. T h e solution o f (6) for uncorrelated p r o b l e m s is
An
= [ (Fl/(6dn)) 1/2
if d,, < ~n,
1.5 - 3 d i n
otherwise,
We apply algorithm H1 for A = An and for four values A obtained by replacing in the above formulas d , - for uncorrelated problems by:
dn(l +rl-1/2),
dn(l_rl
dn(1-n-1/3),
dn(1-n 1/4),
1/2),
- for correlated problems by:
d.(l+n dn(1
1/4),
+ r/-1/2),
dn(l+n
an(1
1/3),
- H-I/2).
In Tables 1 and 2 the results of 10 test problems of each size are summarized. Algorithms H1, H2 and the greedy algorithm A1 with order R2 of [7] were coded in Pascal and run on the I B M / A T compatible computer with a 10 MHz
and for correlated problems A,, = 11.08 - 0.15(25 + 80dn/n) 1/2.
Table 2 Correlated problems n
10 20 50 100 200 500 1000 2000 5000 10000
Mean running time [s]
Mean relative error bound [%]
H1
H2
greedy
HI
H2
greedy
0.01 0.02 0.06 0.11 0.22 0.55 1.11 2.21 5.49 10.96
0.01 0.04 0.06 0.15 0.30 0.79 1.61 3.28 7.95 15.95
0.01 0.03 0.14 0.45 1.57 9.00 35.08 138.16 * ,
13.1879 7.5939 3.3549 1.6587 1.3020 0.6260 0.6125 0.3867 0.3206 0.3755
11.8489 8.8963 3.0241 1.1064 1.0074 0.5780 0.3205 0.3036 0.3321 0.2917
11.8489 7.9054 311413 1.1621 0.9590 0.2227 0.0796 0.0569 , ,
336
K. Dudzinsky, K. Szkatula / A note on sequencing jobs with deadlines problem
clock and a numeric co-processor. We report the mean running times (in seconds, no preprocessing time is included) and the mean relative error bounds (in percents). Our results show that all algorithms behave similarly both for uncorrelated and correlated problems for small sizes, say up to 100-200. For larger sizes HI and H2 have much lower running times than the greedy algorithm. For uncorrelated problems H2 and the greedy algorithm give similar and better results than H1. Correlated problems are harder for H1 and H2, but for n > 2000 the running time of the greedy algorithm exceeds the assumed time limit. The presented algorithms H1 and H2 are of low computational complexity, and high accuracy increasing with the problem size. The threshold algorithm H1 is very easy to implement, even by hand as it is the case in [7].
References [1] Dudzifiski, K., "A heuristic algorithm for sequencing jobs with deadlines", Methods of Operations Research 62 (1990) 191-200.
[2] Dudzifiski, K., and Walukiewicz, S., "A knapsack approach to sequencing jobs with deadlines", Research Report ZPM-4-49/84, Systems Research Institute, Polish Academy of Sciences, 1984. [3] Dudzifiski, K., and Walukiewicz, S., "Exact methods for the knapsack problem and its generalizations", European Journal of Operational Research 28 (1987) 3-21. [4] Lawler, E.L., and Moore, J.M., "A functional equation and its application to resource allocation and sequencing problems", Management Science 16 (1969) 77-84. [5] Potts, C.N., and Van Wassenhove, L.N., "Algorithms for scheduling a single machine to minimize the weighted number of late jobs", Management Science 34 (1988) 843858. [6] Sahni, S.K., "Algorithms for scheduling independent jobs', Journal of ACM 23 (1976) 116-127. [7] Stern, H.I., and Avivi, Z., "The selection and scheduling of textile orders with due dates", European Journal of Operational Research 44 (1990) 11- 16. [8] Szkatu|a, K., "Probabilistic analysis of the sequencing jobs with deadlines problem and the threshold algorithm", in: G. Menga and V. Kempe (eds.), Proceedings of the Workshop on Informatics in Industrial Automation, Central Institute of Cybernetics and Information Processes, Berlin, 1989, 113-124.