Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
11/19/2019 1
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.
• If only a subset of the variables are restricted to be 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.
11/19/2019 2
Example: All-Integer LP
• Consider the following all-integer linear program:
11/19/2019 3
Example: All-Integer LP
Solving the problem as a linear program
ignoring the integer constraints, the optimal
solution to the linear program gives fractional
values for both x1 and x2. From the graph on the
next slide, we see that the optimal solution to the
linear program is:
11/19/2019 4
Example: All-Integer LP
x2
5 -x1 + x2 < 1
4 3x1 + x2 < 9
2
LP Optimal (2.5, 1.5)
x1 + 3x2 < 7
1
x1
1 2 3 4 5 6 7
11/19/2019 5
Example: All-Integer LP
11/19/2019 6
Example: All-Integer LP
• Rounded Up xSolution
2
5 -x1 + x2 < 1
4
3x1 + x2 < 9
Max 3x1 + 2x2
3
ILP Infeasible (3, 2)
2 LP Optimal (2.5, 1.5)
x1 + 3x2 < 7
1
x1
1 2 3 4 5 6 7
11/19/2019 7
Example: All-Integer LP
• Rounding Down
By rounding the optimal solution down to x1
= 2, x2 = 1, we see that this solution indeed is an
integer solution within the feasible region, and
substituting in the objective function, it gives z =
8.
We have found a feasible all-integer solution,
but have we found the OPTIMAL all-integer
solution?
The answer is NO! The optimal solution is x1
= 3 and x2 = 0 giving z = 9, as evidenced in the next
two slides.
11/19/2019 8
Example: All-Integer LP
• Complete Enumeration of Feasible ILP Solutions
There are eight feasible integer solutions to this
problem:
x1 x2 z
1. 0 0 0
2. 1 0 3
3. 2 0 6
4. 3 0 9 optimal solution
5. 0 1 2
6. 1 1 5
7. 2 1 8
8. 1 2 7
11/19/2019 9
Example: All-Integer LP
x2
5 -x1 + x2 < 1
3x1 + x2 < 9
4
Max 3x1 + 2x2
3
ILP Optimal (3, 0)
2
x1 + 3x2 < 7
1
x1
1 2 3 4 5 6 7
11/19/2019 10
Integer Programming Applications
imposition of logical conditions in LP problems (such as the
either/or condition dealt in previous example)
depot location
timetabling
11/19/2019 11
Classic Knapsack Problem
You want to maximize the value of items you can pack into a single
suitcase (or knapsack). However, you are limited to a weight of 50
lbs.
= 1 if put in knapsack A 15 18
B 20 10
C 18 21
D 13 11
E 12 11
11/19/2019 12
Classic Knapsack Problem
Solving the problem:
11/19/2019 13
Capital Budgeting Problem
There are four possible projects, which each run for 3 years and have
the following characteristics.
Capital requirements
11/19/2019 14
Capital Budgeting Problem
• Additional constraint: Either project 1 or project 2 needs to be
chosen.
11/19/2019 15
Blending Problem
Consider the example of a manufacturer of animal feed who is
producing feed mix for dairy cattle. The feed mix contains two active
ingredients and a filler to provide bulk. One kg of feed mix must
contain a minimum quantity of each of four nutrients as below:
Nutrient A B C D
gram 90 50 20 2
A B C D Cost/kg
we need not satisfy all four nutrient constraints but need only
satisfy three of them
11/19/2019 17
The BC Company has a contract to produce 10,000 garden hoses for a
large discount chain. BC has four different machines that can produce this
kind of hose. Because these machines are from different manufacturers
and use differing technologies, their specifications are not the same.
11/19/2019 18
Suppose x is a non-negative integer.
Write the following using linear inequalities by clearly
explaining the variables used:
“Either x ≤ 50 or x ≥ 300”.
11/19/2019 19
11/19/2019 20
Production Planning Problem
In the planning of the monthly production for the next six months
a company must, in each month, operate either a normal shift or
an extended shift (if it produces at all). A normal shift costs
£100,000 per month and can produce up to 5,000 units per
month. An extended shift costs £180,000 per month and can
produce up to 7,500 units per month. Note here that, for either
type of shift, the cost incurred is fixed by a union guarantee
agreement and so is independent of the amount produced.
Month 1 2 3 4 5 6
The company wants a production plan for the next six months that
avoids stockouts, formulate their problem as an integer program.22
11/19/2019
Production Planning – Another Example
A toy manufacturer is planning to produce new toys. The setup
cost of the production facilities and the unit profit for each toy are
given below. :
1 45000 12
2 76000 16
The company has two factories that are capable of producing these
toys. In order to avoid doubling the setup cost only one factory could
be used.
11/19/2019 23
Production Planning – Another Example
(cont…)
The production rates of each toy are given below (in units/hour):
Toy 1 Toy 2
Factory 1 52 38
Factory 2 42 23
11/19/2019 25
Capital Investment Problem (cont…)
11/19/2019 26
Food Mix Problem
The prices for buying each oil are given below (in £/tonne)
11/19/2019 27
Food Mix Problem (cont…)
The final product sells at £180 per tonne. Vegetable oils and non-
vegetable oils require different production lines for refining. It is not
possible to refine more than 210 tonnes of vegetable oils and more than
260 tonnes of non-vegetable oils. There is no loss of weight in the refining
process and the cost of refining may be ignored.
It is required to determine what to buy and how to blend the raw oils so
that the company maximises its profit.
11/19/2019 28
Food Mix Problem (cont…)
Additional Constraints:
if either of VEG1 or VEG2 are used then OIL2 must also be used
11/19/2019 29