No Slide Title

Download Report

Transcript No Slide Title

Lecture 6 – Integer Programming
Models
Topics
• General model
• Logic constraint
• Defining decision variables
• Continuous vs. integral solution
• Applications: staff scheduling, fixed charge, TSP
• Piecewise linear approximations to nonlinear
functions
Linear Integer Programming - IP
Maximize/Minimize z = c1x1 + c2x2 +
s.t.
ai1x1 + ai2x2 +
0  xj  uj,

+ ainxn
{ }


=

+ cnxn
bi, i = 1,…,m
j = 1,…,n
xj integer for some or all j =1,…,n
Decision Variables in IP Models
 An IP is a mixed integer program (MIP) if some
but not all of the decision variables are integer.
 If all decision variables are integer we have a pure IP.
 A binary decision variable must be 0 or 1
(a yes-no decision variable).
 If all decision variables are binary, then the IP is
a binary IP (BIP)
 Decision variables that are not required to be
integer-valued are continuous variables
Why study IP?
(1) LP divisibility assumption (fractional
solutions are permissible) is not
always valid.
(2) Binary variables allow powerful new
techniques like logical constraints.
Call Center Employee Scheduling
• Day is divided into 6 periods, 4 hours each
• Demand/period = {15, 10, 40, 70, 40, 35}
• Workforce consists of full-timers (FT) and parttimers (PT)
– FT = 8-hour shift, $121.6/ shift
– PT = 4-hr shift, $51.8/shift
• One PT = 5/6 FT
• In any period, at least 2/3 of the staff must be FT
employees (this is a headcount constraint)
• Problem: Find minimum cost workforce
Call Center Employee IP Model
Decision variables:
xt = # of full-time employees that begin the day at
the start of interval t and work for 8 hours
yt = # of part-time employees that are assigned
interval t
Min z = 121.6(x1 + . . . +x6) + 51.8(y1 +
s.t.
x1 + x6 +
x1 + x2 +
..
.
x5 + x6 +
5
6
y1  15
5
6
y2  10
5
6
y6
 35
x1 + x6 
..
.
x5 + x6 
xt  0, yt  0, t = 1,2,…,6
...
+y6)
2
3
(x1 + x6 + y1)
2
3
(x5 + x6 + y6)
Optimal LP solution
x = ( 7.06, 0, 40, 12.94, 27.06, 7.94 )
y = ( 0, 3.53, 0, 20.47, 0, 0 )
z = 12,795.2 Not feasible to IP model
A correction method: round continuous solution
x = ( 8, 0, 40, 13, 27, 8 )
y = ( 0, 3, 0, 21, 0, 0 )
z = 12,916.8
Feasible – Yes, Optimal? We do not know!
How good is this solution?
*
zLP = 12,795.2 is a lower bound on integer optimum
Hence, the rounded solution is no more than
12,916.8 – 12,795.2
(
12,795.2
)  100% = 0.95%
from the optimum.
Optimal solution is
x = ( 10, 0, 40, 20, 20, 5 )
y = ( 10, 0, 0, 12, 0, 12 )
*
zIP = 12,795.2
• Here the optimal LP and IP objective functions have
the same value.
• This is not commonly true.
Sometimes there is no “obvious” feasible solution
that can be obtained by rounding
X2


















optimal
IP solution


 optimal LP solution

X1
iso-cost line
The IP solution can be “far” from the LP rounded solution
even when the rounded solution is feasible.
The Days-Off Scheduling Problem
Each employee works 5 days per week and is
given 2 consecutive days off [ (5,7)-cycle problem]
cj = weekly cost of pattern j per employee
ri = number of required on day i
xj = number of employees assigned to days-off
pattern j
Note: There are 7 days-off patterns; i, j = 1,…,7
Days-Off Mathematical Model
7
Minimize z =  c j x j
j =1
subject to
7
x
j =1
j
 xi  xi 1  ri , i = 1,..., 7
xj  0 and integer, j = 1,…,7; x0 = x7
Solve problem to get x*j
Minimum cost workforce W =
7
x
j =1
*
j
Compact Mathematical Model
Minimize z = cx
subject to
0

0
1

1
1

1
1

1
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
0
x  0 and integer
0

1
1

1 x  r
1

