You are on page 1of 53

Integer Programming (IP)

Prof. Yong Won Seo


(seoyw@cau.ac.kr)

College of Business Administration, CAU


Types of Integer Programming(IP) Prob-
lems

Total Integer Model: All decision variables required to have


integer solution values.

0-1 Integer Model: All decision variables required to have


integer values of zero or one.

Mixed Integer Some of the decision variables (but not


Model: all) required to have integer values.

2
Total Integer Model
• Machine shop obtaining new presses and lathes.
• Marginal profitability: each press $100/day; each lathe $150/day.
• Resource constraints: $40,000 budget, 200 sq. ft. floor space.
• Machine purchase prices and space requirements:

Required
Machine Floor Space (ft.2) Purchase Price

Press 15 $8,000

Lathe 30 4,000

3
Total Integer Model

Maximize Z = $100x1 + $150x2


subject to:
$8,000x1 + 4,000x2  $40,000
15x1 + 30x2  200 ft2

x1, x2  0 and integer

4
Mixed Integer Model

• $250,000 available for investments providing greatest re-


turn after one year.
• Data:
– Condominium cost $50,000/unit; $9,000 profit if sold after one
year.
– Land cost $12,000/ acre; $1,500 profit if sold after one year.
– Municipal bond cost $8,000/bond; $1,000 profit if sold after one
year.
– Only 4 condominiums, 15 acres of land, and 20 municipal
bonds available.
– Land can be purchased by fractional acres. Other options
should be integers.

5
Mixed Integer Model
x1 = condominiums purchased
x2 = acres of land purchased
x3 = bonds purchased

Maximize Z = $9,000x1 + 1,500x2 + 1,000x3


subject to:
50,000x1 + 12,000x2 + 8,000x3  $250,000
x1  4 condominiums
x2  15 acres
x3  20 bonds
x2  0
x1, x3  0 and integer
6
0-1 Integer Model
• Recreation facilities selection to maximize daily usage by residents.
• Resource constraints: $120,000 budget; 12 acres of land.
• Selection constraint: either swimming pool or tennis center (not
both).

Expected Usage Land Requirement


Recreation
(people/ day) Cost ($) (acres)
Facility
Swimming pool 300 35,000 4
Tennis Center 90 10,000 2
Athletic field 400 25,000 7
Gymnasium 150 90,000 3

7
0-1 Integer Model
x1 = construction of a swimming pool
x2 = construction of a tennis center
x3 = construction of an athletic field
x4 = construction of a gymnasium

Maximize Z = 300x1 + 90x2 + 400x3 + 150x4


subject to:
$35,000x1 + 10,000x2 + 25,000x3 + 90,000x4  $120,000
4x1 + 2x2 + 7x3 + 3x4  12 acres
x1 + x2  1 facility
x1, x2, x3, x4 = 0 or 1
8
Why Integer Programming Complex

• Rounding non-integer solution values up to the near-


est integer value can result in an infeasible solution.

• A feasible solution by rounding down non-integer so-


lution values may result in a less than optimal (sub-op-
timal) solution.

9
Example of IP solution

Maximize Z = $100x1 + $150x2


subject to:
8,000x1 + 4,000x2  $40,000
15x1 + 30x2  200 ft2
x1, x2  0 and integer

LP Optimal Solution:
Z = $1,055.56
x1 = 2.22 presses
x2 = 5.55 lathes

10
How to solve?

• Branch-and-Bound Method
– Traditional approach to solving integer programming problems.
– Feasible solutions can be partitioned into smaller subsets
– Smaller subsets evaluated until best solution is found.
– Method is a tedious and complex mathematical process

• Cutting plane method


– Iteratively adds additional constraints that drives the LP solution
to integers

11
Total Integer Model with Excel

Integer Programming Model of Machine Shop:

Maximize Z = $100x1 + $150x2


subject to:
8,000x1 + 4,000x2  $40,000
15x1 + 30x2  200 ft2
x1, x2  0 and integer

