5 Integer Programming

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 58

Integer Programming

Types of Integer Programming Models


 The LP that results from dropping the integer requirements is
called the LP Relaxation of the ILP.

 A LP in which all the variables are restricted to be integers is


called an all-integer linear program (ILP).

 If only a subset of the variables are restricted to be integers,


the problem is called a mixed-integer linear program (MILP).

 Binary variables are variables whose values are restricted to


be 0 or 1. If all variables are restricted to be 0 or 1, the
problem is called a 0-1 or binary integer linear program.
Applications Areas

 Transportation planning and operations


 Facility location
 Production scheduling
 Supply-chain management
 Many others
Rounding

 It is tempting to simply round a


fractional solution to the closest integer
solution.
 In general, this does not work reliably:
– The rounded solution may be infeasible.
– The rounded solution may be suboptimal.
Integer Programming Problems and
Sensitivity Analysis

 Integer programming problems do not readily lend


themselves to sensitivity analysis as only a relatively few of
the infinite solution possibilities in a feasible solution space
will meet integer requirements.

 Trial-and-error examination of a range of reasonable


alternatives involves completely solving each revised
problem.
Branch and Bound Technique
Branch-and-Bound

 The Branch-and-Bound (B&B) algorithm can


be used to solve ILP problems.
 Branch
– Selection of an integer value of a decision variable
to examine for a possible integer solution to a
problem.
 Bound
– An upper or lower limit on the value of the objective
function at a given stage of the analysis of an integer
programming problem.
Bounds

 The optimal solution to an LP relaxation of an ILP


problem gives us a bound on the optimal objective
function value.
 For maximization problems, the optimal relaxed
objective function values is an upper bound on the
optimal integer value.
 For minimization problems, the optimal relaxed
objective function values is a lower bound on the
optimal integer value.
ILP Solution Procedure

 Formulate the problem


 Solve the “Relaxed” LP Problem
– “Relaxed” means that we are temporarily suspending the
integer requirement
 Round to find the nearest guaranteed integer
solution
– Round down for a maximization problem
– Round up for a minimization problem
 Use “Branch and Bound” to seek an improved
solution.
The Branch-And-Bound Algorithm

MAX: 2X1 + 3X2


S.T. X1 + 3X2 <= 8.25
2.5X1 + X2 <= 8.75
X1, X2 >= 0 and integer
Solution to LP Relaxation (no integer restriction)
X2
3 Feasible Integer Solutions

Optimal Relaxed Solution


X1 = 2.769, X2=1.826
2 Obj = 11.019

0
0 1 2 3 4 X1
The Branch-And-Bound Algorithm
Problem I MAX: 2X1 + 3X2
S.T. X1 + 3X2 <= 8.25
2.5X1 + X2 <= 8.75
X1 <= 2
X1, X2 >= 0

Problem II MAX: 2X1 + 3X2


S.T. X1 + 3X2 <= 8.25
2.5X1 + X2 <= 8.75
X1 >= 3
X1, X2 >= 0
Solution to LP Relaxation
X2
3 Problem I

X1=2, X2=2.083, Obj = 10.25

Problem II
X1=3, X2=1.25, Obj = 9.75

0
0 1 2 3 4 X1
The Branch-And-Bound Algorithm
Problem III MAX: 2X1 + 3X2
S.T. X1 + 3X2 <= 8.25
2.5X1 + X2 <= 8.75
X1 <= 2
X2 <= 2
X1, X2 >= 0 and integer

Problem IV MAX: 2X1 + 3X2


S.T. X1 + 3X2 <= 8.25
2.5X1 + X2 <= 8.75
X1>= 3
X2 <= 2
X1, X2 >= 0 and integer
Solution to LP Relaxation
X2
3 Problem III

X1=2, X2=2, Obj = 10

2
Problem II

X1=3, X2=1.25, Obj = 9.75

0
0 1 2 3 4 X1
B&B Summary
Original Problem
X1=2.769
X2=1.826
Obj = 11.019 X1>=3
X1<=2
Problem II
Problem I
X1=2 X1=3
X2=2.083 X2=1.25
Obj = 10.25 Obj = 9.75

X2<=2 X2>=2

Problem III Problem IV


