You are on page 1of 54

SMU Classification: Restricted

Integer Linear Programming

Decision Analysis
OPIM 101
Liang Xu
Assistant Professor of Operations Management
leonxu@smu.edu.sg

Decision Analysis – OPIM 101 1


Week 6
SMU Classification: Restricted

Integer Linear Programming

Recess
LP Modelling Examples:
Network Models:
- Assignment Problem
- Transportation Problem
- Transhipment Problem

Decision Analysis – OPIM 101 2


Week 6
SMU Classification: Restricted

Network (Assignment, Transportation, Transshipment) Models

Flair Furniture
From Memphis Denver NY Chicago LA Boston

Memphis $0 - $8 $13 $25 $28

Denver - $0 $15 $12 $26 $25

NY - - $0 $6 $16 $17

Chicago - - $6 $0 $4 $16

LA - - - - $0 -

Boston - - - - - $0

Decision Analysis – OPIM 101 3


Week 6
SMU Classification: Restricted

Network (Assignment, Transportation, Transshipment) Models

Flair Furniture
What are the decisions to make? What are the objective and
constraints?

Decision Analysis – OPIM 101 4


Week 6
SMU Classification: Restricted

Network (Assignment, Transportation, Transshipment) Models

Flair Furniture

s.t. 150
200
=0 Supply node:
outflow – inflow
=0
=130 Transshipment node: outflow –
=130 inflow = 0

Destination node:
inflow – outflow = demand

Decision Analysis – OPIM 101 5


Week 6
SMU Classification: Restricted

Network (Assignment, Transportation, Transshipment) Models

General Network Formulation


Flow balance constraints: At each node inflow should be greater than
equal to outflow, available supply is inflow, satisfied demand is outflow.

min ∑ ∑ 𝑡𝑖𝑗 .𝑥𝑖𝑗 ∑ 𝑖4 ∑ 4𝑗


𝑥 ≥ 𝑥
𝑖 𝑗
Inflows Outflows

𝑖 𝑗
at Node 6 at Node 6

6
SMU Classification: Restricted

Integer Linear Programming

Class Outline
Integer Linear Programming

Decision Analysis – OPIM 101 7


Week 6
SMU Classification: Restricted

Integer Linear Programming

Learning Objectives
Integer Linear Programming (ILP)
- Understand the difference between integer linear programming
(ILP) and LP
- Understand how to solve an ILP in Excel
- Understand how to incorporate logical expressions in
quantitative models using binary variables

Decision Analysis – OPIM 101 8


Week 6
SMU Classification: Restricted

Integer Linear Programming

Integer Linear Programming


 LP assumption of divisibility may not always hold.

 Is it possible to ensure integrality (integer values for


decision variables)?
 An integer linear programming (ILP) model is a model
that has constraints and an objective function identical to
that formulated by linear programming. The only
difference is that one or more of the decision variables
must take on an integer value.
Decision Analysis – OPIM 101 9
Week 6
SMU Classification: Restricted

Integer Linear Programming

Integer Linear Programming


Three types of integer linear programs:
 Total (pure) integer programming model:
 All decision variables required to have integer values.
 Mixed-integer programming model:
 Some of the decision variables (but not all) required to have
integer values.
 0 –1 (binary) integer programming model:
 All decision variables required to have integer values of zero or
one.

Decision Analysis – OPIM 101 10


Week 6
SMU Classification: Restricted

Integer Linear Programming

Harrison Electric Company


Harrison electric company produces two products: chandeliers
and ceiling fans. Both products require a two-step production
process involving wiring and assembly. It takes about 2 hours
to wire each chandelier and 3 hours to wire a ceiling fan.
Final assembly of the chandeliers and fans requires 6 and 5
hours, respectively. There are only 12 hours of wiring time
and 30 hours of assembly time available. Each chandelier
sells for $7 and each fan sells for $6. Only integer number of
products can be produced. What is the optimal production
mix?
Decision Analysis – OPIM 101 11
Week 6
SMU Classification: Restricted

Integer Linear Programming

