Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
| > 0}
where A
L
wide
L
narrow
L
wide
= {(x, y) L | x >
}
L
narrow
= {(x, y) L | x
}
17
Rounding of the wide rectangles
1
2
3
Round up each rectangle in group i to the widest rectangle in group i.
This leaves a constant number m
m = 4/
2
of widths.
18
Congurations
a conguration C is a multiset {
C,1
: w
1
, . . . ,
C,m
: w
} of
widths with total sum
i=1
C,i
w
i
1,
C,i
denotes the number of occurrences of width w
i
in
conguration C.
19
Example
0
0.75
1
1.75
2.75
A A
B B
A
A
B B
Type A: 4 rectangles with width 3/7 and height 1,
Type B: 4 rectangles with width 2/7 and height 3/4.
20
Congurations
0
0.75
1
1.75
2.75
A A
B B
A
A
B B
1. conguration with 2 type A rectangles:
C
1
= {2 : 3/7, 0 : 2/7}.
2. conguration with 1 type A and 2 type B rectangles:
C
2
= {1 : 3/7, 2 : 2/7}.
21
Linear program
Use for each conguration C a positive variable x
C
0 that
represents the total height of conguration C in the solution.
Objective function:
C
x
C
is the total height of the packing.
22
Important inequality
i
the sum of the heights of all rectangles with width w
i
.
C,i
the number of occurrences of w
i
in conguration C.
Inequality:
C
C,i
x
C
i
for i = 1, . . . , m
.
Idea: The congurations must reserve enough space for the
rectangles with width w
i
.
23
Linear program (LP)
min
C
x
C
such that
C
C,i
x
C
i
i = 1, . . . , m
x
C
0
(1)
Notice: this is a relaxation of the 2D packing problem (implicitly we
allow to cut rectangles into pieces).
24
Step I (space generated by LP)
x
1
+x
2
+x
3
+ 3
x
1
+x
2
+ 2
x
1
+ 1
0
x
1
x
2
x
3
25
Step II (placing the wide rectangles)
x
1
+x
2
+x
3
+ 3
x
1
+x
2
+ 2
x
1
+ 1
0
x
1
x
2
x
3
26
Step III (after placing all wide rectangles)
0
x
1
+ 1
x
1
+x
2
+ 2
x
1
+x
2
+x
3
+ 3
x
3
x
2
x
1
27
Step IV (adding the narrow rectangles)
x
1
+x
2
+x
3
+ 3
x
1
+x
2
+ 2
x
1
+ 1
0
x
1
x
2
x
3
28
New Result
Theorem: (Jansen, Solis-Oba 2006)
There is an approximation algorithm A, which computes a packing
into a strip of width 1 and height
A(L) (1 +)OPT(L) + 1
for any > 0.
29
2D knapsack problem
Given:
n rectangles R
i
= (w
i
, h
i
) of width w
i
1, height h
i
1 and
prot p
i
> 0.
Find: a subset R
{R
1
, . . . , R
n
} which can be packed into a
square [0, 1] [0, 1].
Goal: maximize the total prot
R
i
R
p
i
.
30
Example
1
1
R
1
R
2
R
3
R
4
R
5
R
1
= (1/2, 1/2), R
2
= (2/5, 7/20), R
3
= (4/5, 1/4),
R
4
= (1/5, 13/20), R
5
= (7/10, 1/5), R
6
= (4/5, 1/3) with
p
i
= 1.
31
New result
Theorem: (Jansen, Solis-Oba 2006) There is an algorithm B which
nds a subset R
{R
1
, . . . , R
n
} that can be packed into a
rectangle of width 1 and height 1 + and has total prot
B(L) (1 )OPT(L),
where OPT(L) is the maximum prot among all subsets (that t into
a square [0, 1] [0, 1]).
32
Main ideas for 2D knapsack problem
(a) eliminate a group of rectangles (with low prot) of width or height
within [
s
, ].
(b) partition the rectangles into tall and short rectangles and into wide
and narrow rectangles.
(c) round up the height of each tall rectangle (with h
i
> ) to a
multiple of
2
and move these rectangles vertically.
33
Rounding of tall rectangles
1
2
1 + 2
34
Container for short rectangles
i
2
(i + 1)
2
height
width
C
Each container contains at least one short, wide rectangle. Therefore,
there is only a constant number of such containers.
35
Further ideas
(a) pack short, wide rectangles only in containers,
(b) determine a constant number K of tall rectangles with highest
prot
(c) compute packings for the K tall rectangles and the containers,
(d) use a linear program to place the remaining tall and short,
narrow rectangles.
36
Packing of the K tall rectangles and containers
2
R
3
C
1
C
2
1 + 2
R
1
R
2
1
37
Adding the other rectangles
2
R
3
C
1
C
2
1 + 2
R
1
R
2
1
38
New 2D packing algorithm I
(1) use the algorithm by Steinberg to pack L into a strip of height
v 2OPT
Height
(L),
(2) guess approximately a value v
[v/2, v],
(3) use the 2D knapsack algorithm for the set of rectangles with
scaled height
h
i
= h
i
/v
, width w
i
and prot (or area)
p
i
=
h
i
w
i
.
39
2D packing algorithm II
(4) for v
with
OPT
Height
(L) v
(1 +)OPT
Height
(L)
there is a packing of all scaled rectangles into the square
[0, 1] [0, 1] with total area F 1,
(5) our 2D knapsack algorithm packs a subset R
R into the
rectangle [0, 1] [0, 1 +] with total prot
(1 )OPT
Profit
(L) = (1 )F,
The subset R \ R
,
(7) the packing of the scaled rectangles gives a total height of
1 + 2 + 1/v
.
Rescaling generates a total height of at most
(1 + 2)v
+ 1
(1 + 2)(1 +)OPT
Height
(L) + 1
(1 + 5)OPT
Height
(L) + 1.
41
Open questions
(1) is there an efcient algorithm A for the 2D packing problem with
A(L) a OPT
Height
(L)
and a < 2?
(2) is there an efcient algorithm B for the 2D packing problem with
B(L) (1 +)OPT
Height
(L) +b
and b < 1?
42