You are on page 1of 79

Formulations Relaxations and Bounds Branch and Bound

VU Algorithmics
Part VI: Integer Programming
Mario Ruthmair, Markus Leitner, G unther Raidl
Algorithms and Data Structures Group
Institute of Computer Graphics and Algorithms
Vienna University of Technology
WS 2011/12
VU Algorithmics M. Ruthmair 1
Formulations Relaxations and Bounds Branch and Bound
Formulations
VU Algorithmics M. Ruthmair 2
Formulations Relaxations and Bounds Branch and Bound
Motivation
use integer programming to model and solve real-world optimization
problems
can be used for a wide variety of problems
in this lecture we concentrate on applying the tool of integer
programming
if interested in more detailed proofs of underlying theorems consult
additional literature
VU Algorithmics M. Ruthmair 3
Formulations Relaxations and Bounds Branch and Bound
Literature
The rest of the course mainly follows:
Laurence A. Wolsey, Integer Programming, 1998, Wiley
Further literature:
Alexander Schrijver, Theory of Linear and Integer Programming,
1998, Wiley
George L. Nemhauser, Laurence A. Wolsey, Integer and
Combinatorial Optimization, 1999, Wiley
VU Algorithmics M. Ruthmair 4
Formulations Relaxations and Bounds Branch and Bound
Real-World Problems
Scheduling (Trains, Airline Crews, Timetables, ...)
Planning (Production, Electricity Generation, ...)
Telecommunications (Network Design, Routing, ...)
Transportation (Dial-a-Ride, Vehicle Routing, ...)
Cutting and Packing
...
VU Algorithmics M. Ruthmair 5
Formulations Relaxations and Bounds Branch and Bound
Linear Program (LP)
max cx
Ax b
x 0
c ... n-dimensional row vector
x ... n-dimensional column vector
A ... m n matrix
b ... m-dimensional column vector
VU Algorithmics M. Ruthmair 6
Formulations Relaxations and Bounds Branch and Bound
(Linear) Mixed Integer Program (MIP)
max c
1
x
1
+c
2
x
2
A
1
x
1
+A
2
x
2
b
x
1
0
x
2
0 and integer
c
1
... p-dimensional row vector
x
1
... p-dimensional column vector
c
2
... (n p)-dimensional row vector
x
2
... (n p)-dimensional column vector
A
1
... m p matrix
A
2
... m (n p) matrix
b ... m-dimensional column vector
VU Algorithmics M. Ruthmair 7
Formulations Relaxations and Bounds Branch and Bound
Integer Program (IP)
max cx
Ax b
x 0 and integer
c ... n-dimensional row vector
x ... n-dimensional column vector
A ... m n matrix
b ... m-dimensional column vector
VU Algorithmics M. Ruthmair 8
Formulations Relaxations and Bounds Branch and Bound
Binary Integer Program (BIP)
max cx
Ax b
x 0, 1
n
c ... n-dimensional row vector
x ... n-dimensional column vector
A ... m n matrix
b ... m-dimensional column vector
VU Algorithmics M. Ruthmair 9
Formulations Relaxations and Bounds Branch and Bound
Combinatorial Optimization Problem (COP)
Given:
a nite set N = 1, ..., n
weights c
j
, j N
a set T of feasible subsets of N
The problem of nding a minimum weight feasible subset is a
combinatorial optimization problem
min
SN

j S
c
j
: S T
Many COPs can be formulated as (B)IPs.
VU Algorithmics M. Ruthmair 10
Formulations Relaxations and Bounds Branch and Bound
How to solve IPs?
x
1
x
2
objective function
rounded LP solution
optimal IP solution
optimal LP solution
Figure: Rounding optimal LP solution? Does not work!
VU Algorithmics M. Ruthmair 11
Formulations Relaxations and Bounds Branch and Bound
Formulating (B)IPs
1
Dene necessary (and maybe additional) variables
2
Dene a set of constraints using the variables:
feasible points feasible solutions of the problem
3
Dene objective function using the variables
E.g. variables for a COP can be dened as the n-dimensional incidence
vector x
S
0, 1
n
of subset S N:
x
S
j
= 1 if j S
x
S
j
= 0 if j / S
VU Algorithmics M. Ruthmair 12
Formulations Relaxations and Bounds Branch and Bound
The Assignment Problem
Denition
Given:
n jobs, n persons
costs c
ij
for assigning person i to job j
(suitability of persons to jobs)
The problem is to nd an assignment with minimum costs.
VU Algorithmics M. Ruthmair 13
Formulations Relaxations and Bounds Branch and Bound
The Assignment Problem - BIP
1
Variables: x
ij
0, 1, i , j 1, ..., n
x
ij
= 1 if person i is assigned to job j , x
ij
= 0 otherwise
2
Constraints:
Each person i is assigned exactly one job:
n

j =1
x
ij
= 1 i 1, ..., n
Each job j is done by exactly one person:
n

