Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Uwe Schwiegelshohn
■ 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 Paper Bag Factory
■ different applications
● unknown processing time
● known distributions (average, variance)
● priority level
■ multitasking environment
● preemption
■ minimization of the sum of expected weighted completion
times
Information Flow Diagram in a
Manufacturing System
Production planning,
master scheduling Orders, demand forecasts
Capacity Quantities,
status due dates
Material requirements,
planning, Material requirements
capacity planning
Scheduling
and
rescheduling Detailed scheduling
Schedule
performance Schedule
Dispatching
Shop
status Shopfloor
management
Shopfloor
Information Flow Diagram in a
Service System
Data Forecasts
Prices rules
Scheduling Yield
management
Accept/
reject Place order,
(conditions) make reservations
Customer
Job Properties
l : 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
FFc : flexible flow shop with c stages in series and several
identical machines at each stage,
one job needs processing on only one (arbitrary) machine
at each stage.
Machine Environment (2)
■ no – wait (nwt)
A job is not allowed to wait between two successive executions
on different machines (Fm , FFc ).
■ recirculation (recirc)
Objective Functions (1)
■ Lateness of job j: Lj = Cj – dj
The lateness may be positive or negative.
1 if Cj > dj,
■ Number of late jobs: Uj =
0 otherwise
Objective Functions (2)
Lj Tj Uj
1
Cj Cj Cj
dj dj dj
α|β|γ
jobs 1 2 3 4 5 6 7 8 9 10
pj 8 7 7 2 3 2 2 8 8 15
Precedence Constraints
Original Schedule
2 jobs 1 2 3 4 5 6 7 8 9 10
1 pj 8 7 7 2 3 2 2 8 8 15
10
3 = job completed
5 8
6 7 9
1 2 8 9
4 6 5 7 3 10
0 10 20 30
Precedence Constraints
Reduced Processing Time
2 jobs 1 2 3 4 5 6 7 8 9 10
1 pj 7 6 6 1 2 1 1 7 7 14
10
3 = job completed
6 7 9
1 2 9
4 6 5 7 8 3 10
0 10 20 30
Precedence Constraints
Use of 3 Machines
2 jobs 1 2 3 4 5 6 7 8 9 10
1 pj 8 7 7 2 3 2 2 8 8 15
10
3 = job completed
6 7 9
1 2
4 5 8 3 10
6 7 9
0 10 20 30
Active Schedule
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.
Example of an Active Schedule
Machine 1 1
Machine 2 2 1
Machine 3 2
0 2 4 6 8 t
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.
Semi – active Schedule
Example:
Consider again a schedule with three machines and two jobs. The
routing of the two jobs is the same as in the previous example.
■ The processing times of job 1 on machines 1 and 2 are both equal
to 1.
■ The processing times of job 2 on machines 2 and 3 are both equal
to 2.
Example of a Semi – active Schedule
Machine 1 1
Machine 2 2 1
Machine 3 2
0 2 4 6 8 t
Semi-active
X X 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
6 4 8 1 7 3 9 6
1,4,6,8 3,6,7,9
1,3,4,6,6,7,8,9
Examples:
1 || Σ Cj ∝ 1 || Σ wj Cj ∝ Pm || Σ wj Cj ∝ Qm | prec | Σ wj Cj
Rm FJc
Qm FFc Jm
Pm Fm Om
1
Processing Restrictions and
Constraints
0 0 0 0 0 0 0 0 0
Objective Functions
Σwj Tj Σwj Uj
ΣCj Lmax
Cmax
Time Complexity of Algorithms
polynomial NP – hard
time solution
NP-hard strongly
ordinary sense NP-hard
pseudo
polynomial solution
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
j∈S i
j =b
for i=1,2?
∑a j =1
j = tb
∑a
j∈S i
j =b for i=1,… , t?
P2 || Cmax F2 || Cmax
Hard
Easy 1 || Cmax
Complexity of Maximum Lateness
Problems
wj
1 || Σ wj Cj : Schedule the jobs in Smith order pj .
t
h k
t
k h
l* satisfies
l*
l
δ factor
∑j=1
wj ∑wj
j=1
= max
1≤l≤k l
of this
l*
∑ ∑ p j
chain
pj
j=1 j=1
l* determines the δ-factor of the chain 1, ... , k
Total Weighted Completion Time
with Chains
Proof concept
There is an optimal schedule that processes
all jobs 1, ... , l* in succession +
Pairwise interchange of chains
Example: Total Weighted
Completion Time with Chains (1)
jobs 1 2 3 4 5 6 7
wj 6 18 12 8 8 17 18
pj 3 6 6 5 4 8 10
Example: Total Weighted
Completion Time with Chains (2)
24
■ δ-factor of first chain (6 + 18) (3 + 6) = Job 2
9
w7 18 12
■ = <
p7 10 6
Job 3 is scheduled next.
w 4 8 18
■ p4
= <
5 10
Job 7 is scheduled next and finally job 4
Other Total Completion Time
Problems
Cj*,Cj**
j* j**
hj(Cj) hj**
hj*
Cj*,Cj**
j** j*
Minimizing Maximum Cost:
Example
jobs 1 2 3
pj 2 3 5
hj (Cj ) 1 + Cj 1.2 Cj 10
■ Cmax = 2+3+5 = 10
Proof:
Reduction of 3-Partition to 1 | rj | Lmax
3t
b b
integers a1, ... , a3t, b
4
< aj <
2 ∑a j = t ⋅b
n = 4t –1 jobs j =1
Finding bounds:
If there is a better schedule than the one generated by a
branch then the branch can be ignored.
1 | rj , prmp | Lmax can be solved by the preemptive Earliest
Due Date (EDD) first rule.
This produces a nondelay schedule.
The resulting schedule is optimal if it is nonpreemptive.
Branch and Bound Applied to
Minimizing Maximum Lateness (1)
jobs 1 2 3 4
pj 4 2 6 5
rj 0 1 3 5
dj 8 12 11 10
1 3 4 3 2 Lmax = 5
0 4 5 10 15 17
■ Step 3 If ∑p
j∈J
j ≤ d j* then go to Step 4,
otherwise
let k* denote the job which satisfies p k * = max (p j ).
j∈J
Delete k* from J.
Add k* to Jd.
Proof by induction
The claim is correct for k=1.
We assume that it is correct for an arbitrary k.
jobs 1 2 3 4 5
pj 7 8 4 6 6
dj 9 17 18 19 21
■ Job 1 fits: J1 = {1}
■ Job 2 fits: J2 = {1, 2}
■ Job 3 does not fit: J3 = {1, 3 }
■ Job 4 fits: J4 = {1, 3, 4}
■ Job 5 does not fit: J5 = {3, 4, 5}
schedule order 3, 4, 5, (1, 2) Σ Uj = 2
The ratio
∑ w U (WSPT)
j j
may be very large.
∑ w U (OPT)j j
jobs 1 2 3
pj 11 9 90
wj 12 9 89
dj 100 100 100
Total Tardiness (1)
■ 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(J(4, 5, 3), 347) = 347 +83 – 336 +347 + 83 +130 – 337 = 317
for sequence 4, 5
Minimizing Total Tardiness
Example (2)
■ V(J(1, 4, 3), 0) = 0 for sequences 1, 2, 4 and 2, 1, 4
0 + 81 + 317
V({1, ..., 5}, 0) = min 0 + 164 + 223 = 370
76 + 294 + 0
■ 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.
∑ T ( A) ≤ (1 + ε )∑ T (OPT )
j j
optimal schedule
The running time is bounded by a polynomial (fixed degree)
in n and 1 ε.
Total Tardiness
An Approximation Scheme (2)
n ( n + 1)
∑ T ( S ) ≤ ∑ T j ( OPT ) ≤ ∑ T j ( S ) < ∑ T ( S ) + K ⋅
j
*
j
*
2
n ( n + 1)
∑ j
T ( S ) − ∑ j
T ( OPT ) < K ⋅
2
2ε
Select K = ⋅ T max ( EDD )
n ( n + 1)
∑ T (S ) − ∑ T (OPT ) ≤ ε ⋅ T
j j max ( EDD)
PTAS Minimizing Total Tardiness
K
■ Step 3 Apply Algorithm Minimizing Total Tardiness to
the rescaled data.
■ Tmax(EDD)=2230
If ε is chosen 0.02 then we have K=2.973.
Objective Σ Ej + Σ Tj
This problem is harder than total tardiness.
A special case is considered with dj = d for all jobs j.
■ Optimal Schedule:
Early jobs (J1) use Longest Processing Time first (LPT)
Late jobs (J2) use Shortest Processing Time first (SPT)
dj = dj + z
∑
n
■ Step 1 Set k = n, τ = j=1
p j, Jc = {1, ... , n}
■ Objectives: γ 1 , γ 2
1 | β | Θ 1γ 1 + Θ 2 γ 2
Θ 1 → 0 and Θ 2 → 1
1 | β | Θ1γ1 + Θ 2 γ 2 → 1| β | γ 2 (opt ), γ1
Θ 1 → 1 and Θ 2 → 0
1 | β | Θ1γ1 + Θ 2 γ 2 → 1 | β | γ1(opt ), γ 2
Pareto-Optimal Schedule (2)
γ1 : ∑ C j
γ 2 : Lmax
Lmax(EDD) Lmax(SPT/EDD)
Pareto-Optimal Solutions (1)
■ Step 1 Set r = 1
Set Lmax = Lmax(EDD) and d j = d j + L max .
■ Step 2 Set k = n and Jc = {1, ... , n}.
∑
n
Set τ = p and δ = τ.
j=1 j
■ Step 3 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.
■ Step 4 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 Decrease k by l.
Decrease τ by pj*..
Delete job j* from Jc.
If k ≥ 1 go to Step 3,
otherwise go to Step 6.
■ 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.
jobs 1 2 3 4 5
pj 1 3 6 7 9
dj 30 27 20 15 12
1 96, 2 5,4,3,1,2 32 26 22 17 14 1
2 77, 3 1,5,4,3,2 33 30 23 18 15 2
3 75, 5 1,4,5,3,2 35 32 25 20 17 1
4 64, 6 1,2,5,4,3 36 33 26 21 18 2
5 62, 8 1,2,4,5,3 38 35 28 23 20 3
6 60, 11 1,2,3,5,4 41 38 31 26 23 3
7 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.
Parallel Machine Models
1 n −1
Cmax ( LPT ) − pn ≤ ∑ p j
m j =1
Proof of the Bound (2)
n −1 n
1 1 1
C max ( LPT ) ≤ p n +
m
∑
j =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)
n
− < ≤ + ≤ +1
3 3m Cmax (OPT ) Cmax (OPT ) Cmax (OPT ) Cmax (OPT )
jobs 1 2 3 4 5 6 7 8 9
pj 7 7 6 6 5 5 4 4 4
■ 4 parallel machines
■ Cmax(OPT) = 12 =7+5 = 6+6 = 4+4+4
■ Cmax(LPT) = 15 = (4/3 -1/(3·4))·12
7 4 4
7 4
6 5
6 5
Other Makespan Results
C max ( LIST ) 1
■ Arbitrary nondelay schedule C ( OPT ) ≤ 2 −
max m
5 starting jobs
3
r
H(Imax + 1 − r ) = ∑ N(Imax + 1 − k )
2 k =1
Cmax (CPM ) 4
≤ for two machines
Cmax (OPT ) 3
1 4
almost fully connected
bipartite graph
2 5
3 6
1 1 5 2 1 5
2 2 3 4 6 3 6 4
4 3
LNS for P2|pj=1,prec|Cmax
1 2 3
4 5
1 4 1 2 3 1 2 3
2 6 5 4 6 5
4 3
Pm | pj = 1, Mj | Cmax (1)
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)
Machines 1 2 3 4
LFJ 1 4 5 6
2 7 8
3
optimal 2 1 5 7
3 4 6 8
m m processing time
∑x ij = pj ∑x ij ≤ Cmax of each job is less
i=1 i=1 than makespan
∑p
j =1
( j) ( t ) ≥ ∑ q( j ) ( t ) holds for all k = 1, ..., n.
j=1
Example
Consider the two vectors p( t ) = (4, 8, 2, 4) and q( t ) = (3, 0, 6, 6).
Rearranging the elements within each vector and putting these in
decreasing order results in vectors (8, 4, 4, 2) and (6, 6, 3, 0).
It can be easily verified that p( t ) ≥m q( t ).
LRPT Property
Induction hypothesis: The lemma holds for all pairs of vectors with
total remaining processing time less than or equal to ∑ j =1 p j (t ) − 1 and
n
∑ j =1 q j (t ) − 1, respectively.
n
∑ p (t + 1) ≤ ∑ p (t ) − 1 and ∑ q (t + 1) ≤ ∑ q (t ) − 1 .
j =1
j
j =1
j j j
j=1 j=1
If p( t ) ≥m q( t ) , then p( t + 1) ≥m q( t + 1) .
Result of the LRPT Rule
From time t+1 on, R uses LRPT as well due to our induction hypothesis.
Due to the LRPT property, R cannot produce a smaller makespan than
LRPT.
LRPT in Discrete Time
1 3 2 1
2 3 2 1 3
0 5 10 t
LRPT in Continuous Time
1 1, 2, 3
2 2, 3 1, 2, 3
0 5 10 t
Lower Bound for Uniform Machines
Qm | prmp | Cmax
note n!
m −1 n
∑
p1 p1 + p2 j =1
pj ∑ pj
j =1
Cmax ≥ max , , m −1 , m for v1≥ v2≥…≥ vm
v v +v
1 1 2 ∑ v j ∑ v j
j =1 j =1
n
Comparison: Pm | prmp | Cmax Cmax ≥ 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.
1 1
Machine 1
1 3
2 2
0 4 8
∑Cj without Preemptions (1)
∑C = n ⋅ p
j (1) + (n −1) ⋅ p(2) +......+ 2⋅ p(n−1) + p(n)
jobs 1 2 3
pj 1 1 3
wj 1 1 3
■ 2 machines and 3 jobs
■ With the given values any schedule is WSPT.
■ If w1 and w2 are reduced by ε
WSPT is not necessarily optimal.
■ Pm || ∑ wj Cj is NP hard.
Pm | prec | ∑ Cj
■ 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.
● xikj are 0-1 integer variables.
m n n
Minimize ∑∑∑ kp
i =1 j =1 k =1
ij x ikj subject to
m n
∑∑ x
i =1 k =1
ikj =1 j = 1,…, n
∑x
j =1
ikj ≤1 i = 1,…, m and k = 1,…, n
jobs 1 2 3
P1j 4 5 3
p2j 8 9 3
■ 2 machines and 3 jobs
■ The optimal solution corresponds to x121=x112=x213=1. All
other xikj are 0. The optimal schedule is not nondelay.
1 2 Machine 1
3 Machine 2
0 4 8
∑Cj with Preemptions (1)
v1Cn = pn
v2Cn + v1(Cn-1 – Cn ) = pn-1
v3Cn + v2(Cn-1 – Cn) + v1(Cn-2 – Cn-1) = pn-2
:
vnCn + vn-1(Cn-1 – Cn) + v1(C1 – C2) = p1
v1Cn = pn
v2Cn + v1Cn-1 = pn + pn-1
v3Cn + v2Cn-1 + v1Cn-2 = pn + pn-1 + pn-2
:
vnCn+vn-1Cn-1 + ... + v1C1 = pn + pn-1 + ... + p1
∑Cj with Preemptions (3)
Let S’ be an optimal schedule with C’n ≤ C’n-1 ≤ ... ≤ C’1 (see the lemma).
Then we have C’n ≥ pn/v1 ⇒ v1C’n ≥ pn.
This yields
v1C’n ≥ v1Cn
v2C’n + v1C’n-1 ≥ v2Cn + v1Cn-1
:
vnC’n + vn-1C’n-1 + ... + v1C’1 ≥ vnCn + vn-1Cn-1 + ... + v1C1
∑Cj with Preemptions (4)
machines 1 2 3 4
vi 4 2 2 1
jobs 1 2 3 4 5 6 7
pi 8 16 34 40 45 46 61
C1 = 2 C 2 = 5 C 3 = 11 C4 = 16 C5 = 21 C 6 = 26 C 7 = 35
Machine 1 1 2 3 4 5 6 7
Machine 2 2 3 4 5 6 7
0 5 10 15 20 25 30 35
t
Due – Date Related Objectives
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.
Example P2 | prmp | Lmax
jobs 1 2 3 4
dj 4 5 8 9
pj 3 3 3 8
jobs 1 2 3 4
rj 5 4 1 0
pj 3 3 3 8
■ Permutation Schedule j1 , j2 , K , jn
i
C i , j1 = ∑ pl , j1 i = 1, K , m
l =1
k
C1, jk = ∑ p1, jl k = 1, K , n
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
p2, j1 pi , jk pi , jk +1 ...
... ... ...
jobs j1 j2 j3 j4 j5
5 5 3 6 3
p1, jk
p2 , jk 4 4 2 4 4
4 4 3 4 1
p3, jk
p4 , jk 3 6 3 2 5
Directed Graph in the Example
5 5 3 6 3
4 4 2 4 4
4 4 3 4 1
3 6 3 2 5
Critical path
Gantt Chart in the Example
5 5 3 6 3
4 4 2 4 4
4 4 3 4 1
3 6 3 2 5
0 10 20 30
Reversibility
5 5 3 6 3 5 2 3 6 3
4 4 2 4 4 1 4 3 4 4
4 4 3 4 1 4 4 2 4 4
3 6 3 2 5 3 6 3 5 5
5 2 3 6 3
1 4 3 4 4
4 4 2 4 4
3 6 3 5 5
0 10 20 30
F2||Cmax
■ 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)
C’2j = max (C2l + p2k + p2j, C1l + p1k + p2k + p2j, C1l + p1k + p1j + p2j)
∆ik
Iik Wi,k+1
Wik
m −1 n −1
∑p
i=1
i( 1) + ∑I
j=1
mj
m −1 n n −1
min ∑ ∑ x j1p ij + ∑ Imj
i=1 j=1 j=1
subject to n
∑ j=1
x jk = 1 k = 1, ... , n
n
∑ k =1
x jk = 1 j = 1, ... , n
n n
I ik + ∑
j=1
x j,k + 1 p ij + W i,k + 1 − W ik − ∑
j= 1
x jk p i + 1, j − I i + 1,k = 0
■ Sequencing of jobs in p 2, jk 1 4 3 4 4
decreasing order of the slope p3, jk 4 4 2 4 4
index
■ Consider 5 jobs on 4 machines p 4, jk 3 6 3 5 5
with the following processing
times
A1 = -(3 x 5) – (1 x 4) + (1 x 4) + (3 x 3) = -6
A2 = -(3 x 5) – (1 x 4) + (1 x 4) + (3 x 6) = +3
Sequences 2,5,3,1,4
and 5,2,3,1,4 are A3 = -(3 x 3) – (1 x 2) + (1 x 3) + (3 x 3) = +1
optimal and the
A4 = -(3 x 6) – (1 x 4) + (1 x 4) + (3 x 2) = -12
makespan is 32.
A5 = -(3 x 3) – (1 x 4) + (1 x 1) + (3 x 5) = +3