Operations Research
Integer Programming
Integer Programming
When formulating LPs we often found that, strictly,
certain variables should have been regarded as taking
integer values but, for the sake of convenience, we let
them take fractional values reasoning that the variables
were likely to be so large that any fractional part could
be neglected.
While this is acceptable in some situations, in many cases
it is not, and in such cases we must find a numeric
solution in which the variables take integer values.
Problems in which this is the case are called integer
programs (IP's) and the subject of solving such programs
is called integer programming (also referred to by the
initials IP).
An IP in which all variables are required to be integers is
called a pure IP problem.
If some variables are restricted to be integer and some
are not then the problem is a mixed IP problem
The case where the integer variables are restricted to be
0 or 1 comes up surprising often. Such problems are
called pure (mixed) 0-1 programming problems or pure
(mixed) binary IP problems.
Formulation
The same as LP formulation except integer or binary
variables are indicated seperately
Eg. (Pure IP)
max z = x1+ x2+x3
s.t.
x1 + 6x2+ x3 8
x1 + 2x2+1,5x3 2
2x1 + x2+ 5x3 8
x1,x2,x3 integer
Formulation
Eg. (Pure 0-1)
max z = 2x1+ 3x2+ 4x3 + 7x4+ 2x5
s.t.
x1+ 2x2+ 3x3 + x4+ 2x5 8
x1,x2,x3,x4,x5 = 0 or 1
Formulation
Eg. Mixed Integer Program
max z = x1 - 2x2+x3 +2x4
s.t.
x1 + 6x2+ x3 - 2x4 8
x1 + 2x2+1,5x3 +x4 2
2x1 + x2+ 5x3 +2x4 8
x1 0; x2,x3 integer; x4 0 or 1
LP relaxation
For any IP we can generate an LP by taking the same
objective function and same constraints but with the
requirement that variables are integer replaced by
appropriate continuous constraints:
xi 0 and integer can be replaced by xi 0
xi = 0 or 1 can be replaced by xi 0 and xi 1
The LP obtained by omitting all integer or 0-1 constraints
on variables is called LP Relaxation of the IP (LR).
LP relaxation
Mixed Integer Programming
max z = x1+ x2+x3
s.t.
x1 + 6x2+ x3 8
x1 + 2x2+1,5x3 2
2x1 + x2+ 5x3 8
x1 0, x2 integer, x3 binary
LP relaxation of the model
max z = x1+ x2+x3
s.t.
x1 + 6x2+ x3 8
x1 + 2x2+1,5x3 2
2x1 + x2+ 5x3 8
x3 1
x1, x2 , x3 0
Optimum solution of LP Relaxation model
is always better than or as good as
Optimum solution of IP model
Example
max z = 21x1+ 11x2
s.t.
7x1 + 4x2 13
x1, x2 integer
Formulating IP
Practical problems can be formulated as IPs.
For instance
budgeting problems,
knapsack problems,
fixed charge production and location problems,
set covering problems,
etc.
Budgeting problems
Capital Budgeting Example
Stock is considering four investments
Each investment yields a determined NPV ($8,000,
$11,000, $6,000, $4,000)
Each investment requires at certain cash flow at the
present time ($5,000, $7,000, $4,000, $3,000)
Currently Stock has $14,000 available for investment.
Formulate an IP whose solution will tell Stock how to
maximize the NPV obtained from the four investments.
Capital Budgeting Example
Answer
If xj = 0 Stock will not make investment j, and if xj = 1
Stock will make investment j.
max z = 8x1 + 11x2 + 6x3 + 4x4
s.t. 5x1 + 7x2 + 4x3 + 3x4 14
xj = 0 or 1 (j = 1,2,3,4)
This is a knapsack problem!
Knapsack Problem
The traditional story is that: There is a knapsack. There are a
number of items, each with a size and a value. The objective is
to maximize the total value of the items in the knapsack.
Knapsack problems are nice because they are (usually) easy to
solve.
Max z = c1x1 + c2x2 + + cnxn
S.t.
a1x1 + a2x2 + + anxn b
xi = 0 or 1 (i = 1, 2, , n)
Capital Budgeting - Multiperiod
There are four possible projects, which each run for
three years and have the following characteristics:
Which projects would you choose in order to maximize
the total return?
Capital Budgeting Extension
There are a number of additional constraints Stock might
want to add. Logical restrictions can be enforced using 01 variables:
Stock can only make two investments
x1 + x2 + x3 + x4 2
If investment 2 is made, investment 4 must also be made
x2 < x4 or x2 -x4 0
If investment 1 is made, investment 3 cannot be made
x1 + x3 1
Either investment 1 or investment 2 must be done
x1 + x2 =1
Fixed Charge Problems
There is a cost associated with performing an activity at a
nonzero level that does not depend on the level of the
activity.
An important trick can be used to formulate many
production and location problems involving the idea of a
fixed charge as IP.
Gandhi
Gandhi Co makes shirts, shorts, and pants using the limited
labor and cloth described below.
In addition, the machinery needed to manufacture each type of
clothing must be rented at the following rates: shirt machinery,
$200 per week; shorts machinery, $150 per week; pants
machinery, $100 per week.
Each week, 150 hours of labor and 160 sq yd of cloth are
available.
Formulate an IP whose solution will maximize Gandhis weekly
profits.
Product Labor
(hrs/wk)
Cloth
(m2/wk)
Sale Price
Variable unit
cost
Shirts
12
Shorts
Pans
15
Set Covering Problems
Each member of a given set (call it set 1) must be
covered by an acceptable member of some set (call it
set 2).
The objective of a set-covering problem is to minimize
the number of elements in set 2 that are required to
cover all the elements in set 1.
Fire Station example
A county is reviewing the location of its fire stations.
The county is made up of a number of cities:
A fire station can be placed in any city.
It is able to handle the fires for both its city and any adjacent
city (any city with a non-zero border with its home city).
How many fire stations should be built and where?
Either-Or Constraints
Either-Or Constraints
Example
Dorian produces 3 types of cars. Required steel and
required hours of labor for each type is given in the table.
At present, 6,000 tons of steel and 60,000 hours of labor
are available.
For an economically feasible production, at least 1,000
cars of each type of a car must be produced.
Constraint: x 0 or x 1000
Sign restriction: x 0 and Integer
Compact car
Hatchback
Stationwagon
Required steel
1,5 tons
3 tons
5 tons
Required labor
30 hours
25 hours
40 hours
Unit profit ($)
2.000
3.000
4.000
Traveling Salesperson Problems
Given a number of cities and the costs of traveling from
any city to any orther city what is the cheapest round-trip
route (tour) that visits each city once and then returns to
the starting city?
An itinerary that begins and ends at the same city and
visits each city once is called a tour.