X1=2
X2=2 infeasible
Obj = 10
The LP Relaxation Solution
0-1 programming
B&B method
Enumeration method: Tree Diagram

STEPS:
1. List all possible alternatives
2. Determine which alternative is feasible
3. Find the value of objective function
for each feasible alternative
4. Select the feasible alternative with the
best value of the objective function

Enumeration method is most useful


when the number of alternatives is fairly
small (<=16), else it becomes tedious
Solving Integer Programming

 Branch and Bound method


– Creates and solves a sequence of subproblems to
the original problem that are increasingly more
restrictive until an optimal solution is found.
 Enumeration Method
– A method used with 0–1 problems that involves
listing every possible outcome in order to
identify the optimal solution.
Formulating Integer Programming
Problems with 0–1 Constraints

 Either-Or Alternatives

 k-Out-of-n Alternatives

 If-Then Alternatives

 Either-Or Constraints

 Variables That Have Minimum Level Requirements


Metropolitan Microwaves
Metropolitan Microwaves is planning to expand its
operations into other electronic appliances. The company
has identified seven new product lines it can carry.

Initial Floor Space Exp. Rate


Product Line Invest. (Sq.Ft.) of Return (%)

1. Black & White TVs $ 6,000 125 8.1


2. Color TVs 12,000 150 9.0
3. Large Screen TVs 20,000 200 11.0
4. VHS VCRs 14,000 40 10.2
5. Beta VCRs 15,000 40 10.5
6. Video Games 2,000 20 14.1
7. Home Computers 32,000 100 13.2
Metropolitan Microwaves
Metropolitan has decided that they should not stock large
screen TVs unless they stock either B&W or color TVs. Also,
they will not stock both types of VCRs, and they will stock
video games if they stock color TVs. Finally, the company
wishes to introduce at least three new product lines.

If the company has $45,000 to invest and 420 sq. ft. of floor
space available, formulate a model for optimal decision
making

(maximize the expected rate of return)


Metropolitan Microwaves
 Define the Decision Variables
xj = 1 if product line j is introduced;
= 0 otherwise.

 Define the Objective Function


Maximize total overall expected return:
Max .081(6000)x1 + .09(12000)x2 + .11(20000)x3 + .102(14000)x4
+ .105(15000)x5 + .141(2000)x6 + .132(32000)x7
Metropolitan Microwaves
Define the Constraints
1) Money:6x1 + 12x2 + 20x3 + 14x4 + 15x5 + 2x6 + 32x7 ≤ 45
2) Space:125x1 +150x2 +200x3 +40x4 +40x5 +20x6 +100x7 ≤ 420
3) Stock large screen TVs only if stock B&W or color:
x1 + x2 >= x3 or x1 + x2 - x3 >= 0
4) Do not stock both types of VCRs: x4 + x5 < 1
5) Stock video games if they stock color TV's: x2 - x6 ≤ 0
6) At least 3 new lines: x1 + x2 + x3 + x4 + x5 + x6 + x7 > 3
7) Variables are 0 or 1: xj = 0 or 1 for j = 1, , , 7
Ellis Electric - Mixed-Integer Set-up Cost
A problem faced by an electrical utility each day is that of deciding
which generators to start up in order to minimize total cost.
The utility has three generators with the characteristics shown in the
table below.
There have two periods in a day. The number of megawatts needed
in the first period is 2900. The second period requires 3900
megawatts.
A generator may be started in either period but if started in the first
period, may be used in the second period without incurring an
additional startup cost. All generators (i.e. A, B, and C) are turned
off at the end of the day.
Fixed Startup Cost Per Period Per Max Capacity
Generator Cost Megawatt Used In Each Period (MW)
A $3,000 $5 2,100
B $2,000 $4 1,800
C $1,000 $7 3,000
General Form – Ellis Electric
Let:
XA1 = Power generated from Gen A in Period 1 in MW
XB1 = Power generated from Gen B in Period 1 in MW
XC1 = Power generated from Gen C in Period 1 in MW
XA2 = Power generated from Gen A in Period 2 in MW
XB2 = Power generated from Gen B in Period 2 in MW
XC2 = Power from generated Gen C in Period 2 in MW
YA = 1 if Generator A started; else = 0
YB = 1 if Generator B started; else = 0
YC = 1 if Generator C started; else = 0
General Form – Ellis Electric
Min 5XA1 + 5XA2 + 4XB1 + 4XB2 + 7XC1+ 7XC2
+ 3000YA + 2000YB + 1000YC
s.t.
XA1 + XB1+ XC1 >= 2900
XA2 + XB2 + XC2 >= 3900
XA1 − 2100YA  0
XA2 − 2100YA  0
XB1 − 1800YB  0
XB2 − 1800YB  0
XC1− 3000YC  0
XC2− 3000YC  0
and Xij  0 Yi = INT,  0,  1 (Binary)
 Is it correct to take YA, YB, YC????????

 The constraint does not give the relationship

