You are on page 1of 35

Contents college 3 en 4

• Book: Appendix A.1, A.3, A.4, §3.4, §3.5,


§4.1, §4.2, §4.4, §4.6 (not: §3.6 - §3.8, §4.2
- §4.3)

• Extra literature on resource constrained


project scheduling (will be handed out)

1
Planning and scheduling
optimization techniques
• Dispatching Rules
• Composite Dispatching Rules
• Adaptive search
• Dynamic Programming
• (Integer) Linear Programming
• Cutting plane methods
• Branch and Bound
• Beam Search
2
Linear programming (LP) model
• LP: min c1 x1  c 2 x 2  ...  c n x n objective function
subject to :
a11 x1  a12 x 2  ...  a1n x n  b1 constraints
a21 x1  a22 x 2  ...  a2n x n  b2

am1 x1  am2 x 2  ...  amn x n  bm
variable
x j  0 ( j  1,  , n)
restrictions

• Matrix form: min c T x where:


Ax  b x, c: n-vector
A: m,n-matrix
x0 b: m-vector
3
Linear programming example

max x1  x 2 T
1  x1 
max    
subject to : 1  x 2 
or:
2x1  x 2  4 subject to :
3x1  4 x 2  12 2 1   x1   4 
x j  0 ( j  1,2) 3 4   x   12
  2   
 x1  0 
  
 x 2  0 

4
Linear programming example:
graphical solution (2D)
x2 6 2x1  x 2  4
5 3x1  4x 2  12
max x1  x 2
4
subject to : x1  x 2  6
3 (objective)
2x1  x 2  4
3x1  4 x 2  12 2

x j  0 ( j  1,2) 1

0 1 2 3 4 5 6
solution x1
space 5
Linear programming (cont.)
• Solution techniques:
– (dual) simplex method
– interior point methods (e.g. Karmarkar algorithm)
• Commercial solvers, for example:
– CPLEX (ILOG)
– XPRESS-MP (Dash optimization)
– OSL (IBM)
• Modeling software, for example:
– AIMMS
– AMPL 6
Integer programming (IP) models
• Integer variable restriction
– IP: integer variables only
– MIP: part integer, part non-integer variables
– BIP: binary (0-1) variables
min c T x
• General IP-formulation: Ax  b
x integer ( x  Z  )

• Complex solution space 7


Integer programming example:
graphical solution (2D)
x2 6
max x1  x 2 5
subject to : 4
x1  x 2  6
2x1  x 2  4
3 (objective)
3x1  4 x 2  12

2
x j  Z ( j  1,2)
1

2 optimal solutions! 0 1 2 3 4 5 6
x1
8
Total unimodularity property for
integer programming models
Suppose that all coefficients are integer in the model:
min c T x
Ax  b i.e. aij , bi   , i, j
x0
Example: transportation problem

if A has the total unimodularity property


(i.e. every square submatrix has determinant 0,1,-1)
 there is an optimal integer solution x*
& the simplex method will find such a solution 9
Integer programming tricks
PROBLEM: x = 0 or x  k

0 , for x  0
use binary indicator variable y=
1 , for x  k
restrictions:
x  M  y (M is an upperbound on x)
x ky
y  0,1
10
Integer programming tricks (2)
PROBLEM: fixed costs: if xi>0 then costs C(xi)
minimize C( x ) where :
Ax  b  0 for xi  0,
C( x i )  
x0 k i  c i x i for xi  0.
0 , for xi  0
use indicator variable yi= 
1 , for xi  0
xi  M  yi
restrictions (i): C( x i )  k i  y i  c i  x i
y i  0,1 11
(Integer) programming tricks (3)
• Hard vs. soft restrictions
– hard restriction: must hold, otherwise unfeasibility
for example: x1  x 2  5
– soft restriction: may be violated, with a penalty
for example: minimize c T x  Y  100

x1  x 2  5  Y

x  0, Y  0

12
(Integer) programming tricks (4)
• Absolute values: min  y t
j goal

a x
j
j j ,t  bt  y t
variation
x j,t  0, y t free
solution:

yt  y  y
t

t min  y t  y t  
  t
 yt  y  y
a x
t t  
j j ,t  bt  y  y t t
j