1
0 
Logic Constraints
Either-Or Constraints
Either f1(x1,…,xn)  b1
or
f2(x1,…,xn)  b2
or both
IP formulation
Let y  {0,1}
f1(x1,…,xn)  b1 + M y
f2(x1,…,xn)  b2 + M (1 – y)
y = 0  first constraint must hold
y = 1  second constraint must hold
Optimization process will choose the y value.
K out of N constraints must hold
N constraints
f1(x1,…,xn)  b1

fN(x1,…,xn)  bN
At least
K out of N
must be
satisfied
f1(x1,…,xn)  b1 + M (1 – y1)

fN(x1,…,xn)  bN + M (1 – yN)
N
S yi = K
i =1
yi  {0, 1}, i = 1,…,N
Example of K out of N Constraints
• A production system has N potential quality
control inspection strategies
• Management has decided that K of these
strategies should be adopted
Compound Alternatives
(Choice constraints for one region only)
f1(x1,…,xn)  b1 + M (1 – y1)
f2(x1,…,xn)  b2 + M (1 – y1)
}
Region 1 constraints
f3(x1,…,xn)  b3 + M (1 – y2)
f4(x1,…,xn)  b4 + M (1 – y2)
}
Region 2 constraints
f5(x1,…,xn)  b5 + M (1 – y3)
f6(x1,…,xn)  b6 + M (1 – y3)
}
Region 3 constraints
y1 + y2 + y3 = 1, y1, y2, y3  {0,1}
Fixed-Charge Problem
n
Min  hk(xk) where hk(xk) =
k =1
{0
fk + ckxk if xk > 0
fk = setup cost, ck = per unit cost
IP formulation:
n
Min
s.t.
 (ckxk + fkyk)
k =1
xk  Myk , k = 1,…,n
yk  {0,1}, k = 1,…,n
xk  0,
k = 1,…,n
if xk = 0
Example: Facility Location Problem
A company has m potential warehouse sites and n
customers
Data:
dj : demand for customer j
si : capacity (supply) of warehouse i
Decision variables:
yi : build a warehouse at site i (1 = yes, 0 = no)
xij : shipment from warehouse i to customer j
Facility Location IP Model
m
Min
n
m
  cijxij +  fiyi
i =1 j =1
i =1
m
s.t.

xij = dj
j = 1,…,n
i =1
Satisfy each customer’s
demand
n

j =1
xij  siyi i = 1,…,m
xij  0, i = 1,…,m, j = 1,…,n
yi  {0,1}, i = 1,…,m
each warehouse can
ship no more than its
supply if it is built
Example: Uncapacitated Facility
Location Problem
Problem: Open set of facilities & assign each
customer to one facility such that cost is
minimized.
Cost could be a function of distance from
facility to customer or could be based
on a response time (e.g., locating fire
stations).
Indices/Sets
potential facility locations, i  I with |I | = m
customers, j  J with |J | = n
Data
fi : cost of opening a facility at location i
cij : cost of assigning customer j to facility i
Decision Variables
yi : open facility at location i (1 = yes, 0 = no)
xij : assign customer j to location i (1 = yes, 0 = no)
Weak formulation
Min
s.t.
  cijxij
iI jJ
+

iI
fiyi
 xij = 1, " j  J
iI
 xij  nyi , " i  I
jJ
{
xij must be 0 for all jJ
if yi = 0;
up to n of the xij can be 1 if
yi = 1.
xij  {0,1}, yi  {0,1} " i  I, j  J
 Not computationally efficiency
Mathematically Equivalent
Strong Formulation
Min
s.t.
  cijxij
+

fiyi
iI jJ
iI
 xij = 1,
"jJ
Each customer is assigned
to exactly one facility
" i  I, j  J
Setup constraint
iI
xij  yi ,
xij  {0,1} yi  {0,1} , " i  I, j  J
Can assign customer j to facility i only if we open facility i.
Set Covering Problem (Airline Crew Scheduling)
• 3 crews, each must be assigned a sequence of flights
that begins and ends in Dallas (DFW)
• Each flight leg must be covered
Possible tours
Leg
DFW  LAX
DFW DEN
DFW  SEA
LAX  CHI
LAX DFW
CHI  DEN
CHI  SEA
DEN  DFW
DEN  CHI
SEA  DFW
SEA  LAX
Cost ($10000)
1
1
2
1
3
4
1
1
5
1
2
2
6
1
1
3
3
3
4
4
2
7
2
2
3
4
7
1
10
1
1
3
4
2
6
9
2
3
2
8
5
4
7
3
2
4
8
11
1
2
5
5
3
3
12
1
3
4
5
2
2
4
4
5
2
9
9
8
9
Decision Variables
xj ( j =1,…,12) assign a crew to tour j (1 = yes, 0 = no)
Formulation (Set covering problem)
Min 2x1 + 3x2 + 4x3 + … + 8x11 + 9x12
s.t. x1 +x4
x2 +x5
x3 +x6
x4 +x7
x1 +x6
+x7 + x10
+x 8 + x11
+x9 + x12
+x9 + x 10+ x12
+x10 + x11

 1 (DFW  LAX)
 1 (DFW  DEN)
 1 (DFW  SEA)
 1 (LAX  CHI)
 1 (LAX  DFW)


x6 +x9 + x10 + x11+ x12  1 (SEA  LAX)
x1 + x2 + … + x12
= 3 (assign 3 crews)
xj  {0,1}, j = 1,…,12
side constraint
Allows “dead heading”; i.e., multiple crews fly on 1 leg
but only 1 crew works (all get paid).
Traveling Salesman Problem (TSP)
1
2
4
3
Problem: Find minimum distance tour that starts at
city 1, visits every other city exactly once,
and returns to city 1.
Decision Variables
xij = 1 if tour includes arc (i, j )
= 0 otherwise
Initial Formulation
Min 50x12 + 44x13 + 25x14+
s.t.
x12 +
x 21 +
x21 +
x12 +.
.
.
x41 +
x14 +
x13 +
x31 +
x23 +
x32 +
x 14 =
x41 =
x 24 =
x 42 =
1
1
1
1
x42 + x43 = 1
x24 + x 34 = 1
...
+ 20x41 + 45x42 + 40x43
xij  {0,1}, i  j
1
4
2
3
This is incomplete because subtours are allowed.
Add Subtour Elimination Constraints
Let S1 = {1,3} and S2 = {2,4}
and require at least 1 arc from S1 to S2
x12 + x14 + x32 + x34  1
Disallows the “2 loop” solution.
Alternative formulation: x13 + x31  1 and x24 + x42  1
To generalize, let N = {1,…,n}, and let S  N
SEC:
S
(ij)S
xij  |S| – 1, 2  |S|  n/2
Example of SEC
Let n = 10 and S = { 2, 5, 6, 9 }.
Then |S | = 4.
SEC: x25 + x26 + x29 + x52 + x56 + x59 +
x62 + x65 + x69 + x92 + x95 + x96  4 – 1 = 3
6
2
5
9
In general, there are an exponential number of
subtour elimination constraints.
Sequencing problems with sequence-dependent
setup times can be modeled as a TSP
• Testing integrated circuits (ICs): A machine is used to test
several batches of ICs of differing types.
• After each batch the machine must be reset.
• The change-over time depends on what type of IC was just
tested and which type will be tested next.
Change-Over Times
IC Type
IC Type
1
2
3
4
1
-20
50
45
2
10
-44
40
3
17
19
-20
4
15
18
25
--
Graph for IC Testing Example
1
Dummy
node
0
2
44
0
17
0
18
Sample path: 0  1  3  2  4  0
Cost of path: 0 + 17 + 44 + 18 + 0 = 79
4
3
• If the cycle is repeated,
IC1  IC3  IC2  IC4  IC1 . . .
then the total change-over time for one cycle is
17 + 44 + 18 + 45 = 124.
• The goal is to sequence the testing order so that
the throughput (i.e., minimize cycle time) is
maximized for fixed batch sizes.
• Note that in this example, the “travel times” are
not symmetric.
General Piecewise Linear Approximations
fj (xj )
(d3j , f3j )
(d5j , f5j )
(d1j , f1j )
(d2j , f2j )
(d4j , f4j )
xj
Given: fj(xj), 0  xj  uj
Let r = number of grid points
Let (dij, fij) be ith grid point, i = 1,…,r
uj
Linear Transformation for jth Variable
r
Let
xj = S i dij
i=1
r
and
fj(xj) = S i fij
i=1
r
where
S i = 1, i  0, i = 1,…,r
i=1
Not sufficient to guarantee solution is on
one of the line segments.
Additional Constraints for Piecewise
Linear Approximation
Requirement: No more than two i can be positive; also
i’s must be adjacent; i.e., i and i+1
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
What You Should Know About
Integer Programming
• How to convert a problem statement in an IP
model.
• How to define the decision variables.
• How to convert logic statements into constraints.
• How to formulation fixed charge problems,
scheduling problems, covering problems,TSP,
piece-wise linear approximation to nonlinear
functions.