that a generator can work for 2 periods without

incurring any added costs.

 When the generator should start?

 Or should it be YA1, YB1, YC1, YA2, YB2, YC2


General Form – Ellis Electric
Min 5XA1 + 5XA2 + 4XB1 + 4XB2 + 7XC1+ 7XC2
+ 3000(YA1+YA2 ) + 2000(YB1+YB1 )+ 1000(YC1 +YC2 )
s.t.: XA1 + XB1+ XC1 >= 2900
XA2 + XB2 + XC2 >= 3900
XA1 − 2100YA1  0
XA2 − 2100YA2  0
XB1 − 1800YB1  0
XB2 − 1800YB2  0
XC1− 3000YC1  0
XC2− 3000YC2  0
YA1+YA2  1 YB1+YB2  1 YC1+YC2  1
and Xij  0 Yi = INT,  0,  1 (Binary)
• But is the model correct?
• Something still missing?
• What is it?
Should we include YA1, YB1, YC1, YA2,
YB2, YC2 by considering a relationship that
the second period power generation can be
created by the generator installed in the first
period?

Was our previous model doing this??


This provides relation that power
can still be produced in period 2
from machine starting in period 1.

Is the model correct now?


The Fixed-Charge Problem
Many decisions result in a fixed or lump-sum cost being incurred:

– The cost to lease, rent, or purchase a piece of equipment or a


vehicle that will be required if a particular action is taken.

– The setup cost required to prepare a machine or to produce


a different type of product.

– The cost to construct a new production line that will be


required if a particular decision is made.

– The cost of hiring additional personnel that will be required


if a particular decision is made.
Fixed-Charge Problem:
Remington Manufacturing
Hours Required By:
Operation Prod. 1 Prod. 2 Prod. 3 Hours Available
Machining 2 3 6 600
Grinding 6 3 4 300
Assembly 5 6 2 400
Unit Profit $48 $55 $50
Setup Cost $1000 $800 $900

Find the product mix?


Maximize total profit.
MAX: 48X1 + 55X2 + 50X3 – 1000Y1 – 800Y2 – 900Y3
Decision Variables:
Xi = the amount of product i to be produced, i = 1, 2, 3
1, if Xi  0

Yi   i = 1, 2, 3
0, if Xi  0

 Resource Constraints
2X1 + 3X2 + 6X3 <= 600 } machining
6X1 + 3X2 + 4X3 <= 300 } grinding
5X1 + 6X2 + 2X3 <= 400 } assembly
 Binary Constraints: All Yi must be binary
 Nonnegativity conditions
Xi >= 0, i = 1, 2, ..., 6
 Is there a missing link?
 Yes based on product, Xi should be integer, but I
missed it? GOOD OBSERVATION…
 Anything still missing?
 Linking Constraints (with “Big M”)
X1 <= M1Y1 or X1 - M1Y1 <= 0
X2 <= M2Y2 or X2 - M2Y2 <= 0
X3 <= M3Y3 or X3 - M3Y3 <= 0

 If Xi > 0 then these constraints should force the


associated Yi to equal 1.

 If Xi = 0 these constraints allow Yi to equal 0 or 1,


but the objective will cause Solver to choose 0.

 Note that Mi imposes an upper bounds on Xi


i.e is the capacity constraint
Finding Reasonable Values for M1
 Consider the resource constraints
2X1 + 3X2 + 6X3 <= 600 } machining
6X1 + 3X2 + 4X3 <= 300 } grinding
5X1 + 6X2 + 2X3 <= 400 } assembly
 What is the maximum value X1 can assume?