i =1
x
ij
= 1 j 1, ..., n
3
Objective function: minimize the total assignment costs
min
n

i =1
n

j =1
c
ij
x
ij
VU Algorithmics M. Ruthmair 14
Formulations Relaxations and Bounds Branch and Bound
The 0-1 Knapsack Problem
Denition
Given:
n possible projects
costs a
j
for project j
estimated prot c
j
for selecting project j
available budget b
The problem is to nd a set of projects to maximize the total prot while
not exceeding the budget.
VU Algorithmics M. Ruthmair 15
Formulations Relaxations and Bounds Branch and Bound
The 0-1 Knapsack Problem - BIP
1
Variables: x
j
0, 1, j 1, ..., n
x
j
= 1 if project j is selected, x
j
= 0 otherwise
2
Constraint: the budget must not be exceeded
n

j =1
a
j
x
j
b
3
Objective function: maximize the total prot
max
n

j =1
c
j
x
j
VU Algorithmics M. Ruthmair 16
Formulations Relaxations and Bounds Branch and Bound
The Set Covering Problem
Denition
Given:
n potential locations for re stations
costs c
j
for building a re station at location j
m regions that have to be serviced in case of re
sets S
j
of regions that can be serviced within 5 minutes by re
station at location j
The problem is to nd a set of locations for re stations with minimal
total building costs. Each region has to be reachable by at least one re
station within 5 minutes.
VU Algorithmics M. Ruthmair 17
Formulations Relaxations and Bounds Branch and Bound
The Set Covering Problem - BIP
1
Variables: x
j
0, 1, j 1, ..., n
x
j
= 1 if re station is built at location j , x
j
= 0 otherwise
2
Constraint: each region has to be reachable within 5 minutes by at
least one re station
n

j =1
a
ij
x
j
1 i 1, ..., m
a
ij
= 1 if i S
j
and a
ij
= 0 if i / S
j
3
Objective function: minimize the total building costs
min
n

j =1
c
j
x
j
VU Algorithmics M. Ruthmair 18
Formulations Relaxations and Bounds Branch and Bound
The Traveling Salesman Problem (TSP)
Denition
Given:
set N = 1, ..., n of cities
costs c
ij
for traveling from city i to city j
The problem is to nd a tour with minimum traveling costs. Each city
has to be visited exactly once and the salesman has to return to his
starting city at the end.
VU Algorithmics M. Ruthmair 19
Formulations Relaxations and Bounds Branch and Bound
The Traveling Salesman Problem - BIP
1
Variables: x
ij
0, 1, i , j N, i ,= j
x
ij
= 1 if the salesman travels directly from city i to j , x
ij
= 0
otherwise
2
Constraints:
The salesman leaves each city i exactly once:

j N,j =i
x
ij
= 1 i N
The salesman arrives at each city j exactly once:

i N,i =j
x
ij
= 1 j N
3
Objective function: minimize the total traveling costs
min

i N

j N,j =i
c
ij
x
ij
VU Algorithmics M. Ruthmair 20
Formulations Relaxations and Bounds Branch and Bound
The Traveling Salesman Problem - BIP
1
2
3
4
5
Problem: subtours are allowed!
Additional constraints to eliminate these subtours, e.g.:
Cut-set constraints:

i S

j / S
x
ij
1 S N, S ,=
Subtour elimination constraints:

i S

