Integer Programming
Integer Programming
Min/Max Z= c x
S.t.:
Ax ≤b
x≥0
x: integer
Small Large
Max Z = S + 5L
S.t.:
5S + 50L ≤ 100
S ≤2
S, L ≥ 0 and integers
S
ZLP= 11
S=2 L=1.8
0 1 2 L
- Fixed costs:
. If a product is produced a fixed setup cost is incurred
. If a warehouse is operated a fixed cost is incurred.
- Either or constraints
. Production must either be 0 or ≥100
5 PROJECTS:
Investment requirements $(x1000)
project NPV $ (1000) Year 1 Year 2 Year 3
A 180 30 40 40
B 20 12 8 0
C 72 30 20 20
D 25 15 10 24
E 80 20 40 40
available 70 90 100
xi : {
0 Otherwise
S.t.:
xi = 0 or 1 for i=1,..,5
x1 + x4 ≤ 1
x 5 ≥ x3
x1 ≤ 1 –x2
x1 ≤ 1 –x5
___------- 0--------
x 3 ≥ x5
x4≥ x5
or
x3 +x4 ≥ 2 x5
1 if line i is used
yi : {
0 Otherwise
S.t.:
x1 + x2 +x3 +x4 +x5 ≥ 350
5x1 ≤ 510y1
6x2 ≤ 480y2
10x3 ≤ 600y3
4x4 ≤ 440y4
3x5 ≤ 480y5
y4 ≤ 1 –y1
y5 ≤ 1 –y1
___------- 0--------
x2 + x4 ≤ M – (M-150) y3
x2 ≥ 50y2
y2 ≥ y5
max/ min z c j x j
j 1
S.t.
N
a x b
j 1
ij j i
i=1,..,M
x j
0 and integer j=1,..,N
LOGICAL CONDITIONS
0/1 VARIABLE
1 DO
yi : {
0 DON’T
y1 +y2 ≤ 1
y1 +y2 = 1
y1 +y2 ≥ 1
y1 +y2 ≥ 2 or y1 +y2 = 2
y 1 ≤ y2
6. Fixed charges:
If product is produced then a fixed charge F must be paid
1 if x>0
y:{
0 if x=0
x≤ Cy
Z= ………… + Fy
Case 1:
1 if x= aj
yj : {
0 otherwise
Either
5x1+2x2 ≤ 24 process a
or
3x1+4x2 ≤ 21 process b
5x1+2x2 ≤ 24 + My1
3x1+4x2 ≤ 21 + My2
y1 + y2 =1
a x b
j 1
ij j i
i=1,..,N
a x b M y
j 1
ij j i i
i=1,..,N
y
j 1
i
N k
- Plants
- Warehouses, Distribution Centers
- Service Facilities: Hospitals, schools, …
j
Dj
cij
i Si Fi
S.t.
a) Supply:
N
x S yi
j 1
ij i
i=1,..,M
b)Demand:
M
x D
i 1
ij j
j=1,..,N
or
N
x S
j 1
ij i
i=1,..,M
S.t.
a) Supply:
N
x S
j 1
ij i
i=1,..,M
b)Demand:
M
x D
i 1
ij j
j=1,..,N
Fi Fij cij
F12=1
1 2
2
2
3
6
4 5 2
3
4
5
s.t.:
N N
x x b
j 1
ij
k 1
ki i
for all i=,1..,N
TOWNS 1 2 3 4 5 6
1 0 23 14 18 10 32
2 23 0 24 13 22 11
3 14 24 0 60 19 20
4 18 13 60 0 55 17
5 10 22 19 55 0 12
6 32 11 20 17 12 0
TOWNS 1 2 3 4 5 6
1 1 0 1 0 1 0
2 0 1 0 1 0 1
3 1 0 1 0 0 0
4 0 1 0 1 0 0
5 1 0 0 0 1 1
6 0 1 0 0 1 1
Min Z = x1 + x2 + x3 + x4+ x5 + x6
S.t.:
town 1: x1 + x3 + x5 ≥ 1
town 2: x2 + x4 + x6 ≥ 1
town 3: x1 + x3 ≥ 1
town 4: x2 + x4 ≥ 1
town 5: x1 + x5+ x6 ≥ 1
town 6: x2 + x5 + x6 ≥ 1
M
Min z x
i
i 1
S.t.
M
a x 1
i 1
ij i
j=1,..,N
a x 1
i 1
ij i
j=1,..,N
Profit/gallon
GAS1 at least 50% OIL1 12cents
GAS2 at least 60% OIL1 14cents
Available:
Let.
S.t.:
30
15
25
20
20
15
10
25
25O1 if O1≤500
25O1 if O1≤500
C(O1) = 2500 + 20O1 if 500≤O1≤1000
7500 + 15O1 if 1000≤O1≤1500
O1≤1500
z1 ≤500y1
z2 ≥500y2
z2 ≤1000y2
z3 ≥1000y3
z3 ≤1500y3
O1= z1 + z2 +z3
y1 + y2 +y3 =1
Parts/tasks
ASSEMBLY CHART:
5
C
11 3
B F 7
7
D G
A 4
0 I
E H
12 11
5
C
11 3
B F 7
7
D G
A 4
0 I
E H
12 11
7 min. 15 12 16 13
1 2 3 4 5
N: number of tasks
1 if station k operates
yk = {
0 otherwise
S.t.
x
k 1
ik =1 for all i=1,..,N (2)
t i x
i 1
ik ≤ C yk for all k=1,..,K (3)
K K
k x
k 1
ik
≥ k x
k 1
jk
for all i=1,..,N and jIPi (4)
Given K
Minimize C (1)
t i x ≤ C
i 1
ik
for all k=1,..,K (3)
- PARALLEL STATIONS
2C 2C
ST2-1 ST4-1
C C
ST1
ST3
2C 2C
ST2-2 ST4-2
C=3 min/unit
Min. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ST1 C1 C1 C1 C2 C2 C2
ST2-1 C1 C1 C1 C1 C1 C1
ST2-2 C2 C2 C2 C2 C2 C2
ST3 C1 C1 C1 C2 C2 C2
MAX Z = 8x + 7y
s.t.
-18x +38y ≤ 133
13x +11y ≤ 125
10x - 8y ≤ 55
x, y ≥ 0 and integer
y 7
ZLP=78.25
6 x=4.75
y=5.75
5
1 2 3 4 5 6 7 8
P2 P3
Z= 68.76 Z= 78.18
x=4 y=5.95 x=5 y=5.46
y≤5 y≥6
P4 P5
Z= 78.07 INFEASIBLE
x=5.39 y=5
x≤5 x≥6
P6 P7
Z= 75 Z= 77.91
x=5 y=5 x=6 y=4.27
y≤4
y≥5
P8
Z= 77.85 P9
x=6.23 y=4 INFEASIBLE
x≥7
x≤6
P11
P10 Z= 77.64
Z= 76 x=7 y=3.1
x=6 y=4 y≥4
y≤3
P13
P12 INFEASIBLE
Z= 77.62
x=7.1 y=3
x≤7 x≥8
P14 P15
Z= 77 INFEASIBLE
x=7 y=3
X2
1.25
1.67
1 X1
Add : x1 + x2 ≤ 1 (3)
ZLP3 =4*1 = 4 = ZIP
LP1
IP
S.t.
a) Supply:
N
x S
j 1
ij i
i=1,..,M
b)Demand:
M
x D
i 1
ij j
j=1,..,N
Si Dj
xij
i j
xij≤ M yij
M= Min { Si , Dj }
objects
KNAPSACK
How many of these items to put into the bin so that total value
of the objects will be maximized without exceeding the capacity
of the bin?
item vj wj(tons)
1 6 1
2 3 2
3 2 3
4 1 4
S.t. :
N
Max z v j x j
j 1
S.t.
N
w x K
j 1
j i
s.t.
a1x1+ a2x2+…….+ ajxj+………..+ anxn≤b
LP relaxation: 0≤ xj ≤1
Solving LP:
Order
a
j 1
j
b largest k
k
xk 1 b a j / ak 1
j 1
j 1 2 3 4 5 6 7
cj/aj 1 8/5 1/3 1 2/5 1/2 2
Rank 3 2 6 3 5 4 1
30+50+10=90 ≤ 100
x1=(100-90)/40=1/4
B&B:
j 1 2 3 4
cj/aj 3 1/5 3 1/7 3 2 2/3
Rank 1 2 3 4
S2 S3
ZLP= 43 1/3 ZLP= 43 5/7
x1=x2=1 x1=x3=1
x4=2/3 x2=5/7
S6 S7
ZLP= 42 INF
x2=x3=x4=1
- JOB SCHEDULING
JOBS
Sequence?
n! different sequences
CUSTOMERS
???
dij
SM
n! different sequences
B&B
JOBS
1
xij
Position (j)
2
3
4 3 2 1
4 position
Sequence (1-2-3-4)
1 2 3 4
Ti 0 6 3 7
Total Tardiness = 16
Formulate: n jobs
S.t.
n
x
j 1
ij
1 i=1,..,n
x
i 1
ij
1 j=1,..,n
K j
K j 1 i 1
px
i ij
j=1,..,n
T j
K j d i xij
i 1
j=1,..,n
S’ S
S’ S
qS’
q p
S' i
iS '
Position |S’|
S’ | ii S
qS’
X14 =1
X24 =1 X34 =1
X44 =1
Node 1 Node 2 Node 3 Node 4
LB= 15 LB= 19 LB= 11 LB= 7
q = 17 q = 19 q = 18 q = 15
j=3
X13 =1 X33 =1
X23 =1
X12 =1 X22 =1
j=2
Node 8 Node 9
LB= 12 LB= 16
q=4 q=6
j=4
X14 =1
X24 =1 X34 =1
X44 =1
Node 1 Node 2 Node 3 Node 4
LB= 15 LB= 19 LB= 11 LB= 7
q = 17 q = 19 q = 18 q = 15
j=3 X13 =1
X13=1
X23 =1 X33 =1
X23=1 X43=1
X12 =1 X22 =1
j=2
Node 8 Node 9
LB= 12 LB= 16
q=4 q=6
n!
OPT
pi ≤ pj and di ≤ dj i<<j
2<< 1,3,4
1,2,3<<4
( 1 3)
2 4
j=4
X13 =1
X33 =1
X12 =1
j=2
Node 8
LB= 12
q=4
2
1
TOUR
4
S.t.
n
x
j 1
ij
1 i=1,..,n
x
i 1
ij
1 j=1,..,n
connection
S S’
n n
x 1
iS jS '
ij for all subsets S{1,2,…,n}
Add 2n constraints
u3-u4 +5x34 ≤4
u4-u3 +5x43 ≤4
+______________
5(x34 +x43 ) ≤8
NOT UNIMODULAR!!!!!!!!!
cij
i/j 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M 113 303
4 164 201 113 M 196
5 58 79 303 196 M
BRANCH:
x34=0 x43=0
c34=M c43=M
S2
ZAP = 652 S3
1-4-3-1 ZAP = 652
2-5-2 1-3-4-1
2-5-2
X25=0 X52=0
S3 S4
ZAP = 668 ZAP = 704
1-5-2-4-3-1 1-4-3-2-5-1
X25=0 X52=0
S5 S6
ZAP = 704 ZAP = 910
1-5-2-3-4-1 1-3-1
2-5-4-2
3-4-3
SOLUTION METHODS
A. CONSTRUCTION HEURISTICS:
B. IMPROVEMENT HEURISTICS
- exchange based
- ….
C. META HEURISTICS
- Tabu search
- Simulated annealing
- Genetic Algorithms
- Ant colony
- …
i/j 1 2 3 4 5
1 M 120 220 150 210
2 120 M 100 110 130
3 220 80 M 160 135
4 150 M 160 M 190
5 210 130 185 M M
Start at city 3
80
3------- >2
110
2------- >4
150
4------- >1
210
1------- >5
183
5------- >3
ZTSP= 735
IMPROVEMENT HEURISTICs :
Pairwise exchange
2< -- >4
4< --> 1 725
k-->i-->j-->l
k-->j-->i-->l
Exchange ZTSP
(2-4)
(4-1) 725
(1-5) 810
n-OPT ???
Meta heuristics:
- Tabu search
- Simulated annealing
- Genetic Algorithms
- Ant colony
- …
CONSTRUCTION
iterate
IMPROVEMENT
Z(CHI) / Z(OPT) ≤ 2
Z(HEUR) / Z(OPT) ≤ B
2. PROBABILISTIC ANALYSIS
E[Z(HEUR)] / E[Z(OPT)] ≤ K
NNH 15%
CIH 15%
2. M-TSP Capacitated
di j2
i1
i2
j1
dj
TSP
IE424 Scheduling
IE452 Mathematical Modeling and Applications
IE455 An Introduction to Combinatorial Analysis
IE456 Network Routing