Integer Programming lecture v.3
Integer Programming lecture v.3
variables
In LINGO
@BIN() ; variable inside () is binary
@GIN() ; variable inside () is integer
Some BIP Applications
Capital budgeting with fixed investment
proposal
Site selection
Designing a production & Distribution
Network
Dispatching shipments
Scheduling interrelated activities
Scheduling asset divestitures
Airline Applications
Innovative Uses of Binary
Var.
Binary variables are typically used to
model decisions of the type yes-no
They could also be used to model
combinatorial relationships by
expressing such relationships in terms
of questions that must be answered by
yes or no.
This is done by introducing auxiliary
variables to model these choices.
Innovative Uses of Binary
Var.
Modeling Either-Or constraints
3 X 1 2 X 2 18
either
X 1 4 X 2 16 M
3 X 1 2 X 2 18 M
or
X 1 4 X 2 16
Where M is very large
3 X 1 2 X 2 18 My
X 1 4 X 2 16 M (1 y )
Where y is an auxiliary variable
y
i 1
i N K
f X 1 , X 2 , , X n d1 or d 2 or ... d N
where
f X 1 , X 2 , , X n could be equal to a Xj j or X j
j j
Functions with N possible
values
This general case can be modeled
as
N
f X 1 , X 2 , , X n d i yi
i 1
N
0
y i 1 and yi ; i 1, , N
i 1
Cont’d
Example: In the Wyndor Glass Co. problem
considered in LP lectures, the production
capacity at Plant 3 which is 18 could be used
for the production of Product 1 or Product 2 or
left for future products that will be ready for
production soon.
3 X 1 2 X 2 6 or 12 or 18
It can be modeled as follows
3 X 1 2 X 2 6 y1 12 y2 18 y3
y1 y2 y3 1
0
yi ; i 1, 2, 3
1
The Fixed-Charge problem
It is common to incur a fixed charge or setup
cost when undertaking an activity
Total cost of the activity is expressed as
k j c j x j ; if x j 0
f j x j
0 ; if x j 0
where
x j level of activity j
k j setup cost of activity j
c j cost of each incremental unit of activity j
Cont’d
To model a problem of the form
Min Z f1 x1 f 2 x2 f n xn
Subject to Constra int s
We use the following transformation
n
Min Z k j y j c j x j
j 1
Subject to
Constra int s
1
if x j 0
y j
0
if x j 0
Cont’d
Furthermore we can rewrite the last
constraint as
n
Min Z k j y j c j x j
j 1
Subject to
Constra int s
x j My j
1
y j ; j 1, , n
0
Cont’d
The last constraint will ensure that
x j 0 y j 1
If
x j 0 y j 0
The last condition is met because the
objective function is a minimization
and the optimal solution will be for yj =
0
Binary Representation of
General Integer Variables
When the IP contains very few integer
variables it is more convenient to transform
integer variables into binary and solve it using
a BIP algorithm
If 0 x u and x is integer
N
Then x can be irepresented as binary
x 2 y i
i 0
x
j 1
j 3
x j is binary, for j 1,2, ,12
Set Covering Problems
The previous example illustrates a broader class
of problems called set covering problems
Subproblem 1
Stepsfor eachiteration:
1.Branching: Amongtheremaining(unfathome d) subproblem
s,
selectthe one thatwas createdmostrecently.(Breaktiesaccording
to whichhas thelargerbound.)Branchfromthenodefor thissubproblem
to createtwo new subproblem s by fixingthenext varia
ble
(thebranchingvariable)at either0 or 1.
Cont’d
2. Bounding: For eachnew subproblem , obtainits boundapplyingthe
simplexmethodto its LP relaxationandroundingdownthe valueof Z
for theresultingoptimalsolution.
3. Fathoming: For eachnew subproblem , applythe threefathoming
testssummarized above,anddiscardthosesubproblem s thatare
fathomedby anyof the tests.
Subject to
n
a x
j1
ij j bi , for i 1,2, , m
x j 0 for j 1,2, , n
x j is integer, for j 1,2, , I ; I n
Standard Branch-and-Bound
Algorithm for solving MIP
The algorithm presented is a basic
algorithm one for solving MIP
With a variety of refinements this
algorithm provides a standard
approach for MIP
Structure of this algorithm was first
developed by Dakin based on a
pioneering algorithm by Land and
Doig.
Changes from BIP
Algorithm
BRANCHING
The variables considered for
branching are the integer-restricted
variables that have a non-integer
value in the optimal solution of the LP
relaxation of the current subproblem
The values assigned to the branching
variable for creating the 2 new
subproblems as follows
Cont’d
Let x j be the current branching
*
x
variable jand let be its noninteger
value in the optimal solution for the
LP relaxation of the current
subproblem
x greatest integer x
*
j
*
j
x j x*j and x j x*j 1
2. Bounding:
For each new subproblem, get its bound by
applying the simplex method or dual simplex when
reoptimizing to its LP relaxation and use the value
of Z as the bound.
Cont’d
Steps for each iteration:
3. Fathoming:
For each new subproblem apply the three tests
below and discard subproblems that are fathomed
by any of the tests.
Test 1: Its bound ≤ Z*, where Z* is the value of
current incumbent.
Test 2: Its LP relaxation has no feasible solution
Test 3: The optimal solution for its LP relaxation has
integer values for the integer-restricted variables. If
solution is better than the incumbent, it becomes
the new incumbent and test 1 is reapplied to all
unfathomed subproblems with the new larger Z*.
Optimality test:
Stop when no remaining subproblems; the current
incumbent is optimal. Otherwise, perform another
iteration. If no incumbent then problem has no
feasible solution
An Example MIP
Consider the following MIP problem
Maximize Z 4 x1 2 x2 7 x3 x4
Subject to
x1 5 x3 10
x1 x2 x3 1
6 x1 5 x2 0
x1 2 x3 2 x4 3
x j 0 for j 1,2,3,4
x j is an integer, for j 1,2,3
Cont’d
Initialization:
The LP relaxation of the whole problem
yields the optimal solution
( x1 , x2 , x3 , x4 ) ( 5 4 , 3 2 , 7 4 , 0) with Z 14 14
Problem not fathomed cause feasible
non-integer solution was found.
Iteration 1:
Select X1 as branching variable. X1=5/4
Subproblem 1: original Pb + X1 ≤ 1
Subproblem 2: original Pb + X1 ≥ 2
Cont’d
Solving the LP relaxations of these 2
subproblems yield no feasible solutions for
subproblem2 and the following for suproblem1
Bound for subproblem 1 is Z ≤ 14 1/5
Cont’d
Iteration 2:
Select X2 as branching variable with X2=6/5
Subproblem 3: original Pb +X1 ≤ 1+X2 ≤ 1
Subproblem 4: original Pb +X1 ≤ 1+X2 ≥ 2
Solve the LP relaxations of the 2 subproblems yield
Cont’d
Iteration 3:
Subproblem 3 is selected for next branching because better
bound
Select X1 as branching variable with X1 =5/6
Subproblem 5: original Pb +X1 ≤ 1+X2 ≤ 1 + X1 ≤ 0
Subproblem 6: original Pb +X1 ≤ 1+X2 ≤ 1 + X1 ≥ 1
Solve the LP relaxations of the 2 subproblems yielded no feasible
solution for 6
Lagrangian Relaxation
Bounding is usually done by solving a
relaxation of the original problem. Consider
the problem Max Z CX
ST AX b
Since AX * b 0
1. S=1+3=4
2. a2 satisfies S b a2 since 4 3 3
3. a2 4 3 1 and b 4 3 1, so reset a2 1 and b 1.
The new tighter constraint is x1 x2 1 (a1 1, a2 1, b 1)
x2 1
x1 is
Stop after this step. Tightened constraint
Generating Cutting Planes for
Pure BIP
A cutting plane (or cut) for any IP
problem is a new functional constraint
that reduces the feasible region for the
LP relaxation without eliminating feasible
solutions for the IP problem.
One way of generating cutting planes is
by applying the procedure described
earlier for tightening bounds
There are a number of other techniques
that were developed for generating
cutting planes to accelerate a branch-
and-bound algorithm
A Procedure for
Generating Cutting Planes
1. Consider any functional constraint in ≤ form
with only non-negative coefficients
2. Find a group of variables (called a minimum
cover of the constraint) such that
a. The constraint is violated if every variable in the
group equals 1 and all other variables equal 0
b. But the constraint becomes satisfied if the value of
any one of these variables is changed from 1 to 0.
3. By letting N denote the number of variables
in the group, the resulting cutting plane has
the form
Sum of variables in group ≤ N-1
Example
Applying this procedure to the constraint
6 x1 3 x2 5 x3 2 x4 10
We note that the group of variables
x1 , x2 , x4 is a minimal cover because
(1,1,0,1) violates the constraint
But the constraint becomes satisfied if the value of any
one of these variables is changed from 1 to 0.
Since N=3 in this case, the resulting cutting plane is
x1 x2 x4 2
x1 , x3
This same constraint has a second minimal cover
since (1,0,1,0) violates the constraint but both
(1,0,0,0) satisfy the constraint, hence
x1 x3 1
is another valid cutting plane