Harrison Electric Company


x1 number of chandelier
x2 number of ceiling fan

Wiring hours
Assembly hours
Non-negativity
Integer Values
Integer constraint makes the solution more realistic.
Decision Analysis – OPIM 101 12
Week 6
SMU Classification: Restricted

Integer Linear Programming

Solving ILP In Excel


Constraints:
set decision variables to integer

un
c he
c k!

Sensitivity analysis report is not available!

Decision Analysis – OPIM 101 13


Week 6
SMU Classification: Restricted

Integer Linear Programming

ILP and Its LP Relaxation


remove integer
Integer Linear constraints LP Relaxation of
Program (ILP) ILP

Decision Analysis – OPIM 101 14


Week 6
SMU Classification: Restricted

Integer Linear Programming

ILP and Its LP Relaxation


What is the feasible region of the LP relaxation?
What is the feasible region of the IP?
Any connection between their optimal solution, optimal profit?

15
SMU Classification: Restricted

Integer Linear Programming

ILP and Its LP Relaxation

(3, • LP relaxation of ILP has optimal


1):
(3, Pr solution (3.75,1.5), optimal
2) : ofi
Pr t= profit is 35.25
ofi 27
t= • Integer Linear Program has
33
optimal solution (5, 0), optimal
(4 profit is 35
,1
):
Pr
of
it
=
34

Optimal ILP Solution (5,0):


Profit 35
Decision Analysis – OPIM 101 16
Week 6
SMU Classification: Restricted

Integer Linear Programming

ILP and Its LP Relaxation


 The optimal solution of ILP cannot be obtained by simply
rounding the optimal solution of its LP relaxation.
 Solving integer linear program is computational challenging
because we have to check the optimality of every point!
 There is no sensitivity analysis table for ILP optimal solution.
 The LP relaxation’s optimal objective function value is a
“bound” on the ILP’s optimal objective function value:
 Maximization problem: the optimal profit of LP relaxation ≥ the optimal
profit of ILP
 Minimization problem: the optimal cost of LP relaxation ≤ the optimal
cost of ILP 17
SMU Classification: Restricted

Integer Linear Programming

ILP Solution: Branch & Bound


Break the feasible region into sub-regions by eliminating
the non-integer optimal solution of LP relaxation (without
eliminating integer values) and solve LPs in the new sub-
regions.

Decision Analysis – OPIM 101 18


Week 6
SMU Classification: Restricted

Optimal
solution is not
integer!

19
SMU Classification: Restricted

Subproblem B

Subproblem A
20
SMU Classification: Restricted

Integer Linear Programming

ILP Solution: Branch & Bound


Break the feasible region into sub-regions by eliminating
the non-integer optimal solution of LP relaxation (without
eliminating integer values) and solve LPs in the new sub-
regions.
Solve a number of LP models until optimal solution is
found.
Excel Solver uses Branch & Bound Algorithm.

Decision Analysis – OPIM 101 21


Week 6
SMU Classification: Restricted

Integer Linear Programming

0-1 (Binary) Integer Linear


Programming Model
 All decision variables required to have integer values of zero
or one.
 Usually associated with decision “yes” or “no”.

Decision Analysis – OPIM 101 22


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem

https://www.youtube.com/watch?v=Jnc75gjf_84
https://www.youtube.com/watch?v=kKJZ8fznQ1Y
Decision Analysis – OPIM 101 23
Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
You are joining some friends on a camping trip. You are
preparing your backpack, and you realize that you
cannot possibly carry all this weight! You rate each item
for its utility on a scale of 1 to 100 (100 = most
beneficial). You want to carry 35 pounds at most. What
is the optimal packing plan to maximize the total utility?
Item 1 2 3 4 5 6 7 8
Weight 1 4 7 6 7 12 5 14
Utility 20 50 80 60 50 75 30 70

Decision Analysis – OPIM 101 24


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
How to define the decision variables, objective and
constraints?
Item 1 2 3 4 5 6 7 8
Weight 1 4 7 6 7 12 5 14
Utility 20 50 80 60 50 75 30 70