Let X2 = X3 = 0
X1 = MIN(600/2, 300/6, 400/5)
= MIN(300, 50, 80)
= 50
 Maximum values for X2 & X3 can be found
similarly.
Summary of the Model
MAX: 48X1 + 55X2 + 50X3 - 1000Y1 - 800Y2 - 900Y3
S.T.: 2X1 + 3X2 + 6X3 <= 600 } machining
6X1 + 3X2 + 4X3 <= 300 } grinding
5X1 + 6X2 + 2X3 <= 400 } assembly
X1 - 50Y1 <= 0
X2 - 67Y2 <= 0 linking constraints
X3 - 75Y3 <= 0
All Yi must be binary
Xi >= 0, i = 1, 2, 3
Note: X2 capacity constraint should be 400/6=66.666 moment I round it to
67 grinding constraint may be violated if optimal solution has X1 and/or
X2 as 0
So should talk to management to increase 300 to 301 if required. Else
change 67 to 66.
Minimum Order Size Restrictions

Suppose Remington doesn’t want to


manufacture any units of product 3 unless it
produces at least 40 units...
Consider an additional constraint
X3 >= 40 Y3
Traveling Salesman Problem
 Florida Power and Gas company needs an efficient
schedule for their meter readers. There are 5
neighborhoods to be served. HEAD Quarter is in
neighborhood 1. The time estimates (in minutes) of
travelling between neighborhood is given. Find the route
to be travelled.
From/To 1 2 3 4 5
1 0 3 7.5 6.6 2.5
2 3 0 2 8 7.7
3 7.5 2 0 3 8.5
4 6.6 8 3 0 3.5
5 2.5 7.7 8.5 3.5 0
Traveling Salesman Problem
 Decision Variables: (all decision variables = binary)
Xijk = Route from i to j during leg k
X121 = from 1 to 2 in the first leg
X131 = from 1 to 3 in the first leg
….
X515 = from 5 to 1 in the last leg
Traveling Salesman Problem
Objective Function (Minimize):
3X121 + 3X125 + 7.5X131 + 7.5X315 + 6.6X141 +
6.6X415 + 2.5X151 +2.5X515 + 3X232 + 3X233 +3X234
+ 8X242 + 8X243 + 8X244 + 7.7X252 + 7.7X253 +
7.7X254 + … + 3.5X544
Constraints:
 X121 + X131 + X141 + X151 = 1 (starting node is 1)
 X215 + X315 + X415 + X515 = 1 (ending node is 1)
 X232 + X242 + X252 + X322 + X342 + X352 + … + X542 = 1 (leg 2 visits limited to 1)
 X233 + X243 + … + X543 = 1 (leg 3 visits limited to 1)
 Same for leg 4
 X215 + X232 + X242 + X252 + X233 + X243 + X253 + X234 + X244 + X254 = 1 (can
only leave from node 2 once).
 X315 + X322 + X342 + X352 + X323 + X343 + X353 + X324 + X344 + X354 = 1 (can
only leave from node 3 once).
 Format is the same for nodes 4 and 5
•X121 + X322 + X422 + X522 + X323 + X423 + X523 + X324 + X424 + X524 = 1
(can only visit node 2 once)
•X131 + X232 + X432 + X532 + X233 + X433 + X533 + X234 + X434 + X534 = 1
(can only visit node 3 once)
•Format is the same for nodes 4 and 5
•Leg 2 begins where leg 1 ends
•X121 = X232 + X242 + X252
•X131 = X322 + X342 + X352
•X141 = X422 + X432 + X452
•X151 = X232 + X242 + X252
•X322 + X422 + X522 = X233 + X243 + X253 (if leg 2 of the trip ends at node 2, leg
3 must start at node 2)
•X232 + X432 + X532 = X323 + X343 + X353 (if leg 2 of the trip ends at node 3, leg
3 must start at node 3)
•Same formatting for nodes 4 and 5
•Formatting is the same for legs 3 and 4Last leg of trip must end at location 1
•X324 + X424 + X524 = X215
•X234 + X434 + X534 = X315
•X244 + X344 + X544 = X415
•X254 + X354 + X454 = X515
Thank You

You might also like