IP Formulation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Integer Programming Formulations

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.

In some situations, the integrality of the decision variables is very consequential


(for instance, when deciding how many aircrafts to build!). It is also important to note that,
in general, rounding off the fractional LP solution does not give you the optimal integer
solution. Our emphasis in integer programming, however, will almost exclusively be on
the use of binary (0–1) variables. The introduction of binary integer variables in LP
models lends them the ability to represent discrete choices in decision making that cannot
be captured through continuous (fractional) variables. The logical versatility of binary
variables gives integer programs enormous modeling power. Clever use of these
variables can capture an amazingly wide variety of restrictions that affect managerial
decisions. This modeling power, however, also lies at the heart of the computational
complexity that besets large integer programs. The article (BP–9) in the bulkpack
provides a brief outline of the theory of computational complexity and its ramifications for
managerial decision making.

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 grain distributor has various amounts of four different commodities, each of


which must be stored in one or more of seven different silos. Associated with each silo
and commodity combination is a loading cost. Additionally, if a silo is used to store a
commodity, there is a fixed cost incurred independent of the commodity stored or its
amount. Each silo has a finite capacity, so some commodities may have to be split over
several silos. The following table contains the data for the problem:

Decision Models and Uncertainty Page 1 BITSoM, Nov 2022


Integer Programming Formulations

Loading cost per ton


Silo Amount
Commodity 1 2 3 4 5 6 7 to be stored
A $1 $2 $2 $3 $4 $5 $5 75 tons
B 2 3 3 3 1 5 5 50 tons
C 4 4 3 2 1 5 5 25 tons
D 1 1 2 2 3 5 5 80 tons
Capacity (tons) 25 25 40 60 80 100 100
Fixed cost of $200 $200 $350 $400 $500 $700 $700
using silo

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.

Let yj = 1 if silo j is used to store a commodity, 0 otherwise.

Objective function:

Minimize the sum of variable loading costs and fixed silo costs:

Min 1 xA1 + 2 xA2 + . . . + 5 xA7 +


2 xB1 + 3 xB2 + . . . + 5 xB7 +



1 xD1 + 1 xD2 + . . . + 5 xD7 +
200 y1 + 200 y2 + 350 y3 + . . . + 700 y7

Constraints:

Each commodity must be entirely stored in silos:

(Commodity A) xA1 + xA2 + . . . + xA7  75


(Commodity B) xB1 + xB2 + . . . + xB7  50



(Commodity D) xD1 + xD2 + . . . + xD7  80

If a silo is used, its capacity may not be exceeded (and if it not used, then nothing may
be stored therein):

Decision Models and Uncertainty Page 2 BITSoM, Nov 2022


Integer Programming Formulations

(Silo 1) xA1 + xB1 + xC1 + xD1  25 y1


(Silo 2) xA2 + xB2 + xC2 + xD2  25 y2



(Silo 7) xA7 + xB7 + xC7 + xD7  100 y7

Non-negativity and integrality:

xij  0, yj  {0, 1} for all i, j.

Additional Constraint:
Each silo may contain at most one commodity.

To handle this constraint, we have to define additional binary decision variables to


indicate whether a commodity is being stored in a silo.

Let zij = 1 if commodity i is stored in silo j, 0 otherwise.

Then the following constraints ensure that each silo contains at most one commodity.

(Silo 1) zA1 + zB1 + zC1 + zD1  1


(Silo 2) zA2 + zB2 + zC2 + zD2  1



(Silo 7) zA7 + zB7 + zC7 + zD7  1

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:

xA1  25 zA1 xB1  25 zB1 xC1  25 zC1 xD1  25 zD1


xA2  25 zA2 xB2  25 zB2 xC2  25 zC2 xD2  25 zD2



xA7  100 zA7 xB7  100 zB7 xC7  100 zC7 xD7  100 zD7

The last step is to replace each yj variable in the objective function with the corresponding
sum zAj + zBj + zCj + zDj.

Decision Models and Uncertainty Page 3 BITSoM, Nov 2022


Integer Programming Formulations

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:

a) Not all projects have to be selected.


b) Each student should be assigned to one, and only one, project.
c) No more than 4 students may be assigned to a project.
d) Student preferences for projects are listed below; 3-highest, 1-lowest.

Preferences Student (j)


Project (i) Adrian Beverly Charles DongJun Eva Farhad Gita Harry Inoue Jose
1 2 3 1 2 2 1
2 2 1 1 3 2 2 1 2
3 2 3 1 3
4 3 3 3 1 1 3 3
5 1 2 1 3 2

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:

Each student must be assigned to one, and only one project:

(Student A) x1A + x2A + x3A + x4A + x5A = 1


(Student B) x1B + x2B + x3B + x4B + x5B = 1



(Student J) x1J + x2J + x3J + x4J + x5J = 1

No more than 4 students may be assigned to a project:

Decision Models and Uncertainty Page 4 BITSoM, Nov 2022


Integer Programming Formulations

(Project 1) x1A + x1B + . . . + x1J  4


(Project 2) x2A + x2B + . . . + x2J  4



(Project 5) x5A + x5B + . . . + x5J  4

Integrality:

xij  {0, 1} for all i, j.

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:

Suppose the problem has the following additional constraint:

e) Each project, if it is chosen, must be assigned to teams of at least 3 and no more than
4 students.

To incorporate this constraint, we need to include additional decision variables:

Let yi = 1 if project i is assigned to a student team, 0 otherwise.

Now the constraints for each project (the second set of constraints above) need to be
modified as follows:

(Project 1) 3 y1  x1A + x1B + . . . + x1J  4 y1


(Project 2) 3 y2  x2A + x2B + . . . + x2J  4 y2



(Project 5) 3 y5  x5A + x5B + . . . + x5J  4 y5

yi  {0, 1} for all i.

Note: Each project has two constraints, one with the first  sign and the other with the
second.

In compact mathematical representation, this formulation can be written as follows:

Decision Models and Uncertainty Page 5 BITSoM, Nov 2022


Integer Programming Formulations

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

The Assignment Problem in Practice

The assignment problem is a common application of integer programming. The


model can be used to assign consultants to a set of projects, students or professors to
courses, flights to time slots, aircraft or flight crews to flights, nurses to shifts, buses and
bus drivers to routes, salespeople to sales regions, and so on.

The common problem in assignment models is that there exists a set of


employees, each needing to be assigned to a shift (project, region, etc.), and that each
shift (project, region) must have at least one employee assigned to it. These problems
are also referred to as set covering problems because of the task of having to “cover the
entire set” with at least one employee.

3. The Traveling Salesperson Problem (TSP)

As a “classical” optimization problem, the TSP has attracted a great deal of


mathematical research. It is often cited as a “canonical” example of the “hard”
combinatorial problems that exhibit exponential growth in computational complexity as
the problem size grows. The TSP is also at the core of a number of applications in
distribution logistics and production scheduling. We present here, for the mathematically
intrepid, the “pure” TSP problem and its formulation.

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:

Decision Models and Uncertainty Page 6 BITSoM, Nov 2022


Integer Programming Formulations

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:

Minimize the total distance traveled


  c ij x ij
i j

Constraints:

Every city j must be entered exactly once:


n

x
i j
ij 1 j  1,, n

Every city i must be exited exactly once:


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.

Decision Models and Uncertainty Page 7 BITSoM, Nov 2022

You might also like