Decision Analysis – OPIM 101 25


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
Decision variables
=1 if Item 𝑖 is chosen;
=0 if Item 𝑖 is not chosen, where 𝑖=1, …, 8

Decision Analysis – OPIM 101 26


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
We can define the following parameters:
: utility of item 𝑖, 𝑖=1, …, 8
: weight of item 𝑖 (in pounds), 𝑖=1,…, 8

Decision Analysis – OPIM 101 27


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem

un
ch
e ck
!

Decision Analysis – OPIM 101 28


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
How to model the following variations of constraints in
knapsack problem?
- Item 6 and Item 7 cannot be chosen at the same time.
- Item 6 and Item 7 are either both chosen, or both not chosen.
- If Item 1 is chosen, then Item 5 must be chosen.
- Exactly one of the following three items must be chosen: item 1,
item 2, and item 3.
- If item 1 and 2 are chosen, then item 3 must be chosen.

Decision Analysis – OPIM 101 29


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
Item 6 and Item 7 cannot be chosen at the same time
(alternatively, if item 6 is chosen, item 7 would not be
chosen).

𝑥6 + 𝑥 7 ≤1 1 0
0 1
0 0

Decision Analysis – OPIM 101 30


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
Item 6 and Item 7 are either both chosen, or both not
chosen.

𝑥6 =𝑥 7

Decision Analysis – OPIM 101 31


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
If Item 1 is chosen, then Item 5 must be chosen.

1 1
𝑥5 ≥ 𝑥 1
0 1
0 0

Decision Analysis – OPIM 101 32


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
One of and only one of the following three items must be
chosen: item 1, item 2, and item 3.

+ =1

Decision Analysis – OPIM 101 33


Week 6
SMU Classification: Restricted

Integer Linear Programming

Knapsack Problem
If item 1 and 2 are chosen, then item 3 must be chosen.

-1

Decision Analysis – OPIM 101 34


Week 6
SMU Classification: Restricted

Integer Linear Programming

Model Trick: Binary Variable {0,1}


Fixed cost problems
Conditional choice (if – then)
Choice between two options (either – or)

Decision Analysis – OPIM 101 35


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
Panther is manufacturing three types of cars: compact, midsize
and large cars. The production of cars requires both steel and
labor. The profit of cars, the available steel and labor, as well
as the production requirement are summarized in the
following table. What is the optimal production plan to
maximize the total profit?
Compact Midsize Large Available
Steel (ton) 1.5 3 5 6,000
Labor (hr.) 30 25 40 60,000
Profit ($) 2,000 3,000 4,000

Decision Analysis – OPIM 101 36


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
Decision Variables:
xi : Number of cars of type 𝑖 produced, where 𝑖=1,…,3 denote
compact, midsize and large cars, respectively.

Decision Analysis – OPIM 101 37


Week 6
SMU Classification: Restricted

Integer Linear Programming

Model Trick: Binary Variable {0, 1}


Fixed cost problems

Decision Analysis – OPIM 101 38


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
Suppose that the production of each car type would utilize a
specific manufacturing facility (one facility for each car type)
and the one-time setup cost of each facility is $30,000.
To maximize the profit, how to build up an integer programming
model?

Decision Analysis – OPIM 101 39


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
“producing each car type requires a specific production facility
(one facility for each car type). The setup cost for each facility
is $30,000”
Define = 1 if production
facility for type car is set up;
= 0 otherwise,

If = 0, must also be 0; if , no restriction on

How do we write it as a linear constraint?

Decision Analysis – OPIM 101 40


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
Define binary variables , and .where =1 if the facility type 𝑖 car is set up; =0
otherwise.
“ if , = 0, , must also be 0” can be expressed as `` ≤ ,”
, , , are sufficiently large values.

s.t.
+
+
,, How to choose , , ?
for
, = integer
for
41
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
How to choose ?

+ 𝑥1 ≤ 2,000 𝑀 1 ≥ 2,000
+ 30

