Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Fabio Furini
December 8, 2014
Outline
Origins and applications
Applications:
Definition: Bin Packing Problem (BPP)
Solution techniques for the BPP
Heuristic Algorithms
Compact MIP formulation
Stronger MIP formulation
Pseudo-polynomial MIP formulation
Arc-flow Formulation
Dyckhoff Formulation
Bin Packing
3/33
Bin Packing
4/33
Bin Packing
Applications:
Consider the following problem: determining the smallest number of rolls of a
fixed width that have to be cut in order to satisfy the demand of clients.
filling up containers;
loading trucks with weight capacity constraints;
creating file backups;
placing data on multiple disks;
job scheduling.
5/33
Bin Packing
6/33
Bin Packing
7/33
Bin Packing
8/33
Bin Packing
9/33
Bin Packing
10/33
Bin Packing
Heuristic Algorithms
First FitAlgorithm: pack the current item into the first nonempty bin in which
it fits. If no such bin exists, pack the current item into an empty bin.
Best FitAlgorithm: pack the current item into the nonempty bin of largest free
space in which it fits. If no such bin exists, pack the current item into an empty
bin.
11/33
Bin Packing
1
0
h = 1, . . . , m):
m
X
yh =
1
0
if bin h is used
otherwise
yh
(1)
h=1
m
xhi = 1
i = 1, . . . , n
(2)
h = 1, . . . , m
(3)
i = 1, . . . , n, h = 1, . . . , m
(4)
h = 1, . . . , m
(5)
h=1
n
wi xhi W y h
i=1
xhi {0, 1}
h
y {0, 1}
12/33
Bin Packing
Question 1: write the Model ((1),(5)) for the following example: 2 bins
and 3 items, W = 4, w1 = 1, w2 = 3, w3 = 4.
Question 2: try to figure out the optimal solution value of its Linear
Programming relaxation and a possible solution vector of the variable
values.
Question 3: Cutting Stock Problem try to extend the Model ((1),(5) in
case each item has a demand of di copies (i = 1, . . . , n)
13/33
Bin Packing
Model ((1),(5)) is a weak! The Linear Relax has a useless value of:
Pn
LR =
i=1 wi
y h = LR/m
xhi
= 1/m
(6)
h = 1, . . . , m
(7)
i = 1, . . . , n, h = 1, . . . , m
(8)
m
k k!
14/33
Bin Packing
h = 1, . . . , k):
yh
(9)
h=1,...,k
xhi = 1
i = 1, . . . , n
(10)
h = 1, . . . , k
(11)
xhi y h
i = 1, . . . , n, h = 1, . . . , k
(12)
xhi
{0, 1}
i = 1, . . . , n, h = 1, . . . , k
(13)
y {0, 1}
h = 1, . . . , k
(14)
h=1,...,k
n
X
wi xhi W y h
i=1
15/33
Bin Packing
16/33
Bin Packing
Arc-flow Formulation
Cutting pattern corresponds to a path in an acyclic directed graph G =
(V, A), with V = 0, 1, . . . , W as its set of W + 1 vertices, which define
positions in the stock sheet, and
A = {(a, b) : 0 a < b W, b a = wi , i = 1, . . . , n}
as its set of arcs. Minimum flow problem, where:
variables ab correspond to the flow in arc (a, b), (item number of
width b a placed at a units from the beginning of a bin
variable corresponds to the total flow through the graph, and can
be seen as the return flow from vertex W to vertex 0.
Fabio Furini | Universit Paris Dauphine LAMSADE
17/33
Bin Packing
min
(15)
X
ab
ba
(a,b)A
(a,b)A
X
if b=0
if b=W
if b=1,. . . ,W-1
cc+wi 1
(16)
i = 1, . . . , n (17)
(c,c+wi )A
ab R+
(a, b) A (18)
18/33
Bin Packing
19/33
Bin Packing
Dyckhoff Formulation
Residual Bins (RB): each time a bin of width W is cut in order to produce
an item i of length wi , a residual bin of size W wi is obtained, which
can be further used to produce additional items. m
is the number of all
the possible Residual Bins.
Decision variables:
iz =
otherwise.
20/33
Bin Packing
aizt =
otherwise.
21/33
Bin Packing
min
n
X
i0
i=1
m
iz
z=0
m
X
n
X
(19)
1
aizt iz
z=1 i=1
iz R+
n
X
it
i = 1, . . . , n
(20)
t = 1, . . . , m
(21)
z = 0, . . . , m
(22)
i=1
i = 1, . . . , n
22/33
Bin Packing
23/33
Bin Packing
n
X
wj > W
j=1
24/33
Bin Packing
max
n
X
i=1
n
X
pi xi
wi xi W
(23)
i = 1, . . . , n
(24)
i = 1, . . . , n
(25)
i=0
xi {0, 1}
25/33
Bin Packing
xs =
xs
(26)
sS
xs = 1
i = 1, . . . , n
(27)
sS
(28)
sS:is
xs {0, 1}
Fabio Furini | Universit Paris Dauphine LAMSADE
26/33
Bin Packing
min
xs
(29)
sS
xs 1
i = 1, . . . , n
(30)
sS
(31)
sS:is
xs {0, 1}
27/33
Bin Packing
Question 6: explicitly write the Set Partitioning and the Set Covering
formulation of the following instance: bins of capacity W = 7 and items
of sizes 5, 3, 2.
Question 7: write the dual of these models and discuss how they change
in case of having only a subset of the original variables
28/33
Bin Packing
Primal
min
n variables
m constraints
constraint ai x bi
constraint ai x bi
constraint ai x = bi
variable xj 0
variable xj 0
variable xj R
Dual
max
n constraints
m variables
variable ui 0
variable ui 0
variable ui R
constraint aTj u cj
constraint aTj u cj
constraint aTj u = cj
29/33
Bin Packing
Column Generation
min
xs
(32)
max
sS
xs 1
iN
(33)
sS:is
xs 0
(35)
iN
i 1
sS
(36)
iN
(37)
is
sS
(34)
i 0
i > 1
(38)
is
30/33
Bin Packing
Question 8: write a MIP model which allow the separation of the family
of constraints (38)
Question 9: write this MIP model for the following instance: bins of
capacity W = 7 and items of sizes 5, 3, 2.
31/33
Bin Packing
32/33
Bin Packing
Branching rule
Basic idea (Ryan/Foster branching): at each node of the search tree we
select two items i and j N . Then:
1) Same bin create a super item merging i and j,
2) Different bins create an extra constraints:
xi + xj 1
In both cases 1) and 2) the resulting pricing problem is still a KP01, with
1) a super item forced to be packed together
2) an extra constraints not allowed to be packed together
Fabio Furini | Universit Paris Dauphine LAMSADE
33/33
Questions?