x j,t  0, y t  0, y t  0 13
Integer programming tricks (5)
• Conjunctive/disjunctive programming
- conjunctive set of constraints: must all be satisfied
- disjunctive set of constraints: at least one must be satisfied
• example (Appendix A.4):

min  w j x j min  w j x j
j j

x k  x j  pk x k  x j  pk  M1  y
or x j  x k  p j  M2  (1  y )
x j  xk  p j 
 y  {0,1} 14
IP example
nonpreemptive single machine, total weighted
completion time (App. A.3)
model definition:
x jt  1, if job j completes at time t, and 0 otherwise

objective function: minimize weighted completion time:


 t  x jt  completion time of job j if x jt  1
C max-1
 tx
t 0
jt  completion time of job j
n C max-1
 min imize  w j  t  x jt (objective function)
j 1 t 0 15
IP example (cont.)
Restriction: all jobs must be completed once:
C max-1

x
t 0
jt 1

Restriction: only one job per time t:


if job j is in process during t, it must be completed
somewhere during [t,t+pj]
t p j
 x
s t
js  1 (if job j is in process during t)

n t p j
   x js  1 (restricti on : exactly one job per time t)
j1 s  t
16
IP example (cont.)
Complete IP-model:
n C max-1
minimize  w j  t  x jt
j 1 t 0

subject to :
C max-1

x
t 0
jt  1 (for j  1, , n)

n t p j

x js  1 (for t  0, , Cmax - 1)


j 1 s  t nCmax
x jt  0,1 (for j  1, , n, t  0, , Cmax - 1) integer
variables
17
IP example (cont.)
Additional restriction: precedence constraints

Model definition: SUCC(j) = successors of job j

 job j must be completed before all jobs in SUCC(j):


C max 1

 tx
t 0
jt  completion time of job j
C max 1

 tx
t 0
kt  pk  start time of job k
C max 1 C max 1
  tx
t 0
jt   tx
t 0
kt (for k  SUCC(j), j  1, , n)
18
Integer programming
solution techniques
• Heuristic vs. explicit approach:
– trade-off between solution quality and computation time
– trade-off between implementation effort/costs and yield
(i.e. profits gained from solution quality improvement)

• Heuristic methods; for example:


– local search (e.g. simulated annealing, tabu search, k-opt)
– (composite) dispatching rules (e.g. EDD, SPT, MS)
– adaptive search
– rounding fractional solutions
– beam search 19
Integer programming
solution techniques (cont.)
• Explicit methods; 3 categories:
1. dynamic programming
2. cutting plane (polyhedral) methods
3. branch and bound
or: hybrid methods (combination of the above)

• Commercial IP solvers usually use a


combination of heuristics and 2, 3
20
Dynamic programming
• Problem divided into stages x t (t  0, , T)
• Each stage can have various states it
• A recursive objective function is used to
iterate through all states and all stages
(forwards or backwards)
F0 (i0 )  c 0 (constant)
Ft (it )  min{c t (it , x t )  Ft 1 (it 1 (it , x t ))}
xt
21
Cutting plane methods
STEP 0: Create a relaxation of the problem by
omitting restrictions
(e.g. the integrality restrictions)
STEP 1: Solve the current problem
STEP 2: If solution is infeasible then generate
a restriction that cuts of the solution,
and add it to the problem  STEP 1
Otherwise: DONE
22
Branch and bound
• Enumeration in a search tree
root node Level 0

child nodes Level 1

child nodes
... Level 2

...
• each node is a partial solution, i.e. a part of
the solution space 23
Branch and bound example 1
Disjunctive programming (appendix A.4):
disjunctive set of constraints: at least one must be satisfied

xj = completion time of job j


restriction: either x k  x j  pk or x j  x k  p j (j, k  I)
solve LP without
disjunctive restrictions Level 0
(= LP relaxation)

if disjunct. restr. Level 1


violated for j & k
x k  x j  pk x j  xk  p j
24
...
Branch and bound (cont.)

• Upper bound: e.g. a feasible solution


• Lower bound:
e.g. a solution to an “easier” problem
• Node elimination (fathom/discard nodes):
when lower bound >= upper bound

25
Branch and bound (cont.)