+ 𝑥1 ≤ 2,000 𝑀 2 ≥ 2,000
+ 25

+
𝑥1 ≤ 1,2 00 𝑀 3 ≥ 1,200
+ 40

Decision Analysis – OPIM 101 42


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing

Decision Analysis – OPIM 101 43


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing

Decision Analysis – OPIM 101 44


Week 6
SMU Classification: Restricted

Integer Linear Programming

Summary: Fixed Cost Problem


- Suppose that a decision generates both a variable cost
(depends on the level of that decision) and a fixed cost
e.g: if you manufacture a product in a machine, you incur a
fixed cost for the set-up of the machine.
- The model includes 2 decision variables
for the level of production : x
for the decision to set up the machine: binary variable y
= 1 indicates to set up
= 0 indicates not to set up Sufficiently large number (figure
out from other constraints)
Link the variables:
𝑥≤ 𝑀 ⋅ 𝑦
Decision Analysis – OPIM 101 45
Week 6
SMU Classification: Restricted

Integer Linear Programming

Model Trick: Binary Variable {0,1}


Conditional choice (if – then)
Choice between two options (either – or)

Decision Analysis – OPIM 101 46


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
Production of each type of car is only economically feasible if at
least 1,000 cars of that type are produced. That is, if one type
of cars is produced, then at least 1,000 cars should be
produced (or in other words, we either produce no cars of
each type or we produce at least 1000 cars of each type)
How to formulate the problem?

Decision Analysis – OPIM 101 47


Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing
“Production of a type of car is only economically feasible if
at least 1,000 cars of that type are produced”

Define = 1 if at least 1000 cars of


type are produced; = 0 if type i car
is not produced,

If = 0, must also be 0; if , ”

How do we write it as linear constraints?


• Need “if , ”
• Need “if , ”
Decision Analysis – OPIM 101 48
Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing

max 2000𝑥1+3000𝑥2+4000𝑥3
• “if , ”:
• “if , ”:

𝑥1 ,𝑥2 ,𝑥3
Decision Analysis – OPIM 101 49
Week 6
SMU Classification: Restricted

Integer Linear Programming

Panther Manufacturing

Decision Analysis – OPIM 101 50


Week 6
SMU Classification: Restricted

Integer Linear Programming

Midterm FAQ’s
1. What is the exact duration of the exam?
The duration will be 120 minutes. It will be in class time, please
come to class ON TIME!

2. Is it an open book/open notes exam?


It is a closed book/closed notes exam. You can bring one single-
side A4 sized cheat-sheet. Calculators are allowed but not
necessary. You have excel for simple calculation.

Decision Analysis – OPIM 101 51


Week 6
SMU Classification: Restricted

Integer Linear Programming

Midterm FAQ’s
3. Which chapters from the book will be in the exam?
Chapters 1, 2, 3, 4, 5, 6 from Ragsdale, 1, 2, 3, 5, 6, 7 from
Taylor and 1, 2, 3, 6, 7 from ASWM, 7,8,9, 10 from RSHH. I
will design exam based on my lectures from Week1-Week6.
4. What is the format of the exam?
True/false, multiple choice, quantitative questions (similar to in-
class, homework questions).
NOTHING THAT WE HAVE NOT COVERED IN THE CLASS

Decision Analysis – OPIM 101 52


Week 6
SMU Classification: Restricted

Integer Linear Programming

Midterm FAQ’s
5. You Can Use Excel! There will be questions to be solved with
more than two decision variables.
Be efficient in building models from scratch …

Decision Analysis – OPIM 101 53


Week 6
SMU Classification: Restricted

Integer Linear Programming

Topics
Introduction to Decision Analysis: Concepts, definitions, applications.
Linear programming – Graphical solution, special cases, sensitivity
analysis, formulation tricks, more than 2 variable solution
Blending Problem, Financial Planning Problem.
Assignment Problem, Transhipment Problem
Transportation Problem – Inventory Problem
Integer Linear Programming, Binary Variables, Logical Constraints

Decision Analysis – OPIM 101 54


Week 6

You might also like