Biology for Computer Engineers Course Handout.pptx
Chapter 6-INTEGER PROGRAMMING note.pdf
1. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 1
INTEGER PROGRAMMING
Introduction
An integer programming model is one where one or more of the decision variables has to take on
an integer value in the final solution. Solving an integer programming problem is much more
difficult than solving an LP problem. Even the fastest computers can take an excessively long
time to solve big integer programming problems. If requiring integer values is the only way in
which a problem deviates from a linear programming formulation, then it is an integer
programming (IP) problem. (The more complete name is integer linear programming, but the
adjective linear normally is dropped except when this problem is contrasted with the more
esoteric integer nonlinear programming problem. So, the mathematical model for integer
programming is the linear programming model with the one additional restriction that the
variables must have integer values.
In linear programming, each of the decision variable as well as slack and /or surplus variable is
allowed to take any fractional value. However, there are certain practical problems in which the
fractional value of the decision variables has no significance. For example, it does not make
sense saying 1.5 men working on a project or 1.6 machines in a workshop. The integer solution
to a problem can, however, be obtained by rounding off the optimum value of the variables to the
nearest integer value.
This approach can be easy in terms of economy of effort, time and cost that might be required to
derive an integer solution but this solution may not satisfy all the given constraints. Secondly, the
value of the objective function so obtained may not be optimal value. All such difficulties can be
avoided if the given problem, where an integer solution is required, is solved by integer
programming techniques.
Why used?
The implicit assumption was that solutions could be fractional or real numbers (i.e.non
integer) in the linear programming models. However, non-integer solutions are always
practical.
When only integer solutions are practical or logical, non-integer solution values can be
rounded off to the nearest feasible integer values.
For example, if the case is nail, it will cause little concern considering 8000.4 nails as
8000 nails. Round off makes the case cost only a few cents apiece.
For example, if the case is a production of jet aircraft, round off could affect profit or
cost by million dollars considering 7.4 jet airliners as 7 or 8.
Integer Programming Models
There are three types of models;
2. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 2
Pure 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 Model: Some of the decision variables (but not all) required to have
integer values.
There are certain decision problems where decision variables make sense only if they have
integer values in the solution. Capital budgeting, construction scheduling, plant location and
size, routing and shipping schedule, batch size, capacity expansion, fixed charge, etc., are few
problems which demonstrate the areas of application of integer programming.
Example 1: A Total (Pure) Integer Model
Machine shop obtaining new presses and lathes. The Marginal profitability of each press
machine is $100/day and each of lathe machine is $150/day. The Resource constraints is
$40,000 and 200 sq. ft. floor space. The Machine purchase prices and space requirements are
given in the table below:
Machine
Required Floor Space (sq.
ft.) Purchase Price
Press 15 8000
Lathe 30 4000
Integer Programming Model:
Maximize Z = $100X1+ $150X2
subject to:
8,000X1+ 4,000X2 ≤ $40,000
15X1+ 30X2 ≤ 200 ft2
X1, X2 ≥ 0 and integer
X1= number of presses
X2= number of lathes
Example 2: A Total Integer Model
Integer Programming Model:
Maximize Z = 6X1+ 5X2 + 2X3
3. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 3
subject to:
10X1+ 4X2+ 2 X3 ≤ 600
2 X1+ 5 X2+ 2 X3 ≤ 800
X1, X2, X3 ≥0 and integer
X1= 22, X2= 0, X3 = 378
Z=888
Example 3: A 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).
Data:
Recreation
Expected
Usage Cost
($)
Land
Facility (people/day) Requirement
(acres)
Swimming
pool 300 35000 4
Tennis Center 90 10000 2
Athletic field 400 25000 7
Gymnasium 150 90000 3
Integer Programming Model:
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
4. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 4
X1= construction of a swimming pool
X2= construction of a tennis center
X3= construction of an athletic field
X4= construction of a gymnasium
Example 4:
Integer Programming Model:
Maximize Z = 6X1+ 5X2 + 2X3
subject to:
10X1+ 4X2+ 2 X3 ≤ 600
2 X1+ 5 X2+ 2 X3 ≤ 800
X1, X2, X3 ≥ 0 OR 1
X1= 1, X2= 1, X3 = 1, Z=13
Example 5: A Mixed Integer Model;
$250,000 available for investments providing greatest return 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.
Integer Programming Model:
Maximize Z = $9,000x1+ 1,500x2 + 1,000x3
subject to:
50,000X1+ 12,000X2 + 8,000X3 ≤ $250,000
5. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 5
X1 ≤ 4 condominiums
X2 ≤ 15 acres
X3≤20 bonds
X2 ≥0
X1, X3 ≥0 and integer
X1= condominiums purchased, X2 = acres of land purchased, X3= bonds purchased
Example 6:
Integer Programming Model:
Maximize Z = 6X1+ 5X2 + 2X3
subject to:
10X1+ 4X2+ 2 X3 ≤ 600
2 X1+ 5 X2+ 2 X3 ≤800
X1, X2, X3 ≥0
X1= 22.2, X2= 0, X3 = 377.8
Z=888.9
METHODS FOR SOLVING ILP PROBLEMS
a. Branch–and–Bound Method (Developed By: A.H. Land and A. G. Doing)
b. Cutting–Plane Method (developed by: Ralph E. Gomory)
a. BRANCH–AND–BOUND METHOD
Creates and solves a sequence of sub-problems to the original problem that are increasingly
more restrictive until an optimal solution is found.
Branching: Selection of an integer value of a decision variable to examine for a possible
integer solution to a problem. “If the solution to the linear programming problem contains
non-integer values for some or all decision variables, then the solution space is reduced by
introducing constraints with respect to any one of those decision variables. If the value of the
6. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 6
decision variable “X1” is 2.5, then two more problems will be created by using each of the
following constraints. X1 ≤ 2 and X1 ≥ 3.
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.
Lower bound: The lower bound at a node is the value of the objective function
corresponding to the truncated values (integer parts) of the decision variables of the problem
in that node.
Upper bound: The upper bound at a node is the value of the objective function
corresponding to the linear programming solution in that node.
Fathomed subproblem / node: A problem is said to be fathomed if any one of the following
three conditions is true:
1. The values of the decision variables of the problem are integer.
2. The upper bound of the problem which has non–integer values for its decision variables
is not greater than the current best lower bound.
3. The problem has infeasible solution. This means that further branching from this type of
fathomed nodes is not necessary.
Current best lower bound: This is the best lower bound (highest in the case of maximization
problem and lowest in the case of minimization problem) among the lower bounds of all the
fathomed nodes. Initially, it is assumed as infinity for the root node.
Branch & Bound Algorithm Applied to Maximization Problem:
Step 1. Solve the given linear programming problem graphically or using iterative
method. Set, the current best lower bound ZB as ∞.
Step 2. Check, Whether the problem has integer solution. If yes, print the current solution
as the optimal solution and stop; Otherwise go to Step–3.
Step 3. Identify the variable Xk which has the maximum fractional part as the branching
variable. (In case of tie, select the variable which has the highest objective function
coefficient.)
Step 4. Create two more problems by including each of the following constraints to the
current problem and solve them.
a) Xk ≤ Integer part of Xk
b) Xk ≥ Next Integer of Xk
Step 5. If any one of the new sub-problems has infeasible solution or fully integer values
for the decision variables, the corresponding node is fathomed. If a new node has
integer values for the decision variables, update the current best lower bound as the
lower bound of that node if its lower bound is greater than the previous current best
lower bound.
7. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 7
Step 6. Are all terminal nodes fathomed? If answer is yes, go to step–7; otherwise,
identify the node with the highest lower bound and go to step–3.
Step 7. Select the solution of the problem with respect to the fathomed node whose lower
bound is equal to the current best lower bound as the optimal solution.
Example
Max. Z = 10X1 + 20X2
Subject to:
6X1 + 8X2 ≤ 48
X1 + 3X2 ≤ 12
X1, X2 ≥ 0 and integers
ZU = Upper bound = Z (Optimum) of LP Problem.
ZL = Lower bound w. r. t. the truncated values of the decision variables
ZB = Current Best Lower Bound
X1=24/5, X2=12/5,Z=96
ZU=96
ZL=80
ZB=∞
In Problem (P1), X1 has the highest fractional part 24/5. Hence; “X1” is selected for further
branching.
8. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 8
The Problem P2 has the highest lower bound (ZL) of 90 among the unfathomed terminal nodes.
So, the further branching is done from this node.
10. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 10
The solution of P6 is non–integer and its ZL = 80 and ZU = 90. Since, ZU ≤ (Current best ZL =90),
the node P6 is also fathomed and it has infeasible solution in terms of not fulfilling integer
constraints for the decision variables.
The Problem P7 has integer solution. So, it is a fathomed node. Hence the current best lower
bound (ZB) is updated to the objective function value 90.
11. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 11
Now, the Only unfathomed terminal node is P3. The further branching from this node is shown
below:
The problems P8 and P9 have integer solution. So, these two nodes are fathomed. But the
objective function value of these nodes are not greater than the current best lower bound of 90.
Hence, the current best lower bound is not updated. Now, all the terminal nodes are fathomed.
The feasible fathomed node with the current best lower bound is P7. Hence, its solution is treated
as the optimal solution: X1=5, X2 =2, Z(Optimum) = 90
NOTE: This Problem has alternative optimum solution at P8 with X1=3, X2=3, Z(Optimum)=90
12. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 12
Complete Tree:
13. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 13
Example 2;
Max Z = 6X1 + 8X2
Subject to:
4X1 + 5X2 ≤ 22
5X1 + 8X2 ≤ 30
X1, X2 ≥ 0 and integers
b. Integer simplex method (Gomory's cutting plane method)
An Algorithm for solvingPure integer and mixed integer programming
problems have been developed by Ralph E. Gomory
Step I. Relax the integer requirements.
Step II. Solve the resulting LP problem using Simplex Method.
Step III. If all the basic variables have integer values, Optimality of the Integer
programming problem is reached. So, go step 7; otherwise go to step 4.
Step IV. Examine the constraints corresponding to the current optimal solution. For each
Basic Variable with non-integer solution in the current optimal table, find the fractional
part, fi, Therefore, bi = [bi] + fi, where [bi] is the integer part of bi, and fi is the
fractional part of bi.
Step V. Choose the largest fraction among various fi; i.e. Max (fi). Treat the constraint
corresponding to the maximum fraction as the source row
(equation). Based on the source equation, develop an additional constraint (Gomory’s
constraint / fractional cut) as shown:
–fi = Si – Summation ((fi) (Non–Basic Variable))
Step VI. Add the fractional cut as the last row in the latest optimal table and proceed
further using dual simplex method, and find the new optimum solution. If the new
optimum solution is integer then go to step 7; otherwise go to step IV.
Step VII. Print the integer solution [X’s and Z – Values]
Find solution using integer simplex method (Gomory's cutting plane method)
MAX Z = x1 + x2
subject to
3X1 + 2X2 ≤ 5
X2 ≤ 20
and X1, X2 >= 0
The optimal table of this linear programming problem is obtained at the third iteration of the
simplex method. The optimal table looks like as follow;
Iteration-3 Cj 1 1 0 0
B CB XB x1 x2 S1 S2 Min Ratio
14. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 14
x2 1 2.5 1.5 1 0.5 0
S2 0 17.5 -1.5 0 -0.5 1
Z=2.5 Zj 1.5 1 0.5 0
Zj-Cj 0.5 0 0.5 0
Since all Zj-Cj≥0
Hence, non-integer optimal solution is arrived with value of variables as:
X1=0, X2=2.5
Max Z=2.5
To obtain the integer valued solution, we proceed to construct Gomory's fractional cut, with the
help of X2-row as follows:
2.5=1.5X1+1X2+0.5S1
(2+0.5) = (1+0.5) X1+(1+0) X2+(0+0.5) S1
The fractional cut will become
-0.5=Sg1-0.5X1-0.5S1→ (Cut-1)
Adding this additional constraint at the bottom of optimal simplex table. The new table so
obtained is;
Iteration-1 Cj 1 1 0 0 0
B CBv XB X1 X2 S1 S2 Sg1
X2 1 2.5 1.5 1 0.5 0 0
S2 0 17.5 -1.5 0 -0.5 1 0
Sg1 0 -0.5 (-0.5) 0 -0.5 0 1
Z=2.5 Zj 1.5 1 0.5 0 0
Zj-Cj 0.5 0 0.5 0 0
Ratio=Zj-Cj/Sg1, j
and Sg1, j<0
-1↑ --- -1 --- ---
15. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 15
Minimum negative XB is -0.5 and its row index is 3. So, the leaving basis variable is Sg1.
Maximum negative ratio is -1 and its column index is 1. So, the entering variable is X1.
The pivot element is -0.5.
Entering =X1, Departing =Sg1, Key Element =-0.5
R3(old) = -0.5 -0.5 0 -0.5 0 1
R3(new)=R3(old)÷ (-0.5) 1 1 0 1 0 -2
R1(old) = 2.5 1.5 1 0.5 0 0
R3(new) = 1 1 0 1 0 -2
1.5×R3(new) = 1.5 1.5 0 1.5 0 -3
R1(new)=R1(old) - 1.5R3(new) 1 0 1 -1 0 3
R2(old) = 17.5 -1.5 0 -0.5 1 0
R3(new) = 1 1 0 1 0 -2
1.5×R3(new) = 1.5 1.5 0 1.5 0 -3
R2(new)=R2(old) + 1.5R3(new) 19 0 0 1 1 -3
Iteration-2 Cj 1 1 0 0 0
B CBv XB X1 X2 S1 S2 Sg1
X2 1 1 0 1 -1 0 3
S2 0 19 0 0 1 1 -3
X1 1 1 1 0 1 0 -2
Z=2 Zj 1 1 0 0 1
Zj-Cj 0 0 0 0 1
Ratio --- --- --- --- ---
16. COMPILED BY TSEGAY BERHE MSC IN PRODUCTION ENGINEERING AND MANAGEMENT 16
Since all Zj-Cj≥0. Hence, integer optimal solution is arrived with value of variables as:
X1=1,X2=1
Max Z=2
The integer optimal solution found after 1-cuts.