1 material to cover relationship between different types of models incorrect to round real to...
TRANSCRIPT
1
Material to Cover
relationship between different types of models
incorrect to round real to integer variables
logical relationship: site selection
weak and strong formulation: uncapacitated facility location problem
set covering problems: airline crew scheduling
generalized piecewise linear approximation
2
max/min z = c1x1 + c2x2 + … + cnxn
s.t.
ai1x1 + ai2x2 + … + ainxn bi, i = 1,…, m
0 xj uj, j = 1,…, n
xj integer for some or all j =1,…, n
{
}
Linear Integer Programming - IP
3
mixed IP (MIP): some xj Z#1, some xj #2
pure IP: all xj Z
binary decision variable: xj = 1 or 0 (e.g., a variable for a yes-no decision)
binary IP (BIP): all xj being binary
Linear Integer Programming - IP
#1 Z: the set of integers; Z+: the set of positive integers
#2 : the set of real numbers ; +: the set of positive real numbers
4
Motivation of Studying IP
integer variables in some context e.g., machine, manpower
logical relationship incorrect to round continuous variables
5
Incorrect to Round Continuous Variables
optimal LP solution
X1
X2
optimalIP solution
iso-cost line
usually all right to round in real life
problems with large xi
6
Example to Motivate IP
site selection: three designs A, B, C on sites 1, 2, 3, 4
total amount for investment: $100 M how to invest?
Option A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4
Net Income ($M) 6 7 9 11 12 15 5 8 12 16 19 20
Investment ($M) 13 20 24 30 39 45 12 20 30 44 48 55
7
Example to Motivate IP
I = {A, B, C, D}, J = {1, 2, 3, 4}
yij = 1 iff design i used at site j, iI, jJ
max z = iI pij yij
s.t. iI jJ aij yij 100
yij {0, 1}, iI, jJ
optimal solution: yA1 = yA3 = yB3 = yB4 = yC1 = 1; z* = 40
8
Example to Motivate IP
boss says NO!
at most one design at a site
a building at site 2 (required)
at most two designs at the three sites
design A considered for sites 1, 2, and 3 only if being used at site 4
how to model?
9
Example to Motivate IP
at most one design at a site and a building at site 2 (required)
yA1 + yB1 + yC1 1, yA2 + yB2 + yC2 = 1,
yA3 + yB3 + yC3 1, yA4 + yB4 + yC4 1
design A considered for sites 1, 2, and 3 only if being used at site 4
yA1 + yA2 + yA3 3yA4
10
Example to Motivate IP
at most two designs at the three sites
wi = 1, if design i is used, = 0, o.w., i = A, B, C
wA + wB + wC 2
yi1+yi2+yi3+yi4 4wi, i = A, B, C
optimal solution: yA1 = yA4 = yB2 = yB3 = 1; others = 0; z* = 37
11
Logical Constraints for Variables
n situations how to model (i) at most k of them hold, (ii) at least k of them hold, and (iii) exactly k hold
yj binary variables for j = 1 to n; yj = 1 if j holds, and = 0 otherwise
mutually exclusive yj: y1 + y2 + … + yn 1
at most k of yj = 1: y1 + y2 + … + yn k
at least k of yj = 1: y1 + y2 + … + yn k
exactly k of yj = 1: y1 + y2 + … + yn = k
12
Logical Constraints for Expressions
either-or constraints
either f1(x1, …, xn) b1 or f2(x1, …, xn) b2 or both
IP formulation: let y be a binary variable
M: a large positive number, practically “”
two constraints: f1(x1, …, xn) b1+My and f2(x1, …, xn) b2+M(1-y)
only one of these two being picked by the optimization procedure
13
Logical Constraints for Expressions
m constraints, at least k out of m being true f1(x1, …, xn) b1, …, fm(x1, …, xn) bm
modeling procedure m binary variables yi, one for each constraint
f1(x1, …, xn) b1+M(1-y1), …, fm(x1, …, xn) bm+M(1-ym)
y1 + … + ym k
14
An Example of Logical Constraints for Expressions
single processor for three jobs, of processing times 3 hr, 5 hr, and 7 hr, respectively
objective: minimizing the total completion time of the three jobs
how to formulate it as an integer program? note. The IP is for the illustration of formulation.
The problem has very simple solution.
15
Definitions of Parameters and Variables
si: the processing start time of job i
ci: the completion time of job i
pi: the processing time of job i (i.e., p1 = 3, p2 = 5, p3 = 7)
C: total completion time
16
How About This?
if job 1 before job 2, and before job 3, C = 26
if job 1 before job 3, and before job 2, C = 28
if job 2 before job 1, and before job 3, C = 28
if job 2 before job 3, and before job 1, C = 32
if job 3 before job 1, and before job 2, C = 32
if job 3 before job 2, and before job 1, C = 34
17
How About This?
s1 s2 s3, C = 26 if (y12=1 & y23=1), C = 26
s1 s3 s2, C = 28 if (y13=1 & y32=1), C = 26
s2 s1 s3, C = 28 if (y21=1 & y13=1), C = 28
s2 s3 s1, C = 32 if (y23=1 & y31=1), C = 32
s3 s1 s2, C = 32 if (y31=1 & y12=1), C = 32
s3 s2 s1, C = 34 if (y32=1 & y21=1), C = 34
then setting conditions on yij …, which obviously not working
18
The Formulation
min c1 + c2 + c3,
s.t. c1-s1 = 3; c2-s2 = 5; c3-s3 = 7;
one of c1 s2 and c2 s1 holds;
one of c1 s3 and c3 s1 holds;
one of c2 s3 and c3 s2 holds;
ci 0, si 0, i = 1, 2, 3.
19
The Formulation
min c1 + c2 + c3,
s.t. c1-s1 = 3; c2-s2 = 5; c3-s3 = 7;
c1 s2+My12; c2 s1+My21; y12+y21 = 1;
c1 s3+My13; c3 s1+My31; y13+y31 = 1;
c2 s3+My23; c3 s2+My32; y23+y32 = 1;
ci 0, si 0, i = 1, 2, 3;
yij {0, 1}, i j, and i, j = 1, 2, 3
yij = 1 if job j is before job i.
20
Equivalence Between BIP and General PIP
BIP PIP BIP PIP a PIP of bounded integer variables BIP max 5x1 + 2x2
s.t. 2x1 + x2 15
x1 0, x2 Z+
conversion 0 x2
15
x2 = y1 + 2y2 + 4y3 + 8y4, yi binary
21
Fixed-Charge Problem
costs for having a facility at site j, j = 1 to n set up cost kj
variable cost cj per unit of capacity
capacity of the whole system C minimum cost site selection for the capacity co
nstraint
22
Fixed-Charge Problemn
j=1min fj(xj) where fj(xj ) = {
kj + cjxj, if xj > 0
0, if xj = 0
kj = set-up cost, cj = per unit cost
IP formulation:
minn
j =1 ( cjxj + kjyj )
s.t.xj Myj, j = 1, …, n;
j xj C;
yj {0,1}, j = 1, …, n;
xj 0, j = 1, …, n;
23
A More Realistic Fixed-Charge Problem
telecommunication network
source nodes S = {1, 3, 7}; destination nodes D = {2, 4, 5, 8}; transshipment node T = {6}
solid links: existing; dotted links: planned; total A = {1, 2, …, 17}
each link: (capacity, cost)
planned links A’ = {1, 2, …, 5}; fixed costs f1 = 8; f2 = 6; f3 = 9, f4 = 7, f5 = 7
min cost construction to satisfy the demands & flows
24
A More Realistic Fixed-Charge Problem
decision variables
xk: the amount of flow in link k
yk: the binary variable of constructing link k A'
parameters
bi: the demand of node i (source = -demand)
uk: the upper bound of flow of link k
fk: the fixed cost coefficient
ck: the variable cost coefficient
25
A More Realistic Fixed-Charge Problem
min z = kA’fkyk + kA ckxk
s.t.
total in-flow – total out-flow = bi, conservation of flow node i
xk ukyk, capacity constraint (proposed) arc k A'
xk uk, capacity constraint (existing) arc k A
yk = 0 or 1, binary variable (proposed) arc k A'
xk 0, arc k A A'
26
Facility Location Problem
distributing goods to n customers possibly through m warehouses
warehouse i fixed cost fi
variable cost vi per unit capacity
maximum capacity ui
shipment cost cij per unit
from warehouse i to customer j
C1
.
.
.Cn
W1
.
.
.
Wm
27
Facility Location Problem distributing goods to n customers possibly through m warehouse
s data
dj : demand for customer j ui : maximum capacity at warehouse i fi : fixed cost to build warehouse i vi : variable cost/unit of capacity of warehouse i cij : variable cost/unit of goods sent from warehouse i to custome
r j decision variables
yi: build a warehouse at site i? (1 = yes, 0 = no)
zi : capacity (supply) of warehouse i xij: shipment from warehouse i to customer j
28
Facility Location Problem
m
i
n
jijij
m
iii
m
iii xczvyf
1 111min
miy
njmix
miz
i
ij
i
,...,1 },1,0{
,...,1 ,,...,1 ,0
..., 1, ,0
warehousea of constraintcapacity
ouseeach warehcapacity
demands all meeting
1
1
,...,1 ,
,...,1 ,
,...,1 ,
miyuz
mizx
njdx
iii
n
jiij
m
ijij
29
Strong versus Weak Formulation – An Illustration through the Facility Location Problem
uncapacitated version of the facility location problem intuitively optimal to have each customer satisfied by
one warehouse simplified the formulation re-definition
cij: shipment cost to customer j, possibly including the variable cost of operating warehouse i for demand dj
xij: proportion of demand j satisfied by warehouse i
30
Weak Formulation
miy
njmix
minyx
njx
xcyf
i
ij
n
jiij
m
iij
m
i
n
jijij
m
iii
,...,1 },1,0{
,...,1 ,,...,1 },1,0{
,...,1 ,
,...,1 ,1
min
ouseeach wareh of constraintcapacity 1
demands all meeting1
1 11
31
Strong Formulation
miy
njmix
njmiyx
njx
xcyf
i
ij
iij
m
iij
m
i
n
jijij
m
iii
,...,1 },1,0{
,...,1 ,,...,1 },1,0{
,...,1 ,,...,1 ,
,...,1 ,1
min
ouseeach wareh of constraintcapacity
demands all meeting1
1 11
32
Comparison of the Strong and Weak Formulations
strong: more constraints xij yi, i = 1, …, m; j = 1, …, n
weak: less constraints i xij nyi, j = 1, …, n
which one is better? strong: more precise constraints and possibly s
horter computation time
33
Covering Problems and Partitioning Problems
S: a set of m items Sj: a subset of S that includes one or more of the it
ems, j = 1, …, n cj: the cost of selecting subset j
selecting the minimum cost collection of subsets Sj to include elements of S set covering: fine as long as including all items of S set partitioning: each element of S is included exactly once
34
Airline Crew Scheduling (Set Covering Problem)
service network
group legs into tours according to constraints
LAX
SEA
CHI
DEN
DFW
35
Airline Crew Scheduling (Set Covering Problem)
a tour: feasible assignment for a crew, starting & ending at DFW
a leg: a flight scheduled between two cities covering 11 legs by 3 crews on 12 possible tours minimizing the total tour cost
Tour 1 2 3 4 5 6 7 8 9 10 11 12
DFW LAX 1 1 1 1DFW DEN 1 1 1 1DFW SEA 1 1 1 1
LAX CHI 2 2 3 2 3LAX DFW 2 3 5 5 CHI DEN 3 3 4CHI SEA 3 3 3 3 4DEN DFW 2 4 4 5DEN CHI 2 2 2
SEA DFW 2 4 4 5
SEA LAX 2
Cost 2 3 4 6 7 5 7 8 9 9 8 9
24 42
36
Airline Crew Scheduling (Set Covering Problem)
optimal solution: “Dead heading” on first leg
Min 2x1+3x2+4x3 + … + 8x11 + 9x12
s.t. x1 +x4 +x7 + x10 (DFW LAX)x2 +x5 +x8 + x11 (DFW DEN)x3 +x6 +x9 + x12 (DFW SEA)x4 +x7 +x9 + x10+ x12 (LAX CHI)x1 +x6 +x10 +x11 (LAX DFW)
x6 +x9 +x10 + x11+ x12
1(SEA LAX)
x1 +x2 +… + x12 = 3 (assign 3 crews)
xj {0,1}, j = 1,…,12
1
1
1 1 1
37
The Days-Off Scheduling Problem
(5,7)-cycle: 5 working days + 2 consecutive days off
7 days-off patterns parameters
ri = number of employees required on day i
cj = weekly cost of pattern j per employee
decisions xj = # of employees using days-off pattern j
38
The Days-Off Scheduling Problem
min z = cjxj
s.t. ( xj ) – xi – xi-1 ri , i = 1,…7
xj 0 and integer, j = 1,…,7; x0 = x7
7
j=1
7
j=1
solve problem to get x*j
minimum cost workforce W = x*j
7
j=1
39
The Days-Off Scheduling Problem
possibly to be solved as two LP compact expression
Minimize z = cx s.t.
rx
0011111
1001111
1100111
1110011
1111001
1111100
0111110
x 0 and integer
40
The Cutting Stock Problem
raw material: rolls of 25 ft
requirements 5-foot: 40 rolls
8-foot: 35 rolls
12-foot: 30 rolls
15-foot: 25 rolls
17-foot: 20 rolls
objective: using minimum # of 25-foot rolls
41
General Piecewise Linear Approximations
f (x )j j
jju
x
(d , f )1j 1j
(d , f )2j 2j
(d , f )3j 3j
(d , f )4j 4j
(d , f )5j 5j
fj(xj), 0 xj uj
r = number of grid points
(dij, fij) be ith grid point, i = 1…, r
42
Linear Transformation for xj
xj = idij
gj(xj) = ifij
i = 1, i 0, i = 1,…, r
not sufficient to guarantee that the solution is on one of the line segments
r
i=1
r
i=1
r
i=1
43
Additional Constraints for Piecewise
Linear Approximation condition: at most two positive i, and positive i‘s adjacent
1 ≤ y1
i ≤ yi-1 + yi , i = 2,…, r–1
r ≤ yr-1
y1 + y2 + · · · + yr-1 = 1
yi = 0 or 1, i = 1,..., r–1 not necessary to define ’s if minimizing a convex function or
maximizing a concave function
44
Approximation in Minimizing
a Convex Objective Function
20.251640y
4.5420x1
CBAOpoints
45
Approximation in Minimizing
a Convex Objective Function
all right to omit (4) if approximating a convex
objective function in minimization or a concave objective
function in maximization
46
Approximation in Minimizing
a Convex Objective Function
all right to omit (4) if approximating a convex
objective function in minimization or a concave objective
function in maximization
47
Special Non-linear Objective Functions
machines: A to D products: P, Q, R potential sales: P 100, Q 100, R 100
prod
mh timeP Q R available
time
A 20 10 10 2400
B 12 28 16 2400
C 15 6 16 2400
D 10 15 0 2400
48
Special Non-linear Objective Functions
nonlinear unit profit from the products
prod
salesP Q R
0-30 60 40 20
31-60 45 60 70
61-100 35 65 20
How to formulate the problem?
49
Special Non-linear Objective Functions
max Z = f1(P) + f2(Q) + f3(R) s.t. 20P + 10Q + 10R 2400 (mh A) 12P + 28Q + 16R 2400 (mh B) 15P + 6Q + 16R 2400 (mh C) 10P + 15Q 2400 (mh D) P 100, Q 100, R 100 (marketi
ng) P 0, Q 0, R 0 How to model f1(P), f2(Q), f3(R)
50
Special Non-linear Objective Functions
Pi: # of sales of product P in the ith price range
Qi: # of sales of product Q in the ith price range
Ri: # of sales of product R in the ith price range
object function: max Z = 60P1+45P2+ 35P3+40Q1+60Q2
+ 65Q3+20R1+70R2+20R3
51
Special Non-linear Objective Functions
Z = 60P1+45P2+ 35P3+40Q1+60Q2+ 65Q3
+20R1+70R2+20R3+ for P
0 P1 30, 0 P2 30, 0 P3 40 concave prices, no additional constraints
for Q 0 Q1 30, 0 Q2 30, 0 Q3 40
use second price segment only if Q1 = 30
use third price segment only if Q2 = 30
for R 0 R1 30, 0 R2 30, 0 R3 40
use second and third price segments only if R1 = 30
52
Special Non-linear Objective Functions
for Q yQ2 = 1 if sales in segment 2 are made
= 0 otherwise
yQ3 = 1 if sales in segment 3 are made
= 0 otherwise
30yQ2 Q1 30, 30yQ3 Q2 30yQ2, 0 Q3 40yQ3
for R yR2 = 1 if sales in segments 2 or 3 are made
= 0 otherwise
30yR2 R1 30, 0 R2 30yR2, 0 R3 40yR2
53
Other Examples
Traveling salesman problems sequence dependent setup times
assembly line balancing