Sie sind auf Seite 1von 40

Integer Programming

Introduction
In LP problems, decision variables are non negative values,
i.e. they are restricted to be zero or more than zero.
It demonstrates one of the properties of LP namely,
continuity, which means that fractional values of the
decision variables are possible in the solution of a LP model.
For some problems like: product mix, balanced diet
(nutrition) etc. the assumption of continuity may be valid.
Further, in some problems such as, production of different
fertilizers (in kilograms or tonnages), usage of different
amounts of food items (in grams) etc. may satisfy the
continuity assumption.
2
Introduction

But some items cannot be produced in fractions. Say, ship,


cranes, tables, chairs etc.
If we round off the production volume of such products:
Corresponding solution may be different from the optimal
solution.
There would be a significant difference in the total profit,
if the profit per unit of each of the products is very high.
There are problems where it is also necessary to assign
people , machines, vehicles to activities in integer quantities.

3
Example
Consider the problem
maximize 3x + 4y
subject to 5x + 8y 24
x, y 0 and integer

What is the optimal solution?

4
Example

Question: What is the


optimal integer solution?
5

What is the optimal linear


solution?
4
3

Can one use linear


2

programming to solve the


integer program?
1
0

0 1 2 3 4 5
5
A rounding technique that sometimes is useful, and
sometimes not.

Solve LP (ignore integrality) get


x=24/5, y=0 and z =14 2/5.
5

Round, get x=5, y=0, infeasible!


4

Truncate, get x=4, y=0, and z


=12
3

Same solution value at x=0, y=3.


2

Optimal is x=3, y=1, and z =13


1
0

6 0 1 2 3 4 5
Introduction

That means these variables should take integer values.


Hence there is a need for Integer programming methods.
The mathematical model for IP or more precisely ILP is the LP
model with one additional restriction/constraint: variables
must have integer values.
If only some of the variables of the problem should be integers
then they are called Mixed IP problems.
If all the variables should take integer values then we have Pure
IP problems.
We discuss Branch and Bound algorithm to solve an
integer LPP.
7
Branch and Bound (B & B) Algorithm
Applicable to both pure as well as mixed-integer programming
problem.
It refers to certain procedure for finding an optimal solution.
With some rules, solutions are divided into two parts:
One that most probably contains the optimal solution and
therefore, should be examined further.
The second part that would not contains the optimal
solution, and thus, be left out of further consideration.
Therefore, B & B essentially keeps dividing up the feasible
region into smaller and smaller parts (branching) until the
optimal is determined (bounding).
8
B & B Algorithm
1. Obtain an optimal solution to the given LPP ignoring the
restriction of integers.
2. Test the integrality of the optimal solution:
1. If solution is integers, the current solution is optimum to IPP.
2. If solution is not integers go to the next step.
3. Considering the value of the objective function as upper
bound, obtain the lower bound by rounding off to integral
values of the decision variables.
4. Let the optimum value xj* of the variable xj is not an integer.
Then subdivided the given LPP into two problems:
1. S P 1: given LPP with an xj* <= [xj* ]. where, [xj*] is the integer
2. S P 2: given LPP with xj* >= [xj* ] + 1. part of xj*
9
B & B Algorithm
5. Solve the two sub problems obtained in step 4. There may
arise three oases:
1. If the optimal solution of the two S Ps are integrals, then
the required solution is one that gives larger value of Z.
2. If the optimal solution of one subproblem is integral, and
other problem has no feasible optimal solution, the
required solution is same as that of subproblem having
integer valued solution.
3. If the optimal solution of one subproblem is integral
while that of the other is not integer valued, then record
the integer-valued solution and repeat steps 3 and 4 for
the noninteger-valued subproblem.
10
B & B Algorithm

6. Repeat steps 3-5, until all integer-valued solutions are recorded.


7. Choose the solution amongst the recorded integer-valued
solutions that yields the optimal value of Z.

11
Example 1:

Maximize
z 3x1 2 x2
Subject to 2 x1 5x2 9

4 x1 2 x2 9

x1 , x2 0 and integers

12
Example
The associated LPP, LP0 is defined by removing the integer
restrictions.
Solving we get x1= 1.69, x2 = 1.13, z = 7.31.
Because the optimum LP0 solution does not satisfy the
integer requirements, the B&B algorithm modifies the
solution space in a manner that eventually identifies the
integer optimum solution.
First we select one of the variables whose optimum value at
LP0 is not an integer.
We select x1.

