Professional Documents
Culture Documents
Scheduling Problems and Solutions: Uwe Schwiegelshohn
Scheduling Problems and Solutions: Uwe Schwiegelshohn
Textbook
These slides are an extract from this book. They are to be used only
for this lecture and as a complement to the book.
Scheduling Problem
Constraints
Tasks
Time
Resources
(Jobs)
(Machines)
Objective(s)
Areas:
Manufacturing and production
Transportations and distribution
Information - processing
Example 1
Example 2
Gate Assignments at Airport
Example 3
different applications
multitasking environment
Tasks in a CPU
preemption
Quantities,
due dates
Material requirements,
planning,
capacity planning
Scheduling
constraints
Material requirements
Shop orders,
release dates
Scheduling
and
rescheduling
Schedule
performance
Detailed scheduling
Schedule
Dispatching
Shop
status
Shopfloor
management
Data collection
Job loading
Shopfloor
Status (history)
Forecasts
Data
Scheduling
Accept/
reject
(conditions)
Prices rules
Place order,
make reservations
Customer
Forecasting
Yield
management
Job Properties
: single machine
Pm : m identical machines in parallel
Qm : m machines in parallel with different speeds
Rm : m unrelated machines in parallel
Fm : flow shop with m machines in series
each job must be processed on each machine using the same route.
queues between the machines
FIFO queues, see also permutation flow shop
FJc
Om
preemption (prmp)
The processing of a job can be interrupted and later
resumed (on the same or another machine).
no wait (nwt)
A job is not allowed to wait between two successive executions
on different machines (Fm , FFc ).
recirculation (recirc)
Lateness of job j: Lj = Cj dj
The lateness may be positive or negative.
Tj
Uj
1
Cj
dj
Cj
dj
Cj
dj
Ej + Tj , wj Ej + wj Tj
objective (to be
minimized)
constraints,
processing,
characteristics
Examples:
Paper bag factory
Gate assignment
Tasks in a CPU
Traveling Salesman
FF3 | rj | wj Tj
Pm | rj , Mj | wj Tj
l | rj prmp | wj Cj
l | sjk | Cmax
Classes of Schedules
1
8
2
7
3
7
4
2
5
3
6
2
7
2
8
8
9 10
8 15
Precedence Constraints
Original Schedule
2
1
10
jobs
10
pj
15
= job completed
3
8
5
4
1
4
0
3
10
10
20
30
Precedence Constraints
Reduced Processing Time
2
1
10
jobs
10
pj
14
= job completed
5
4
1
4 6
0
9
3
10
10
20
30
Precedence Constraints
Use of 3 Machines
2
1
10
5
4
10
pj
15
5
6
1
4
= job completed
jobs
8
7
10
9
10
20
30
Active Schedule
It is not possible to construct another schedule by changing
the order of processing on the machines and having at
least one task finishing earlier without any task finishing
later.
There is at least one optimal and active schedule for Jm|| if
the objective function is regular.
Example :
Consider a job shop with three machines and two jobs.
Job 1 needs 1 time unit on machine 1 and 3 time units on machine 2.
Job 2 needs 2 time units on machine 3 and 3 time units on machine 2.
Both jobs have to be processed last on machine 2.
Machine 2
Machine 3
2
0
It is clear that this schedule is active as reversing the sequence of the two
jobs on machine 2 postpones the processing of job 2. However, the
schedule is neither nondelay nor optimal. Machine 2 remains idle until
time 2 while there is a job available for processing at time 1.
Machine 2
Machine 3
2
0
Semi-active
Nondelay
Active
All Schedules
A Venn diagramm of the three classes of nonpreemptive schedules;
the nondelay schedules, the active schedules, and the semi-active schedules
Complexity Preliminaries
Example
Mergesort
6
4,6
1
1,8
3,7
1,4,6,8
6
6,9
3,6,7,9
1,3,4,6,6,7,8,9
n input values
Complexity Hierarchies of
Deterministic Scheduling Problems
Some problems are special cases of other problems:
Notation: 1 | 1 | 1 (reduces to) 2 | 2 | 2
Examples:
1 || Cj 1 || wj Cj Pm || wj Cj Qm | prec | wj Cj
Complex reduction cases:
| | Lmax | | Uj
| | Lmax | | Tj
Variation of dj and logarithmic search
Machine Environment
Rm
FJc
Qm
FFc
Jm
Pm
Fm
Om
rj
sjk
prmp
prec
brkdwn
Mj
block
nwt
recrc
Objective Functions
wj Tj
wj Uj
wj Cj
Tj
Uj
Cj
Lmax
Cmax
Problem Classification
Deterministic scheduling problems
polynomial
time solution
NP hard
NP-hard
ordinary sense
pseudo
polynomial solution
strongly
NP-hard
Partition
1 t
Given positive integers a1,, at and b = j =1 a j ,
2
do there exist two disjoint subsets S1 and S2 such that
a
jS i
=b
for i=1,2?
3-Partition
Given positive integers a1,, a3t, b with
b
b
< aj < ,
4
2
and
j = 1, , 3t,
3t
a
j =1
= tb
a
jS i
=b
for i=1, , t?
Proof of NP-Hardness
FFc || Cmax
Jm || Cmax
P2 || Cmax
F2 || Cmax
Hard
Easy
1 || Cmax
Pm || Lmax
Hard
Easy
1 | rj | Lmax
1 || Lmax
1 | rj , prmp | Lmax
1 | prmp | Lmax
wj
pj
t
k
O (n log(n))
l
wj
wj
factor
j=1
j=1
max
=
of this
l*
1lk l
chain
pj
p j
j=1
j=1
l* determines the -factor of the chain 1, ... , k
l*
jobs
wj
1
6
2
18
3
12
4
8
5
8
6
17
7
18
pj
10
(6 + 18) (3 + 6) =
24
9
Job 2
Job 6
Job 3
w7 18 12
= <
p7 10 6
w 4 8 18
= <
p4
5 10
1 | rj ,prmp | Cj is easy.
1 | rj | Cj is strongly NP hard.
1 || wj (1 e -rCj ) can be solved optimally with the
Weighted Discounted Shortest Processing Time first
rp j
(WDSPT) rule:
wj e
1 e
rp j
Maximum Cost
[C max p j , C max ]
jJ
Algorithm:
Minimizing Maximum Cost
Step 1
Step 2
h j* p j = min h j p k
c jJ '
k J c
jJ
Add j* to J.
Delete j* from Jc.
Modify J to represent the new set of schedulable jobs.
Step 3
hj(Cj)
hj*
j*
Cj*,Cj**
j**
hj**
hj(Cj)
hj*
j**
j*
Cj*,Cj**
pj
hj (Cj )
1 + Cj
1.2 Cj
10
Cmax = 2+3+5 = 10
Proof:
Reduction of 3-Partition to 1 | rj | Lmax
integers a1, ... , a3t, b
n = 4t 1 jobs
rj = jb + (j 1),
rj = 0,
pj = 1,
pj = aj t +1,
b
b
< aj <
4
2
3t
a
j =1
= t b
dj = jb + j,
j = 1,..., t 1
dj = tb + (t 1), j = t,..., 4t 1
d1
b+1
r2
d2
2b+1 2b+2
r3
d3
r t-2
d t-2
r t-1
3b+2 3b+3
d t-1
tb+t1
Level 1: n nodes:
A specific job scheduled at the first position of
the schedule.
jobs
pj
rj
dj
12
11
10
3
4
4
5
3
10
2
15
Lmax = 5
17
1
3
3
12
Lmax = 7
18
optimal
Step 1
Step 2
Step 3
If
p
jJ
d j* then go to Step 4,
otherwise
let k* denote the job which satisfies p k * = max (p j ).
jJ
Delete k* from J.
Add k* to Jd.
Step 4
2.
1 || Uj : Example
jobs
pj
dj
17
18
19
21
Job 1 fits:
Job 2 fits:
Job 3 does not fit:
Job 4 fits:
Job 5 does not fit:
schedule order
J1 = {1}
J2 = {1, 2}
J3 = {1, 3 }
J4 = {1, 3, 4}
J5 = {3, 4, 5}
3, 4, 5, (1, 2)
Uj = 2
1 || wjUj : Example
w U (WSPT)
w U (OPT)
j
2, 3, 1
wjUj = 12
jobs
pj
11
90
wj
12
89
dj
100
100
100
jk +
J(j, l, k): all jobs in the set {j, ..., l} with a processing time
pk but job k is not in J(j, l, k).
V(, t) = 0
V({j}, t) = max (0, t+ pj dj)
Recursive relation:
V ( J( j, l, k ), t ) = min ( V ( J( j, k '+ , k ' ), t ) + max( 0, Ck ' ( ) dk ' ) + V ( J(k '+ + 1, l, k ' ), Ck ' ( )))
pseudo polynomial
jobs
pj
121
79
147
83
130
dj
260
266
266
336
337
V(J(1, 3, 3), 0) = 0
V(J(4, 5, 3), 347) = 347 +83 336 +347 + 83 +130 337 = 317
for sequence 4, 5
V(J(1, 4, 3), 0) = 0
0 + 81 + 317
0 + 164 + 223
76 + 294 + 0
= 370
Dominance result
If there are two jobs j and k with dj dk , pj pk and wj
wk then there is an optimal sequence in which job j
appears before job k.
Total Tardiness
An Approximation Scheme (1)
For NP hard problems, it is frequently interesting to find in
polynomial time a (approximate) solution that is close to
optimal.
Fully Polynomial Time Approximation Scheme A for 1 || Tj :
T ( A) (1 + ) T (OPT )
j
optimal schedule
Total Tardiness
An Approximation Scheme (2)
a)
( OPT )
Total Tardiness
An Approximation Scheme (3)
b)
Total Tardiness
An Approximation Scheme (4)
c)
n ( n + 1)
T ( S ) T j ( OPT ) T j ( S ) < T ( S ) + K
2
n ( n + 1)
T
(
S
)
T
(
OPT
)
<
K
j
j
2
*
j
*
j
2
K =
T max ( EDD )
n ( n + 1)
Select
T (S ) T (OPT ) T
j
max
( EDD)
Step 1
Step 2
p ' j = p
Step 3
d'j =
pj
1210
790
1470
830
1300
dj
1996
2000
2660
3360
3370
Tmax(EDD)=2230
If is chosen 0.02 then we have K=2.973.
late completion
Cj > d
job set J2
Optimal Schedule:
Early jobs (J1) use Longest Processing Time first (LPT)
Late jobs (J2) use Shortest Processing Time first (SPT)
Step 1
Step 2
Step 3
Step 1
Step 2
Step 3
Set 1 = d and 2 = pj - d.
Set k = 1.
If 1 2, assign job k to the first unfilled
position in the sequence and set 1 = 1 pk.
If 1 < 2, assign job k to the last unfilled
position in the sequence and set 2 = 2 pk.
If k < n, set k = k + 1 and go to Step 2.
If k = n, STOP.
pj
106
100
96
22
20
Assignment
Sequence
180
166
1xxxxx
74
166
1xxxx2
74
66
13xxx2
-22
66
13xx42
-22
44
13x542
-22
24
136542
| | 1 (opt), 2
primary
objective
secondary
objective
SPT/EDD rule
dj = dj + z
new deadline
j= 1
pk pl
and
for all l such that
j =1
hold.
Step 1
Step 2
Step 3
Step 4
c = {1, ... , n}
p
Set k = n, =
,
J
j
j=1
Find k* in Jc such that
d k * and
p k * p l for all jobs l in Jc such that
dl .
Decrease k by 1.
Decrease by pk*
Delete job k* from Jc .
If k 1 go to Step 2, otherwise STOP.
pj
dj
10
12
14
18
18
= 18 d4 = d5 = 18
p 4 = 4 > 2 = p5
Last job : 4
= 18 p4 = 14 d3 = 14 14
d5 = 18 14
p5 = 2 = p3
Either job can go in the now last position : 3
= 14 p3 = 12 d5 = 18 12
d2 = 12 12
p 2 = 6 > 2 = p5
Next last job: 2
= 12 p2 = 6 d5 = 18 6
d1 = 10 12
p 1 = 4 > 2 = p5
Sequence:
51234
Multiple Objectives
In a generalized approach, multiple objectives are combined
in a linear fashion instead of using a priority ordering.
Objectives: 1 , 2
1 | | 1 1 + 2 2
1 + 2 = 1
1 0 and 2 1
1 | | 11 + 2 2 1| | 2 (opt ), 1
1 1 and 2 0
1 | | 11 + 2 2 1 | | 1(opt ), 2
Lmax(EDD)
Lmax(SPT/EDD)
2 : Lmax
Step 1
Step 2
Step 3
Step 4
Set r = 1
Set Lmax = Lmax(EDD) and d j = d j + L max .
Set k = n and Jc = {1, ... , n}.
n
Set =
p and = .
j=1 j
Find j* in Jc such that
d j* , and
p j* pl for all jobs in Jc such that dl .
Put job j* in position k of the sequence.
If there is no job l such that dl < and pl > p j* , go to Step 5.
Otherwise find j** such that
d j** = min( dl )
l
Step 5
Step 6
Decrease k by l.
Decrease by pj*..
Delete job j* from Jc.
If k 1 go to Step 3,
otherwise go to Step 6.
Set Lmax = Lmax + .
If Lmax > Lmax(SPT/EDD), then STOP.
Otherwise set r = r + 1, d j = d j + , and go to Step 2.
pj
dj
30
27
20
15
12
EDD sequence
SPT/EDD sequence
Iteration r
(Cj, Lmax )
Pareto optimal
schedule
current +
96, 2
5,4,3,1,2
32 26 22 17 14
77, 3
1,5,4,3,2
33 30 23 18 15
75, 5
1,4,5,3,2
35 32 25 20 17
64, 6
1,2,5,4,3
36 33 26 21 18
62, 8
1,2,4,5,3
38 35 28 23 20
60, 11
1,2,3,5,4
41 38 31 26 23
58, 14
1,2,3,4,5
44 41 34 29 26
Stop
1 || 1 wj Cj + 2 Lmax
Extreme points (WSPT/EDD and EDD) can be
determined in polynomial time.
The problem with arbitrary weights 1 and 2 is NP hard.
Pm || Cmax
The problem is NP-hard.
P2 || Cmax is equivalent to Partition.
Cmax ( LPT ) 4 1
Cmax (OPT ) 3 3m
1 n
Cmax (OPT ) p j
m j =1
1 n 1
Cmax ( LPT ) pn p j
m j =1
C max
1
( LPT ) p n +
m
n 1
j =1
1
1
p j = p n (1 ) +
m
m
j =1
pj
4 1 Cmax ( LPT ) pn (1 1 m) j =1 p j m pn (1 1 m)
<
+1
3 3m Cmax (OPT ) Cmax (OPT ) Cmax (OPT ) Cmax (OPT )
n
jobs
pj
4 parallel machines
Cmax(OPT) = 12 =7+5 = 6+6 = 4+4+4
Cmax(LPT) = 15 = (4/3 -1/(34))12
C max ( LIST )
1
2
Arbitrary nondelay schedule C ( OPT )
m
max
a)
b)
Heuristics Algorithms
Pm | pj = 1, tree | Cmax
highest level Imax
Level
5
4
3
H(Imax + 1 r ) = N(Imax + 1 k )
2
1
k =1
root
CP for P2|pj=1,prec|Cmax
Cmax (CPM ) 4
Cmax (OPT ) 3
6
1
Pm | pj = 1, Mj | Cmax (1)
A job can only be processed on subset Mj of the m parallel machines.
Here, the sets Mj are nested.
Exactly 1 of 4 conditions is valid for jobs j and k.
Mj is equal to Mk
(Mj=Mk)
Mj is a subset of Mk
(MjMk)
Mk is a subset of Mj
(MjMk)
Mj and Mk do not overlap. (MjMk=)
Every time a machine is freed, the job is selected that can be processed
on the smallest number of machines.
Least Flexible Job first (LFJ) rule
LFJ is optimal for P2 | pj = 1, Mj | Cmax and for Pm | pj = 1, Mj |
Cmax when the Mj sets are nested (pairwise exchange).
Pm | pj = 1, Mj | Cmax (2)
1
1
2
3
2
3
2
4
3
5
7
4
6
8
1
4
5
6
7
8
x
i=1
ij
= pj
xij Cmax
j=1
processing time
of job j
x
i=1
ij
x ij > 0
Cmax
processing time
of each job is less
than makespan
positive execution
fragments
max p1 , p j m = C *max
j =1
LRPT Rule
Longest Remaining Processing Time first (LRPT)
Preemptive version of Longest Processing Time first (LPT)
This method may generate an infinite number of preemptions.
Vector Majorization
Vector of remaining processing times at time t
(p1(t), p2(t), ..........pn(t)) = p (t).
A vector p( t ) majorizes a vector q( t ) , p( t ) m q( t ) , if
k
p
j =1
( j)
Example
LRPT Property
If p( t ) m q( t ) then LRPT applied to p( t ) results in a larger or
equal makespan than obtained by applying LRPT to q( t ).
Induction hypothesis: The lemma holds for all pairs of vectors
with
n
total remaining processing time less than or equal to j =1 p j (t ) 1 and
n
j =1 q j (t ) 1, respectively.
Induction base: Vectors 1, 0, , 0 and 1, 0, 0.
After LRPT is applied for one time unit on p (t )and q (t ), respectively,
then we obtain at time t+1 the vectors p (t + 1) and q (t + 1) with
n
p (t + 1) p (t ) 1 and q (t + 1) q (t ) 1 .
j =1
j =1
j=1
If p( t ) m q( t ) , then p( t + 1) m q( t + 1) .
j=1
3
3
2
5
2
1
1
3
10
1
2
0
1, 2, 3
2, 3
1, 2, 3
5
10
Cmax
note n!
m 1
n
pj pj
p1 p1 + p2 j =1
j =1
, m 1 , m
max ,
v v +v
1 1 2 v j v j
j =1
j =1
Cmax
for v1 v2 vm
max p1 , p j m
j =1
LRPT-FM
Continuous time:
All processing times are multiplied by a large number K.
The speeds of the machines are multiplied by a large number V.
Application of LRPT-FM
Machine 1
C = n p
j
(1)
jobs
pj
wj
w C (WSPT) 1 (1 +
w C (OPT) 2
j
Pm || wj Cj is NP hard.
2)
Pm | prec | Cj
Other Cj Problems
The LFJ rule is optimal for Pm|pj=1,Mj|Cj when the Mj sets are nested.
The Rm||Cj problem can be formulated as an integer program
Although linear integer programming is NP-hard this program has a
special structure that allows a solution in polynomial time.
xikj=1 if job j is scheduled as the kth to last job on machine i.
i =1 k =1
n
x
j =1
i =1 j =1 k =1
x
ikj
kp
Minimize
m
ikj
=1
x ikj {0,1}
ij
x ikj subject to
j = 1,, n
i = 1,, m and k = 1,, n
i = 1,, m, k = 1,, n, and j = 1,, n
Example Rm||Cj
jobs
P1j
p2j
Machine 1
3
0
Machine 2
4
If there are more jobs than machines, then machines with speed 0
are added.
If there are more machines than jobs, then the slowest machines are
not used.
This yields
v1Cn v1Cn
v2Cn + v1Cn-1 v2Cn + v1Cn-1
:
vnCn + vn-1Cn-1 + ... + v1C1 vnCn + vn-1Cn-1 + ... + v1C1
vi
jobs
pi
16
34
40
45
46
61
C 3 = 11
C4 = 16
C5 = 21
C 6 = 26
Machine 1
Machine 2
Machine 3
Machine 4
10
15
C 7 = 35
7
25
30
35
Qm | prmp | Lmax
Assume Lmax = z
Cj dj + z
set d j= dj + z (hard deadline)
Hard deadlines are release dates in the reversed problem.
Finding a schedule for this problem is equivalent to solving
Qm | rj, prmp | Cmax
If all jobs in the reverse problem finish at a time not smaller than
0, then there exists a schedule for Qm | prmp | Lmax with Lmax z.
The minimum value for z can be found by a simple search.
dj
pj
rj
pj
Flow Shops
Permutation Schedule j1 , j2 , K , jn
i
C i , j1 = pl , j1
i = 1, K , m
C1, jk = p1, jl
k = 1, K , n
l =1
k
l =1
C i , jk = max( C i 1, jk , C i , jk 1 ) + p i , jk
i = 2, K , m
k = 2, K , n
p1, j2
p2, j1
... ...
...
...
pm , j1
...
...
...
p1, jn
...
...
pi , jk
pi , jk +1
...
pi +1, jk
pi +1, jk +1
...
...
...
...
...
pm , jn
Example F4|prmu|Cmax
5 jobs on 4 machines with the following processing times
jobs
j1
j2
j3
j4
j5
p1, jk
p2 , jk
p3, jk
p4 , jk
Critical path
10
20
30
Reversibility
Two m machine permutation flow shops with n jobs are
considered with pij(1) = p(2)m+1-i,j .
pij(1) and pij(2) denote the processing times of job j in the first and
the second flow shop, respectively.
j1
j2
j3
j4
j5
p1, jk
3 (5)
6 (5)
3 (3)
2 (6)
5 (3)
p2 , jk
4 (4)
4 (4)
3 (2)
4 (4)
1 (4)
4 (4)
4 (4)
2 (3)
4 (4)
4 (1)
5 (3)
5 (6)
3 (3)
6 (2)
3 (5)
p3, jk
p4 , jk
Original problem
Reverse problem
10
20
30
F2||Cmax
F2||Cmax with unlimited storage in between the two machines
The optimal solution is always a permutation.
Interchange of j and k
Starting time (C1l + p1j + p1k) of job h on machine 1 is not affected
Starting time of job h on machine 2:
C2k = max ( max ( C2l, C1l + p1j) + p2j, C1l + p1j + p1k) + p2k
= max ( C2l + p2j + p2k, C1l + p1j + p2j + p2k, C1l + p1j + p1k + p2k)
C2j = max (C2l + p2k + p2j, C1l + p1k + p2k + p2j, C1l + p1k + p1j + p2j)
Fm | prmu | Cmax
Formulation as a Mixed Integer Program (MIP)
Graphical Description of ik
ik
Iik
Machine i
pi(k)
Wi,k+1
pi(k+1)
Wik
Machine i +1
pi+1(k-1)
pi+1(k)
Wik > 0 and Ii+1, k = 0
pi+1(k+1)
p
i=1
i( 1)
Remember : p i ( k ) =
j=1
x jk p ij
n 1
I
j=1
mj
x jk = 1
k = 1, ... , n
x jk = 1
j = 1, ... , n
j=1
n
I ik +
j=1
Wi1 = 0
I1k = 0
Wik 0
Iik 0
k =1
j,k + 1
p ij + W
i,k + 1
ik
j= 1
x jk p i + 1, j I i + 1,k = 0
F3||Cmax
C max =
p
j =1
Slope Heuristic
A j = ( m ( 2i 1))p ij
i =1
Sequencing of jobs in
decreasing order of the slope
index
Consider 5 jobs on 4 machines
with the following processing
times
jobs
j1
j2
j3
j4
j5
p1, jk
p 2, jk
p3, jk
p 4, jk
A1 = -(3 x 5) (1 x 4) + (1 x 4) + (3 x 3) = -6
Sequences 2,5,3,1,4
and 5,2,3,1,4 are
optimal and the
makespan is 32.
A2 = -(3 x 5) (1 x 4) + (1 x 4) + (3 x 6) = +3
A3 = -(3 x 3) (1 x 2) + (1 x 3) + (3 x 3) = +1
A4 = -(3 x 6) (1 x 4) + (1 x 4) + (3 x 2) = -12
A5 = -(3 x 3) (1 x 4) + (1 x 1) + (3 x 5) = +3