Introduction to Integer Programming 518: Introduction to Integer

Introduction to Integer Programming
Marina A. Epelman
Winter 2012
IOE 518: Introduction to IP, Winter 2012
Page 1
c Marina A. Epelman
518: Introduction to Integer Programming
I
Lectures: Mondays and Wednesdays, 10:30 – 12:00, first
half-term
I
Instructor: Marina A. Epelman
”[email protected]”, office: 2845 IOE; Office hours: as
announced on the website, and by appointment
I
Textbook: “Integer Programming” by Laurence A. Wolsey.
I
See syllabus for other references
I
Other course materials, including assignments, lecture topics
and these slides are available on CTools
I
Required background: IOE 510, familiarity with AMPL
and/or CPLEX
IOE 518: Introduction to IP, Winter 2012
Introduction
Page 2
c Marina A. Epelman
Course Logistics
I
Approximately weekly homeworks (worth a total of 30%);
include some computer modeling and programming
I
A midterm exam (worth 30%) in late January or early
February
I
Final exam (worth a total of 40%), tentatively on February
22nd
Individual work policy: you are allowed, indeed, encouraged to
work in groups on the homework conceptualizing the problems.
However, all submitted homework assignments (including computer
codes and outputs, if relevant) should represent your own e↵orts.
Also you may not acquire, read, or otherwise utilize answers from
solutions handed out in previous terms in this, or other, courses.
Please read syllabus for complete course policies.
IOE 518: Introduction to IP, Winter 2012
Introduction
Page 3
c Marina A. Epelman
Informal (and tentative) course outline
I
Examples of IP formulations
I
Quality of IP formulations
I
Relaxations and bounds: assessing quality of solutions
Basic techniques for solving IPs:
I
I
I
I
Branch and Bound algorithms
Cutting plane methods
Dynamic programming (?)
I
Lagrangian duality
I
Approximation methods
I
Heuristic Algorithms (?)
IOE 518: Introduction to IP, Winter 2012
Introduction
Page 4
c Marina A. Epelman
From Linear Programs to Integer Programs
Formalisms
A Linear programming/optimization Problem (LP):
I
A mathematical optimization problem:
I
Optimize a linear objective function...
I
subject to linear constraints on decision variables...
I
and decision variables are continuous, i.e., allowed to take on
integer or fractional values
A linear Integer programming/optimization Problem (IP):
I
A mathematical optimization problem:
I
Optimize a linear objective function...
I
subject to linear constraints on decision variables...
I
and decision variables are integer, i.e., only allowed to take
on integer values
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 5
c Marina A. Epelman
From LPs to IPs
Example: snack attack
I
Almonds (3 oz), Cashews (2 oz), Walnuts (2 oz) available
I
You love almonds, like cashews, walnuts are OK
I
You have room for 4 oz of nuts
I
Goal: fill up to maximize utility
Take all (3 oz) of almonds and
1/2 (1 oz) of cashews
IOE 518: Introduction to IP, Winter 2012
Take all (3 oz) of almonds — no
room for others,
or take cashews and walnuts?
Integer Programs defined
Page 6
c Marina A. Epelman
Some of the application areas for Integer Programming1
I
Aviation
I
I
I
I
Media
I
I
Sales of TV ad slots during the upfronts (NBC)
Sports
I
I
Crew scheduling and rostering (New Zealand Air)
Crew recovery in the face if schedule disruptions (Continental)
Flexjet aircraft and crew scheduling
Creation of sport leagues schedules
Supply chain management
I
Complex bid-based sourcing strategy (Procter and Gamble)
1
For details, and additional examples, see Success Stories at
http://www.scienceofbetter.org/ and articles in INFORMS journal Interfaces
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 7
c Marina A. Epelman
Integer Programming: what do we study?
I
Many real life problems involve integer variables or discrete
decisions
I
I
Methods for solving LPs do not (usually) work to solve IPs
I
I
Need to develop solution methods (algorithms) for IPs
Solving IPs requires large amounts of computer memory and
time
I
I
I
I
Need to extend our modeling vocabulary beyond LPs
Need to understand what makes IPs hard to solve
Identify IPs that have some special features
Develop specialized solution methods that exploit these
features to save memory and/or time
Challenges for IP researchers and practitioners:
I
I
I
Solve problems we can’t solve today
Solve what we already can faster
Solve what we already can with better accuracy
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 8
c Marina A. Epelman
What is an integer program?
Matix-vector notation: Vector of variables x 2 Rn , A 2 Rm⇥n with
[A]ij = aij , b 2 Rm , with [b]i = bi , c 2 Rn , with [c]j = cj
Pn
max
c j xj
max c T x
x1 ,...,xn Pj=1
x
n
(LP)
s.t.
or s.t. Ax  b
j=1 aij xj  bi i = 1, . . . , m
x1 , . . . , xn 0
x 0
If all variables are integer: we have a (Linear) Integer Program:
(IP) maxn {c T x : Ax  b, x
0 and integer}.
x2R
If each variable is only allowed to take on values 0 or 1, i.e., all
variables are binary, we have a 0-1, or Binary, Integer Program:
(BIP) maxn {c T x : Ax  b, x 2 {0, 1}n }
x2R
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 9
c Marina A. Epelman
What is an integer program?
(Linear) Mixed Integer Program (most general form):
a linear programming problem with the added restriction that some
of the variables must take integer values.
max
x1 ,...,xn , y1 ,...,yp
(MIP)
s.t.
Pn
j=1 cj xj +
Pn
j=1 aij xj
x1 , . . . , xn
y1 , . . . , yp
+
Pp
j=1 hj yj
Pp
j=1 gij yj
 bi
