a branch-and-price algorithm for the bin packing …fvanderb/papers/presbpwc.pdf · a...

31
Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov 1 François Vanderbeck 1,2 1 INRIA — Bordeaux Sud-Ouest, France 2 Université Bordeaux I, France ISMP, August 25, 2009 Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Upload: truongthien

Post on 06-Sep-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

A Branch-and-Price Algorithm for the BinPacking Problem with Conflicts

Ruslan Sadykov1 François Vanderbeck1,2

1INRIA — Bordeaux Sud-Ouest, France

2Université Bordeaux I, France

ISMP, August 25, 2009

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 2: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Contents

1 Problem definition

2 Branch-and-Price approach

3 Pricing: knapsack problem with conflicts

4 Results

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 3: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Problem definition

Givenan infinite number of bins of size W ,a set N = {1, . . . , n} of items i of sizes wi ,a graph G = (N, E) of conflicts between items.

Pack the items into a minimum number of bins.Two items in conflict cannot be in the same bin.

conflict

conflict

conflict

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 4: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

IP formulation

Variables:yk = 1 if bin k is used, otherwise yk = 0xik = 1 if item i is put to bin k , otherwise xik = 0

min∑k∈K

yk∑k∈K

xik = 1, i ∈ N,

n∑i=1

wixik ≤ Wyh, k ∈ K ,

xik + xjk ≤ yk , (i , j) ∈ E , k ∈ K ,

yk ∈ {0, 1}, k ∈ K ,

xik ∈ {0, 1}, i ∈ N, k ∈ K .

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 5: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Contents

1 Problem definition

2 Branch-and-Price approach

3 Pricing: knapsack problem with conflicts

4 Results

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 6: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Set covering formulation

B = set of valid single bin packingsλb = 1 if subset b ∈ B of items occupies a bin

Formulation

min∑b∈B

λb∑b∈B:i∈b

λb ≥ 1, i ∈ N,

λb ∈ {0, 1}, b ∈ B.

Pricing problem

max∑i∈N

πixi∑i∈N

wixi ≤ W ,

xi + xj ≤ 1, (i , j) ∈ E ,

xi ∈ {0, 1}, i ∈ N.

(Knapsack with conflicts)

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 7: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Set covering formulation

B = set of valid single bin packingsλb = 1 if subset b ∈ B of items occupies a bin

Formulation

min∑b∈B

λb∑b∈B:i∈b

λb ≥ 1, i ∈ N,

λb ∈ {0, 1}, b ∈ B.

Pricing problem

max∑i∈N

πixi∑i∈N

wixi ≤ W ,

xi + xj ≤ 1, (i , j) ∈ E ,

xi ∈ {0, 1}, i ∈ N.

(Knapsack with conflicts)

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 8: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

CG approach in the literature

Elhedhli, Li, Gzara (2008):Subproblem with clique constraints: CPLEX 10.Branching: specialised Ryan&Foster type(P + 1 descendants: combination of P pairs of items +adding a conflict for each pair separately).Rounding heuristic based on subsets b such that λb isclose to 1.

Muritiba, Iori, Malaguti, Toth (2008):Pre-processing using combinatorial lower bounds andspecialized meta-heuristics.Subproblem: greedy algorithm + CPLEX 10.Branching: Largest fractional part on λ variables.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 9: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

CG approach in the literature

Elhedhli, Li, Gzara (2008):Subproblem with clique constraints: CPLEX 10.Branching: specialised Ryan&Foster type(P + 1 descendants: combination of P pairs of items +adding a conflict for each pair separately).Rounding heuristic based on subsets b such that λb isclose to 1.

Muritiba, Iori, Malaguti, Toth (2008):Pre-processing using combinatorial lower bounds andspecialized meta-heuristics.Subproblem: greedy algorithm + CPLEX 10.Branching: Largest fractional part on λ variables.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 10: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Test instances

Due to Gendreau, Laporte, Semet (2004):Sizes (integer):

Uniforms(u): wi ∈ U[20, 100], W = 150.Triples(t): wi ∈ U[250, 500] (in triples), W = 1000.

“Conflictness” of items: pi ∈ U[0, 1).Conflict graph density: δ ∈ {0, 0.1, . . . , 0.9}.(i , j) ∈ E if and only if (pi + pj)/2 ≥ 1− δ.

ResultsPercentage of instances not solved within 1 hour:

type & # of jobs u250 u500 u1000 t120 t249 t501ELG 0.5% 6.5% – 1.5% 5% –

MIMT 0% 5% 2% 5% 4% 4%

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 11: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Test instances

Due to Gendreau, Laporte, Semet (2004):Sizes (integer):

Uniforms(u): wi ∈ U[20, 100], W = 150.Triples(t): wi ∈ U[250, 500] (in triples), W = 1000.

“Conflictness” of items: pi ∈ U[0, 1).Conflict graph density: δ ∈ {0, 0.1, . . . , 0.9}.(i , j) ∈ E if and only if (pi + pj)/2 ≥ 1− δ.

ResultsPercentage of instances not solved within 1 hour:

type & # of jobs u250 u500 u1000 t120 t249 t501ELG 0.5% 6.5% – 1.5% 5% –

MIMT 0% 5% 2% 5% 4% 4%

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 12: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Our algorithm

We use a generic Branch-and-Price solver BaPCod:generic branching,“diving” heuristic.

We exploit the structure of the conflict graphs of the testinstances (interval graphs):

(i , j) ∈ E iffpi+pj

2 ≥ 1− δpi

pi < 1− δ

pi ≥ 1− δ

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 13: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Our algorithm

We use a generic Branch-and-Price solver BaPCod:generic branching,“diving” heuristic.

We exploit the structure of the conflict graphs of the testinstances (interval graphs):

(i , j) ∈ E iffpi+pj

2 ≥ 1− δpi

pi < 1− δ

pi ≥ 1− δ

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 14: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Generic branching scheme

λ is fractional ⇔ exists a pair i , j such that∑

i,j∈b λb 6= {0, 1}Branching: either item i and j are in the same bin or not, weadd constraints to the pricing subproblem.

Ryan&Foster scheme

xj = xi xj + xi ≤ 1

The interval conflict graphstructure can be broken.

Generic branching scheme

Same bin:either xi = xj = 0or xi = xj = 1

Different bins:either xi = 0or xi = 1, xj = 0

Does not brake graph structure.Stronger LP bound afterbranching.More subproblems to solve.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 15: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Generic branching scheme

λ is fractional ⇔ exists a pair i , j such that∑

i,j∈b λb 6= {0, 1}Branching: either item i and j are in the same bin or not, weadd constraints to the pricing subproblem.

Ryan&Foster scheme

xj = xi xj + xi ≤ 1

The interval conflict graphstructure can be broken.

Generic branching scheme

Same bin:either xi = xj = 0or xi = xj = 1

Different bins:either xi = 0or xi = 1, xj = 0

Does not brake graph structure.Stronger LP bound afterbranching.More subproblems to solve.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 16: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

“Diving” rounding heuristic

Combines:Depth-first search on λvariablesDiversification (LimitedDiscrepancy Search)Pre-processing

· · · · · ·

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 17: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Contents

1 Problem definition

2 Branch-and-Price approach

3 Pricing: knapsack problem with conflicts

4 Results

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 18: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Problem definition

Givena set N = {1, . . . , n} of items i of sizes wi and profits pi ,a graph G = (N, E) of conflicts between items.

Find a subset of items of a maximum total profit which “fit”to the bin of size W .This subset cannot contain any pair of items in conflict.

Formulation reminder

max∑i∈N

πixi∑i∈N

wixi ≤ W ,

xi + xj ≤ 1, (i , j) ∈ E ,xi ∈ {0, 1}, i ∈ N.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 19: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Existent approaches

Arbitrary conflict graphs

NP-hard, ≈ 100 seconds for solving exactly a 1000-itemsinstance (Hifi, Michrafy, 2007) — slow.

Structured conflict graphsTrees and chordal graphs: dynamic programmingalgorithm with complexity O(nW 2) (Pferschy, Shauer,2008) — slow.Interval graphs: these instances we can solve fast.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 20: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Existent approaches

Arbitrary conflict graphs

NP-hard, ≈ 100 seconds for solving exactly a 1000-itemsinstance (Hifi, Michrafy, 2007) — slow.

Structured conflict graphsTrees and chordal graphs: dynamic programmingalgorithm with complexity O(nW 2) (Pferschy, Shauer,2008) — slow.Interval graphs: these instances we can solve fast.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 21: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Existent approaches

Arbitrary conflict graphs