12
Total Integer Model with Excel

Objective function

Slack, =G6-E6

Decision variables—B10:B11
=C6*B10+D6*B11

13
Total Integer Model with Excel

Integer variables

14
Total Integer Model with Excel

Click on “int”

15
0-1 Model with Excel

Recreational Facilities Example:

Maximize Z = 300x1 + 90x2 + 400x3 + 150x4


subject to:
$35,000x1 + 10,000x2 + 25,000x3 + 90,000x4  $120,000
4x1 + 2x2 + 7x3 + 3x4  12 acres
x1 + x2  1 facility
x1, x2, x3, x4 = 0 or 1

16
0-1 Model with Excel

17
0-1 Model with Excel

Restricts variables, C12:C15, to inte-


ger and 0-1 values

18
0-1 Model with Excel

Click on “bin” for 0-1.

19
0-1 Model with Excel

Deactivate

Return to solver win-


dow

20
Mixed Integer Model with Excel: Try!

Integer Programming Model for Investments Problem:


Maximize Z = $9,000x1 + 1,500x2 + 1,000x3
subject to:
50,000x1 + 12,000x2 + 8,000x3  $250,000
x1  4 condominiums
x2  15 acres
x3  20 bonds
x2  0
x1, x3  0 and integer

21
Integer Programming Problems and Sen-
sitivity Analysis
• Integer programming problems do not readily lend
themselves to sensitivity analysis.
– Small changes in the problem result in completely different so-
lutions.
– Because only a relatively few of the infinite solution possibilities
in a feasible solution space will meet integer requirements.

• Completely solving each modified problem is required.

22
Integer Programming

FORMULATION TECHNIQUES

23
Formulating 0-1 IP

• Either-Or Alternatives
– two alternatives x1, x2 (for example, backup machine)
• x1+x2 = 1, x1, x2=0 or 1
– if it is allowed to use neither machine
• x1+x2  1, x1, x2=0 or 1

• k-Out-of-n Alternatives
– for example, choosing 2 machines out of 5
• x1+x2+x3+x4+x5 = 2, all xj=0 or 1
– at least 2 machines are required out of 5
• x1+x2+x3+x4+x5  2, all xj=0 or 1
– no more than 2 machines are required out of 5
• x1+x2+x3+x4+x5  2, all xj=0 or 1
– 2~4 machines?
24
Example: Capital Budgeting

• University bookstore expansion project.


• Not enough space available for both a computer de-
partment and a clothing department.

NPV Return Project Costs per Year ($1000)


Project
($1,000s) 1 2 3

1. Web site $120 $55 $40 $25


2. Warehouse 85 45 35 20
3. Clothing department 105 60 25 --
4. Computer department 140 50 35 30
5. ATMs 75 30 30 --

Available funds per year 150 110 60

25
Capital Budgeting

x1 = selection of web site project


x2 = selection of warehouse project
x3 = selection clothing department project
x4 = selection of computer department project
x5 = selection of ATM project
xi = 1 if project “i” is selected, 0 if project “i” is not selected

Maximize Z = $120x1 + $85x2 + $105x3 + $140x4 + $70x5


subject to:
55x1 + 45x2 + 60x3 + 50x4 + 30x5  150
40x1 + 35x2 + 25x3 + 35x4 + 30x5  110
25x1 + 20x2 + 30x4  60
26
x3 + x4  1
Formulating 0-1 IP (cont’d)

• If-Then Alternatives
– If you buy x2, you should also buy x1.
• x 1  x2 , x1, x2=0 or 1
– If the purchase of either machine requires the purchase of the
other,
• x1 = x2 , x1, x2=0 or 1

27
Formulating 0-1 IP (cont’d)