j S
x
ij
[S[ 1 S N, [S[ 2, ..., n 1
VU Algorithmics M. Ruthmair 21
Formulations Relaxations and Bounds Branch and Bound
The Combinatorial Explosion
We can solve combinatorial optimization problems by simple enumeration
number of possible (feasible and infeasible) solutions:
The Assignment Problem: n! (permutations)
The Knapsack Problem: 2
n
(power set)
The Set Covering Problem: 2
n
The Traveling Salesman Problem: (n 1)!
we need some more intelligent algorithm!
VU Algorithmics M. Ruthmair 22
Formulations Relaxations and Bounds Branch and Bound
MIPs - Modeling of Fixed Costs
Non-linear xed charge cost function:
h(x) =

0 : x = 0
f + px : 0 < x C, f > 0, p > 0
1
Additional variable y 0, 1:
y = 0 if x = 0
y = 1 if x > 0
2
Additional constraint: x Cy
3
Objective function: min fy + px
Note: x = 0, y = 1 is feasible in model but infeasible for h(x).
Nevertheless, this case cannot occur in an optimal solution.
VU Algorithmics M. Ruthmair 23
Formulations Relaxations and Bounds Branch and Bound
Uncapacitated Facility Location (UFL)
Denition
Given:
set N = 1, ..., n of potential depots
xed cost f
j
for opening depot j
set M = 1, ..., m of clients
transportation costs c
ij
for delivering all orders of client i from depot
j
The problem is to decide which depots to open and which depots serve
each client. The sum of xed depot opening and transportation costs
should be minimized.
VU Algorithmics M. Ruthmair 24
Formulations Relaxations and Bounds Branch and Bound
Uncapacitated Facility Location - MIP
1
Variables:
x
ij
0, i M, j N: fraction of demand of client i satised by
depot j
y
j
0, 1, j N: y
j
= 1 if depot j is opened, else y
j
= 0
2
Constraints:
The demand of client i has to be satised:

j N
x
ij
= 1 i M
Linking x and y variables:

i M
x
ij
my
j
j N
3
Objective function: minimize the sum of all costs
min

i M

j N
c
ij
x
ij
+

j N
f
j
y
j
VU Algorithmics M. Ruthmair 25
Formulations Relaxations and Bounds Branch and Bound
Uncapacitated Lot Sizing (ULS)
Denition
Given:
xed costs f
t
for producing in period t
unit production costs p
t
in period t
unit storage costs h
t
in period t
demand d
t
in period t
The problem is to nd a production plan for a single product for the next
n time periods. The sum of xed, production and storage costs should be
minimized.
VU Algorithmics M. Ruthmair 26
Formulations Relaxations and Bounds Branch and Bound
Uncapacitated Lot Sizing - MIP
1
(Obvious) variables:
x
t
0, t 1, ..., n: amount produced in period t
s
t
0, t 0, ..., n: stock at the end of period t (s
0
= s
n
= 0)
y
t
0, 1, t 1, ..., n: y
t
= 1 if production occurs in period t,
else y
t
= 0
2
Objective function: minimize the sum of production, storage and
xed costs
min
n

t=1
p
t
x
t
+
n

t=1
h
t
s
t
+
n

t=1
f
t
y
t
VU Algorithmics M. Ruthmair 27
Formulations Relaxations and Bounds Branch and Bound
Uncapacitated Lot Sizing - MIP
3
Constraints:
Flow conservation in each period t:
s
t1
+ x
t
d
t
= s
t
t 1, ..., n
Note: s
t
=

t
i =1
x
i

t
i =1
d
i
Linking x and y variables:
x
t
My
t
t 1, ..., n
How large must M be? Is there an upper bound on x
t
?
x
t
(
n

i =t
d
i
)y
t
t 1, ..., n
VU Algorithmics M. Ruthmair 28
Formulations Relaxations and Bounds Branch and Bound
Discrete Alternatives or Disjunctions
How can we model disjunctions? (e.g. in scheduling problems)
x R
n
, 0 x u
Either a
1
x b
1
or a
2
x b
2
1
Binary variables y
1
, y
2
0, 1
2
Constraints:
a
i
x b
i
M(1 y
i
) i 1, 2
y
1
+ y
2
= 1
M max
i {1,2}
a
i
x b
i
: 0 x u
VU Algorithmics M. Ruthmair 29
Formulations Relaxations and Bounds Branch and Bound
Formulation
Denition 1
A polyhedron P R
n+p
is a formulation for a set X Z
n
R
p
if and
only if X = P (Z
n
R
p
).
Note: When we modeled xed costs on slide 23 we did not model
X = (0, 0), (x, 1) : 0 < x C but X (0, 1).
VU Algorithmics M. Ruthmair 30
Formulations Relaxations and Bounds Branch and Bound
Are there more equivalent formulations for set X?
x
1
x
2
P
1
P
2
P
3
Figure: Dots denote integer values. Big dots denote set X of feasible solutions.
VU Algorithmics M. Ruthmair 31
Formulations Relaxations and Bounds Branch and Bound
Equivalent formulation for UFL
Variables stay the same:
x
ij
0, i M, j N: fraction of demand of client i satised by
depot j
y
j
0, 1, j N: y
j
= 1 if depot j is opened, else y
j
= 0
Constraints

i M
x
ij
my
j
j N
are replaced by
x
ij
y
j
i M, j N
Is this equivalent formulation better or worse?
VU Algorithmics M. Ruthmair 32
Formulations Relaxations and Bounds Branch and Bound
Extended formulation for ULS
1
Variables:
w
it
0, i , t 1, ..., n, i t: amount produced in period i to
satisfy demand in period t
y
t
0, 1, t 1, ..., n: y
t
= 1 if production occurs in period t,
else y
t
= 0
2
Constraints:
Demand satisfaction in period t:
t

i =1
w
it
= d
t
t 1, ..., n
Variable upper bounds by linking w and y variables:
w
it
d
t
y
i
i , t 1, ..., n, i t
VU Algorithmics M. Ruthmair 33
Formulations Relaxations and Bounds Branch and Bound
Extended formulation for ULS
3
Objective function stays the same
min
n

t=1
p
t
x
t
+
n

t=1
h
t
s
t
+
n

t=1
f
t
y
t
variables x
t
and s
t
are expressed by w
it
:
x
t
=
n

i =t
w
ti
s
t
=
t

i =1
n

j =t+1
w
ij
VU Algorithmics M. Ruthmair 34
Formulations Relaxations and Bounds Branch and Bound
Comparing formulations
x
1
x
2
P
2
P
3
P
1
Figure: All formulations are feasible for set X but which is the best?
VU Algorithmics M. Ruthmair 35
Formulations Relaxations and Bounds Branch and Bound
Ideal Formulation
Denition 2
A formulation P for a set X R
n
is ideal if and only if P = conv(X).
Consequence:
IP: max cx : x X can be replaced by LP: max cx : x conv(X)
optimal solution is extreme point of conv(X) IP can be solved in
polynomial time.
Problem:
In general conv(X) has no simple characterization and exponentially
many constraints.
VU Algorithmics M. Ruthmair 36
Formulations Relaxations and Bounds Branch and Bound
Good Formulations
X conv(X) P, for all formulations P, suggests:
Denition 3
Given a set X R
n
and formulations P
1
and P
2
for X, P
1
is a better
formulation than P
2
if P
1
P
2
.
Four dierent cases:
1
P
1
= P
2
: x P
1
x P
2
2
P
1
P
2
: (x P
1
x P
2
) (x P
2
: x / P
1
)
3
P
1
P
2
: (x P
2
x P
1
) (x P
1
: x / P
2
)
4
P
1
,= P
2
: (x P
1
: x / P
2
) (x P
2
: x / P
1
)
VU Algorithmics M. Ruthmair 37
Formulations Relaxations and Bounds Branch and Bound
Comparing formulations for UFL
Let P
1
be the formulation with constraints

i M
x
ij
my
j
j N (1)
and P
2
the one with
x
ij
y
j
i M, j N (2)
If (x, y) P
2
then by summing constraints 2 over i M we see that
(x, y) P
1
P
2
P
1
.
Suppose, m = n and each depot serves exactly one client: x
ij
= 1 if
i = j , and x
ij
= 0 otherwise, y
j
= 1/m, lies in P
1
P
2
.
P
2
P
1
: P
2
is better than P
1
.
VU Algorithmics M. Ruthmair 38
Formulations Relaxations and Bounds Branch and Bound
Projections
The two formulations for ULS use dierent sets of variables. How can we
compare them?
Let P R
n
be a formulation for integer set X Z
n
mincx : x P Z
n

and a second extended formulation Q R


n
R
p
mincx : (x, w) Q (Z
n
R
p
)
Denition 4
The projection of polyhedron Q R
n
R
p
onto the subspace P R
n
,
denoted proj
x
Q, is dened as:
proj
x
Q = x R
n
: (x, w) Q for some w R
p

VU Algorithmics M. Ruthmair 39
Formulations Relaxations and Bounds Branch and Bound
Comparing formulations for ULS
Let P
1
be the formulation with constraints
s
t1
+ x
t
d
t
= s
t
t 1, ..., n
x
t
My
t
t 1, ..., n
and P
2
= proj
x,s,y
Q
2
, where Q
2
is dened by
t

i =1
w
it
= d
t
t 1, ..., n
w
it
d
t
y
i
i , t 1, ..., n, i t
x
t
=
n

i =t
w
ti
, s
t
=
t

i =1
n

j =t+1
w
ij
t 1, ..., n
VU Algorithmics M. Ruthmair 40
Formulations Relaxations and Bounds Branch and Bound
Comparing formulations for ULS
It can be shown that P
2
is an ideal formulation.
ULS can be solved in polynomial time by solving the LP of P
2
.
From above, P
2
P
1
. To show P
2
P
1
:
E.g. the point x
t
= d
t
, s
t
= 0, y
t
= d
t
/M, t 1, ..., n lies in
P
1
P
2
.
P
2
is better than P
1
(and even ideal).
VU Algorithmics M. Ruthmair 41
Formulations Relaxations and Bounds Branch and Bound
Alternative Formulations for TSP
Basic BIP without subtour elimination:
min

j ,j =i
c
ij
x
ij

j ,j =i
x
ij
= 1 i N

i ,i =j
x
ij
= 1 j N
x
ij
0, 1 i , j N, i ,= j
The number of cut-set or subtour elimination constraints is exponential.
Are there other ways to prevent subtours?
VU Algorithmics M. Ruthmair 42
Formulations Relaxations and Bounds Branch and Bound
Sequential Formulation
introduced by Miller, Tucker and Zemlin (1960)
additional (continuous) variables u
i
, are used to indicate the order in
which the cities are visited
additional constraints:
u
i
+ x
ij
u
j
+ M (1 x
ij
) i , j N 1, i ,= j
1 u
i
n 1 i N 1
M has to inactivate a constraint if x
ij
= 0 M = n 2
Is it possible to tighten the constraints by integrating x
ji
?
VU Algorithmics M. Ruthmair 43
Formulations Relaxations and Bounds Branch and Bound
Single Commodity Flow Formulation
introduced by Gavish and Graves (1978)
additional (continuous) variables f
ij
represent the amount of ow
on arc (i , j )
additional constraints: node 1 sends out n 1 goods and any
other node consumes exactly one

j ,j =1
f
1j
= n 1

i ,i =j
f
ij

k,k=j
f
jk
= 1 j N 1
0 f
ij
(n 1) x
ij
i , j N, i ,= j
VU Algorithmics M. Ruthmair 44
Formulations Relaxations and Bounds Branch and Bound
Multi Commodity Flow Formulation
introduced by Wong (1980)
additional (continuous) variables f
k
ij
represent the amount of ow
on arc (i , j ) for commodity k
additional constraints: node 1 sends out n 1 dierent commodities
each one dedicated to a specic node

j ,j =1
f
k
1j
= 1 k N 1

i ,i =k
f
k
ik
= 1 k N 1

i ,i =j
f
k
ij

i ,i =j
f
k
ji
= 0 j , k N 1, j ,= k
0 f
k
ij
x
ij
i , j N, i ,= j , k N 1
VU Algorithmics M. Ruthmair 45
Formulations Relaxations and Bounds Branch and Bound
Relaxations and Bounds
VU Algorithmics M. Ruthmair 46
Formulations Relaxations and Bounds Branch and Bound
Optimality Condition
Given IP or COP maxc(x) : x X Z
n

Denition 5
A solution x

with z

= c(x

) is optimal if there is a lower bound z z

and an upper bound z z

, such that z = z

= z.
An algorithm tries to nd an increasing sequence of lower bounds and a
decreasing sequence of upper bounds
z
1
< z
2
< ... < z
l
z

z
u
< ... < z
2
< z
1
and can stop when
z
u
z
l
( 0)
But how can we derive lower and upper bounds?
VU Algorithmics M. Ruthmair 47
Formulations Relaxations and Bounds Branch and Bound
Primal Bounds
Denition 6
Lower bounds in maximization problems and upper bounds in
minimization problems are called primal bounds.
Every feasible solution x X is a primal (in our case lower) bound
z = c(x) z


use (meta-)heuristics to derive feasible solutions and (hopefully) good
primal bounds
(see lecture Heuristic Optimization Techniques in winter term)
VU Algorithmics M. Ruthmair 48
Formulations Relaxations and Bounds Branch and Bound
Dual Bounds
Denition 7
Upper bounds in maximization problems and lower bounds in
minimization problems are called dual bounds.
In most cases dual bounds are obtained by relaxations:
a dicult (maximization) IP is replaced by a simpler optimization
problem with an optimal value at least as large as z

, e.g. by removing
some constraints.
VU Algorithmics M. Ruthmair 49
Formulations Relaxations and Bounds Branch and Bound
Relaxations
Denition 8
A problem RP z
R
= maxf (x) : x Y R
n
is a relaxation of IP
z

= maxc(x) : x X R
n
if:
1
X Y, and
2
f (x) c(x), x X.
Theorem 9
If RP is a relaxation of IP, then z
R
z

.
Proof.
If x

is an optimal solution of IP, x

X Y, and z

= c(x

) f (x

).
As x

Y, f (x

) is a lower bound on z
R
, and so z

f (x

) z
R
.
VU Algorithmics M. Ruthmair 50
Formulations Relaxations and Bounds Branch and Bound
Linear Programming Relaxations
Denition 10
Given an IP maxcx : x P Z
n
with formulation P, the LP relaxation
is the LP z
LP
= maxcx : x P.
Since P Z
n
P and the objective function is not changed, the LP
relaxation is a relaxation.
Better formulations give tighter (dual) bounds:
Theorem 11
Let P
1
and P
2
be two formulations for IP maxcx : x X Z
n
, and P
1
is better than P
2
, i.e. P
1
P
2
.
If z
LP
i
= maxcx : x P
i
, i 1, 2, then z
LP
1
z
LP
2
, c R
n
.
VU Algorithmics M. Ruthmair 51
Formulations Relaxations and Bounds Branch and Bound
Optimality by Relaxations
In some cases relaxations can prove optimality:
Theorem 12
1
If relaxation RP is infeasible, the original IP is infeasible.
2
Let x

be an optimal solution to RP. If x

X and f (x

) = c(x

),
then x

is optimal for IP.


Proof.
1
As RP is infeasible, Y = . Since X Y holds for a relaxation,
X = .
2
As x

X, z

c(x

) = f (x

) = z
R
. Since z

z
R
, we get
c(x

) = z

= z
R
.
VU Algorithmics M. Ruthmair 52
Formulations Relaxations and Bounds Branch and Bound
Combinatorial Relaxations
Denition 13
If the relaxation is a COP, we speak of a combinatorial relaxation.
Preferably, these COPs are easy problems which can be solved eciently,
e.g.:
When considering the TSP on a digraph D = (V, A), feasible tours T
correspond to assignments containing no subtours
z
TSP
= min
TA

(i ,j )T
c
ij
: T is a tour
z
ASS
= min
TA

(i ,j )T
c
ij
: T is an assignment
VU Algorithmics M. Ruthmair 53
Formulations Relaxations and Bounds Branch and Bound
Combinatorial Relaxation for Symmetric TSP
Given an undirected graph G = (V, E) with edge costs c
e
, e E, we
search for an undirected tour with minimum costs.
Every tour consists of two edges incident to node 1, and a path
through nodes 2, ..., n.
A path is a special case of a tree.
Denition 14
A 1-tree is a subgraph containing two edges adjacent to node 1, and the
edges of a tree on nodes 2, ..., n.
Every tour is a 1-tree
z
STSP
= min
TE

eT
c
e
: T is a tour
z
1-tree
= min
TE

eT
c
e
: T is a 1-tree
VU Algorithmics M. Ruthmair 54
Formulations Relaxations and Bounds Branch and Bound
Comb. Relaxation for the Knapsack Problem
Given the set
X = x Z
n
+
:
n

j =1
a
j
x
j
b
A relaxation of set X is
X

= x Z
n
+
:
n

j =1
a
j
|x
j
b|
Why is this relaxation easier to solve?
There are ecient pseudo-polynomial dynamic programming algorithms
for instances with integer weights.
VU Algorithmics M. Ruthmair 55
Formulations Relaxations and Bounds Branch and Bound
Lagrangian Relaxation
Given an IP z

= maxcx : Ax b, x X Z
n
. If we drop constraints
Ax b, we obtain a relaxation z
R
= maxcx : x X, and clearly
z
R
z

(e.g. drop subtour constraints in TSP).


Extension: Not just drop constraints but add them to the objective
function with Lagrange multipliers (dual variables):
Theorem 15
Let z(u) = maxcx +u(b Ax) : x X. Then z(u) z

, u 0.
Proof.
Let x

be optimal for IP. Since x

is feasible for IP, x

X and Ax

b
holds. Thus, as u 0, z

= cx

cx

+u(b Ax) z(u).


VU Algorithmics M. Ruthmair 56
Formulations Relaxations and Bounds Branch and Bound
Duality
LP duality provides a standard way to obtain dual bounds.
Note: any dual feasible solution provides a dual bound, but a
relaxation must be solved to optimality to get a dual bound.
Theorem 16
Given the IP z

= maxcx : Ax b, x Z
n
+
and the according dual
problem DIP w

= minub : uA c, u Z
m
+
. Let LP and DLP be the
according linear programming relaxations, respectively. Then, IP and DP
form a weak dual pair. Strong duality does not hold in general.
Proof.
Since LP and DLP are relaxations, z

z
LP
and w
DLP
w

. Because
of strong LP duality, z
LP
= w
DLP
holds. Thus,
z

z
LP
= w
DLP
w

.
VU Algorithmics M. Ruthmair 57
Formulations Relaxations and Bounds Branch and Bound
Optimality by Duality
Similar to relaxations, dual problems can sometimes prove optimality:
Theorem 17
Let IP maxc(x) : x X and DIP min(u) : u U be a weak dual
pair.
1
If DIP is unbounded, IP is infeasible.
2
If x

X and u

U satisfy c(x

) = (u

), then x

is optimal for
IP and u

is optimal for DIP.


VU Algorithmics M. Ruthmair 58
Formulations Relaxations and Bounds Branch and Bound
A Matching Dual
Denition 18
Given a graph G = (V, E), a matching M E is a set of disjoint edges.
A vertex cover is a set R V of nodes such that every edge has at least
one endpoint in R.
Theorem 19
The problem of nding a maximum cardinality matching
(MCM) max
ME
[M[ : M is a matching
and the problem of nding a minimum cardinality vertex cover
(MCVC) min
RV
[R[ : R is a vertex cover
form a weak dual pair.
VU Algorithmics M. Ruthmair 59
Formulations Relaxations and Bounds Branch and Bound
A Matching Dual - Proof
Proof.
(graph theoretic) Given a matching M = i
1
, j
1
, ..., i
k
, j
k
, then all
2k nodes are distinct, and any vertex cover must contain at least one
node of each edge e M. Thus, [R[ k = [M[.
Proof.
(LP based) Given the n = [V[ by m = [E[ node-edge incidence matrix A
with a
je
= 1 if node j is an endpoint of edge e, and a
je
= 0 otherwise.
The MCM and MCVC can be formulated as IPs
(MCM) z

= max1x : Ax 1, x Z
m
+

(MCVC) w

= miny1 : yA 1, y Z
n
+

Then, z

z
LP
= w
LP
w

.
VU Algorithmics M. Ruthmair 60
Formulations Relaxations and Bounds Branch and Bound
A Matching Dual - Example
1
2 3
e
3
e
2
e
1
Weak (not strong) duality: z

= [M[ = 1, w

= [R[ = 2
LP relaxations:
x
e
1
= x
e
2
= x
e
3
= 0.5, y
1
= y
2
= y
3
= 0.5 z
LP
= w
LP
= 1.5
Note: in bipartite graphs strong duality holds.
VU Algorithmics M. Ruthmair 61
Formulations Relaxations and Bounds Branch and Bound
Branch and Bound
VU Algorithmics M. Ruthmair 62
Formulations Relaxations and Bounds Branch and Bound
Divide and Conquer
Given a problem z = maxcx : x S.
Use divide and conquer approach:
1
Break the problem into smaller and easier problems
2
Solve all smaller problems
3
Put information together to solve original problem
Theorem 20
Let S = S
1
... S
K
be a decomposition of S into smaller sets, and let
z
k
= maxcx : x S
k
, k 1, ..., K. Then z = max
k
z
k
.
A divide and conquer approach can be represented by an enumeration
tree.
VU Algorithmics M. Ruthmair 63
Formulations Relaxations and Bounds Branch and Bound
Binary Branching
E.g. S 0, 1
3
:
S
S
0
S
1
S
00
S
01
S
10
S
11
S
000
S
001
S
010
S
011
S
100
S
101
S
110
S
111
x
1
= 0 x
1
= 1
x
2
= 0
x
3
= 0
x
2
= 1
x
3
= 1
A leaf S
i
1
i
2
i
3
is non-empty if and only if x = (i
1
, i
2
, i
3
) S. The leaves
directly correspond to points in B
3
.
VU Algorithmics M. Ruthmair 64
Formulations Relaxations and Bounds Branch and Bound
Multiway Branching
E.g. Asymmetric TSP with n = 4:
x
12
= 1 x
13
= 1 x
14
= 1
x
23
= 1 x
24
= 1 x
21
= 1 x
24
= 1 x
21
= 1 x
23
= 1
1234 1243 1342 1324 1432 1423
Leaves correspond to the (n 1)! feasible tours. Here we used
problem-specic branching.
VU Algorithmics M. Ruthmair 65
Formulations Relaxations and Bounds Branch and Bound
Implicit Enumeration
Complete enumeration is computationally impossible for [x[ > 20 for
many problems.
How can we benet from bound information to prune complete
subtrees without explicitely enumerating them?
How can we put together bound information?
Theorem 21
Let S = S
1
... S
K
be a decomposition of S into smaller sets, and let
z
k
= maxcx : x S
k
, k 1, ..., K, z
k
be an upper bound and z
k
be a lower bound on z
k
. Then z = max
k
z
k
is an upper bound and
z = max
k
z
k
a lower bound on z.
VU Algorithmics M. Ruthmair 66
Formulations Relaxations and Bounds Branch and Bound
Prune by Optimality
Given a maximization problem and a decomposition of S into two sets
S
1
, S
2
, and lower and upper bounds on these problems:
27
S
1
S
2
S
13
20
20
25
15
25
S
1
S
2
S
20
25
15
z = max
k
z
k
= max20, 25 = 25 and
z = max
k
z
k
= max20, 15 = 20
z
1
= z
1
= z
1
problem z
1
is solved.
In general, if z
t
= maxcx : x S
t
is solved, branch S
t
can be pruned.
VU Algorithmics M. Ruthmair 67
Formulations Relaxations and Bounds Branch and Bound
Prune by Bound
27
S
1
S
2
S
13
20
18
26
21
26
S
1
S
2
S
21
26
21
z = max
k
z
k
= max20, 26 = 26 and
z = max
k
z
k
= max18, 21 = 21
z = 21 and z
1
= 20 no optimal solution can lie in S
1
.
In general, if z
t
z, branch S
t
can be pruned.
VU Algorithmics M. Ruthmair 68
Formulations Relaxations and Bounds Branch and Bound
Prune by Infeasibility
27
S
1
S
2
S
13
=
26
21
26
S
1
S
2
S
21
26
21
z = max
k
z
k
= max26 = 26 and z = max
k
z
k
= max21 = 21
S
1
= z
1
is infeasible.
In general, if S
t
= , branch S
t
can be pruned.
VU Algorithmics M. Ruthmair 69
Formulations Relaxations and Bounds Branch and Bound
No Pruning Possible
40
S
1
S
2
S

13

37
S
24 37
13
S
1
S
2
13

24 37
z = max
k
z
k
= max24, 37 = 37 and
z = max
k
z
k
= max13 = 13
Here, no pruning is possible both subproblems have to be further
examined.
VU Algorithmics M. Ruthmair 70
Formulations Relaxations and Bounds Branch and Bound
Open Questions
The implementation of an implicit enumeration algorithm seems quite
easy, but:
What relaxation or dual problem should be used to provide
dual bounds? Should we use a weak bound which can be calculated
quickly or a stronger bound which takes more time to obtain?
How should we separate a set S into smaller sets? Should we
use binary or multiway branching? Should the separation rule be
xed or obtained dynamically depending on bounds and solutions?
In what order should we examine the open subproblems?
FIFO, LIFO, or something else?
VU Algorithmics M. Ruthmair 71
Formulations Relaxations and Bounds Branch and Bound
LP-based Branch and Bound
Most common way to solve (M)IPs
LP-relaxation used as dual (upper) bound
Binary branching by splitting set S on fractional variables: if x
j
is
integer and x
j
= x
LP
j
/ Z then
S
1
= S x : x
j
x
j
|,
S
2
= S x : x
j
,x
j
|
S
1
S
2
= S, S
1
S
2
= , x
LP
/ LP(S
1
), x
LP
/ LP(S
2
)
maxz
1
, z
2
< z the upper bound strictly decreases.
VU Algorithmics M. Ruthmair 72
Formulations Relaxations and Bounds Branch and Bound
LP-based Branch and Bound
Resolve LPs with new constraints by dual simplex algorithm:
former optimal basis stays dual feasible, typically only a few pivots
needed to nd a new optimal solution
Updating the incumbent solution (best primal bound): if
x
t,LP
S (feasible for original problem) z = maxz, z
t
prune
branch S
t
by optimality
VU Algorithmics M. Ruthmair 73
Formulations Relaxations and Bounds Branch and Bound
Algorithm 1: LP-based Branch and Bound
problem list L : maxcx : x S
z = , incumbent x

= NULL
while L ,= do
choose set S
i
and remove it from L
solve z
i
= LP(S
i
)
x
i ,LP
= optimal LP solution
if S
i
= then prune S
i
by infeasibility
else if z
i
z then prune S
i
by bound
else if x
i ,LP
S then
if z
i
z then
update primal bound z = z
i
update incumbent x

= x
i ,LP
prune S
i
by optimality
else L = L S
i ,1
, S
i ,2

VU Algorithmics M. Ruthmair 74
Formulations Relaxations and Bounds Branch and Bound
How to Choose a Branching Variable
Typically, there is a set C of integer variables that are fractional in the
current LP solution. Which one should be chosen to branch on?
Random variable x
i
Most fractional variable x
i
:
i = arg max
j C
minf
j
, 1 f
j
with f
j
= x
LP
j
x
LP
j
|
Strong branching: spend more time on the decision
1
try each x
j
C as branching variable, branch up (U) and down (D)
and resolve all LPs z
U
j
, z
D
j
, x
j
C
2
choose actual branching variable x
i
with largest decrease of dual
bound
i = arg min
j C
maxz
U
j
, z
D
j

VU Algorithmics M. Ruthmair 75
Formulations Relaxations and Bounds Branch and Bound
GUB Branching
Many models contain generalized upper bounds (GUB)
k

j =1
x
j
= 1, x
j
0, 1, j 1, ..., k
Standard branching on fractional variable x
j
would be
S
1
= S x : x
j
= 0 and S
2
= S x : x
j
= 1
S
1
is typically much larger (k 1 possibilities x : x
i
= 1
i =j
) than S
2
(only one variable assignment) the tree is unbalanced.
GUB branching: user species variable ordering j
1
, ..., j
k
and
S
1
= S x : x
j
i
= 0, i 1, ..., r ,
S
2
= S x : x
j
i
= 0, i r + 1, ..., k
with r = mint :
t

i =1
x
LP
j
i
0.5
VU Algorithmics M. Ruthmair 76
Formulations Relaxations and Bounds Branch and Bound
How to Choose a Subproblem
Random choice
Depth-First-Search strategy at rst goes down the enumeration
tree to quickly nd primal bounds
mostly, pruning is only possible with a strong primal bound.
the LP relaxation is easier to resolve by just adding one simple
constraint (the current optimal basis is available).
Best-Node-First strategy chooses problem i with best dual (largest
upper) bound z
i
= max
t
z
t

the total number of examined problems is minimized.


never a problem is separated with z
t
< z (which would be pruned
later).
In practice, a combination of the last two strategies is used.
VU Algorithmics M. Ruthmair 77
Formulations Relaxations and Bounds Branch and Bound
Additional Features in Practice
Commercial branch-and-bound systems (e.g. IBM ILOG CPLEX) often
include:
a preprocessor to simplify the formulations by reducing the number
of constraints and variables
dierent simplex variants and interior point methods chosen
automatically or by hand
various branching and problem selection options
user-dened priorities on integer variables to control branching
various primal heuristics based on LP solutions to obtain good
primal bounds
user-dened cuto values
VU Algorithmics M. Ruthmair 78
Formulations Relaxations and Bounds Branch and Bound
If All Else Fails
If the problem is too hard, such that
no feasible solution has been found, or
the gap between upper and lower bound is very large, or
the system runs out of memory due to a very large list of not yet
examined problems,
then
nd better primal bounds by external (meta-)heuristics, or
nd better dual bounds by improving (tightening) the formulation for
the problem, or use other dual bounds, e.g. Lagrangian relaxation.
VU Algorithmics M. Ruthmair 79

You might also like