Bin$Packing$with$Linear$Usage$Costs$$€¦ · Outline$ 1. The$EnergeTIC$Project(Problem$Formulaon)$...
Transcript of Bin$Packing$with$Linear$Usage$Costs$$€¦ · Outline$ 1. The$EnergeTIC$Project(Problem$Formulaon)$...
Bin Packing with Linear Usage Costs An applica)on to Energy Management in Data
Centres
Hadrien Cambazard G-‐SCOP, Université de Grenoble
Deepak Mehta, Barry O’Sullivan, Helmut Simonis Cork Constraint ComputaAon Centre, Cork, Ireland
Outline 1. The EnergeTIC Project (Problem FormulaAon)
2. A key sub-‐problem BPUC (Bin Packing with Usage Costs) – Lower bounds based on LP – A Constraint Programming view-‐point
3. Back to the applicaAon – A Lower bound by column generaAon relying on BPUC – Upper bound via Large Neighborhood Search
4. Overview of experimental results
The EnergeTIC Project
• Interest increased by the Roadef Challenge with google • EnergeTIC is a project located in Grenoble • Companies involved:
Schneider, Bull, Eolas Business & Decision, UXP
Design of energy efficient data centres
• Permanent increase of energy price (50 % by 2020) • Growing market for cloud compuAng
The EnergeTIC Project
Problem formulaAon Assign virtual machines to servers
over mulAple Ame-‐periods
Energy models Characterize
each component
Demand predicAon Forecast the cpu needs
Energy indicators -‐ Usage -‐ Energy
ExploitaAon constraints
Solver Plan
The EnergeTIC Project
Problem formulaAon Assign virtual machines to servers
over mulAple Ame-‐periods
Energy models Characterize
each component
Demand predicAon Forecast the cpu needs
Energy indicators -‐ Usage -‐ Energy
ExploitaAon constraints
Solver Plan
EnergeTIC: Modeling Equipment
• Characterize energy consumpAon of heterogeneous servers – Measures performed on Bull equipment – Linear model of energy consumpAon
Fixed cost Usage cost
The EnergeTIC Project
Problem formulaAon Assign virtual machines to servers
over mulAple Ame-‐periods
Energy models Characterize
each component
Demand predicAon Forecast the cpu needs
Energy indicators -‐ Usage -‐ Energy
ExploitaAon constraints
Solver Plan
Problem formulaAon
…
1 migration
…
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
• A server has a CPU, MEMORY and CARDINALITY capaciAes • A virtual machine has a CPU consumpAon changing over Ame and a
fixed MEMORY consumpAon • The number of migraAons is limited from one period to the next • ObjecAve : state (ON/STAND_BY) and load of servers
changes of state migraAons
Problem formulaAon
1 migration
… …
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
A series of consecuAve “cost aware” mulAdimensional Bin-‐Packing problems (linked by a limited number of changes)
Problem formulaAon
1 migration
… …
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
A series of consecuAve “cost aware” mulAdimensional Bin-‐Packing problems (linked by a limited number of changes)
Coupling constraints
Problem formulaAon
1 migration
… …
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
A series of consecuAve “cost aware” mulAdimensional Bin-‐Packing problems (linked by a limited number of changes)
Coupling constraints
• A set of items
• A set of bins
Bin Packing with Usage Costs S = {w1, . . . , wn}
B = {{C1, f1, c1}, . . . , {Cm, fm, cm}}
w1 w2. . .
Cj
Fixed cost for opening a bin
Usage cost depending on the load
Cost
Load
Load
{Cj , fj , cj }
cjfj
• Minimize
costj = fj + Loadjcj
Pm
j=1|Loadj>0 costj
Bin Packing with Usage Costs
3
9
{9,0,1} {3,0,2} {3,0,2} {3,0,2} {3,0,2}3
2
Items Bins
• A set of items • A set of bins • Minimize the sum of the costs of the used bins
S = {w1, . . . , wn}B = {{C1, f1, c1}, . . . , {Cm, fm, cm}}
Bin Packing with Usage Costs • A set of items • A set of bins • Minimize the sum of the costs of the used bins
S = {w1, . . . , wn}B = {{C1, f1, c1}, . . . , {Cm, fm, cm}}
3
2
3
9
{9,0,1} {3,0,2} {3,0,2} {3,0,2} {3,0,2}
(P1) (P2)
{9,0,1} {3,0,2} {3,0,2} {3,0,2} {3,0,2}
8x1 + 3x2 + 3x2 + 3x2 = 26 9x1 + 2x2 + 2x2 + 2x2 + 2x2 = 25
Lower bounds for BPUC
Bin j is open Item i is placed on bin j Load of bin j
“Standard” LP formulaCon:
Lower bounds for BPUC
Bin j is open Item i is placed on bin j Load of bin j
“Standard” LP formulaCon:
Linear relaxaCon easy to characterize: • A unit of space on bin j will cost at least: • Sort the bins by non-‐decreasing • Fill the “cheapest” bins first
rj = fj/Cj + cjrj
Lower bounds for BPUC
rj = fj/Cj + cj
9
f1 =c1 =
9 5
r1 = 6
14 3
7
f3 =c3 =r3 = 5
1
5
f4 =c4 =10 r4 =10.2
3
f2 =c2 =r2 =
1 5 5.33
12
f5 =c5 =r5 =
12 10 11
Cj =
3
5
Lower bounds for BPUC
rj = fj/Cj + cj
9
f1 =c1 =
9 5
r1 = 6
14 3
7
f3 =c3 =r3 = 5
1
5
f4 =c4 =10 r4 =10.2
3
f2 =c2 =r2 =
1 5 5.33
12
f5 =c5 =r5 =
12 10 11
9
r1 = 6
7
r3 = 5
5
r4 =10.2
3
r2 =5.33
12
r5 = 11
3
5
3
Lower bounds for BPUC
rj = fj/Cj + cj
9
f1 =c1 =
9 5
r1 = 6
14 3
7
f3 =c3 =r3 = 5
1
5
f4 =c4 =10 r4 =10.2
3
f2 =c2 =r2 =
1 5 5.33
12
f5 =c5 =r5 =
12 10 11
Total Load = 18 Lower bound = 7x5 + 3x5.33 + 6x8 = 99
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11 O(mlog(m) + n)
7 8
3
5
3
Lower bounds for BPUC
Total Load = 18
Lower bound = 99
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11
OpAmal soluAon
Opt = 129
7 8
3
5
Lower bounds for BPUC based on LP
2 3 4 5 70
F
0 5 9 7 6 15 18 2400 5 12 7
S = {2, 2, 3, 5} B = {{3,1,2},{4,3,1},{7,3,3}}
z3: Arc-‐Flow Model of Carvalho
z1: Standard LP formulaAon z2: Gilmore and Gomory
i-‐th cuing pajern of bin j
C C z2 z3 z1
Solving BPUC exactly
Arc-‐Flow Model Standard LP formulaAon
Gilmore and Gomory
BPUC in the applicaAon domain goes with: 1. Large scale 2. Side constraints (ex: cardinality constraints, 2D, …)
MIP
Solving BPUC exactly
Arc-‐Flow Model Standard LP formulaAon
Gilmore and Gomory
BPUC in the applicaAon domain goes with: 1. Large scale 2. Side constraints (ex: cardinality constraints, 2D, …)
MIP
Not so easy to extend with side constraints
Solving BPUC exactly
Arc-‐Flow Model Standard LP formulaAon
Gilmore and Gomory
BPUC in the applicaAon domain goes with: 1. Large scale 2. Side constraints (ex: cardinality constraints, 2D, …)
MIP
Solving BPUC exactly
Arc-‐Flow Model Standard LP formulaAon
Gilmore and Gomory
Bin-‐Packing global constraint +
Cost propagaAon using bound of LP
MIP CP
BPUC in the applicaAon domain goes with: 1. Large scale 2. Side constraints (ex: cardinality constraints, 2D, …)
Cost propagaAon for BPUC
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11
7 3
8
Idea: Use LP bound to compute the minimum/maximum possible filling of each bin due to cost
LB = 99
Cost propagaAon for BPUC
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11
Suppose a UB=130, load on bin 3 (cheapest bin) must be >= 1 (if not LB = 132 > 130)
7 3
8 1
Idea: Use LP bound to compute the minimum/maximum possible filling of each bin due to cost
LB = 99
Cost propagaAon for BPUC
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11
7 3
8 1
Idea: Use LP bound to compute the minimum/maximum possible filling of each bin due to cost
1
UB = 130
We know now that 3 and 1 must be open so: • Count their fixed costs in the bound • Apply the same reasoning on restricted problem unAl a fixed point is reached
Cost propagaAon for BPUC
r1 = 6 r3 = 5 r4 =10.2 r2 =5.33 r5 = 11
7 3
8 3
0
3 3
5
Idea: Use LP bound to compute the minimum/maximum possible filling of each bin due to cost
UB = 130
9
Update upper bounds Update lower bounds
O(m)
Cost propagaAon for BPUC
r1 = 6 r3 = 5 r4 = 10.2 r2 = 5.33 r5 = 11
7
3
8 3
0
3 3
5
UB = 130 9
Update upper bounds Update lower bounds
• Lower bound in and filtering in for each bin • Upper/lower bounds can also be Aghtened by Dynamic Programming
(during search for CP, iniAally for MIP) • On the example, the bound at the root node (with UB = 130):
– LP Bound: 114.4 – CP Bound: 119.66
• UpdaAng load bounds triggers the filtering of the Bin-‐Packing global constraint commiing/forbidding items to bins
O(mlog(m) + n) O(m)
Results on BPUC
• CP is good at handling large BPUC problems • Need to implement branch and price for the cuing-‐
stock formulaAon to compare with CP
Lower bounds
Back to the applicaAon
• Upper bounds: Large Neighborhood Search designed for the ROADEF Challenge 2012 (Mehta, O’Sullivan, Simonis)
• Lower bounds: Column generaAon relying on BPUC
…
1 migration
…
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
Back to the applicaAon (Lower bound)
• A column is a Bin-‐Packing (one Ame period) … • The pricing problem can be well modeled with 3 global
constraints: – BinPackingWithUsageCost (for cpu cost pertubated by dual variables) – BinPackingWithUsageCost (for cardinality cost due to dual variables) – BinPacking (for memory limitaAons) – GlobalCardinality (for limits on the number of items on each bin)
…
1 migration
…
t-1 t t+1
STAND BY
STAND BY
STAND BY
Uit
MiUmaxj
Mmaxj
Back to the applicaAon (Lower bound)
• A column is a Bin-‐Packing (one Ame period) …
• The pricing problem can be well modeled with 3 global constraints: – BinPackingWithUsageCost (for cpu cost pertubated by dual variables) – BinPackingWithUsageCost (for cardinality cost due to dual variables) – BinPacking (for memory limitaAons) – GlobalCardinality (for limits on the number of items on each bin)
• Pricing is intractable but we are only looking for a lower bound:
– Use a lower bound of the best reduced costs to get the dual bound of the column generaAon
– Problem reduced to one Ame period are relaAvely easy in pracAce
Results on the applicaAon • Benchmark: 74 instances with at most 242 virtual machines, 20 servers,
287 Ame-‐periods. Time-‐limit 600s. • CG lower bound outperforms the LP and MIP lower bounds
(avg:0.3%, med:0.1%, max:7% of best known upper bounds) • LNS scales very well in quality and size
(avg:0.5%, med:0%, max:4.5% of the best known lower bounds) • Zoom on some instances:
Lower bound Upper bound
Conclusion • Study of a key variant of Bin-‐Packing (BPUC):
– Characterize LP bound + Cost based propagaAon – Propose an extension of the Bin-‐Packing global constraint with a useful cost-‐model for this applicaAon domain
– CP gives an effecAve exact solver for BPUC specially to handle large-‐scale problems and side constraints
• Minimizing energy in data centres: – Design a lower bound based on column generaAon that has some generality for the applicaAon domain
– Assert the quality of LNS on real benchmark – We are currently tesAng the scalability on problems where the bin-‐packings are 4 Ames larger:
1000 vms, 80 servers, 300 Ame-‐periods