You are on page 1of 68

# Introduction Square Packing Hypercube Packing Summary

## Approximating the Orthogonal Knapsack Problem for Hypercubes

Rolf Harren
University of Dortmund

2007.09.07

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

## Input: d-dimensional cuboid items a1 , . . . , an

...

...

Objective: an orthogonal, non-rotational and non-overlapping packing into a given space such that...

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

## Multidimensional Orthogonal Packing Problems

B IN PACKING ...the number of bins is minimized
k=1 2 3

...

h

## K NAPSACK PACKING ...the prot of the packed selection of items is maximized

Rolf Harren

selection

... ...
Approx. the Orthogonal Knapsack Problem for Hypercubes

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

## Orthogonal Knapsack Packing for Hypercubes

Considered problem All items are squares, cubes or hypercubes 0 < a1 , . . . , an 1 Items have prots pi Bin has unit size

selection

...

...

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Results

## B IN PACKING 2- dim 3- dim d- dim 1.525..

APX-complete Bansal, Correa, Sviridenko

S TRIP PACKING AFPTAS Kenyon, Rmila 1.691.. open Hypercube S TRIP PACKING AFPTAS APTAS
Bansal, Han, Iwama Sviridenko, Zhang

## 3.382.. open Hypercube B IN PACKING APTAS Bansal, Correa,

Kenyon, Sviridenko

2- dim d- dim

APTAS

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Results

## B IN PACKING 2- dim 3- dim d- dim 1.525..

APX-complete Bansal, Correa, Sviridenko

S TRIP PACKING AFPTAS Kenyon, Rmila 1.691.. open Hypercube S TRIP PACKING AFPTAS APTAS
Bansal, Han, Iwama Sviridenko, Zhang

## 3.382.. open Hypercube B IN PACKING APTAS Bansal, Correa,

Kenyon, Sviridenko

2- dim d- dim

APTAS

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Results
K NAPSACK PACKING General 2- dim 3- dim d- dim 2+ 7+ APX-complete open
Jansen, Zhang Diedrich, H., Jansen Thle, Thomas
2d +1 2d

Hypercube 5 4 +
9 8

+ +

## Further results exist on

PACKING WITH LARGE RESOURCES , MAXIMIZING THE VOLUME , MAXIMIZING THE NUMBER ,

...

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Results
K NAPSACK PACKING General 2- dim 3- dim d- dim 2+ 7+ APX-complete open
Jansen, Zhang Diedrich, H., Jansen Thle, Thomas
2d +1 2d

Hypercube 5 4 +
9 8

+ +

## Further results exist on

PACKING WITH LARGE RESOURCES , MAXIMIZING THE VOLUME , MAXIMIZING THE NUMBER ,

...

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Open Question

NP-Completeness It is unknown for all previous packing problems whether the restriction to Hypercube packing is NP-hard for d 3.

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Applications

Cutting Problems All packing problems can be seen as cutting problems, e.g., cutting textile or wood Transportation Industry Arranging container on a ship Arranging items inside a container

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Applications

Cutting Problems All packing problems can be seen as cutting problems, e.g., cutting textile or wood Transportation Industry Arranging container on a ship Arranging items inside a container

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Applications

Advertisement Placement Arranging ads in a newspaper Arranging ads on a ash page Scheduling Bounded running time on a computer with a grid layout for the processors Tasks need a xed running time on a rectangular grid of processors

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Applications

Advertisement Placement Arranging ads in a newspaper Arranging ads on a ash page Scheduling Bounded running time on a computer with a grid layout for the processors Tasks need a xed running time on a rectangular grid of processors

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

NFDH

l4

N EXT-F IT-D ECREASING -H EIGHT (NFDH) is a very efcient layer based packing algorithm for small items

l3 l2 l1

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Gaps in a Packing

Lemma Given a packing P of m squares we can partition the free space into at most 3m rectangles
At least one item in P has to be aligned to the bottom of the bin

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Shifting Technique
L
... ...

dispose

L h
S1 S2 S3 S4

...

Si

...

Sl

w=1

Lemma For small items ai it is possible to free a given line L by shifting the items into a gap losing not more than O()p(I) of the prot.

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

Shifting Technique
L
... ...

dispose

L h
S1 S2 S3 S4

...

Si

...

Sl

w=1

Lemma For small items ai it is possible to free a given line L by shifting the items into a gap losing not more than O()p(I) of the prot.

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

## Rectangle Packing with Large Resources