• Either-Or Constraints (Activating or De-activating certain


constraints)
– If you use machine x8, 5x4+3x5  100 should be held. (Turn on
the constraint 5x4+3x5  100)
• 5x4+3x5  100x8 , x8=0 or 1
– If you use machine x8, 5x4+3x5 >=100. If not, 5x4+3x5  50
• 5x4+3x5  100x8
• 5x4+3x5  50(1-x8) , x8=0 or 1
– ( case, different) If you execute project y1, 2x1+x2  16. If not,
4x1+8x2  40.
• 2x1+x2  16+M(1-y1)
• 4x1+8x2  40+My1 , y1=0 or 1, M is a very large number

28
Formulating 0-1 IP (cont’d)

• Variables That Have Minimum Level Requirements


– If you decide to buy x1, the minimum quantity is 200 units.

• x1 200y1
• x1 My1 , y1=0 or 1

• Note that,
– x1=0  y1=0
– x1>0  y1=1  x1>=200

29
Fixed Charge and Facility
• Which of six farms should be purchased that will meet current pro-
duction capacity at minimum total cost, including annual fixed
costs and shipping costs?
Available Plant ($/ton shipped)
Plant Capacity
(tons,1000s) Farm A B C
A 12
B 10 1 18 15 12
C 14 2 13 10 17
Farms Annual Fixed Projected Annual 3 16 14 18
Costs Harvest (tons, 1000s) 4 19 15 16
($1000)
1 405 11.2 5 17 19 12
2 390 10.5 6 14 16 12
3 450 12.8
4 368 9.3
5 520 10.8
6 465 9.6

30
Fixed Charge and Facility
yi = 0 if farm i is not selected, and 1 if farm i is selected; i = 1,2,3,4,5,6
xij = potatoes (1000 tons) shipped from farm I to plant j; j = A,B,C.
Minimize Z = 18x1A+ 15x1B+ 12x1C+ 13x2A+ 10x2B+ 17x2C+ 16x3+ 14x3B
+18x3C+ 19x4A+ 15x4b+ 16x4C+ 17x5A+ 19x5B+12x5C+ 14x6A
+ 16x6B+ 12x6C+ 405y1+ 390y2+ 450y3+ 368y4+ 520y5+ 465y6
subject to:
x1A + x2A + x3A + x4A + x5A + x6A = 12
x1B + x2B + x3B + x4B + x5B + x6B = 10
x1C + x2C + x3C + x4C + x5C + x6C = 14

x1A + x1B + x1B ≤ 11.2y1 x2A + x2B + x2C ≤ 10.5y2


x3A + x3A + x3C ≤ 12.8y3 x4A + x4b + x4C ≤ 9.3y4
x5A + x5B + x5B ≤ 10.8y5 x6A + x6B + X6C ≤ 9.6y6

xij ≥ 0 yi = 0 or 1
31
Set Covering
• Deciding on which nodes provide coverage so that all
areas are served.
• A telecommunication company is considering 7 location
nodes to reach all 10 neighborhoods.
– The cost of opening 7 nodes are : 125, 85, 70, 60, 90, 100, 110
– The coverage of 7 nodes are
• node 1: neighborhoods 1,3,4,6,9,10
• node 2: neighborhoods 2,4,6,8
• node 3: neighborhoods 1,2,5
• node 4: neighborhoods 3,6,7,10
• node 5: neighborhoods 2,3,7,9
• node 6: neighborhoods 4,5,8,10
• node 7: neighborhoods 1,5,7,8,9
• Determine which nodes should be opened to provide
coverage to all neighborhoods at a minimum cost.
32
Set Covering
Min 125X1 + 85X2 + 70X3 + 60X4 + 90X5 + 100X6 + 110X7
ST
X1+X3+X7>=1
X2+X3+X5>=1
X1+X4+X5>=1
X1+X2+X6>=1
X3+X6+X7>=1
X1+X2+X4>=1
X4+X5+X7>=1
X2+X6+X7>=1
X1+X5+X7>=1
X1+X4+X6>=1

Xj = 0 or 1

33
Knapsack problem

• How many units of each item to put in a knapsack in or-


der to maximize profit?
– many real-world applications (ex. cargo-loading, project selection)

