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
1
Linear Integer Programming - IP
 max/min
z = c1x1 + c2x2 + … + cnxn
 s.t.


=

ai1x1 + ai2x2 + … + ainxn {

0  xj  uj,

xj integer for some or all j =1,…, n
j = 1,…, n
} bi, i = 1,…, m
2
Linear Integer Programming - IP
 mixed
 pure
IP (MIP): some xj  Z#1, some xj  #2
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
#1
Z: the set of integers; Z+: the set of positive integers
#2
: the set of real numbers ; +: the set of positive real numbers
3
Motivation of Studying IP
 integer
 e.g.,
variables in some context
machine, manpower
 logical
relationship
 incorrect to round continuous variables
4
Incorrect to
Round Continuous Variables
X2


















optimal
IP solution


 optimal LP solution

X1
iso-cost line
usually all right to
round in real life
problems with large xi
5
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
6
Example to Motivate IP
I
= {A, B, C, D}, J = {1, 2, 3, 4}
 yij
= 1 iff design i used at site j, iI, jJ
 max
z = iI pij yij
 s.t.
iI jJ aij yij  100

yij  {0, 1}, iI, jJ
 optimal
z* = 40
solution: yA1 = yA3 = yB3 = yB4 = yC1 = 1;
7
Example to Motivate IP
 boss
 at
a
says NO!
most one design at a site
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?
8
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
9
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
10
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
11
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
 b2+M(1-y)

only one of these two being picked by the optimization
procedure
f2(x1, …, xn)
12
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
13
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.
14
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
15
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
16
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
17
The Formulation
 min c1
 s.t.
+ c2 + c3,
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.
18
The Formulation
 min c1
 s.t.
+ c2 + c3,
yij = 1 if job j is before job i.
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
19
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
20
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
of the whole system  C
 minimum cost site selection for the capacity
constraint
 capacity