If the bin is much bigger than the items we can derive a good approximation ratio Lemma There is an approximation algorithm for R ECTANGLE PACKING into a bin B = (a, b) where a = 1 and b 1 with approximation 4 ratio (1 + )
Idea: Bin has strip-like shape Pack a selection of items with the AFPTAS for S TRIP PACKING and apply a shifting technique to the overhang

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Problem Preparation

## Rectangle Packing with Large Resources

If the bin is much bigger than the items we can derive a good approximation ratio Lemma There is an approximation algorithm for R ECTANGLE PACKING into a bin B = (a, b) where a = 1 and b 1 with approximation 4 ratio (1 + )
Idea: Bin has strip-like shape Pack a selection of items with the AFPTAS for S TRIP PACKING and apply a shifting technique to the overhang

Rolf Harren

## Separation Large Items Small Items Everything

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Separation Large Items Small Items Everything

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation
A little bit technical... Separation Let r =
1

## and 0 = , i+1 = i4 for 1 i r

Divide (unknown) optimal solution Iopt Mi = {s Iopt : s [i+1 , i [} i {1, . . . , r } with p(Mi ) p(Iopt )

Rolf Harren

## Separation Large Items Small Items Everything

Separation

In a nutshell Large items are large (i.e., i ) Small items are small (i.e., < i +1 ) Medium items are unimportant (i.e., p(M) OPT(I)).

Rolf Harren

## Separation Large Items Small Items Everything

Separation

In a nutshell Large items are large (i.e., i ) Small items are small (i.e., < i +1 ) Medium items are unimportant (i.e., p(M) OPT(I)).

Rolf Harren

## Separation Large Items Small Items Everything

Separation

In a nutshell Large items are large (i.e., i ) Small items are small (i.e., < i +1 ) Medium items are unimportant (i.e., p(M) OPT(I)).

Rolf Harren

## Separation Large Items Small Items Everything

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

Enumeration

1 2 i

1 2 i

large

Rolf Harren

Enumeration

1 2 i

1 2 i

large

Rolf Harren

Enumeration

1 2 i

1 2 i

large

Rolf Harren

Enumeration

1 2 i

1 2 i

large

Rolf Harren

Unlled Volume

Packing of Lopt

Gaps in packing

NFDH

Small items

Rolf Harren

Unlled Volume

Packing of Lopt

Gaps in packing

NFDH

Small items

Rolf Harren

Unlled Volume

## Adding small items with N EXT-F IT-D ECREASING -H EIGHT

number of gaps unlled volume per gap

Unlled volume =

3m 3 3
1 2 i 1 2 i

i2

2 2i +1 2i4

Rolf Harren

## Separation Large Items Small Items Everything

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Separation Large Items Small Items Everything

3 Methods

Enough remaining space Several large items Only one very large item

Rolf Harren

## Enough Remaining Space Vol(Lopt ) 1 i

Guess Lopt
constant packing

Packing of Lopt

Gaps in packing
partition free space in 3|Lopt | gaps

## te ple ion com merat enu

Input I
separated by i selection with
2 FracKnap+ (S, V 2i )

NFDH

...

...

V 22

22

Rolf Harren

## Enough Remaining Space Vol(Lopt ) 1 i

Guess Lopt
constant packing

Packing of Lopt

Gaps in packing
partition free space in 3|Lopt | gaps

## te ple ion com merat enu

Input I
separated by i selection with
2 FracKnap+ (S, V 2i )

NFDH

...

...

V 22

22

Rolf Harren

## Enough Remaining Space Vol(Lopt ) 1 i

Guess Lopt
constant packing

Packing of Lopt

Gaps in packing
partition free space in 3|Lopt | gaps

## te ple ion com merat enu

Input I
separated by i selection with
2 FracKnap+ (S, V 2i )

NFDH

...

...

V 22

22

Rolf Harren

## Several Large Items

Guess Lopt
k items constant packing

Packing of Lopt

P1
complete enumeration

Lopt \ {ak }

Gaps in packing

Input I
separated by i

## partition free space in 3|Lopt |gaps

P2
selection with Knapsack(S, 1 Vol(Lopt ), ) NFDH

...

...

Rolf Harren

## Prot P1 k pk Prot P2 p(Lopt S ) pk

0.5

P1

P2

0.25

0.5

0.75

k max(P1 , P2 ) ( O( ))OPT(I) k +1

Rolf Harren

## Prot P1 k pk Prot P2 p(Lopt S ) pk

0.5

P1

P2

0.25

0.5

0.75

k max(P1 , P2 ) ( O( ))OPT(I) k +1

Rolf Harren

## Only One Very Large Item amax 1

S1

g2
amax

S4

S5 1 + amax

1 amax

g1

amax

amax

g1

S2

g2

S3

1 amax

1 amax

Use R ECTANGLE PACKING WITH L ARGE R ESOURCES for the free space

p(Lopt S ) (1 O( ))OPT(I)

Rolf Harren

## Only One Very Large Item amax 1

S1

g2
amax

S4

S5 1 + amax

1 amax

g1

amax

amax

g1

S2

g2

S3

1 amax

1 amax

Use R ECTANGLE PACKING WITH L ARGE R ESOURCES for the free space

p(Lopt S ) (1 O( ))OPT(I)

Rolf Harren

## Separation Large Items Small Items Everything

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Putting Everything Together

We derived methods for Case 1 Case 2 Case 3 Enough remaining space Several large items Only one very large item (1 O( ))OPT(I) k ( k +1 O( ))OPT(I) (1 O( ))OPT(I)

Rolf Harren

Main Idea

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Generalization

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

Generalization

## Methods for Hypercube Packing

Direct adoption of 2-dim methods With suitable separation parameters Case 1 Enough remaining space Case 2 Several large items work as well More work needed For Case 3 we need an approximation algorithm for O RTHOGONAL K NAPSACK PACKING WITH L ARGE R ESOURCES FOR H YPERCUBES with ratio (1 + ) if the bin is big enough

Rolf Harren

Generalization

## Methods for Hypercube Packing

Direct adoption of 2-dim methods With suitable separation parameters Case 1 Enough remaining space Case 2 Several large items work as well More work needed For Case 3 we need an approximation algorithm for O RTHOGONAL K NAPSACK PACKING WITH L ARGE R ESOURCES FOR H YPERCUBES with ratio (1 + ) if the bin is big enough

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Generalization

Wellstructured Packing
amax big enough
free of items

1
x3
space for

amax
x2 x1

Rolf Harren

Generalization

## Construction of a Wellstructured Packing

amax big enough
H2 H2 H1 H1

x3

amax

x2 x1

C
Rolf Harren Approx. the Orthogonal Knapsack Problem for Hypercubes

Generalization

## Packing the Small Items

Applying the algorithm for O RTHOGONAL K NAPSACK PACKING WITH L ARGE R ESOURCES FOR H YPERCUBES
S2 S1

S3
x3
space for

amax
x2 x1

Rolf Harren

Generalization

## Improving Approximation Ratio

Seven similarly large cubes cannot ll a cube bin almost completely In general For d-dim Hypercube Packing, we can reduce Case 2 with k < 2d to Case 1 or Case 3

Rolf Harren

Generalization

## Improving Approximation Ratio

Seven similarly large cubes cannot ll a cube bin almost completely In general For d-dim Hypercube Packing, we can reduce Case 2 with k < 2d to Case 1 or Case 3

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Outline
1

Introduction Problem Preparation Square Packing Separation into Large, Medium and Small Items Packing the Large Items Optimally Adding the Small Items Putting Everything Together Hypercube Packing Generalization Summary

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Summary
Result We developed an approximation algorithm with approximation 1 ratio 1 + 2d + for d-dimensional O RTHOGONAL K NAPSACK PACKING FOR H YPERCUBES Main Steps Separation of large, medium and small items Packing the large items Adding the small items Three similarly large squares cannot ll a square bin almost completely

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Summary
Result We developed an approximation algorithm with approximation 1 ratio 1 + 2d + for d-dimensional O RTHOGONAL K NAPSACK PACKING FOR H YPERCUBES Main Steps Separation of large, medium and small items Packing the large items Adding the small items Three similarly large squares cannot ll a square bin almost completely

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Practical application of this algorithm The running time is dominated by huge enumerations, making the algorithm practically unusable. Asymptotic behavior The structure of the problem does not allow asymptotic algorithms. Neither in the size of the input, nor in the value of an optimal solution.

Rolf Harren

## Introduction Square Packing Hypercube Packing Summary

Practical application of this algorithm The running time is dominated by huge enumerations, making the algorithm practically unusable. Asymptotic behavior The structure of the problem does not allow asymptotic algorithms. Neither in the size of the input, nor in the value of an optimal solution.

Rolf Harren

The End

Rolf Harren