Maximize c1 x1  c2 x2    c n xn
subject to
w1 x1  w2 x2    wn xn  B
x j  0 and integer

– Types of Knapsack Problem


• xj=0 or 1 : 0-1 knapsack problem
34
• x =0, 1 … b : bounded knapsack problem
Traveling Salesperson Problem (TSP)

• Minimize total distance to visit all the given locations


– He should return to the starting point.

• IP Formulation?
35
• Solving time?
Minimize  c xij ij
if n=4,
subject to xijk : ij in kth leg
x121  x131  x141  1 (The tour starts at node 1)
x214  x314  x414  1 (The tour ends at node 1)
x232  x242  x322  x342  x422  x432  1 (Just one move in leg 2)
x233  x243  x323  x343  x423  x433  1 (Just one move in leg 3)
x214  x232  x242  x233  x243  1 (Just one departure at node 2)
x314  x322  x342  x323  x343  1 (Just one departure at node 3)
x414  x422  x432  x423  x433  1 (Just one departure at node 4)
x121  x322  x422  x323  x423  1 (Just one arrival at node 2)
x131  x232  x432  x233  x433  1 (Just one arrival at node 3)
x141  x242  x342  x243  x343  1 (Just one arrival at node 4)
x121  x232  x242 (If leg 1 ends at node 2, leg 2 should start at node 2)
x131  x322  x342 (If leg 1 ends at node 3, leg 2 should start at node 3)
x141  x422  x432 (If leg 1 ends at node 4, leg 2 should start at node 4)
x121  x232  x242 (If leg 1 ends at node 2, leg 2 should start at node 2)
x322  x422  x233  x243 (If leg 2 ends at node 2, leg 3 should start at node 2)
x232  x432  x323  x343 (If leg 2 ends at node 3, leg 3 should start at node 3)
x242  x342  x423  x433 (If leg 2 ends at node 4, leg 3 should start at node 4)
x323  x423  x214 (If leg 3 ends at node 2, leg 4 should start at node 2)
x233  x433  x314 (If leg 3 ends at node 3, leg 4 should start at node 3)
x243  x343  x414 (If leg 3 ends at node 4, leg 4 should start at node 4 )
36 xijk  0
Difficulties in Solving IP problems

• Complexity of algorithm?

• P, NP, NP complete

• Examples of NP problems
– TSP, crew scheduling, knapsack, decrypting secret codes…

• Optimal Algorithm vs. Heuristic Algorithm

• Genetic Algorithm
– Meta-heuristic
– Currently the best technique to solve TSP
– (demo) https://www.youtube.com/watch?v=Yr_nRnqeDp0
37
[Appendix]
Integer Programming (IP)
Branch and Bound Method of Solving
Integer Programming Problems
Prof. Yong Won Seo
(seoyw@cau.ac.kr)

College of Business Administration, CAU


Integer Programming Problems

• 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.
– For example, in Maximization IP, LP solution of the problem
serves as an upper bound of the exact solution. (The exact IP
obj value cannot exceed the relaxed LP obj value)

• Branch
– Selection of an integer value of a decision variable to examine
for a possible integer solution to a problem.
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.
Example 7S-1. an example of IP

41
The LP Relaxation Solution

42
Node 1: the LP Relaxation Solution

Not Integer So-


lution

43
Branching from the first node

• First, we branch with x2

44
Subproblems and Solution Points for
Nodes 2 and 3

45
Solutions for Nodes 2 and 3

<Rule:>
- Branch only from current optimum.
- If current optimum is IP feasible, stop.
46
Subproblem and Solution Point for Node
4 (Node 5: infeasible)
Solutions for Nodes 4 and 5
Subproblems and Solutions for the Next
Two Nodes
Solutions for Nodes 6 and 7

Current optimum
satisfies integer
condition. Stop.
The LP Relaxation Solution Point and IP
exact optimal solution point

IP optimum
Tree Diagram for 0-1 IP example (Ex.5)
Branch and bound tree for Example 5

x1

You might also like