• Branching strategy:
how to partition solution space
• Node selection strategy:
– sequence of exploring nodes:
• depth first (tries to obtain a solution fast)
• breadth/best bound first (tries to find the best solution)
– which nodes to explore (filter and beam width)
• filter width: #nodes selected for thorough evaluation
• beam width: #nodes that are branched on ( filter width)
 Beam search 26
Branch and bound example 2
• Single machine, maximum lateness, release
and due dates
Jobs 1 2 3 4 (?,?,?,?) Level 0
p(j) 4 2 6 5
r(j) 0 1 3 5
d(j) 8 12 11 10

(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?) Level 1

lower bound: EDD + preemption


27
Branch and bound example 2
• Lower bound for: (1,?,?,?) Jobs 1 2 3 4
p(j) 4 2 6 5
r(2) r(3) r(4) r(j) 0 1 3 5
d(j) 8 12 11 10

1 3 4 3 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
t
d(4)<d(3) d(3)<d(2)

Lower bound: Lmax = max(0,17-12,15-11,0)=5


28
Branch and bound example 2 (cont.)
(?,?,?,?) Level 0

LB=5 LB=7*
infeasible: =UB (2,?,?,?) (3,?,?,?)
(1,?,?,?) (4,?,?,?) Level 1
(1,3,4,3,2)

LB=6* LB=5*=UB
=UB (1,2,?,?) (1,3,?,?) (1,3,4,2) Jobs 1 2 3 4
(1,2,4,3) DONE p(j) 4 2 6 5
r(j) 0 1 3 5
d(j) 8 12 11 10
(1,2,4,3) (1,3,4,2)
29
Branch and bound example 3
LP solution: x1  0.8,
x 2  2.4
x2 6
x1  0 x1  1
5
x 1  0, x1  1,
4
x2  3 x2  2 x1  x 2  6
obj: 3 obj: 3 3 (objective)
2

1
x2  2 x2  3

x1  1, x 1  0,
0 1 2 3 4 5 6
x2  2 x2  3 x1
obj: 3 obj: 3 30
Beam search example 1
single-machine, total weighted tardiness
Upper bound: ATC rule (apparent tardiness cost):
• schedule 1 job at a time
• every time a machine comes available, determine
ranking of jobs:
 max( d j p j  t ,0 )  MS rule
wj 
 K p


I j (t)  e  
pj
look-ahead parameter:
WSPT
rule K = 4.5 + R (R  0.5)
K = 6 - 2R (R  0.5)
R  dmax  dmin  / Cmax = due date range factor
31
Beam search example 1 (cont.)
single-machine, total weighted tardiness

(?,?,?,?)

Jobs 1 2 3 4
p(j) 10 10 13 4
d(j) 4 2 1 12
w(j) 14 12 1 12 (1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?)
w(j)/p(j) 1.4 1.2 0.1 3

Upper bound by ATC rule: max(d j  p j  t ,0)  0 ( j  1,2,3)


 max( d j p j  t ,0 ) 
wj 
 K p

 wj
 I j (t)  e  
 (j  1,2,3)
pj pj 32
Beam search example 1 (cont.)
single-machine, total weighted tardiness
Jobs 1 2 3 4
(?,?,?,?)
p(j) 10 10 13 4
d(j) 4 2 1 12
w(j) 14 12 1 12
w(j)/p(j) 1.4 1.2 0.1 3
(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?)

Upper bound Jobs C(j) d(j) T(j) w(j)*T(j)


by ATC rule: 1 10 4 6 84
2 24 2 22 264
3 37 1 36 36
4 14 12 2 24
33
Total = 408
Beam search example 1 (cont.)
single-machine, total weighted tardiness

(?,?,?,?)

4 nodes
(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?)
analyzed
(filter width=4)
UB=408 UB=436 UB=814 UB=440

explored discarded
further
(beam width = 2)
34
Beam search example 1 (cont.)
(?,?,?,?)

UB=408 436 440


814
(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?)

UB=480 706 408 436

(1,2,?,?) (1,3,?,?) (1,4,?,?) (2,1,?,?) (2,3,?,?) (2,4,?,?)

UB=408 554 436 608


(1,4,2,3) (1,4,3,2) (2,4,1,3) (2,4,3,1)
35
best solution

You might also like