VRPSolverBonn IntroductionCG
VRPSolverBonn IntroductionCG
Eduardo Uchoa
Departamento de Engenharia de Produç~
ao
Universidade Federal Fluminense, Brazil
INRIA International Chair 2022-2026, Bordeaux
min z = cx
subject to
Ax = b
x ≥0
c = 24 29 10 38 0 0
x1
x2
x3 60
x = b = 12 .
1 4 5 0 0 0 x4
10
A = 0 2 1 0 1 0 x5
2 1 −1 4 0 −1 x6
z = 340
z = 340
| | | |
π1 1 5 0 24 π1 4
πB = π2 · 0 1 1 = 10 ⇒ π2 = 0
π3 2 −1 0 0 π3 10
π1 + 2π3 = 24 π1 = 4
πB = cB ⇔ 5π1 + π2 − π3 = 10 ⇒ π2 = 0
π2 = 0 π3 = 10
1 5 0 d1 0 20/11
Bd = 0 1 1 · d3 = 0
⇒ d = −4/11 .
2 −1 0 d5 4 4/11
z = 329
z = 329
(O) max z = cx
subject to
Ax = b
Dx = d
x ≥0
(O0 ) max z = cx
subject to
Ax = b
x ∈P
(O0 ) max z = cx
subject to
Ax = b
x ∈P
(O0 ) max z = cx
subject to
Ax = b
x ∈P
subject to
X
(Ar )λr = b (π)
r ∈R
X
λr = 1 (ν)
r ∈R
λ≥0
Step 3: Pricing
Solve the pricing subproblem (SP), its objective function depends
on the dual solution found in Step 2. The optimal solution x ∗ of
(SP) is a point r ∈ R. If c∗ ≥ 0, no variable in (MP) is suitable
to enter in the current basis of (RMP), so the current solution
of (RMP) is also an optimal solution for (MP) and the
column generation stops.
D1
D2
D3
Usually not!
Even when the LP has a block-diagonal structure, it is usually
faster to solve (O) directly than to apply DW decomposition
and solve (MP) by Column Generation
In fact, top solvers like CPLEX, Gurobi and XPRESS do not
even offer DW decomposition for LP
(IP) max z = cx
s.t. Ax = b
x ∈ Zn+
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
Branch-and-Bound algorithm
Work with the linear relaxation of an IP. Better formulations
lead to smaller gaps (difference between the LP value to the
IP value). That integrality gap has an exponential impact on
the size of the B&B tree
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
(O) max cx
(O0 ) max cx
s.t. Ax = b
=⇒ s.t. Ax = b
Dx = d
x ∈P
x ∈ Zn+
P = {Dx = d, x ∈ Zn+ }
λ ∈ {0, 1}Q
subject to
Q
X
(Apj )λj = b
j=1
Q
X
λj = 1
j=1
λ ∈ {0, 1}Q
subject to
Q
X
(Apj )λj = b (π)
j=1
Q
X
λj = 1 (ν)
j=1
λ≥0
λ≥0
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • •
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
min c 1 x 1 + c 2 x 2 + · · · + c K x K
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
Dk xk = dk k = 1, . . . , K
nk
x k ∈ Z+ k = 1, . . . , K
min c 1 x 1 + c 2 x 2 + · · · + c K x K
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
Dk xk = dk k = 1, . . . , K
nk
x k ∈ Z+ k = 1, . . . , K
min c 1 x 1 + c 2 x 2 + · · · + c K x K
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
Dk xk = dk k = 1, . . . , K
nk
x k ∈ Z+ k = 1, . . . , K
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
xk ∈ Pk k = 1, . . . , K
k
P k = {D k x k = d k , x ∈ Zn+ }
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
xk ∈ Pk k = 1, . . . , K
λ ∈ {0, 1}Qk
subject to
Q
K X k
X
(Ak pjk )λkj = b
k=1 j=1
Q k
X
λkj = 1 k = 1, . . . , K
j=1
k
λ ∈ {0, 1}Q k = 1, . . . , K
subject to
Q
K X k
X
(Ak pjk )λkj = b (π)
k=1 j=1
Q k
X
λkj = 1 k = 1, . . . , K (ν k )
j=1
λ≥0 k = 1, . . . , K
Q
K X k
X
(MP) min z = (c k pjk )λkj
k=1 j=1
subject to
Q
K X k
X
(Ak pjk )λkj = b (π)
k=1 j=1
Q k
X
λkj ≤ 1 k = 1, . . . , K (ν k )
j=1
λ≥0 k = 1, . . . , K
j1 j2 j3 j4 S
9
wj1
8 3 2 3
9
5
wj2
1 1
2
7 5
Min zIP = 8x11 + 3x21 + 2x31 + 9x41 + x12 + 7x22 + 5x32 + 2x42
S.t. x11 + x12 = 1
1
x2 + x22 = 1
1
x3 + x32 = 1
1
x4 + x42 = 1
2x11 + 3x21 + 3x31 + x41 ≤ 5
5x12 + x22 + x32 + 3x42 ≤ 8
0 ≤ x ≤ 1
x ∈ Z8
Master LP:
X X X
Min z = cjk pqj
k k
λq (4a)
k∈K q∈P k j∈J
X X
k k
S.t. pqj λq = 1, j ∈ J; (4b)
k∈K q∈P k
X
λkq ≤ 1, k ∈ K; (4c)
q∈P k
λkq ≥ 0, k ∈ K , q = 1, . . . , Q k(4d)
P1 P2
pqk p11 p21 p31 p41 p51 p61 p71 p81 p91 p12 p22 p32 p42 p52p62 p72 p82 p92 2
p10 2
p11
k
pq1 1 0 0 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1
k
pq2 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0
k
pq3 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 1 0
k
pq4 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 1 1
cost 8 3 2 9 11 10 17 12 11 1 7 5 2 8 13 6 12 14 7 3
λkq λ11 λ12 λ13 λ14 λ15 λ16 λ17 λ18 λ19 λ21 λ22 λ23 λ24 λ25 λ26 λ27 λ28 λ29 λ210 λ211
z = 396; µ1 = 1, µ2 = 1, µ3 = 1, µ4 = 1
z = 396; µ1 = 1, µ2 = 1, µ3 = 1, µ4 = 1
Min c̄ 1 = −91x11 − 96x21 − 97x31 − 90x41 Min c̄ 2 = −97x12 − 92x22 − 94x32 − 97x42
S.t. 2x11 + 3x21 + 3x31 + x41 ≤ 5 S.t. 5x12 + x22 + x32 + 3x42 ≤ 8
x ∈ {0, 1} x ∈ {0, 1}
z = 112
z = 24
z = 18
Min c̄ 1 = 6x11 − 6x21 − 4x31 + 4x41 Min c̄ 2 = −x12 − 2x22 − x32 − 3x42 + 4
S.t. 2x11 + 3x21 + 3x31 + x41 ≤ 5 S.t. 5x12 + x22 + x32 + 3x42 ≤ 8
x ∈ {0, 1} x ∈ {0, 1}
z = 15
(cj1 − πj )xj1 − ν 1
P
Subproblem 1: min (cj2 − πj )xj2 − ν 2
P
Subproblem 2: min
j∈J j∈J
z = 15
c̄ 1 = 0 c̄ 2 = 0
Definition
Robust Cut, Robust Branch-Cut-and-Price Algorithm
(BCPA). A cutting plane in a BCPA is robust if it does not force
any change in the structure of the pricing subproblems in
subsequent calls to the Column Generation algorithm. A cutting
plane that does force changes in the pricing structure is non-robust.
A BCPA that only performs robust branchings and only separates
robust cuts is said to be robust, otherwise, it is non-robust.
The dual variable of the new cut is included in the π vector, its α
coefficients are included as an additional row in matrix A.
Everything happens as if αx ≥ α0 was part of the original IP.
So, there is no change in the pricing structure and the cut is robust.
(RMP) Solution:
λ1 = λ1[1010]| = 0.5
λ7 = λ1[0100]| = 0.5 x11 = x12 = x21 = x22 = x31 = x32 = 0.5
=⇒ x42 = 1
λ6 = λ2[1001]| = 0.5
z = 15
λ8 = λ2[0111]| = 0.5
(RMP) Solution:
λ1 = λ1[1010]| = 0.5
λ7 = λ1[0100]| = 0.5 x11 = x12 = x21 = x22 = x31 = x32 = 0.5
=⇒ x42 = 1
λ6 = λ2[1001]| = 0.5
z = 15
λ8 = λ2[0111]| = 0.5
Translating to λ variables:
z = 16.4
Subproblem
P 1 1: 1 Subproblem
P 2 2: 2
min (cj −πj )xj −2π5 x21 −2π5 x31 −ν 1 min (cj − πj )xj − π5 x12 − π5 x42 − ν 2
j∈J j∈J
Min c̄ 1 = 0x11 + 0x21 + 0x31 + 0x41 Min c̄ 2 = −4.2x12 − 1.6x22 − 2.6x32 − 4.2x42 + 8.4
S.t. 2x11 + 3x21 + 3x31 + x41 ≤ 5 S.t. 5x12 + x22 + x32 + 3x42 ≤ 8
x ∈ {0, 1} x ∈ {0, 1}
c̄ 1 = 0 c̄ 2 = 0
x11 = 0.6
x12 = 0.4
λ1 = λ1[1010]| = 0.4
x21 = 0.4
λ5 = λ1[1100]| = 0.2
x22 = 0.6
λ7 = λ1[0100]| = 0.2 =⇒
x31 = 0.4
λ6 = λ2[1001]| = 0.4
x32 = 0.6
λ8 = λ2[0111]| = 0.6
x42 = 1
z = 16.4
bρAcx ≤ bρbc.
X X XJ XJ
k
b ρj pqj cλkq ≥ b ρj c. (8)
k∈K q∈P k j=1 j=1
RMP Solution:
λ1 = λ1[1010]| = 0.5
λ7 = λ1[0100]| = 0.5
λ6 = λ2[1001]| = 0.5
λ8 = λ2[0111]| = 0.5
Using ρ = [2/3 1/3 1/3 1/3], we obtain the following violated cut:
λ1 + λ2 + λ5 + λ6 + λ8 ≤ 1
By also separating a second CGC with ρ = [1/3 1/3 1/3 2/3], the
instance is solved at the root node.
min c 1 x 1 + c 2 x 2 + · · · + c K x K
subject to
A1 x 1 + A2 x 2 + · · · + AK x K = b
Dk xk = dk k = 1, . . . , K
nk
x k ∈ Z+ k = 1, . . . , K
P 0 = {D 0 x 0 = d 0 , x 0 ≥ 0 and integer}
subject to
Q
X
(A0 pj )λj = b (π)
j=1
Q
X
λj = K (ν)
j=1
λ≥0
1 Instance
Stocks of length W
Set J of items
Each item j ∈ J has length wj and a demand of bj copies
2 Problem
Obtain the demanded number of copies of each item by
cutting the minimum possible number of stocks
Issues
A not-really compact formulation. The formulation size is
pseudo-polynomial
Even when M is not so large, branch-and-bound algorithms
perform poorly on it
the linear relaxation
P lower bound is equal to the the trivial
j∈J bj wj
lower bound
W
suffers from symmetry: the same fractional/integer solution
can be represented in many different ways by only permutating
the stock indices
Length Demand
40 4
35 5
31 5
13 8
Length Demand
40 4
35 5
31 5
13 8
Q
X
min z= λq (10a)
q=1
Q
X
S.t. pqj λq = bj j ∈J (π) (10b)
q=1
λq ∈ Z q = 1, . . . , Q (10c)
Pricing subproblem
At each iteration, the following Integer Knapsack Problem is
solved:
X
min c̄ = 1 − πj xj
j∈J
X
S.t. wj xj ≤ W ,
j∈J
|J|
xj ∈ Z+ ∀j ∈ J.
S = (2, 0, 0, 1) and c̄ = 0
New lower bound: 7 stocks. But no integer solution. What to do?
Hausdorff School – Bonn 2022 Introduction to Column Generation 76 / 84
Getting an (heuristic) integer solution
min z = λ1 + λ2 + λ3 + λ4 + λ5 + λ6 + λ7 + λ8
2λ1 + 2λ6 ≥4
2λ2 + 2λ5 + λ7 + λ8 ≥5
3λ3 + 2λ8 ≥5
7λ4 + 2λ5 + λ6 + 5λ7 ≥8
λ ∈ Z+8
λ5 = 1, λ6 = 2, λ7 = 1, λ8 = 3, z = 7
λ5
n
λ6
λ7
(
λ8
Some guidelines:
When DW decomp improves linear relaxation significantly, but the
subproblems are still tractable
Solving a (MP) by CG is time-consuming. This is usually
only worthy if the resulting bounds are a lot better
This means that the subproblems should not be easy
polynomial problems. The big gains are obtained exactly by
convexifying constraints that define NP-hard problems
“Tractable” NP-hard problems often includes those solvable in
pseudo-polynomial time or those where some exact algorithm
still performs well on instances of reasonable size
A delicate balance