You are on page 1of 10

Faculty of Engineering Types of Integer Programming Models

• An LP in which all the variables are restricted to be


integers is called an all-integer linear program (ILP).
• The LP that results from dropping the integer
requirements is called the LP Relaxation of the ILP.
Integer Linear • If only a subset of the variables are restricted to be
Programming 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.
Dr. Ahmed Mohib

Example 1: All-Integer LP Example 1: All-Integer LP


Consider the following all-integer linear program: • LP Relaxation
x2
5 -x1 + x2 < 1
Max 3x1 + 2x2
4 3x1 + x2 < 9
s.t. 3x1 + x2 < 9
3 Max 3x1 + 2x2
x1 + 3x2 < 7
2 LP Optimal (2.5, 1.5)
-x1 + x2 < 1
x1 + 3x2 < 7
1
x1, x2 > 0 and integer
x1
1 2 3 4 5 6 7

Example 1: All-Integer LP Example 1: All-Integer LP


• LP Relaxation • Rounded Up Solution
Solving the problem as a linear program ignoring x2
the integer constraints, the optimal solution to the
linear program gives fractional values for both x1 and 5 -x1 + x2 < 1
x2. From the graph on the next slide, we see that the
4 3x1 + x2 < 9
optimal solution to the linear program is:
x1 = 2.5, x2 = 1.5, z = 10.5 Max 3x1 + 2x2
• Rounding Up 3
ILP Infeasible (3, 2)
If we round up the fractional solution (x1 = 2.5,
x2 = 1.5) to the LP relaxation problem, we get x1 = 3 2 LP Optimal (2.5, 1.5)
and x2 = 2. From the graph on the next slide, we see x1 + 3x2 < 7
that this point lies outside the feasible region, 1
making this solution infeasible.
x1
1 2 3 4 5 6 7
Example 1: All-Integer LP Example 1: All-Integer LP
• Rounding Down
• Complete Enumeration of Feasible ILP Solutions
By rounding the optimal solution down to x1 = 2, There are eight feasible integer solutions to this
x2 = 1, we see that this solution indeed is an problem:
integer solution within the feasible region, and x1 x2 z
substituting in the objective function, it gives z = 8. 1. 0 0 0
We have found a feasible all-integer solution, 2. 1 0 3
but have we found the OPTIMAL all-integer 3. 2 0 6
solution? 4. 3 0 9 optimal solution
5. 0 1 2
6. 1 1 5
The answer is NO! 7. 2 1 8
8. 1 2 7
The optimal solution is x1 = 3 and x2 = 0 giving z = 9

Example 1: All-Integer LP Integer programming


x2 solution techniques (cont.)
-x1 + x2 < 1
5
• Explicit methods; 3 categories:
3x1 + x2 < 9 1. branch and bound
4
Max 3x1 + 2x2 2. cutting plane (polyhedral) methods
3 3. dynamic programming
ILP Optimal (3, 0)
2 or: hybrid methods (combination of the above)
x1 + 3x2 < 7
1
• Commercial IP solvers usually use a
x1
1 2 3 4 5 6 7 combination of heuristics and 1, 2

Branch and bound Branching


• Enumeration in a search tree
root node Level 0

child nodes Level 1

child nodes
... Level 2

...
• each node is a partial solution, i.e. a part of • current solution is infeasible
the solution space
Branching on Variables Branching on Constraints

• split problems into sub problems to cut off • split problems into subproblems to cut off
current solution current solution

Using Solver for IP Branch-and-Bound Method


• IP models are formulated in Excel in the • Bounds on the value of the objective function
same way as LP models are found and used to help determine which
subproblems can be eliminated and when the
optimal solution has been found
• The additional integer restriction is entered
like an additional constraint
• If a solution is not optimal, a new subproblem
int - Means general integer variables is selected and branching continues
bin - Means binary variables
Go to file 6-1.xls

Six Steps in Solving IP Maximization Six Steps in Solving IP Maximization