i = 1, . . . , m
0
0 and integer
Or, in matrix-vector form:
max
c T x+ hT y
s.t.
Ax+ Gy  b
x 0; y 0 and integer
x,y
(MIP)
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 10
c Marina A. Epelman
In AMPL: mip.mod file
#
#
#
#
Generic formulation of a MIP
Assumes presence of at least one continuous
and at least one integer variable,
and at least one inequality constraint
param n>0; # number of continuous variables
param p>0; # number of integer variables
param m>0; # number of inequality constraints
param
param
param
param
param
a{1..m,1..n};
b{1..m};
c{1..n};
g{1..m,1..p};
h{1..p};
var x {1..n} >=0;
var y {1..p} integer >=0;
maximize Objective_Function: sum{j in 1..n}c[j]*x[j]+sum{j in 1..p}h[j]*y[j];
subject to
Inequality_Constraint {i in 1..m}: sum{j in 1..n}a[i,j]*x[j]+sum{j in 1..p}g[i,j]*y[j]<=b[i];
I
I
Should be accompanied by an appropriately formatted data
file defining the values of all parameters
Binary variables: var x {1..n} binary;
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 11
c Marina A. Epelman
Other allowed formats:
I
The above is a maximization problem; the objective could also
be to
min c T x + hT y
I
The above problem contains only “less-than-or-equal-to”
constraints; could also have
I
n
X
aij xj +
j=1
I
n
X
gij yj
bi for some i’s, and/or
j=1
aij xj +
j=1
I
p
X
p
X
gij yj = bi for some i’s
j=1
In the above problem all variables are constrained to be
nonnegative; could also have variables unrestricted in sign
IOE 518: Introduction to IP, Winter 2012
Integer Programs defined
Page 12
c Marina A. Epelman
Formulating a problem as an optimization problem
Recall: an optimization problem is a mathematical model of a real
problem.
To model a problem as an optimization problem, the following
steps are typically followed:
1. Define what appear to be the necessary variables; usually
quantitative expressions of decisions that need to be made
2. Use these variables to define a set of constraints; values of
variables feasible for the constraints must correspond to
feasible solutions to the problem, and vice versa
3. Use these variables to define the objective function to be
minimized or maximized
Remember that your original definition of variables may need to be
revised, and that there is often more than one way to model a
problem.
You saw many problems that can be modeled as LPs in IOE 510;
below are some examples of integer programs.
IOE 518: Introduction to IP, Winter 2012
BIP Examples: 0
IP formulations
Page 13
c Marina A. Epelman
1 Knapsack Problem
There is a budget b available for investment in projects during the
coming year and n projects are under consideration, where aj is the
required investment in project j, and cj is the expected return. The
goal is to choose a set of projects so that the budget is not
exceeded and the expected return is maximized.
Variables: xj = 1 if project j is selected, 0 otherwise.
Formulation:
Pn
max
c j xj
(Expected return)
Pj=1
n
s.t.
(Budget cannot be exceeded)
j=1 aj xj  b
xj 2 {0, 1}, j = 1, . . . , n (All variables are binary)
IOE 518: Introduction to IP, Winter 2012
IP formulations
Page 14
c Marina A. Epelman
BIP Examples: Assignment Problem
There are n people available to carry out n jobs, all of which must
be completed. Each person is assigned to carry out exactly one
job. The estimated cost of assigning person i to job j is cij ,
i, j = 1, . . . , n. The problem is to find a minimum cost assignment.
Variables: xij = 1 if person i does job j, and xij = 0 otherwise
Formulation:
Pn Pn
min
(Cost of the assignment)
j=1 cij xij
Pi=1
n
s.t.
xij = 1, i = 1, . . . , n (Each person i does one job)
Pj=1
n
i=1 xij = 1, j = 1, . . . , n (Each job j assigned to one person)
xij 2 {0, 1}, i, j = 1, . . . , n (All variables are binary)
IOE 518: Introduction to IP, Winter 2012
IP formulations
Page 15
c Marina A. Epelman