13
Example
We replace the original LP0 with two new LPPs,
LP1 and LP2 defined as
LP1 space = LP0 space + ( x1 1)
LP2 space = LP0 space + ( x1 2) Set lower bound = -
We solve the LP1 problem
(which is given by adding to LP0, the constraint x1 1)
The solution is
x1 = 1, x2 = 1.4, z = 5.80
Now x1 is integer but x2 is not.
14
Example
So we replace the LP1 problem with two new LPs, LP3,LP4,
defined as
LP3 space = LP1 space + ( x2 1)
LP4 space = LP1 space + ( x2 2)
We now solve the LP3 problem.
The solution is : x1 = 1, x2 = 1, z = 5
Thus we have now got an all integer solution. So we need not
consider this node any further as we will not get a better
optimum since we will be looking at smaller subsets. We say
this node is fathomed. We also update the lower bound to 5.

15
Example

Now we solve the LP4 problem. We find it is infeasible. We


say this node is also fathomed.
Now we look at LP2 problem.
Solving we get x1 = 2, x2 = 0.5, z = 7.
We now replace the LP2 problem with two new LPs, LP5,
LP6 defined as
LP5 = LP2 + ( x2 0)
LP6 = LP2 + ( x2 1)
Solving LP5 we get x1 = 2.25, x2 = 0, z = 6.75

16
Example:
Thus we replace the LP5 problem with two new LPs LP7, LP8
defined as
LP7 = LP5 + ( x1 2)
LP8 = LP5 + ( x1 3)
Solving LP7 we get the all-integer solution
x1 = 2, x2 = 0, z = 6 and this node is fathomed.
We update the lower bound to 6.
We find LP8 is infeasible. Thus this is also fathomed.
We also find LP6 is infeasible. Thus this is also fathomed.
Thus ultimately we got the all-integer optimum solution as
x1 = 2, x2 = 0, z = 6.
17
All the above are depicted graphically as follows
LP0
x1=1.69,x2=1.13,z=7.31

x1 1 x1 2
LP1 LP2
x1=1,x2=1.4,z=5.8 x1=2,x2=0.5,z=7.0

x2 1 x2 2 x2 1
LP3 LP4 LP6
x1=1,x2=1,z=5 Infeasible x2 0 Infeasible
(fathomed) (fathomed) (fathomed)
LP5
x1=2.25,x2=0, z=6.75
x1 2 x1 3
LP7 LP8
x1=2,x2=0,z=6 Infeasible
Optimum Solution (fathomed) (fathomed)
18
Example 2:
Maximize
z 5x1 7 x2
subject to

2 x1 x2 13
5 x1 9 x2 41
x1 , x2 0 and integers

We solve this both graphically and algebraically.


LP0: We first solve without integer
restrictions.

Optimal
Solution
(0,41/9)
(5.85, 1.31)

z=38.38
(13/2,0)
LP1: LP0 + {x1 5 }

Optimal
Solution
(0,41/9)
(5,1.78) z=37.44

(5,0) (13/2,0)
LP2: LP0 + { x1 6 }

Optimal
Solution
(0,41/9)
(6,1) z=37
Fathomed
(6,0) (13/2,0)
LP3: LP1 + {x2 1 }

Optimal
(0,41/9) Solution
(5,1) z=32
Fathomed
(5,0) (13/2,0)
LP4: LP1 + { x2 2 }.

Optimal
Solution
(0,41/9)
(4.60,2) z=37
(0,2)
Fathomed