Problems by Branch and Bound Problems by Branch and Bound
1. Solve the original problem using LP. If the answer 5. (a) If a branch yields a solution to the LP problem
satisfies the integer constraints, we are done. If not, that is not feasible, terminate the branch
this value provides an initial upper bound. (b) If a branch yields a solution to the LP problem
2. Find any feasible solution that meets the integer that is feasible, but not an integer solution, go to
constraints for use as a lower bound. Usually, step 6
rounding down each variable will accomplish this. (c) If the branch yields a feasible integer solution,
3. Branch on one variable from step 1 that does not examine the value of the objective function. If this
have an integer value. Split the problem into two value equals the upper bound, an optimal
subproblems based on integer values that are solution has been reached. If it not equal to the
immediately above or below the noninteger value. upper bound, but exceeds the lower bound,
4. Create nodes at the top of these new branches by terminate this branch.
solving the new problem
Six Steps in Solving IP Maximization
Harrison Electric Company
Problems by Branch and Bound
6. Examine both branches again and set the upper • integer programming formulation is
bound equal to the maximum value of the objective
Maximize profit = $7X1 + $6X2
function at all final nodes. If the upper bound equals
subject to 2X1 + 3X2 ≤ 12
the lower bound, stop. If not, go back to step 3.
6X1 + 5X2 ≤ 30
where
X1 = number of chandeliers produced
Note: Minimization problems involved X2 = number of ceiling fans produced
reversing the roles of the upper and
lower bounds • And the optimal noninteger solution is

X1 = 3.75 chandeliers, X2 = 1.5 ceiling fans


profit = $35.25

Harrison Electric Company Harrison Electric Company


• Since X1 and X2 are not integers, this solution is not Subproblem A
valid Maximize profit = $7X1 + $6X2
• The profit value of $35.25 will provide the initial upper subject to 2X1 + 3X2 ≤ 12
bound 6X1 + 5X2 ≤ 30
• We can round down to X1 = 3, X2 = 1, profit = $27, X1 ≥4
which provides a feasible lower bound
Subproblem B
• The problem is now divided into two subproblems
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≤3

Harrison Electric Company Harrison Electric Company


• If you solve both subproblems graphically • Harrison Electric’s first branching:
subproblems A and B Next Branch (C)
Subproblem A’s Subproblem A
[X1 = 4, X2 = 1.2, profit = $35.20]
optimal solution: X1 = 4 Infeasible (Noninteger) Solution
X2 = 1.2 Upper Bound = $35.20
Lower Bound = $33.00
P = 35.20
≥4
Subproblem B’s X1
[X1 = 3, X2 = 2, profit = $33.00] Next Branch (D)
optimal solution: X1 = 3.75 Upper Bound = $35.25
X2 = 1.5 Lower Bound = $27.00 (From
P = 35.25 Rounding Down)
Subproblem B
• We have completed steps 1 to 4 of the branch and X
1 ≤3
bound method X1 = 3
X2 = 2
P = 33.00
Stop This Branch
Solution Is Integer, Feasible
Provides New Lower Bound of $33.00
Harrison Electric Company Harrison Electric Company
• Subproblem A has branched into two new • Subproblem C has no feasible solution because
subproblems, C and D the all the constraints can not be satisfied
Subproblem C
• We terminate this branch and do not consider this
Maximize profit = $7X1 + $6X2 solution
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30 • Subproblem D’s optimal solution is X1 = 4.17, X2 =
X1 ≥4 1, profit = $35.16
X2 ≥2 • This noninteger solution yields a new upper bound
Subproblem D of $35.16
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X2 ≤1

Harrison Electric Company Harrison Electric Company


• Finally we create subproblems E and F
• The stopping rule for the branching process is that
Subproblem E
we continue until the new upper bound is less than or
Maximize profit = $7X1 + $6X2
equal to the lower bound
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30 Optimal solution to E: • or no further branching is possible
X1 ≥4 X1 = 4, X2 = 1, profit = $34
• The later case applies here since both branches
X1 ≤4
X2 ≤1
yielded feasible integer solutions
Subproblem D • The optimal solution is subproblem F’s node
Maximize profit = $7X1 + $6X2 • Computer solutions work well on small and medium
subject to 2X1 + 3X2 ≤ 12 problems
6X1 + 5X2 ≤ 30 Optimal solution to F:
X1 ≥4 X1 = 5, X2 = 0, profit = $35 • For large problems the analyst may have to settle for
X1 ≥5 a near-optimal solution
X2 ≤1