NP-hard, ≈ 100 seconds for solving exactly a 1000-itemsinstance (Hifi, Michrafy, 2007) — slow.

Structured conflict graphsTrees and chordal graphs: dynamic programmingalgorithm with complexity O(nW 2) (Pferschy, Shauer,2008) — slow.Interval graphs: these instances we can solve fast.

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 22: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Interval conflict graphs: dynamic programming

P(i , w) — solution value of the subproblem with the first i itemsand bin size w

pi

bi ei

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 23: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Interval conflict graphs: dynamic programming

P(i , w) — solution value of the subproblem with the first i itemsand bin size w

pi

bi ei

i

P(i , w) = max{

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 24: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Interval conflict graphs: dynamic programming

P(i , w) — solution value of the subproblem with the first i itemsand bin size w

pi

bi ei

i

preci

P(i , w) = max{

P(preci , w − wi) + pi ,

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 25: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Interval conflict graphs: dynamic programming

P(i , w) — solution value of the subproblem with the first i itemsand bin size w

pi

bi ei

i

P(i , w) = max{

P(preci , w − wi) + pi ,

P(i − 1, w)}

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 26: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Interval conflict graphs: dynamic programming

P(i , w) — solution value of the subproblem with the first i itemsand bin size w

pi

bi ei

i

preci

P(i , w) = max{

P(preci , w − wi) + pi ,

P(i − 1, w)}

Complexity: O(nW ), same as for the usual knapsack problem!

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 27: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Contents

1 Problem definition

2 Branch-and-Price approach

3 Pricing: knapsack problem with conflicts

4 Results

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 28: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Numerical experiments

10 instances not solved by Muritiba et al. (2008) were tested.

8 instances were solved to optimality.For 9 instances, we found improved solutions.

Name Type, # items # nodes Sol. Improv. Time6_3_6 t120 533 41 0 3m11s7_3_4 t249 1 83 -1 1m13s8_3_4 t501 136 167 -2 9m05s3_4_4 u500 1 204 -3 14m04s3_4_5 u500 1 206 -1 15m58s3_4_7 u500 1 208 -4 12m11s3_4_8 u500 1 205 -1 10m08s3_4_9 u500 471 197 -3 1h00m01s4_4_8 u1000 1 404 -7 1h42m16s4_4_10 u1000 1 398 -8 2h46m46s

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 29: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Numerical experiments

10 instances not solved by Muritiba et al. (2008) were tested.

8 instances were solved to optimality.For 9 instances, we found improved solutions.

Name Type, # items # nodes Sol. Improv. Time6_3_6 t120 533 41 0 3m11s7_3_4 t249 1 83 -1 1m13s8_3_4 t501 136 167 -2 9m05s3_4_4 u500 1 204 -3 14m04s3_4_5 u500 1 206 -1 15m58s3_4_7 u500 1 208 -4 12m11s3_4_8 u500 1 205 -1 10m08s3_4_9 u500 471 197 -3 1h00m01s4_4_8 u1000 1 404 -7 1h42m16s4_4_10 u1000 1 398 -8 2h46m46s

Effect of the “diving” heuristic!Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 30: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Conclusions and perspectives

ConclusionsKnapsack problem with interval conflict graph can besolved efficiently (and fast!) by dynamic programming.Generic branch-and-price solver BaPCod is competitivewith specialized oracle.Very good performance of the generic “diving” heuristic.

Future researchImprovement of BaPCod (other generic primal heuristics,pre-processing,...)We need faster (in practice) algorithms for the knapsackproblem with specialized and arbitrary conflict graphs

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts

Page 31: A Branch-and-Price Algorithm for the Bin Packing …fvanderb/papers/presBPWC.pdf · A Branch-and-Price Algorithm for the Bin Packing Problem with Conflicts Ruslan Sadykov1 François

Problem definition Branch-and-Price approach Pricing: knapsack problem with conflicts Results

Conclusions and perspectives

ConclusionsKnapsack problem with interval conflict graph can besolved efficiently (and fast!) by dynamic programming.Generic branch-and-price solver BaPCod is competitivewith specialized oracle.Very good performance of the generic “diving” heuristic.

Future researchImprovement of BaPCod (other generic primal heuristics,pre-processing,...)We need faster (in practice) algorithms for the knapsackproblem with specialized and arbitrary conflict graphs

Ruslan Sadykov, François Vanderbeck Branch-and-price for bin packing with conflicts