IP Formulation
IP Formulation
IP Formulation
The assumption of linearity in LP models implies that the decision variables may
take any continuous (fractional) values. In the models we have discussed so far, we have
not worried about fractional LP solutions to quantities (such as the number of postal
workers) that must, for obvious practical reasons, remain whole numbers. We claimed
that (in most cases) it is pointless to worry about fractional LP solutions since our models
are approximations of real problems anyway, and the error caused by rounding off the
fractional LP solution (in the direction that keeps the solution feasible) is not
consequential. In this note we look at LP models in which (some or all of) the decision
variables are restricted to take only integer values.
The purpose of this note is to give you more examples of the use of binary variables
in formulating discrete-choice (go/no-go) decision problems. It is meant to supplement
your class notes and the textbook.
1. A Storage Problem
A moment’s reflection reveals that this problem is virtually identical to the GlobChem
transportation/plant location problem. The formulation follows.
Decision variables:
Let xij = amount (in tons) of commodity i stored in silo j; where the index i = A, ..., D
represents the four commodities and the index j = 1, 2, ..., 7 represents the 7 silos.
Objective function:
Minimize the sum of variable loading costs and fixed silo costs:
Constraints:
If a silo is used, its capacity may not be exceeded (and if it not used, then nothing may
be stored therein):
Additional Constraint:
Each silo may contain at most one commodity.
Then the following constraints ensure that each silo contains at most one commodity.
The next task is to link the zij variables logically with the xij variables. This can be done
in different ways. One way is to do away with the yj variables and replace the second set
of constraints in the original formulation with the following set of 28 constraints:
The last step is to replace each yj variable in the objective function with the corresponding
sum zAj + zBj + zCj + zDj.
2. Assignment Problem
Ten students each need to be assigned a project, from a set of five available
projects. The following rules govern the assignment of students to projects:
The problem is to determine which project should be assigned to each student in order to
maximize the total preference score of the assignment.
Decision variables:
Let xij = 1 if project i is assigned to student j, 0 otherwise; where the index i = 1, 2, ..., 5
represents the five projects and the index j = A, B, ..., J represents the 10 students.
Objective function:
The total preference score of the assignment is now obtained by multiplying the decision
variables with the corresponding score and adding the products:
Max 2 x1B + 3 x1E + 1 x1F + 2 x1G + 2 x1H + 1 x1J + 2 x2A + . . . + 3 x5G + 2 x5I
Constraints:
Integrality:
Note: In the formulation above, we have allowed all possible combinations of students
and projects, including projects not ranked 3, 2, or 1 by the students. Implicitly, we
have assigned a preference score of zero to these combinations. If we wanted to
disallow these combinations, we could simply leave out the corresponding decision
variables from the model.
Additional Constraint:
e) Each project, if it is chosen, must be assigned to teams of at least 3 and no more than
4 students.
Now the constraints for each project (the second set of constraints above) need to be
modified as follows:
Note: Each project has two constraints, one with the first sign and the other with the
second.
Let sij be the preference score for project i of student j and i (ui) be the lower (upper) limit
on the number of students for each project selected, i = 1, …,N, j =1, …,M.
N M
max s
i 1 j 1
ij x ij
subject to: N
(each student is assigned) x
i 1
ij 1 j 1,, M
M
(project team limits) i y i x ij u i y i i 1,, N
j 1
(assignment integrality) x ij {0,1} for all i , j
(project integrality) y i {0,1} forall i
Problem:
Let 1, 2, ..., n be cities with distances cij between every pair (i, j) of cities. Find the
minimum distance tour through the n cities that visits every city exactly once.
Decision Variables:
We use the same idea that we used in the assignment problem. Let xij = 1 if the
tour goes from city i to city j, 0 otherwise. We will make sure through the constraints that
there are exactly n - 1 of these variables that take value 1, and that they represent a tour
that visits every city exactly once.
Objective Function:
Constraints:
x
i j
ij 1 j 1,, n
x
j i
ij 1 i 1,, n
No subtours are allowed for any subset of cities S not including city 1:
x
i , j S
ij S 1 S {1
, , n}
where |S| is the number of cities in the set S. We need these constraints for each subset
of the set of cities. Without these constraints, the formulation allows for disjoint subtours.
For additional references see “The Traveling Salesman Problem: A Guided Tour of
Combinatorial Optimization”, Lawler, Lenstra, Rinnooy Kan, and Shmoys (eds.), John Wiley &
Sons, 1985.