Using Software to Solve Harrison


Harrison Electric Company Integer Programming Problem
• Harrison Electric’s full branch and bound solution • Using Excel’s Solver to formulate Harrison’s integer
Subproblem C programming model
No
Feasible
Solution
Region
Subproblem A Subproblem E
≥2
X2
X1 = 4 X1 = 4
X2 = 1.2 X2 = 1 Feasible, Integer
P = 35.20 P = 34.00 Solution
≥4 Subproblem D ≤4
X1 X X1
2 ≤1
X1 = 3.75 X1 = 4.17
X2 = 1.5 X2 = 1
P = 35.25 P = 35.16
Subproblem B Subproblem F
X X
1 ≤3 1 ≥5
X1 = 3 Upper Bound X1 = 5
X2 = 2 = $35.25 X2 = 0
P = 33.00 Lower Bound P = 35.00
= $27.00
Optimal
Solution
Using Software to Solve Harrison Using Software to Solve Harrison
Integer Programming Problem Integer Programming Problem
• Integer variables are specified with a drop-down • Excel solution to the Harrison Electric integer
menu in Solver programming model

Binary ( 0 – 1 ) Integer Example: Example


Portfolio Selection Stock Data
Choosing stocks to include in portfolio

Decision: Which of 7 stocks to include?

Objective: Maximize expected annual


return (in $1000’s)

Decision Variables
Restrictions
Use the first letter of each stock’s name
• Invest up to $3 million
Example for Trans-Texas Oil:
• Include at least 2 Texas companies
T = 1 if Trans-Texas Oil is included
• Include no more than 1 foreign company
T = 0 if not included
• Include exactly 1 California company
Objective Function (in $1000’s return) • If British Petro is included, then
Trans-Texas Oil must also be included
Max 50T + 80B + 90D + 120H + 110L +
40S + 75C
ST: (in $1000’s return) If British Petro is included (B=1), then
Invest up to $3 Million Trans-Texas Oil must also be included (T=1)
480T + 540B + 680D + 1000H
+ 700L + 510S + 900C < 3000 T=0 T=1
Combinations B=0 ok ok
Include At Least 2 Texas Companies of B and T
B=1 not ok ok
T+H+L > 2
B<T
Include No More Than 1 Foreign Company
allows the 3 acceptable combinations and
B+D < 1
prevents the unacceptable one
Include Exactly 1 California Company
S+C = 1

Special 0-1 Constraints Example 2: Metropolitan Microwaves

• When xi and xj represent binary variables designating Metropolitan Microwaves, Inc. is


whether projects i and j have been completed, the planning to expand its operations into
following special constraints may be formulated: other electronic appliances. The
– At most k out of n projects will be completed: company has identified seven new
Σxj < k product lines it can carry.
j

– Project j is conditional on project i: Relevant information about each line


xj - xi < 0 follows on the next slide.
– Project i is a corequisite for project j:
xj - xi = 0
– Projects i and j are mutually exclusive:
xi + xj < 1

Example: Metropolitan Microwaves Example: Metropolitan Microwaves


Initial Floor Space Exp. Rate Metropolitan has decided that they should
Product Line Invest. (Sq.Ft.) of Return
not stock projection TVs unless they stock
1. TV/VCRs $ 6,000 125 8.1%
2. Color TVs 12,000 150 9.0 either TV/VCRs or color TVs. Also, they will not
3. Projection TVs 20,000 200 11.0 stock both VCRs and DVD players, and they will
4. VCRs 14,000 40 10.2
5. DVD Players 15,000 40 10.5 stock video games if they stock color TVs.
6. Video Games 2,000 20 14.1 Finally, the company wishes to introduce at least
7. Home Computers 32,000 100 13.2
three new product lines.
If the company has $45,000 to invest and
420 sq. ft. of floor space available, formulate an
integer linear program for Metropolitan to
maximize its overall expected return.
Example: Metropolitan Microwaves Example: Metropolitan Microwaves
• Decision Variables • Decision Variables
xj = 1 if product line j is introduced; xj = 1 if product line j is introduced;
= 0 otherwise. = 0 otherwise.
where:
Product line 1 = TV/VCRs „ Objective Function
Product line 2 = Color TVs Maximize total expected return:
Product line 3 = Projection TVs Max .081(6000)x1 + .09(12000)x2 + .11(20000)x3
Product line 4 = VCRs + .102(14000)x4 + .105(15000)x5 + .141(2000)x6
Product line 5 = DVD Players + .132(32000)x7
Product line 6 = Video Games
Product line 7 = Home Computers

