Econ Lecture
Econ Lecture
LP:
objective function
subjectto :
a11x1 a12x2 ... a1nxn b1
constraints
variable
restrictions
where:
x, c: n-vector
A:
m,n-matrix
b:
m-vector
Linear programming
example
max x1 x2
subjectto :
2x1 x2 4
3x1 4x2 12
xj 0 ( j 1,2)
or:
1 x1
max
1 x2
subjectto :
2 1 x1
4
3 4 x 12
2
x1
0
0
x2
4
Linear programming
example: graphical
solution (2D)
2x1 x2 4
x2 6
max x1 x2
3x1 4x2 12
x1 x2 6
2x1 x2 4
(objective
)
3x1 4x2 12
xj 0 ( j 1,2)
subjectto :
solution
space
6
x1
Linear programming
(cont.)
Solution techniques:
General
mincT x
IP-formulation: Ax b
x integer( x Z )
Integer programming
example: graphical solution
(2D)
x2 6
max x1 x2
subjectto :
2x1 x2 4
3x1 4x2 12
xj Z ( j 1,2)
2 optimal solutions!
5
4
x1 x2 6
(objective
)
2
1
0
6
x1
mincT x
Ax b
x0
aij , bi , i, j
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 ky
y 0,1
10
minimizeC( x) where:
Ax b
x0
C( xi )
for xi 0,
ki cixi for xi 0.
0 , for xi 0
use indicator variable yi=
1 , for xi 0
xi M yi
restrictions
:
(i) C( xi ) ki yi ci xi
yi 0,1
11
x 0, Y 0
12
Absolute values:min yt
goal
a x
j
j ,t
bt yt
x j,t 0, yt free
solution:
yt yt yt
variation
yt y y
min yt yt
t
a x
j
j ,t
bt y y
x j,t 0, yt 0, yt 0 13
Conjunctive/disjunctive programming
xk x j pk
xk x j pk M1 y
or
x j xk pj
x j xk pj M2 (1 y)
y {0,1}
14
IP example
nonpreemptive single machine, total
weighted completion time (App. A.3)
model definition:
xjt 1, if job j completesat timet, and0 otherwise
objective function: minimize weighted completion time:
Cmax-1
t x
t 0
jt
completiontimeof job j
n Cmax-1
minimize
j 1
w
t0
t xjt (objectivefunction)
15
IP example (cont.)
Restriction: all jobs must be completed once:
Cmax-1
x
t0
jt
t pj
x
s t
js
n t pj
xjs 1 (restricti
on: exactlyone job per timet)
j 1 s t
16
IP example (cont.)
Complete IP-model:
n Cmax-1
minimize
j 1
w
t0
t xjt
subjectto :
Cmax-1
x
t0
jt
1 (for j 1, , n)
n t pj
x
j 1 s t
js
1 (for t 0, , Cmax- 1)
nCmax
integer
variables
17
IP example (cont.)
Additional restriction: precedence constraints
tx
jt
t0
C max1
tx
t0
kt
completion
timeof job j
pk starttimeof job k
C max1
tx
t0
jt
C max1
tx
t0
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)
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
xt (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 ) c0 (constant)
Ft (it ) min{ct (it , xt ) Ft1(it1(it , xt ))}
xt
21
Level 0
Level 1
child nodes
...
child nodes
...
Level 2
xj = completion
of job j
eitherxtime
k x j pk or x j xk pj (j, k I )
restriction:
solve LP without
disjunctive
restrictions
(= LP relaxation)
if disjunct.
restr. violated
xk x j pk
for j & k
Level 0
Level 1
x j xk pj
...
24
Beam search
26
1
4
0
8
2
2
1
12
3
6
3
11
4
5
5
10
(1,?,?,?)
Level 0
(?,?,?,?)
(2,?,?,?)
(3,?,?,?)
(4,?,?,?)
Level 1
r(3)
r(4)
3
p(j) 4 2 6
r(j) 0 1 3
d(j) 8 12 11
4
5
5
10
0 1 2 3 4 5 6 7 8 9 10 1112 13 14 15 16 17
d(4)<d(3
)
d(3)<d(2
)
Level 0
LB=5
LB=7
infeasibl
*
(1,?,?,?)
(2,?,?,?) (3,?,?,?) (4,?,?,?) Level 1
e:
=UB
(1,3,4,3,
2)
LB=6*
LB=5*=UB
=UB (1,2,?,?)
Jobs 1 2 3 4
(1,3,?,?)(1,3,4,2)
(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
LP solution:x1 0.8,
x2 2.4
x1 0
x1 1
x1 0,
x1 1,
x2 3
x2 2
obj: 3
x2 6
obj: 3
5
4
x1 x2 6
(objective
)
2
x2 2
x2 3
x1 1,
x1 0,
x2 2
x2 3
obj: 3
obj: 3
1
0
6
x1
30
I j (t)
wj
pj
Kp
look-ahead parameter:
WSPT
K = 4.5 + R (R 0.5)
rule
K = 6 - 2R (R 0.5)
R dmax dmin / Cmax = due date range
31
factor
Jobs
p(j)
d(j)
w(j)
w(j)/p(j)
1
10
4
14
1.4
2
10
2
12
1.2
3
13
1
1
0.1
4
4
12
12
3
(1,?,?,?)
(2,?,?,?)
(3,?,?,?)
(4,?,?,?)
I j (t)
wj
pj
max(dj pj t ,0)
Kp
wj
pj
(j 1,2,3)
32
Jobs
p(j)
d(j)
w(j)
w(j)/p(j)
1
10
4
14
1.4
2
10
2
12
1.2
3
13
1
1
0.1
4
4
12
12
3
(?,?,?,?)
(1,?,?,?)
C(j)
10
24
37
14
(2,?,?,?)
(3,?,?,?)
(4,?,?,?)
33
(1,?,?,?)
(2,?,?,?)
(3,?,?,?)
(4,?,?,?)
UB=408UB=436 UB=814UB=440
explored
further
(beam width = 2)
4 nodes
analyzed
(filter width=4)
discarded
34
UB=408
436
(1,?,?,?)
UB=480
(1,2,?,?)
(2,?,?,?)
706
(1,3,?,?)
(3,?,?,?)
408
(1,4,?,?)
UB=408
(1,4,2,3)
best
440
814
(4,?,?,?)
436
(2,1,?,?)
554
(1,4,3,2)
(2,3,?,?)
(2,4,?,?)
436
(2,4,1,3)
608
(2,4,3,1)
35