21
Fixed-Charge Problem
kj + cjxj, if xj > 0
n
min  fj(xj) where fj(xj ) = {
0,
j=1
if xj = 0
kj = set-up cost, cj = per unit cost
IP formulation:
n
min
 ( c jx j + k jy j )
j =1
s.t.
xj  Myj,
j = 1, …, n;
j xj  C;
yj  {0,1}, j = 1, …, n;
xj  0,
j = 1, …, n;
22
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
23
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
24
A More Realistic
Fixed-Charge Problem

min z = kA’fkyk + kA 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'
25
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
W1
C1
.
.
.
.
.
.
Wm
Cn
26
Facility Location Problem


distributing goods to n customers possibly through m
warehouses
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 customer 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
27
Facility Location Problem
m
m
m n
i =1
i =1
i =1 j =1
min  f i yi   vi zi    cij xij
m
 xij = d j , j = 1,..., n
i =1
n
meeting all demands
 xij  zi , i = 1,..., m
capacity each warehouse
zi  ui yi , i = 1,..., m
capacity constraintof a warehouse
j =1
zi  0, i = 1, ..., m
xij  0, i = 1,..., m, j = 1,..., n
yi  {0,1}, i = 1,..., m
28
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
29
Weak Formulation
m
m n
i =1
i =1 j =1
min  f i yi    cij xij
m
 xij = 1, j = 1,..., n
meeting all demands
 xij  nyi , i = 1,..., m
capacity constraint of each wareh ouse
i =1
n
j =1
xij  {0,1}, i = 1,..., m, j = 1,..., n
yi  {0,1}, i = 1,..., m
30
Strong Formulation
m
m n
i =1
i =1 j =1
min  f i yi    cij xij
m
 xij = 1, j = 1,..., n
meeting all demands
xij  yi , i = 1,..., m, j = 1,..., n
capacity constraintof each warehouse
i =1
xij  {0,1}, i = 1,..., m, j = 1,..., n
yi  {0,1}, i = 1,..., m
31
Comparison of the
Strong and Weak Formulations
 strong:
 xij
more constraints
 yi,
 weak:
i = 1, …, m; j = 1, …, n
less constraints
 i xij
 nyi,
j = 1, …, n
 which
one is better?
 strong: more precise constraints and possibly
shorter computation time
32
Covering Problems and
Partitioning Problems
S: a set of m items
 Sj: a subset of S that includes one or more of the
items, 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

33
Airline Crew Scheduling
(Set Covering Problem)
 service network
CHI
SEA
DEN
LAX
DFW
 group legs into tours according to constraints
34
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
DFW  LAX
DFW DEN
DFW  SEA
LAX  CHI
LAX DFW
CHI  DEN
CHI  SEA
DEN  DFW
DEN  CHI
SEA  DFW
SEA  LAX
1
Cost
2
3
4
5
6
1
1
8
2
2
3
3
4
3
2
4
4
2
2
3
4
7
12
3
2
5
5
3
3
1
3
4
5
2
2
6
11
1
1
3
3
10
1
1
1
2
2
9
1
1
1
7
5
4
7
2
5
4
8
2
4
4
2
9
9
8
9
35
Airline Crew Scheduling
(Set Covering Problem)
Min 2x1 +3x2 +4x3 + … + 8x11 + 9x12
s.t. x1 +x4 +x7 + x10
 1 (DFW  LAX)
x2 +x5 +x8 + x11
 1 (DFW  DEN)
x3 +x6 +x9 + x12
 1 (DFW  SEA)
x4 +x7 +x9 + x10 + x12  1 (LAX  CHI)
x1 +x6 +x10 + x11
 1 (LAX  DFW)



x6 +x9 + x10 + x11+ x12  1 (SEA  LAX)
x1 +x2 + … + x12
= 3 (assign 3 crews)
xj  {0,1}, j = 1,…,12

optimal solution: “Dead heading” on first leg
36
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
37
The Days-Off Scheduling Problem
7
 min z =  cjxj
j=1
7
 s.t. ( xj ) – xi – xi-1  ri ,
i = 1,…7
j=1
 xj  0 and integer, j = 1,…,7;
 solve problem to get x*j
x0 = x7
7
 minimum cost workforce W =  x*j
j=1
38
The Days-Off Scheduling Problem
 possibly
to be solved as two LP
 compact expression
 Minimize
 s.t.
0

0
1

1
1

1

1
z = cx
1 1 1 1 1 0

0 1 1 1 1 1
0 0 1 1 1 1

1 0 0 1 1 1 x  r
1 1 0 0 1 1 
1 1 1 0 0 1
x  0 and integer

1 1 1 1 0 0
39
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
40
General Piecewise Linear Approximations
fj (xj )
(d3j , f3j )
(d5j , f5j )
(d1j , f1j )
(d2j , f2j )
 fj(xj), 0  xj  uj
(d4j , f4j )
xj
uj
 r = number of grid points
 (dij, fij) be ith grid point, i = 1…, r
41
Linear Transformation for xj
r
 xj =  idij
i=1
r
 gj(xj) =  ifij
i=1
r
  i = 1, i  0, i = 1,…, r
i=1
 not sufficient to guarantee that the solution is on
one of the line segments
42
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
43
Approximation in Minimizing
a Convex Objective Function
points
O
A
B
C
x1
0
2
4
4.5
y
0
4
16
20.25
44
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
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
Special Non-linear
Objective Functions

machines: A to D

products: P, Q, R

potential sales: P  100, Q  100, R  100
prod
mh time
P
Q
R
available
time
A
B
C
D
20
12
15
10
10
28
6
15
10
16
16
0
2400
2400
2400
2400
47
Special Non-linear
Objective Functions
 nonlinear
unit profit from the products
prod
sales
P
Q
R
0-30
60
40
20
31-60
45
60
70
61-100
35
65
20
 How to formulate the problem?
48
Special Non-linear
Objective Functions
max
 s.t.







Z = f1(P) + f2(Q) + f3(R)
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 (marketing)
P  0, Q  0, R  0
How to model f1(P), f2(Q), f3(R)
49
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
50
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
51
Special Non-linear
Objective Functions

for Q

yQ2
= 0 otherwise


yQ3

= 1 if sales in segment 3 are made
= 0 otherwise


= 1 if sales in segment 2 are made
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
52
Other Examples
 Traveling
salesman problems
 sequence
 assembly
dependent setup times
line balancing
53