(5,0) (13/2,0)
Thus though we have not got all integer
solution, we have got z=37 and since any
further subdivision will only yield z < 37, we
say this node is fathomed.
And the all integer optimum solution is:
x1=6, x2=1 with z = 37
Algebraic solution of LP0 (given problem without
integer restrictions)
Basic z x1 x2 s1 s2 Solution
z 1 -5 -7 0 0 0
s1 0 2 1 1 0 13
s2 0 5 9 0 1 41
z 1 -10/9 0 0 7/9 287/9
s1 0 13/9 0 1 -1/9 76/9
x2 0 5/9 1 0 1/9 41/9
z 1 0 0 10/13 9/13 499/13
x1 0 1 0 9/13 -1/13 76/13
x2 0 0 1 -5/13 2/13 17/13
Algebraic solution of LP1= LP0 + { x1 5}
Basic z x1 x2 s1 s2 s3 Solution
z 1 0 0 10/13 9/13 0 499/13
x1 0 1 0 9/13 -1/13 0 76/13
x2 0 0 1 -5/13 2/13 0 17/13
s3 0 1 0 0 0 1 5
0 0 - 9/13 1/13 -11/13
z 1 0 0 0 7/9 10/9 337/9
x1 0 1 0 0 0 1 5
x2 0 0 1 0 1/9 -5/9 16/9
s1 0 0 0 1 -1/9 -13/9 11/9
Algebraic solution of LP2= LP0 + { x1 6}
Basic z x1 x2 s1 s2 s3 Solution
z 1 0 0 10/13 9/13 0 499/13
x1 0 1 0 9/13 -1/13 0 76/13
x2 0 0 1 -5/13 2/13 0 17/13
s3 0 -1 0 0 0 1 -6
0 0 9/13 - 1/13 -2/13
z 1 0 0 7 0 9 37
x1 0 1 0 0 0 -1 6
x2 0 0 1 1 0 2 1
s2 0 0 0 -9 1 -13 2
Algebraic solution of LP3= LP1+ { x2 1}
Basic z x1 x2 s1 s2 s3 s4 Solution
z 1 0 0 0 7/9 10/9 0 337/9
x1 0 1 0 0 0 1 0 5
x2 0 0 1 0 1/9 -5/9 0 16/9
s1 0 0 0 1 -1/9 -13/9 0 11/9
s4 0 0 1 0 0 0 1 1
0 -1/9 5/9 -7/9
z 1 0 0 7 0 5 7 32
x1 0 1 0 0 0 1 0 5
x2 0 0 1 0 0 0 1 1
s1 0 0 0 1 0 -2 -1 2
s2 0 0 0 0 1 -5 -9 7
Algebraic solution of LP4= LP1+ { x2 2}
Basic z x1 x2 s1 s2 s3 s4 Solution
z 1 0 0 0 7/9 10/9 0 337/9
x1 0 1 0 0 0 1 0 5
x2 0 0 1 0 1/9 -5/9 0 16/9
s1 0 0 0 1 -1/9 -13/9 0 11/9
s4 0 0 -1 0 0 0 1 -2
0 1/9 -5/9 -2/9
z 1 0 0 0 1 0 2 37
x1 0 1 0 0 -1/5 0 9/5 23/5
x2 0 0 1 0 0 0 -1 2
s1 0 0 0 1 -2/5 0 -13/5 9/5
s3 0 0 0 0 -1/5 1 -9/5 2/5
All the above are depicted graphically as follows

LP0
x1=5.85,x2=1.31,z=38.38

x1 5 x1 6
LP1 LP2
x1=5,x2=1.78,z=37.44 x1=6, x2=1,z=37
(fathomed)
x2 1 x2 2
LP3 LP4
x1=5,x2=1, z=32 x1=4.6,x2=2, z=37
(fathomed) (fathomed)

Optimum Solution
Example 3:
Minimize z 5x1 4 x2

subject to 3x 2 x 5
1 2

2 x1 3x2 7
x1 , x2 0 and integers

We solve this problem graphically only.


LP0 : No integer restrictions

(0,5/2) Optimum Solution x1=0.20


(1/5, 11/5) x2=2.20
(0,7/3)
z = 9.80

(5/3,0) (7/2,0)
LP1 : LP0 + { x1 0 }

(0,5/2) Optimum Solution x1=0


x2=2.50
(0,7/3)
z = 10

(5/3,0) (7/2,0)

Note: FR consists only of y axis y 2


LP2 : LP0 + { x1 1 }

(0,5/2) Optimum Solution x1=1


(1,5/3)
x2=1.67
(0,7/3)
z = 13.33

(1,0) (5/3,0)
(7/2,0)
LP3 : LP1 + { x2 2 }

(0,5/2) Infeasible

(0,7/3)
(0,2)

(5/3,0) (7/2,0)

Note: FR is empty (possible points are x1=0, x2 2)


LP4 : LP1 + { x2 3 }

(0,3)
(0,5/2) x1=0
Optimum solution
(0,7/3) x2=3
z=12

(5/3,0) (7/2,0)

Note: FR consists only of y axis y 3


LP5 : LP2 + { x2 1 }

(0,5/2) Optimum Solution x1=2


x2=1
(0,7/3)
z = 14
(2,1)

(5/3,0) (7/2,0)

Note: FR consists only of y axis.


LP6 : LP2 + { x2 2 }

(0,5/2)
(0,2) (1,2) x1=1
(0,7/3) Optimum Solution x2=2
z = 13

(5/3,0) (7/2,0)
All the above are depicted graphically as follows
LP0
x1=0.2,x2=2.2,z=9.8

x1 0 x1 1
LP1 LP2
x1=0,x2=2.5,z=10 x1=1,x2=1.66,z=11.66

x2 2 x2 3 x2 1
LP3 LP4 LP6
Infeasible x1=0,x2=3, z=12 x2 1 x1=1,x2=2,z=13
(fathomed) (fathomed) (fathomed)
LP5
x1=2,x2=1, z=14
(fathomed)

Optimum Solution

Das könnte Ihnen auch gefallen