Example: Metropolitan Microwaves Example: Metropolitan Microwaves


• Constraints • Constraints

1) Money: 4) Do not stock both VCRs and DVD players:


6x1 + 12x2 + 20x3 + 14x4 + 15x5 + 2x6 + 32x7 < 45 x4 + x5 < 1
5) Stock video games if they stock color TV's:
2) Space:
x2 - x6 > 0
125x1 +150x2 +200x3 +40x4 +40x5 +20x6 +100x7 < 420
6) Introduce at least 3 new lines:
3) Stock projection TVs only if x1 + x2 + x3 + x4 + x5 + x6 + x7 > 3
stock TV/VCRs or color TVs: 7) Variables are 0 or 1:
x1 + x2 > x3 or x1 + x2 - x3 > 0 xj = 0 or 1 for j = 1, , , 7

Example: Metropolitan Microwaves Example 3: Tina’s Tailoring


Tina's Tailoring has five idle tailors and four
• Optimal Solution
custom garments to make. The estimated time (in
Introduce: hours) it would take each tailor to make each garment
TV/VCRs, Projection TVs, and DVD Players is shown in the next slide.
Do Not Introduce: Tailor
Color TVs, VCRs, Video Games, and Home Computers
Garment 1 2 3 4 5
Total Expected Return: Wedding gown 19 23 20 21 18
$4,261 Clown costume 11 14 X 12 10
Admiral's uniform 12 8 11 X 9
Bullfighter's outfit X 20 20 18 21
Example: Tina’s Tailoring Example: Tina’s Tailoring
Formulate an integer program for determining
the tailor-garment assignments that minimize • Decision variables
the total estimated time spent making the four
xij = 1 if garment i is assigned to tailor j
garments. No tailor is to be assigned more than one
= 0 otherwise.
garment and each garment is to be worked on by only
one tailor. Number of decision variables =
-------------------- [(number of garments)(number of tailors)]
This problem can be formulated as a 0-1 integer - (number of unacceptable assignments)
program. The LP solution to this problem will = [4(5)] - 3 = 17
automatically be integer (0-1).

Example: Tina’s Tailoring Example: Tina’s Tailoring

• Objective function • Constraints


Minimize total time spent making garments: Exactly one tailor per garment:
Min 19x11 + 23x12 + 20x13 + 21x14 + 18x15 + 11x21 1) x11 + x12 + x13 + x14 + x15 = 1
+ 14x22 + 12x24 + 10x25 + 12x31 + 8x32 + 11x33
2) x21 + x22 + x24 + x25 = 1
+ 9x35 + 20x42 + 20x43 + 18x44 + 21x45
3) x31 + x32 + x33 + x35 = 1
4) x42 + x43 + x44 + x45 = 1

Example: Tina’s Tailoring


Applications of IP
• Extensions to LPs eg Manufacturing, Distribution, Petroleum, Gas and Chemicals
• Constraints
• Global Optimisation of non-convex (non-linear) models
No more than one garment per tailor: • Power Systems Loading
5) x11 + x21 + x31 < 1 • Facilities Location
• Routing
6) x12 + x22 + x32 + x42 < 1 • Telecommunications
• Medical Radiation
7) x13 + x33 + x43 < 1 • Statistical Design
• Molecular Biology
8) x14 + x24 + x44 < 1 • Genome Sequencing
• Archaeological Seriation
9) x15 + x25 + x35 + x45 < 1 • Optimal Logical Statements
Nonnegativity: xij > 0 for i = 1, . . ,4 and j = 1, . . ,5 • Computer Design
• Aircraft Scheduling
• Crew Rostering
Faculty of Engineering

You might also like