Containment Algorithms for Nonconvex Polygons with Applications to Layout

The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters

Citation McIntosh Daniels, Karen. 1995. Containment Algorithms for Nonconvex Polygons with Applications to Layout. Harvard Computer Science Group Technical Report TR-12-95.

Citable link http://nrs.harvard.edu/urn-3:HUL.InstRepos:34310069

Terms of Use This article was downloaded from Harvard University’s DASH repository, and is made available under the terms and conditions applicable to Other Posted Material, as set forth at http:// nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of- use#LAA

Containment Algorithms for Nonconvex

Polygons with Applications to Layout

Karen McIntosh Daniels

TR

May

Center for Research in Computing Technology

Harvard University

Cambridge Massachusetts

Containment Algorithms for Nonconvex Polygons

with Applications to Layout

A thesis presented

by

Karen McIntosh Daniels

to

The Division of Applied Sciences

in partial fulllment of the requirement for the degree of

Do ctor of Philosophy

in the sub ject of

Computer Science

Harvard University

Cambridge Massachusetts

May

c

by Karen McIntosh Daniels

All rights reserved

Table of Contents

List of Figures

List of Tables

Introduction

Background

Containment Packing and Layout

Thesis Statement and Overview of Chapter

Overview of Containment Work

Related Work

Our Containment Work

Overview of Layout Work

Related Work

Convex Items

Nonconvex Items

Assignment

Our Layout Work

Pro ject Background

Compaction

Panel Placement

Trim Placement

Benchmarks

Contribution

Overview

I Translational Containment

Preliminaries

Introduction

Overview of Chapter

Notation

Hardness

The RestrictEvaluateSubdivid e Paradigm

Approach to Running Time Analysis

Related Work

Containment Characterization

Overview of Part One

Conguration Space Restrictions

Introduction

Overview

Notation

Prop erties of Valid Restrictions

Boundary Intersection

Lo ose Fits

Annular Conguration Spaces

Size and sAnalysis

Identical Items

SteadyState Geometric Restriction

Avnaim and Boissonnats Solutions to NN and NP

SteadyState Restriction

Running Time

Example

Eectiveness

SteadyState Restriction

Example

Eectiveness

Subset Restriction

Union Restriction

CharacterizationBased Restriction

Symmetry Breaking and Subset Substitution Restrictions

Closed Op erators

Summary and Conclusions

Evaluation and Sub division

Introduction

Evaluation

Sub division

Overview

Greedy Evaluation

Algorithm

Heuristics for Selecting u

ij

Comparing Heuristics for Selecting u

ij

Overlap Reduction Evaluation

Evaluation of a Restricted U

Sub division

Denition and Goals

SizeBased Metho d

CombinatoriallyBased Metho ds

DistanceBased Metho d

Summary and Conclusions

Algorithms

Introduction

Overview

An Approximate Containment Algorithm

Introduction

Analysis

Results

A Hybrid Containment Algorithm

Introduction

Results

Conclusion

Summary and Conclusions

II Applications of Containment to Layout

Preliminaries

Introduction

Overview of Chapter

Overview of Container Transformation Work

Overview of Minimal Container Work

Related Work

Our Minimal Container Work

Overview of Maximal Item Work

Our Maximal Item Work

Overview of Part Two

Limited Gaps

Introduction

Decomp osing the Container into Gaps

Overview

The Challenge of Constructing Gap Sets

Compaction

Partitioning Squares

Other Metho ds

Limited Gaps

Reachable Regions

Dening Limited Gaps using Probability of Interference

Ecient Computation of Limited Gaps

Breaking Polygons

Inking Polygons

MAAPRs

Summary of MAAPR Results

MAAPR Characterization and Naive Algorithm

Summary and Conclusions

Minimal Container Problems

Introduction

Overview

Strip Packing

Minimal Square Enclosures

Minimal Rectangular Enclosures

Tight Convex and Nonconvex Enclosures

Summary and Conclusions

Maximal Item Problems

Introduction

Overview

Maximally Scaled Items

An Elimination Technique

Randomized Subset Construction

Prepacking

Assignment Strategy

Results

Summary and Conclusions

III Conclusion and App endix

Conclusion and Future Work

Conclusion

Future Work

Containment

Applications of Containment to Layout

A Containment File Format

Bibliography

List of Figures

Translational containment problem for six items

The markermaking task in the apparel industry

B t A if and only if t A B

B t A if and only if t A B

Boundary intersection example the containment problem

Boundary intersection example two onecomp onent U s with U s

j

j

Boundary intersection example two twocomponent U s with U s

ij

ij

Boundary intersection example the containment problem

Boundary intersection example a onecomp onent U with U s

j

j

s Boundary intersection example a twocomponent U with U

ij

ij

An annular conguration space

Geometric restriction

SSGR containment problem place convex items

for the SSGR of U A onecomp onent U with U

j

j

A twocomponent U with U for the SSGR of U

ij

ij

A NN example with SSGR restriction

Lshap ed container and items

A NN example with average SSGR restriction

An infeasible CN example

A CC example with an unrestrictive container

A NC example with average SSGR restriction

A CC example with average SSGR restriction

U U U

A CC example with strong SSGR restriction

A highly restrictive NN example

A NN example eect of SSGR on two onecomp onent U s

j

Counterexample for A A A

Selected U s for NN example

ij

SSLPR containment problem place nonconvex items

Two twocomponent U s with U s for SSLPR of U

j

j

A onecomp onent U with U s for SSLPR of U

ij

ij

Eect of SSLPR on U s when a single comp onent of a U is selected

ij ij

Example for which SSLPR is more p owerful than SSGR

Regularization example

Two rectangles with degenerate intersection

CN example which do es not yield a common intersection of translated U s

j

No common intersection of translated U s

j

No common intersection after maximizing intersection

Common intersection after maximizing convexity of the union

Distancebased sub division

Common situation for p t t

j i

NN example time seconds

NN example time seconds

NN example time seconds

NN example time seconds

NN feasible example solved using partial characterization

NN example time seconds

NN example time seconds

Trim placement task

A partitioning square which fragments the container

A neck which is usable although items cannot pass through it

Algorithmic results for a variety of p olygon types

Edge contact types for a determining set

Slop e lemma

Parameter problems with two and three dep endent sliding contacts

Determining sets of contacts for the MAAPR

Limited gaps example

Incremental layout task

Lo ose layout

Final layout

Compaction solution

Minimal square enclosure for nonconvex items

Minimal square enclosure for items

Minimal square enclosure for nonconvex items

Tight rectangular enclosure for convex items

Tight rectangular enclosure for nearly identical nonconvex items

Tight rectangular enclosure for nonconvex items

Tight nonconvex enclosure for items

Scaling circles

Scaling up items in a greedy fashion

Scaling up items in an enhanced balanced fashion

Scaling up two items

Find a large subset which ts

A large subset which ts

Items and container for randomized construction task

Randomly constructed item group

Randomly constructed item group

Trim placement task for cmrk

FirstFit for cmrk

Assignment for cmrk

Assignment plus FirstFit for cmrk

Trim placement task for bmrk

FirstFit for bmrk

Assignment for bmrk

Assignment plus FirstFit for bmrk

List of Tables

SSGR applied to infeasible examples

Number of solutions found without sub division

Running times in seconds denotes infeasible example

Running time in seconds and number of hypotheses examined by approxi

mate algorithm

Number of hypotheses examined by sequential algorithm denotes infea

sible example

Number of hypotheses examined for identical items denotes infeasible

example

Exact vs approximate running times for CN examples calls each

Running times for feasible examples in seconds

Running times for infeasible examples in seconds

Number of hypotheses examined denotes infeasible example

Number of hypotheses evaluated for restriction options denotes infeasible

example

Number of hypotheses evaluated for infeasible problems no hypothesis re

striction

Prepacking results

Abstract

Layout and packing are NPhard geometric optimization problems of practical imp or

tance for which nding a globally optimal solution is intractable if PNP Such problems

app ear in industries such as aerospace ship building apparel and sho e manufacturing

furniture pro duction and steel construction At their core layout and packing problems

have the common geometric feasibility problem of containment nd a way of placing a set

of items into a container In this thesis we fo cus on containment and its applications to

layout and packing problems We demonstrate that although containment is NPhard it

is fruitful to develop algorithms for containment as opp osed to heuristics design

containment algorithms so that they say no almost as fast as they say yes use ge

ometric techniques not just mathematical programming techniques and maximize the

number of items for which the algorithms are practical

Our approach to containment is based on a new restrictevaluatesubdivide paradigm

We develop new theory and practical techniques for the op erations within the paradigm

The techniques are appropriate for twodimensional containment problems in which the

items and container may b e irregular ie nonconvex p olygons and have multiple com

p onents and in which the items may b e translated but not rotated Our techniques can

b e combined to form a variety of twodimensional translational containment algorithms

The paradigm is designed so that unlike existing iterationbased algorithms containment

algorithms based on the paradigm are adept at saying no even for slightly infeasible prob

lems Infeasible problems o ccur frequently in practice We present two algorithms based on

our paradigm We obtain the rst practical running times for NPcomplete twodimensional

translational containment problems for up to ten nonconvex items in a nonconvex container

Most of our examples are from apparel manufacturing Typically each item has from to

vertices and the container has from to vertices

We demonstrate that viewing containment as a feasibility problem has many b enets

for packing and layout problems For example we present an eective metho d for nding

minimal enclosures which uses containment to p erform binary search on a parameter Com

paction techniques can accelerate the search We also use containment to develop the rst

practical prepacking strategy for a multistage pattern layout problem in apparel manu

facturing Prepacking is a layout metho d which packs items into a collection of containers

by rst generating groups of items which t into each container and then assigning groups

to containers

Acknowledgments

My research has b een carried out under the sup ervision of my advisor Victor Milenkovic

Assistant Professor of Computer Science at Harvard who is now an Asso ciate Professor at

the University of Miami His guidance and supp ort of my research have b een sup erb I

gratefully acknowledge the advice provided by my entire thesis committee Professor Victor

Milenkovic Professor Fred Ab ernathy and Professor Harry Lewis In addition I thank

Professor Les Valiant who served on my qualier committee

This thesis research is part of a pro ject funded by the Sloan Foundation within the

Harvard Center for Textile and Apparel Research The principal investigator is Professor

Fred Ab ernathy who has help ed us forge relationships with industry Don Walker of the

Harvard Oce of Technology and Licensing has help ed us formalize our relationships with

industry Micro dynamics Inc and Gerb er Garment Technologies have help ed us transfer

our work to the apparel manufacturing industry

Sp ecial thanks are due to two former Harvard graduate students Dr Zhenyu Li of

GTE Labs and Dr Dan Roth Zhenyu Li was an integral member of our research team

while working on his dissertation at Harvard His comments on drafts of the thesis were

very helpful I am grateful to Dan Roth for his collab oration on nding the maximumarea

axisparallel rectangle in a p olygon

Our research team has involved a number of Harvard undergraduates over the years

Ra jarshi Bhattachyarya Lee Wexler Jacqueline Huang Jackie Chang Sanjoy Dasgupta

Venkatesh Reddy Shivashish Chatterjee Kirat Singh Eric Wilfrid Sanjay Madan Matt

LaMantia John Immel Ben Westbrook Ed Han and Iraklis Kourtidis I also thank future

Harvard student Umesh Shankar for his work while at the MIT Summer Research Institute

Administrative assistance from Carol Harlow Sheila Toomey Baiba Menke Pauline

Mitchell and the rest of the sta has b een wonderful The constant supp ort of the Aiken

computer systems sta has kept our machines up and running through years of research and

many demonstrations I convey longdistance thanks to Irina Kaliman at the University of

Miami for her supp ort of our software and for her translations of Russian layout work

On a p ersonal note I thank my family for their encouragement and patience my daugh

ters Theresa and Michelle and my husband Murray Daniels My mother Jane McIntosh

has also provided constant supp ort I dedicate this thesis to my husband Murray whose

user interface co de is an integral part of our pro jects software and whose love and supp ort

have made it p ossible for me to pursue this research

C h a p t e r

Introduction

Background

Many industrial problems involve placing ob jects into containers so that no two ob jects

overlap each other The general goal is to either minimize the size of the container or nd

a maximal collection of placed ob jects These problems are known by a variety of names

such as layout packing loading placement and nesting A number of industries apply

layout techniques when cutting new parts from sto ck material In apparel manufacturing

for instance pattern pieces are arranged on cloth The goal is to nd a nonoverlapping

arrangement which uses the least amount of cloth In sheet metal layout ob jects are cut

from metal sto ck sheets The goal here is typically to cut as many ob jects as p ossible from

a given sheet In sho e manufacturing each hide is a dierent shap e and the goal is to cut

as many ob jects from each hide as p ossible

Layout applications are not limited to cutting op erations nor to pro cesses where the

goal is to minimize the waste of material In VLSI layout for example rectangular mo dules

are arranged on a chip in such a way as to b est meet the two comp eting goals of minimizing

chip area and minimizing the length of interconnections b etween mo dules on the chip In

furniture layout an arrangement of furniture usually must satisfy a set of aesthetic criteria

When putting together a jigsaw puzzle the goal is simply to nd a feasible solution

Placement problems also app ear in rob otics The simplest problem is to nd a p osition

for a rob ot amidst a collection of obstacles This is generalized to planning a motion for

the rob ot through the obstacles This can b e further generalized to problems in assembly

planning in which motions must b e planned not only for the rob ot but also for parts which

the rob ot manipulates

People typically do not think of all of these problems as similar as they corresp ond to

entirely dierent elds of research However some work in rob ot motion planning and com

putational geometry has noted the corresp ondence b etween placement and motion planning

problems Cha CK AB Avn For example Avnaim Avn solves placement

and displacement motion planning problems noting that the former type is useful in

layout applications and the latter in rob otics The relationship b etween cutting packing

1

One p ossible maximality criterion is the number of ob jects Another is the total area of the ob jects

and motion planning was also observed by CuninghameGreen in a survey pap er CG

At their core all these problems have the common problem of containment nd a way of

placing a set of ob jects into a container

In this thesis we fo cus on containment and its applications to layout and packing prob

lems In Section we dene containment packing and layout and show how these form

a hierarchy of problems We also briey discuss the stateoftheart with resp ect to these

problems Section states our main thesis and provides an overview of the remainder

of this chapter

Containment Packing and Layout

In the rst part of Section we dene containment and show how it ts into a

hierarchy of layout and packing problems We then discuss how dicult these problems are

to solve their hardness and the current stateoftheart in solving them in the second

part of Section

Hierarchy of Problems

We dene containment as follows given a container a set of items and a set of al

lowable transformations of the items nd transformations of the items which result in a

nonoverlapping arrangement of the items within the container Figure shows an ex

ample of a twodimensional containment problem for six nonconvex p olygonal items and a

nonconvex p olygonal container consisting of the complement of some other already placed

items within the rectangle The items are pattern pieces from a layout problem in ap

parel manufacturing The pieces are allowed to translate but not rotate and so this is a translational containment problem

22 17 28 15

18 31 16 7 8 1 21 2

3 30 12 9 5 26 19 20 29 10 6

4 25 13

0 14 27 24

11 23

Figure Translational containment problem for six items

A packing problem is an extension of a containment problem Its solution is a non

overlapping arrangement that also optimizes some criteria applied to either the container

or the items Typically the goal is to either nd the minimal container into which a given

set of items t or to nd the maximal collection of items which t into a given container

A packing problem is therefore an optimization problem over a range of containers or

collections of items A containment problem considers only the feasibility of placing a given

collection into a given container Thus containment is the feasibility problem corresp onding

to the packing optimization problem

One example of a minimal container type of packing problem is the classical one

dimensional binpacking problem People often think of this as a sp ecialized twodimensional

packing problem for which a set of rectangular axisparallel bins and a set of rectangular

items are given The set of bins is innite the set of items is nite Bins and items all

have unit width Each item has height c where c is the common bin height The task

is to minimize the number of bins required to pack all the items using only translation

An example of the maximal collection of items type of packing problem is the three

dimensional task of cargo load planning for aircraft where the goal is to eciently utilize

the available threedimensional cargo space

The terms packing and layout are sometimes used interchangeably in the literature

Often however a layout problem refers to a packing problem which either has additional

constraints or multiple goals For example as mentioned earlier a VLSI layout problem

has the two comp eting goals of minimizing chip area and minimizing the length of intercon

nections b etween mo dules This type of problem also has constraints such as a requirement

to maintain a certain minimum separation b etween mo dules For other types of layout

problems the constraints are sometimes in the form of aesthetic criteria as in the case of

laying out furniture in a ro om

Denitions vary but we consider containment packing and layout to b e a hierarchy of

problems Loading generally refers to a sp ecic type of threedimensional layout problem

that arises in shipping In VLSI design placement is that asp ect of the layout task concerned

with the p ositions of mo dules whereas routing deals with interconnections b etween mo dules

The term nesting is asso ciated with packing tasks for irregularly shap ed items in particular

ones which can b e placed inside of others

StateoftheArt

Work on containment problems for small numbers of items three or fewer app ears

o ccasionally in the literature on computational geometry and has primarily b een motivated

by problems in rob otics Section gives a detailed account of this work

By comparison the literature on packing and layout problems is vast This work app ears

in the literature on management sciences engineering sciences information and computer

science mathematics and op erations research Section reviews this work which

employs a broad range of techniques

For rectangular shap es the layout and packing literature and algorithms are well

developed For example some sp ecial types of rectangular problems lend themselves to

linear andor in particular when guillotine cuts are used exclu

sively DD Groundbreaking work in this area was done in the s by Gilmore and

2

One p ossible minimality criterion is area

3

A guillotine cut is a horizontal or vertical cut which completely partitions the remaining material

Gomory GG There also exists a rich literature on binpacking for rectangles that con

tains much theoretical work on the eectiveness of simple heuristics JGJ

For irregular shap es packing and cutting algorithms have yet to match human p erfor

mance In industry such problems are usually solved either by humans or by computer

based heuristics Exp ert humans construct nearly optimal layouts in some domains One

very large clothing company has humans create layouts p er week averaging ab out

hours of lab or for a layout of items The automatic generation of pro ductionquality

layouts of irregular items is an active area of research

What is primarily missing from work on packing and layout is the ability to quickly

detect an infeasible problem that is to say no to the containment question Infeasible

problems arise frequently in practice and this shortcoming signicantly limits the types of

techniques which can b e used in layout and packing

Saying no is dicult Except in the simplest of cases heuristics and even humans

cannot detect infeasibility For instance the example in Figure is not obviously in

feasible A human could try for a long time to place the items but would never succeed

Furthermore this failure would not constitute a pro of of infeasibility until every p ossible

p osition had b een tried

Containment in its most general form is NPhard and therefore computationally in

tractable if PNP Current containment algorithms have worstcase running times which

are exp onential in the number of items b eing placed Furthermore current containment

algorithms attain their worstcase running times when faced with any infeasible problem

Multiple resolution techniques for approximating p olygonal b oundaries can b e used to im

prove the ability to say no However algorithms using these techniques still p erform

slowly when faced with problems which are just barely infeasible Figure is an example

of such a problem This type of problem arises frequently in practice b ecause a tight packing

is the goal of a packing problem

Another shortcoming of current practical containment algorithms is that they place at

most three items Why has the computational geometry community not pro duced practical

containment algorithms for larger numbers of items Since containment is NPhard p erhaps

their view is that computational geometry techniques are not p owerful enough for such

problems and that mathematical programming techniques oer the only chance for success

Thesis Statement and Overview of Chapter

This thesis provides twodimensional translational containment algorithms which over

come b oth of the disadvantages of existing containment algorithms Our algorithms are

designed to place an arbitrary number of items The algorithms can say b oth no and

yes quickly They do not necessarily p erform more slowly on slightly infeasible inputs

One of our algorithms is practical for up to ten items The implementation of the other

algorithm is currently fast for up to four items The slowness of our current implementation

of p olygon set op erations makes this algorithm slow for more than four items The ability

to solve containment for up to ten items is p owerful Previously unsolved packing and lay

out problems for hundreds of items can now b e solved using containment as the feasibility

4

In this case the problem is infeasible and the global overlap minimum is small but nonzero

5

Our examples are drawn primarily from the apparel industry Each item is represented as a p olygon

which typically has from to vertices The container is also represented as a p olygon it typically has

from to vertices The items and container may b e nonconvex

oracle inside other metho ds

Our ability to say no well comes primarily from our new geometric techniques Our

ability to say yes for so many items is partly due to our geometric techniques and partly

due to our application of and improvements to existing linear programmingbased tech

niques Thus we demonstrate that a computational geometry approach can contribute

signicantly to practical algorithms for NPhard geometric problems

Our main thesis is that although containment is NPhard it is fruitful to develop

algorithms for containment as opp osed to heuristics design containment algorithms so

that they say no almost as fast as they say yes use geometric techniques not just

mathematical programming techniques and maximize the number of items for which the

algorithms are practical

The remainder of the thesis is divided into two main parts Part I describ es our work

on containment algorithms Part II presents applications of containment to layout The

applications validate our approach to containment

The remainder of this chapter is organized as follows Section discusses work from

the containment literature and then gives an overview of our own work on containment

Section describ es work from the layout literature and discusses our applications of con

tainment to layout problems Section describ es the research pro ject which has motivated

the work in this thesis Section discusses b enchmarks Section highlights the main

contributions of the thesis Finally Section provides a road map for the remainder of

the thesis

Overview of Containment Work

Containment problems are in general NPhard As we show in Section containment

is NPcomplete if the items are allowed to translate but not rotate Part I of the thesis

discusses our work on the NPcomplete twodimensional translational containment problem

for p olygons The p olygons and container may b e nonconvex We present new theory

leading to practical algorithms for up to ten p olygons

The following two subsections provide an overview of related work on containment and of

our work on containment Section surveys the literature on containment Section

summarizes our work on containment

Related Work

The term containment app ears as early as in a seminal pap er by Chazelle on two

dimensional p olygon containment Cha Subsequent work on containment has app eared

in literature on rob ot motion planning computational geometry and op erations research

The layout and packing communities do not seem to use this containment work Either they

are unaware of it or they have encountered diculties when implementing it In layout

the equivalent problem is sometimes called arrangement

The next two parts of this subsection survey related work on containment The rst part

discusses work on rotational containment The second part treats work on translational

6

Some of the containment research has fo cused more on combinatorial issues than on implementation

details and so this is not surprising

7

The term arrangement has a very dierent meaning in the computational geometry community

containment For these discussions we assume that the container is a p olygon with n

vertices and that a p olygonal item to b e placed has at most m vertices

Rotational Containment

Chazelle Cha considers tting a single p olygon P into another p olygon C where

b oth translation and rotation of P are allowed He observes that if one only seeks a single

solution it suces to examine stable placements of P in C for which P s three degrees of

freedom are removed He gives an Omn time algorithm for solving the problem when C

is convex and an Om n time algorithm if C is convex and only translations are allowed

He gives a naive algorithm for the general case requiring Om n m n logm n time

Avnaim Avn and Avnaim et al AB give an Om n log mn time algorithm for a

single nonconvex p olygon in a nonconvex container Their algorithm yields al l the solutions

Grinde and Cavalier GC use mathematical programming to solve the rotational

containment problem for a convex p olygon in a convex container Their algorithm requires

Obmn time where b is the number of twocontact sets obtained as P rotates through

As b Om n when the p olygon and container are convex their algorithm requires

Om n mn time

Translational Containment

In order to discuss related work on translational containment we use the conguration

space concept from rob otics In rob otics a p oint in the conguration space is a cong

uration The comp onents of the conguration are the values of the joint angles and any

other parameters necessary to sp ecify the rob ot p osition and orientation For our approach

as in AB Avn Dev an essential type of conguration space is the set of rela

k

tive positions for a pair of p olygons For k p olygons and one container there are

such conguration spaces A conguration in this type of conguration space is a k

tuple t t t where t is a translation of the ith p olygon and t is a translation of

k i

the container usually set to If applying these translations to the p olygons yields a

nonoverlapping arrangement the k tuple is a valid conguration

In the following discussion we use a shorthand notation to describ e various types of

translational containment problems The shorthand is based on the two denitions b elow

Denition The kNN problem is that of nding a valid conguration of k noncon

vex polygons in a nonconvex container Variations replace N with either C convex R

rectangle or P parallelogram

Denition The rkNN problem is that of nding al l subsets of size k out of a set of

r nonconvex polygons such that the k polygons can be simultaneously placed in a nonconvex

container The variations of Denition apply

We know of at least one industrial solution to translational containment and it is used

in an interactive setting That solution app ears to b e based on inner and outer approxi

mations of p olygonal b oundaries and the running time increases with the tightness of the

t Published algorithms for translational containment for small k have asymptotic running

times which tend to dep end on a high p ower of n For arbitrary k and nonconvex p olygons

and container the only known algorithms have running time which is exp onential in k This

is not surprising since k NN is NPcomplete

k

A naive k NN algorithm requires Ok mn log mn time It searches for a valid

conguration by iterating over all choices of k contacting vertexedge pairs among the

p olygons and container More details app ear in Section The naive algorithm has

k

running time in mn b ecause it must iterate over all p ossible choices of contacts

whenever the problem is infeasible

Fortune For gives a solution to CN by computing the Minkowski sum using a gen

eralized Voronoi diagram This Omn log mn result is an improvement over the On

mn log mn time algorithm for CN given by Baker et al BFM Avnaim and Bois

sonnat AB Avn use the Minkowski sum and convex decomp osition to solve NN and

NN and Avnaim Avn gives an algorithm for NN which iterates over the edges of the

conguration space p olygons Devillers Dev gives faster algorithms for CN and CN

These running times are summarized b elow

k k CN k NN

Omn log mn For Om n log mn AB Avn

Om n log m Dev Om n log mn AB Avn

Om n log m Dev Om n log mn Avn

Avnaim and Boissonnat also give a solution to the NP problem three nonconvex p oly

gons in a parallelogram container using time in Om log m AB Avn Their NP

algorithm is based on p olygon unions intersections and Minkowski sum op erations Even

though the asymptotic running time of the NP algorithm contains a p olynomial whose

degree is high compared to the others in practice the NP algorithm is faster than the NN

algorithm which is in turn faster than the naive algorithm We defer further discussion of

this until Section Unfortunately Avnaim shows that there is no formula for a solution

to NN purely based on p olygon union intersection and Minkowski sums Avn This

means that for k any k NN algorithm must use iteration over edges or sub division

or some technique other than set op erations on p olygonal regions The fact that Avnaims

algorithm for NN uses iteration gives it the m n lower b ound

Milenkovic et al DML oer three approaches to translational containment The

rst metho d op erates on convex p olygons It iterates over combinations of orientations for

the lines which separate the convex p olygons This approach yields an algorithm for CN

with running time in Om n log mn an improvement of a factor of On over previous

algorithms in particular Dev The second metho d uses a MIP mixed integer pro

gramming mo del for k NN This approach is describ ed in detail in Li It takes one or

two minutes on a typical workstation for two or three p olygons but is slow for four or more

p olygons it can easily take more than an hour to detect an infeasible CN problem The

third metho d is an algorithm for k NN which nds an approximate conguration using

k

time in O k s log s where s is the maximum number of vertices in a p olygon log

8

For p olygons A and B the Minkowski sum is dened as A B fa b j a A b B g See Section

for more details

9

For an approximate conguration no p oint of any p olygon is more than inside of the b oundary

of any other p olygon when the p olygons are laid out according to the conguration For some cutting

application s CAD vendors round p olygon vertex co ordinates to integers In such cases an overlap of up to

one unit corresp onding to inches is acceptable

which is created through successive applications of a certain collection of p olygon set op er

ations see the discussion of size analysis in Section This algorithm is introduced in

DM DM and app ears in Chapter of this thesis

Milenkovic Mil DM improves up on the CN algorithm of DML by giving an

algorithm which has the same asymptotic running time but is simpler to implement He also

introduces an exact k NN algorithm based on linear programming and approximation and

k

sub division of the conguration spaces which runs in Omn LP k Ok mn k m

time where LP a b is the time to solve a linear program with a variables and b constraints

This algorithm is practical for k

Our Containment Work

Existing twodimensional translational containment algorithms developed by other re

searchers are practical only for k We present new theory leading to algorithms which

handle any k One of our algorithms is practical for k the implementation of the

other algorithm is currently fast for k As stated in Section our examples are

drawn primarily from the apparel industry Each item is represented as a p olygon which

typically has from to vertices The container is also represented as a p olygon it

typically has from to vertices The items and container may b e nonconvex Under

these conditions we can solve containment problems quickly typically in several minutes

or less on a MHz SPARCstation Our work is therefore practical for solving a number

of layoutrelated problems for nonconvex p olygons

Although containment is NPhard in general we b elieve that it is valuable to make the

practical value of k as large as p ossible Thus we continue the b ottomup progression

CC NN CN NN etc of containment work which has taken place in rob otics and

computational geometry Our ability to say no well comes primarily from the use of our

new geometric techniques Our ability to say yes for so many items is partly due to our

geometric techniques and partly due to our application of and improvements to existing

linear programmingbased techniques Thus we demonstrate that a computational ge

ometry approach can contribute signicantly to practical algorithms for NPhard geometric

problems

Saying no quickly is imp ortant Iterationbased algorithms for containment attain

their worstcase running time when the containment problem is infeasible This situation

o ccurs frequently in practice We replace iteration with sub division Our algorithms are

sp ecically designed to detect infeasibility quickly and we have some theoretical justication

for their b ehavior which we discuss in more detail later in the thesis

We present a new paradigm for containment algorithms Our containment algorithms

apply three op erations in order to the conguration spaces restriction which prunes

the spaces and helps detect infeasibili ty evaluation which tries to nd a solution and

sub division which partitions one of the conguration spaces into two parts The algorithm

then recurses on each part while keeping the other conguration spaces constant

We introduce new theory and practical techniques for each of these types of op era

tions for the case of twodimensional containment problems in which the items and con

tainer may b e irregular ie nonconvex and have multiple comp onents and in which

10

SPARCstation is a trademark of SPARC International Inc licensed exclusively to Sun Microsystems

Inc

11

We use the CPLEX linear programming system CPLEX Optimization Inc

the items may b e translated but not rotated Our techniques can b e combined in vari

ous ways to form twodimensional translational containment algorithms which follow the

restrictevaluatesubdivide paradigm The paradigm is designed so that unlike existing

iterationbased algorithms containment algorithms based on the paradigm are adept at

saying no even for slightly infeasible problems

At present there app ear to b e two approaches to containment within the restrict eval

uatesub divide framework direct and indirect Direct metho ds act on the conguration

spaces directly and these metho ds tend to b e based on computational geometry Indirect

metho ds act on convex approximations to the conguration spaces either inner or outer

approximations Indirect metho ds use linear programming or other types of mathematical

programming which is why they can only act on convex approximations Direct metho ds

have a more accurate view of the world but they can only op erate on a few three in

our case conguration spaces at a time Indirect metho ds can act on all the congura

tion spaces simultaneously in a single op eration but they use only approximations to the

conguration spaces

The thesis presents two new algorithms based on our paradigm They are briey de

scrib ed b elow The rst is a direct algorithm We call the second a hybrid algorithm b ecause

it uses an indirect evaluation metho d and b oth direct and indirect metho ds for restriction

Direct Algorithm

This thesis presents a new direct algorithm for containment It is an approximate

algorithm which pro duces an approximate conguration whose overlap is b elow a given

tolerance As mentioned earlier for some cutting applications CAD vendors round p olygon

vertex co ordinates to integers In such cases an overlap of up to one unit corresp onding

to inches is acceptable Our approximate algorithm uses our new direct techniques for

restriction evaluation and sub division It app ears in DM DM as well as in Section

Our direct restrictions are based on p olygon set op erations and so we call them geometric

restrictions They are p owerful to ols for detecting infeasibili ty We dene two general types

of restrictions valid restrictions which preserve all solutions to a containment problem and

semivalid restrictions which preserve a single solution if one exists We present a variety

of restrictions and several general prop erties of valid restrictions We examine in detail the

eectiveness of our geometric restrictions which are valid restrictions Our characterization

of the types of containment problems for which these restrictions are eective is based on

theoretical as well as exp erimental results

The evaluation metho d uses restriction together with a geometric metho d for maximizing

the intersection of translations of the conguration spaces The evaluation metho d often

nds a containment solution without any sub division The sub division metho d is a size

based one Its goal is to partition a conguration space into two parts each smaller than

the unsub divided conguration space

Our approximate algorithm has an extra layer of structure on top of the restrictevaluate

sub divide paradigm This layer has a set of containment subproblems to which course

grained parallelism could b e applied in the future We create the subproblems by charac

terizing a valid conguration for translational containment

The current implementation of this algorithm is fast for up to four items For k

the current implementation of our geometric restrictions based on p olygon set op erations

slows the algorithm down considerably Increasing the sp eed of our p olygon set op erations

is a sub ject of future work see Section In our exp eriments our approximate

algorithm p erforms fewer sub divisions than the faster hybrid algorithm and so we b elieve

the approximate algorithm has the p otential to b e comp etitive with the hybrid algorithm

Hybrid Algorithm

In addition to our direct algorithm we also present signicant improvements to the

restriction evaluation and sub division techniques of Milenkovics exact k NN algorithm

Mil which is an indirect algorithm Milenkovics indirect algorithm in its original form

was slower than our direct algorithm for infeasible problems and its practical upp er b ound

on k was k The improved indirect algorithm is currently our fastest containment

algorithm for k

Our rst improvement to the indirect algorithm is a pro of that restrictions when used

in the indirect algorithm do not increase the algorithms worstcase running time if the

algorithm bases certain decisions on the unrestricted conguration spaces This is imp ortant

b ecause restrictions can add vertices to the conguration spaces and so they might have

increased the worstcase running time The pro of allows us to add our new direct geometric

restrictions to the algorithm without increasing the worstcase number of sub divisions It

also allows us to apply a new linear programmingbased restriction metho d developed by

Milenkovic

The second improvement to the indirect algorithm is related to the evaluation metho d

We apply the work of Li and Milenkovic on overlap resolution Li ML LMc LMa

to improve the evaluation step Their overlap resolution algorithm is an indirect algorithm

It uses inner convex approximations an approach which complements the outer approxi

mations of the indirect containment algorithm Our third improvement is our new practical

sub division technique which attempts to maximize the distance from the current evaluation

to the convex approximations of the sub divided conguration spaces

We call the resulting algorithm a hybrid algorithm b ecause it uses indirect metho ds

for evaluation developed by Li and Milenkovic and b oth direct and indirect metho ds for

restriction The hybrid algorithm is describ ed in MD as well as in Section

The hybrid algorithm in addition to b eing a formidable containment algorithm has

the prop erty that a partial containment solution from it is valuable This is b ecause each

evaluation step pro duces either a nonoverlapping solution or an overlapping conguration

for which a linear program has reached a lo cal minimum As a result the hybrid algorithm

when terminated early is the most p owerful heuristic known for generating a lo cal overlap

minimum

Overview of Layout Work

Part I I of the thesis discusses our application of containment to layout problems Layout

and packing are NPhard problems for which nding a globally optimal solution is gener

ally intractable The more restricted problem of packing squares onto a rectangle without

rotation as in VLSI applications is NPcomplete Rectangle packing is also NPcomplete

when rotation is not allowed even for the onedimensional binpacking problem JGJ

In general translational packing is NPcomplete

In this section we survey related work in layout and then describ e our applications of

containment to layout Section discusses related work at a high level Section

reviews work on layout of convex items Section treats work on nonconvex items

Related Work

Work on layout is spread across a broad range of literature Relevant areas include

Dyc management sciences engineering sciences information and computer science

mathematics and op erations research

Work on layout cutting packing loading and nesting has b een surveyed in Hin

SP Dyc DF DD DD Sweeney and Paternoster give an applicationoriented

bibliography for cutting and packing problems in SP Dowsland and Dowsland survey

research on packing problems in DD In DD the same authors review work on irregular

nesting problems emphasizing the dierent types of approaches which have b een taken

Dyckho analyses the structure of cutting and packing problems and presents a classication

in Dyc this forms the basis for Dyckho and Finkes metasurvey for cutting and packing

literature DF

In DF Dyckho and Finke distinguish four ma jor types of cutting and packing

problems based on the way items are assigned to containers and on the assortment of items

They observe that in the layout literature problems of the same type tend to b e solved using

the same technique The four types are binpacking in which heterogeneous items are

assigned to a selection of containers cutting sto ck which is similar to binpacking but the

items can b e partitioned into a small set of equivalence classes based on shap e knapsack

in which all the containers must b e used and the items are heterogeneous and pallet

loading in which all the containers must b e used but the items are homogeneous These

binpacking and knapsack denitions are more general than typical usage in the literature

Because of their diculty binpacking problems are typically solved suboptimally using

fast simple heuristics such as FirstFit The small number of distinct shap es involved in

cutting sto ck problems often allows them to b e solved using rep eating patterns Knapsack

problems are frequently solved using branchandbound or dynamic programming For a

pallet loading problem the containers are often homogeneous In this case a solution for

one container can b e applied to all the others

Layout techniques cover a wide range of metho ds In some cases exact techniques from

mathematical programming such as linear or dynamic programming are appropriate for

all or part of the problem Integer and mixed are still considered

to o slow for even mo derate sized problems Some researchers are exp erimenting with AI

approaches such as heuristic search knowledgebased systems casebased reasoning and

neural networks Other researchers use improvement strategies based on metaheuristics

such as genetic algorithms and Other techniques in

clude databasesubstitution greedy heuristics Monte Carlo placement lattice packings

and clustering metho ds

Our discussion of layout work treats only twodimensional layout problems b ecause the

containment problem we solve is twodimensional We b egin in the rst part of Section

with the simplest of situations in which the items are rectangular Next we consider

arbitrary convex items in the second part of Section Section discusses nonconvex

items The amount of published research on nonconvex items in nonconvex containers is

quite small compared with the amount of research on convex items Finally we discuss in

12

Tabu search is a usually deterministic neighborho o d search technique with mechanisms for managing

restrictions on tab o o regions of the search space and for keeping historical information Ree

Section how the layout literature treats the assignment problem that is the problem

of assigning items to dierent comp onents of a container The assignment problem is a

combinatorial optimization problem which can arise as a subproblem of containment when

the container consists of multiple nonidentical comp onents

Convex Items

Here we review layout literature related to convex items The rst part of Section

surveys work on rectangular items and the second part of Section discusses work on

convex items which need not b e rectangular

Rectangular Items

Dyckho Dyc observes that most problems in the cutting and packing literature

deal with shap es which can b e sp ecied using a small number of parameters such as the

rectangle Research into problems for which b oth the container and items are rectangular

is reviewed in DF DD JGJ

Coman et al JGJ survey approximation algorithms for binpacking The survey

fo cuses on approximation algorithms which are eective in practice and simple enough so

that their worstcase or averagecase p erformance has b een analyzed in the literature These

include for example FirstFit NextFit BestFit and their variations Onedimensional

binpacking was dened ab ove in Section In twodimensional strippacking a semi

innite vertical strip of unit width is given along with a set of rectangular items of width

The goal is to pack items on the strip while minimizing the height of the strip The

classical twodimensional binpacking problem JL is a variant on strippacking in which

horizontal b oundaries are added to the strip at integer heights Few published analyses

exist for the case where the bins are not identical

Israni and Sanders IS present heuristics for packing nonidentical rectangles One

uses decreasing length p erp endicular strip placement DLPER and another uses decreas

ing height p erp endicul ar strip placement DHPER These heuristics essentially place the

rectangles in nested Lshap ed strips In IS Israni and Sanders compare the p erfor

mance of DLPER and DHPER with other binpacking heuristics

Some sp ecial cases of rectangular twodimensional packing for cutting sto ck problems

lend themselves to linear andor dynamic programming for example when guillotine cuts

are used exclusively DD Gilmore and Gomory GG solve some restricted types of

guillotine cutting problems using a linear programming formulation whose sp eed relies on

solving knapsack problems the knapsack problems can b e solved using dynamic program

ming Dagliand TatogluDT observe that if each item has a weight and if at least one

dimension of the items and containers is equal the twodimensional problem reduces to a

onedimensional single container problem which can b e solved with dynamic programming

13

An for an optimization minimization problem has the prop erty that the

value of its output is times the optimal minimum value This is dierent from the denition of an

approximate algorithm in which the solution generated by the algorithm is accurate to within a tolerance

For example a containment algorithm which pro duces an approximate conguration is an approximate

algorithm b ecause the conguration may contain small overlaps

14

We remind the reader that a guilloti ne cut is a horizontal or vertical cut which completely partitions

the remaining material

In AA Adamowicz and Albano lay out rectangles by rst forming candidate strips

and then selecting a subset of candidate strips using dynamic programming Haims and

Freeman HF also use dynamic programming to place rectangles they use linear pro

gramming and twodimensional dynamic programming and take a multistage approach

Convex Items

Nonrectangular packing results have app eared primarily for problems that pack identi

cal copies of a convex p olygon It is well known that the densest packing by translates of a

convex p olygon is given by a lattice packing Rog In a lattice packing the p olygons are

placed at p oints on a lattice A lattice is determined by two linearly indep endent vectors a

p oint on the lattice is an integral linear combination of the two vectors The densest lattice

packing of an nvertex convex p olygon can b e found in On time MSb A doublelattice

packing is the union of two lattice packings such that a rotation of either of the two lattice

packings by pro duces the other lattice packing The densest doublelattice packing can

b e found in On time for any convex p olygon that is allowed to rotate by Mou The

p

density of such a packing is KK Dori and BenBassat DBB show how to

nd an appropriate circumscribing hexagon for a convex p olygon in order to nd a lattice

packing

Nonconvex Items

Dowsland and Dowsland DD survey work on irregular nesting problems highlighting

the dierent types of approaches which have b een taken No fast high quality solutions

have emerged to date for layout problems involving a variety of nonconvex items Many

algorithms for packing nonconvex ob jects are unpublished QS suggests this may b e

due to commercial condentiality Published work with nonconvex items app ears to b e

narrowly fo cused on the particular application under consideration

Published metho ds for packing nonconvex ob jects can b e classied as in AS as

indirect or twostage where nonconvex items are rst enclosed in convex p olygons and

techniques for packing convex ob jects are then applied and direct where the nonconvex

p olygons themselves are manipulated In the following discussion we restate more gen

erally in terms of clustering an item or collection of items is replaced by an approximation

and placement is p erformed on the approximations We further sub divide as follows a

prepro cessing clustering o ccurs only as a prepro cessing step and b integration clustering

is integrated into the layout algorithm

Clustering

Prepro cessing One p opular prepro cessing metho d encloses p olygons in rectangles The

advantage of this is the abundance of literature on packing rectangles the disadvantage is

that the resultant waste typically makes this approach unacceptable in practice For rect

angular containers Adamowicz and Albano AA Haims and Freeman HF Amaral

et al ABJ Dagli and Tatoglu DT and Bailleul et al BTS pack nonconvex

items into rectangles to form comp osite items and then place the rectangles In AA

Adamowicz and Albano give an algorithm for pairwise clustering of irregular shap es in a

15

Packing density is the ratio of used area to total area

rectangle and describ e limited clustering options for more than two items They assume the

shap es can rotate The rectangles are placed in strips using dynamic programming Linear

andor dynamic programming are not p erceived as feasible options unless nonconvex items

are enclosed rst within rectangles Amaral et al ABJ adopt the approach of AA

for clustering items

Bohme and Graham BG enclose each item within another p olygon and then use

Monte Carlo metho ds to place each p olygon onto rectangular metal plates It has b een

suggested that a nonconvex p olygon b e approximated by its convex hull if the waste is not

to o large CG DBB If the waste is large Dori and BenBassat DBB suggest that

small groups of nonconvex items b e combined into a convex ob ject and then convex packing

techniques can b e applied This approach is also followed by Karoupi and Loftus KL

However this leaves op en the problem of how to combine nonconvex items automatically

into a convex or nearly convex one Heistermann and Lengauer HL observe that it is

not known what conditions a comp osite part must satisfy in order to b e useful in nesting

If the comp osite convex ob jects are dierent from each other is not clear that algorithms

for packing nonidentical convex ob jects have advanced enough to make such an approach

practical DD

If a large set of nonconvex items to b e placed on a rectangle or rectangular strip

contains many identical items an ecient layout can often b e created using rep eating

patterns For some item shap es lattice or doublelattice packings are appropriate However

it is not necessarily true that the densest packing of identical nonconvex p olygons is lattice

based BK

Prasad and Somasundaram PS and Babaev Bab follow the rep eating pattern

approach for nesting sheetmetal blanks They form an ecient cluster of items then build

a rep eating pattern Ismail and Hon IH use a genetic algorithm to cluster two similar

shap es together

To reduce waste an indirect metho d can approximate each p olygon using a collection

of p olygons For example Qu and Sanders QS approximate nonconvex items by non

overlapping rectangles then use a greedy layout algorithm to arrange the rectilinear items

into layers of descending staircase patterns They assume the container is a set of rectangular

sto ck sheets

Tanaka and Wachi TW place horizontally convex approximations of garment pieces

on a rectangular strip using heuristic search They rep ort material waste of to

Nakajima and Hayashi NH improve up on the algorithm of TW using several tech

niques they obtain slightly less waste than TW

Heistermann and Lengauer HL use a exible approximate representation for noncon

vex items and a nonconvex container To compute the approximation they rst construct

a set of triangles along the b oundary then iteratively smo oth the contour selecting at each

step the smallest area triangle This technique could b e used in our containment work

Integration Some work rests on the observation that go o d lo cal nesting often pro duces

go o d global nesting Dagli and Tatoglu DT cluster pairs of items in a greedy fashion

They rst cluster two items make them a unit cluster this unit with another item and so

on Babaev Bab also places nonidentical nonconvex items this way Dighe and Jakiela

DJ present a hierarchical genetic algorithm The algorithm uses a binary tree in which

each item together with values for its three parameters x y and constitutes a leaf and

a no de represents a search for the minimal enclosing rectangle of its two children Thus

the genetic algorithm seeks the b est binary tree for a set of items They note that genetic

algorithms rely on the hypothesis that combining two go o d building blo cks leads to another

go o d building blo ck

Milenkovic et al MDL take advantage of the largesmall item dichotomy and

natural equivalence classes in pants layout problems To place large items they build

column clusters of four items and form a gridlike layout consisting of a set of columns An

algorithm based on dynamic programming and allowing backtracking adds one column at

a time to the layout The technique of clustering items into columns also app eared in the

work of Gurel at IBM in the s Gurb Gura Gur

Heckmann and Lenguaer HL use dynamic approximations for items As temp erature

decreases in their simulated annealing pro cess they use tighter approximations They

rep ort that this approach can reduce running time by up to This idea of using tighter

approximations later in the pro cess is similar to the use of convex hulls in Mil and in

our hybrid containment algorithm as sub division pro ceeds the convex hulls b ecome b etter

approximations to the sub divided p ortions of the conguration spaces

Direct

Dealing directly with an assortment of nonconvex p olygons is an extremely dicult

problem If many items are similar in shap e and size it can b e useful to partition the set

of items into equivalence classes For example if a largesmall item dichotomy exists it is

common to place all the large items rst and then place the small ones Bab MDL

ABJ

In some applications the problem denition sp ecies equivalence classes For woo d

OF and sheetmetal cutting PS BG Bab there is often more than one copy of

each item and so an equivalence class might contain all identical items Items in apparel

manufacturing are usually similar in shap e and size b ecause a layout typically contains a

mixture of sizes for the same garment style Heistermann and Lengauer HL use topology

classes of nonconvex p olygons to help select the next item to b e placed on a leather hide

using a greedy strategy One of the ways Nakajima and Hayashi NH improve up on the

algorithm of Tanaka and Wachi TW is to apply the Group Technology manufacturing

principle to classify items according to a criterion such as size Group Technology is dened

by Mo on and Kao MK as a manufacturing principle and practice of identifying simi

larities among diverse parts forming part families classifying new parts into part families

and eciently storing and retrieving information ab out part families See HW for more

details We note that grouping together similar items can have b enets for containment

see the discussion of symmetry breaking and subset substitution restrictions in Section

Some of the earliest work in direct placement of nonconvex items was done by IBM

and used a greedy approach to placement see for example MH An early nongreedy

approach was taken by Adamowicz Ada Albano and Sappup o AS note that the

exp erimental system in Ada involves iterative application of linear programming For

problems of nontrivial size techniques of mathematical programming have b een viewed as

to o slow even in cases where they can b e applied Integer and mixed integer formulations

for exact solutions have to date led to programs whose running time is unacceptably

slow AI and metaheuristic techniques can pro duce layouts with low waste but again at

the cost of much computation time eg several hours even for or items

Some researchers are exp erimenting with AI approaches such as heuristic search case

based reasoning knowledgebased systems and neural networks For example the Clavier

system describ ed in HT uses casedbased reasoning to arrange comp osite parts in a

convection auto clave oven for a curing pro cess Yuzu et al YLW present an exp ert

system for placing nonconvex p olygons in the garment industry Albano and Sappup o

AS pack assortments of nonconvex p olygons using heuristic search techniques They

allow nonconvex items to rotate by and they pack them onto a rectangle They control

the number of no des expanded in their search tree by for example introducing a waste

parameter They present results for the value of waste for some very small apparel

examples containing no more than items They assume the container is a single rectangle

large enough to contain all the items

Other researchers use improvement strategies for nonconvex p olygons based on meta

heuristics such as simulated annealing genetic algorithms and tabu search A central

question for such metho ds is how to reconcile the two comp eting goals of minimizing waste

and eliminating overlaps Some researchers explicitly forbid overlap others allow it but

assign a p enalty for it For example the Dowsland survey discusses the tabu search algo

rithm of Blazewicz et al BHW this algorithm forbids overlaps Both approaches rely

on fast overlap detection The latter also requires p owerful overlap reduction which until

the recent work of Li and Milenkovic Li ML LMc LMa has not b een available

This thesis oers an even more p owerful overlap reduction heuristic recall our discussion

of the overlap reduction evaluation metho d within the hybrid containment algorithm in

Section

The Dowsland survey DD discusses some simulated annealing work such as that of

Oliveira and Ferreira OF We augment the Dowsland list with two more examples

Mangen and Lasudry use simulated annealing for markermaking in the garment industry

ML They forbid overlaps Heckmann and Lengauer HL apply simulated annealing

to textile manufacturing They allow overlaps and use a p enalty term In b oth of these

cases items are nonconvex and the container is a rectangular strip In the latter case

the nonconvex p olygons which are laid out are nonconvex approximations of the original

items Heckmann and Lengauer obtain waste levels comparable to human levels for small

numbers of items Achieving this requires multiple runs of their algorithm and from

one to ve hours of computing time Heckmann and Lengauer also use simulated annealing

to solve a fteen piece puzzle in seven hours in this case the container is a rectangle

Heckmann and Lengauer compare their simulated annealing results to results they obtain

using search techniques closely related to simulated annealing such as Threshold Accepting

TA The primary dierences b etween TA and simulated annealing are TA has only

one parameter and it accepts every new conguration which is not much worse than

the old one Due

Dighe and Jakiela DJ survey the published work on genetic algorithms for layout

and introduce genetic algorithms capable of placing irregular shap es They forbid overlaps

b etween items In addition to the hierarchical clustering algorithm describ ed earlier Dighe

and Jakiela give an alternate genetic algorithm which is based on ordering the items and

adding them one at a time to the layout without overlap using a leftmost heuristic In this

case the genetic algorithm seeks the b est ordering of the items

Li and Milenkovic Li ML LMc LMa introduce a substitutionbased approach

to pants markermaking for the garment industry Given a database of markers a new

marker can b e created by nding a template marker in the database whose items are similar

16

Markermaking is the pro cess of laying out pattern pieces on cloth

to the new ones arranging the new items in the same pattern as those of the template and

then eliminating overlaps This metho d is appropriate for applications in which there is

a large collection of previous layouts and the items and containers are suciently similar

from one layout to another It is not appropriate in general for sheet metal work where

the layouts are dierent enough from each other that humans nd it dicult to develop

exp ertise It is also not appropriate for leather nesting problems b ecause each hide is

dierent with resp ect to b oth shap e and the lo cation of defects HL

Assignment

The assignment problem is a combinatorial optimization problem which can arise as

a subproblem of containment when the container consists of multiple comp onents which

are not identical and are considered separately If the layout algorithm treats comp onents

individuall y it must decide which items to assign to each comp onent of the container Arb el

Arb identies two dierent assignment strategies prepacking where feasible groups

for each container are generated and then assignment is p erformed and postpacking

where groups are assigned based on some estimate of eciency without determining their

feasibility

There is a rich literature on combinatorial optimization See CMTS PS Law

LLKS for discussions of exact metho ds and Ree for a treatment of mo dern heuristics

In spite of this discussions of assignment in the literature on nonconvex layout are rare

Often the issue is either ignored or else resolved using a greedy strategy Dagliand Tatoglu

DT observe that most researchers do not handle allo cation of items among multiple

containers Arb el Arb dismisses prepacking as prohibitively exp ensive and therefore

uses p ostpacking to pack nonconvex items on rectangular sto ck sheets His p ostpacking

metho d uses integer programming Bohme and Graham BG who use Monte Carlo

metho ds to place items onto metal plates state that the set of candidate plates is selected

by a prepro cessor neither this algorithm nor the metho d of selecting the next plate to

pack is describ ed Qu and Sanders QS who approximate nonconvex items by non

overlapping rectangles do not indicate how their algorithm selects the next sheet to b e

packed Heistermann and Lengauer HL for whom a nonconvex container is partitioned

into quality zones use a which treats one region at a time

To our knowledge no successful prepacking strategies app ear in the literature

Our Layout Work

We claim that the ability to quickly solve containment problems leads to improved

metho ds for solving a variety of layout problems Recall that our containment approach

is a b ottomup one in which we increase the practical value of k Clustering techniques

for layout also use a b ottomup approach Some of them even allow the items to rotate

However the metho ds which cluster more than two arbitrary nonconvex p olygons are greedy

heuristics Our containmentbased solutions to minimal container problems do not allow

the items to rotate but in contrast to the heuristics we establish an actual lower bound

on the size of the container for multiple items

In addition we b elieve that some p otentially promising layout techniques have b een

abandoned by the layout community b ecause they lack strong b ottomup metho ds The

primary example of this is prepacking If the layout world had a practical metho d for

generating groups of items which t into each container this plus an appropriate assignment

strategy would make prepacking viable We demonstrate through our containmentbased

solutions to maximal item problems that prepacking can work

Before describing our applications in more detail we pause to argue that in general

feasibility problems can help to solve optimization problems We also show how to construct

geometric optimization problems from a containment problem

One need only lo ok as far as the Russian ellipsoid metho d in linear programming Kha

to nd a p owerful example of how solving feasibility problems can facilitate solving opti

mization problems In addition a feasibility problem is a decision problem which can

b e used as an oracle in order to solve problems involving a parameter For example one

can p erform binary search on the value of the parameter or in some cases one can use

Meggidos parametric search technique Meg The binary search approach has b een sug

gested by Chazelle Cha in the computational geometry literature as a way to nd the

maximum scaling factor which allows a p olygon to t inside another p olygon In the litera

ture on combinatorial optimization Reeves Ree discusses binary search and comments

However we would not usually try to solve an instance of an optimization problem by

this means Our b elief is consistent with b oth of these views Binary search is valuable

but pure binary search alone is insucient The b est approach in practice accelerates the

binary search by using an improvement strategy typically a heuristic to help up date the

upp er b ound

This metho d provides one way to establish a lower b ound for a solution to a minimization

problem The b ound can b e compared with a value obtained by a heuristic The ability to

solve a feasibility problem thus makes it p ossible to evaluate the eectiveness of a heuristic

whether or not the heuristic is automated Evaluating the eectiveness of heuristics is a

challenging and imp ortant task Other techniques exist for establishing lower b ounds for

some types of optimization problems For example in the area of combinatorial optimiza

tion lower b ounds for minimization problems can b e found using relaxation techniques

Ree

We construct two dierent types of geometric optimization problems from a containment

problem The rst type is a minimal container problem the second is a maximal item

problem Given a collection of items and a particular type of container a minimal container

problem asks for the minimal container of that type which contains the given items

Similarly given a container and a particular collection of item characteristics a maximal

item problem asks for the maximal collection of items which p ossesses those characteristics

and which also ts into the container

The thesis gives examples of layout problems of each type which can b e solved using

twodimensional translational containment for irregular p olygons We give four examples

of minimal container problems strip packing nding minimal square enclosures for

items nding minimal rectangular enclosures and nding tight convex and nonconvex

enclosures

From the discussion of related work in layout in Section we see that solutions to

17

The Russian ellipsoi d metho d is not currently regarded as practical but it was the rst p olynomial time

algorithm for linear programming

18

Reeves et al Ree discuss two types of relaxation metho ds linear programming relaxation for

integer or mixedinteger programming which can either b e solved heuristicall y using dual ascent or exactly

and Lagrangean relaxation

19

One p ossible minimality criterion is area

minimal enclosure problems are often required for the rst clustering stage of a multistage

layout problem Minimal container problems also arise when nding the b est sto ck sheet

size for a given set of items or the b est cloth width in garment manufacturing Section

discusses computational geometry work on various types of enclosure problems for single

items Current solutions to minimal enclosure problems for more than two items are rare and

heuristic This work app ears in the layout literature see Section and Section

The problem is typically solved either incrementally by adding one item at a time DT

or by placing small items in gaps inside the b ounding b ox of two large items AA

Our general approach to nding minimal enclosures is to nd an optimal value for a

parameter via binary search combined with containment The binary search can b e ac

celerated by using compaction techniques such as those developed by Li and Milenkovic

Li ML LMc LMa to help up date the upp er b ound ie to improve a feasible solu

tion found by containment Our hybrid containment algorithm is appropriate for minimal

enclosure problems It is extremely fast for lo ose ts and so the initial stages of the search

are fast

For the problem of nding tight convex and nonconvex enclosures we show that re

moving unreachable p ortions of a tight rectangular enclosure can yield tight convex and

nonconvex enclosures which preserve all the containment solutions for the rectangle

We also give four examples of maximal item problems For this discussion let k

pr actical

b e the largest number of p olygons for which current containment algorithms are practical

Our problems are for a feasible containment problem nding maximally scaled copies

of items which t in the container given a container and a collection of k items

pr actical

for which the sum of the item areas do es not exceed the area of the container nding a

large subcollection which ts in the container given a container and a collection of

items for which either the sum of the item areas exceeds the area of the container or the

number of items is k nding a large subcollection of k items which

pr actical pr actical

ts in the container and problem for a collection of containers

For problem we use nested binary search combined with containment The key to

solving problem is to carefully choose which item to eliminate from an infeasible subset

We reject the most troublesome item which is identied using the results of the overlap

elimination evaluation metho d of the hybrid containment algorithm For problem we

randomly construct a set of items and solve problem This yields a rich collection of

n

sets which t into the container For each set of size n which ts we automatically have

subsets which t and which need not b e individual ly represented This work provides the

rst practical metho d for constructing sets of up to ten p olygons which t in a container

For problem we solve problem for each container and then apply a lo okahead

assignment strategy This is a prepacking strategy Containment thus allows us to trans

form a geometric optimization problem into a combinatorial optimization problem Our

results challenge the existing b elief that prepacking metho ds are impractical for layout

Arb

In a multistage layout problem problem might involve a large highly nonconvex

container Highly nonconvex containers also app ear in industries in which defects in material

cause the material to b e partitioned into quality zones see Heistermann and Lengauers

work with leather HL We show how to decomp ose such a container in a natural fashion

transforming this problem into problem The transformation removes p ortions of the

container which are clearly not reachable by any item Our decomp osition metho d uses

an algorithm we developed for nding the maximumarea axisparallel rectangle MAAPR

in a p olygon Our theoretical work on this problem gives the fastest known asymptotic

running time for a MAAPR algorithm for p olygons

Pro ject Background

The work in this thesis is part of a pro ject whose goal is to automate the markermaking

pro cess in the US apparel industry Markermaking is the pro cess of laying out pattern

pieces on cloth so as to minimize cloth waste As an example Figure depicts a multi

stage markermaking problem from the apparel industry At the top is a collection of large

pants panels and a set of smaller trim pieces The markermaking task is a strippacking

problem arrange these items on a semiinnite strip of material while minimizing the length

of the strip

Our markermaking research has b een carried out under the direction of Victor J

Milenkovic Assistant Professor of Computer Science at Harvard University The research

is part of a larger pro ject funded by the Sloan Foundation The principal investigator

of this pro ject is Frederick H Ab ernathy Professor of Mechanical Engineering at Harvard

University and director of the Harvard Center for Apparel and Textile Research

Humans generally place the large panels rst and then place the trim in the gaps formed

by neighboring panels Thus they rst solve a panel placement problem followed by a trim

placement problem A layout of panels is shown in the gure followed by the complete

layout pro duced by a human exp ert In this example the items may translate and may also

rotate by a discrete set of angles

The goal of our pro ject is to meet or exceed human p erformance for the pants marker

making problem One way to do this is to apply an improvement strategy to an existing

layout pro duced by a human Another way is to generate a new layout from scratch using

for example a twostage approach such as the one adopted by human markermakers

Accordingly we initially partitioned our pro ject into three subpro jects compaction

panel placement and trim placement Below we briey describ e these three parts of our

pro ject

Compaction

Li and Milenkovics work on compaction has b een a signicant part of our pro ject Li

ML LMc LMa Given a layout their algorithms use linear programming to improve

the layout through continuous motion of the pieces A p ositionbased linear programming

mo del is at the heart of the algorithms The algorithms accomplish a variety of tasks One

task is to reduce the length of a marker This type of compaction can b e used to accelerate

binary search in our work on minimal enclosures Another task is to reduce overlaps among

pieces This is an integral part of the substitutionbased approach to pants markermaking

describ ed in Section Thus compaction can serve b oth as an improvement metho d for

existing layouts and as the basis of a metho d for constructing layouts The overlap reduction

evaluation metho d we apply within our hybrid containment algorithm is an extension by

Milenkovic of the overlap reduction work

20

Victor Milenkovic is now an Asso ciate Professor at the University of Miami Set of polygonal parts

Strip of fixed width and unknown length

Placement of large pieces

Name: 37457c Width: 59.75 in Length: 269.04 in Pieces: 108 Efficiency: 89.54%

Human layout with 180 degree rotations and xy-flips allowed

Figure The markermaking task in the apparel industry

Panel Placement

Section summarized the work of Milenkovic MDL on placing large items by

building column clusters To place large items he builds column clusters of four items and

forms a gridlike layout consisting of a set of columns An algorithm based on dynamic

programming adds one column at a time to the layout Backtracking is allowed

Trim Placement

The trim placement task falls within the twodimensional binpacking category accord

ing to Dyckho and Finkes typology DF One might argue that it also b elongs in the

cutting sto ck category b ecause the items can b e partitioned into equivalence classes How

ever the items in each class are not congruent they are graded copies of each other Trim

placement is not solved using rep eating patterns and so it do es not t Dyckho and Finkes

cutting sto ck type However approaches to trim placement can certainly take advantage of

the similarity b etween pieces in the same equivalence class

Trim placement can b e viewed as a containment problem for which the container is the

complement of the placed panels within the original container The container is highly

nonconvex and has multiple comp onents The number of items far exceeds the number

which can currently b e handled by any practical containment algorithm However practical

algorithms for solving the asso ciated packing problem ie place as many pieces as p ossible

can b e developed if we rst decomp ose the container into a collection of containers where

each containers capacity is appropriate for a containment algorithm

This trim placement problem provided the original motivation for our work on contain

ment Most of the containment examples in this thesis are drawn from various marker

making problems in the apparel industry

Surprisingly we found that the problem of decomp osing a complex container is a chal

lenge in its own right We therefore discuss container decomp osition in a separate chapter

Chapter within the applications part of the thesis

Benchmarks

As we have already discussed our test data comes primarily from apparel manufacturing

We welcome data from other sources We prop ose that a set of b enchmarks b e constructed

so that researchers may compare the p erformance of their translational containment algo

rithms We oer to provide data for our containment examples to interested researchers

providing that the data is not used for commercial b enet To facilitate this exchange while

protecting the source of the data we oer our data using a simple le format which is given

in App endix A

Contribution

The primary contribution of this thesis is our demonstration that although containment

is NPhard it is fruitful to develop algorithms for containment as opp osed to heuristics

design containment algorithms so that they say no almost as fast as they say yes

21

In apparel manufacturing grading is a combination of scaling and morphing

use geometric techniques not just mathematical programming techniques and maximize

the number of items for which the algorithms are practical

Our approach to containment has a number of imp ortant features First we intro

duce a restrictevaluatesubdivide paradigm Second we develop new theory and practical

techniques for the op erations within the paradigm The techniques are appropriate for two

dimensional containment problems in which the items and container may b e irregular ie

nonconvex and have multiple comp onents and in which the items may b e translated but

not rotated Our techniques can b e combined to form a variety of twodimensional transla

tional containment algorithms which follow the restrictevaluatesubdivide paradigm The

paradigm is designed so that unlike existing iterationbased algorithms containment algo

rithms based on the paradigm are adept at saying no even for slightly infeasible problems

Infeasible problems o ccur frequently in practice

We develop geometric restrictions which are p owerful conguration space pruning tech

niques They often detect infeasibility without any evaluation or sub division We give two

algorithms which use geometric restrictions and are based on the restrictevaluatesubdivide

paradigm We obtain the rst practical running times for NPcomplete twodimensional

translational containment problems for up to ten nonconvex items in a nonconvex container

Our examples are drawn primarily from the apparel industry Each item is represented as

a p olygon which typically has from to vertices The container is also represented as

a p olygon it typically has from to vertices

We demonstrate that viewing containment as a feasibility problem has many b enets

for layout optimization problems We present an eective metho d for nding minimal

enclosures which uses containment to p erform binary search on a parameter We note that

compaction can b e used to accelerate the search This work represents the rst practical

approach to nding minimal enclosures for multiple nonconvex items Clustering is used

often in layout but current clustering techniques are weak Although they often allow

items to rotate they typically use greedy heuristics and therefore cannot provide a lower

b ound on the size of the container Our minimal enclosure work should lead to more

p owerful clustering metho ds and is an example of how strong b ottomup techniques

from computational geometry can help the layout community

We b elieve that some p otentially promising layout techniques have b een abandoned by

the layout community b ecause they lack strong b ottomup metho ds The primary example

of this is prepacking We challenge the view that prepacking is impractical for multiple

container packing problems by generating a rich collection of groups for each container

using containment and then applying an assignment strategy

Our advances in containment will help automate layout for industrial pro cesses that rely

on twodimensional packing of ob jects Our results are particularly relevant to industries

which deal with irregularly shap ed items This includes industries such as aerospace ship

building apparel and sho e manufacturing furniture pro duction and steel construction

Overview

The remainder of the thesis is divided into two main parts Part I describ es our

work on translational containment for nonconvex items in a nonconvex container This

part contains four chapters The rst chapter introduces our restrictevaluatesubdivide

paradigm for containment and provides the notational and technical background required by

our containment work The second chapter describ es our conguration space restrictions

The third chapter discusses evaluation and sub division techniques The fourth chapter

presents two dierent algorithms which can b e formed via sp ecic choices of restriction

evaluation and sub division techniques Portions of our containment work also app ear in

DML DM DM MD

Part I I of the thesis gives examples of how containment can b e applied to solve various

layout problems This part contains four chapters The rst chapter discusses preliminaries

The second shows how to transform a container so that regions not reachable by any item

are eliminated and the remaining reachable regions are decomp osed in a natural way Our

container decomp osition work also app ears in DM Our theoretical work on nding the

maximumarea axisparallel rectangle in a p olygon which is used for the decomp osition is

summarized in that chapter and also app ears in DMR DMR The third chapter solves

four minimal container problems The fourth solves four maximal item problems

Conclusions future work and an app endix containing a le format for containment

examples app ear in Part I I I of the thesis

Part I

Translational Containment

C h a p t e r

Preliminaries

Introduction

In this part of the thesis we consider the twodimensional translational containment

problem for p olygons The problem is stated as follows given a container and a set of

items nd translations of the items which result in a nonoverlapping arrangement of the

items within the container The items and container may b e nonconvex

Existing twodimensional translational containment algorithms developed by other re

searchers are practical only for k We present new theory leading to the rst practical

running times for twodimensional translational containment problems for up to ten non

convex items in a nonconvex container For k one of our algorithms typically

runs in several minutes or less on a MHz SPARCstation and it is therefore practical

for solving a number of layoutrelated problems Most of our examples are from apparel

manufacturing Usually each item has from to vertices and the container has from

to vertices

Although containment is NPhard in general we b elieve that it is valuable to increase

the practical value of k as much as p ossible Thus we continue the b ottomup progres

sion CC NN CN NN etc of containment work which has taken place in rob otics

and computational geometry Since containment is NPhard and all known containment

algorithms have running time which is exp onential in k an increase in the practical value

of k from three to ten is signicant

Our ability to say no well comes primarily from the use of our new geometric tech

niques Our ability to say yes for so many items is partly due to our geometric techniques

and partly due to our application of and improvements to existing linear programmingbased

techniques Thus we demonstrate that a computational geometry approach can contribute

signicantly to practical algorithms for NPhard geometric problems

Saying no quickly is imp ortant Current translational containment algorithms are

iterationbased Iterationbased algorithms for containment attain their worstcase run

ning time when the containment problem is infeasible This situation o ccurs frequently

in practice We replace iteration with sub division Our sub divisionb ased algorithms are

sp ecically designed to detect infeasibility quickly

We present a new paradigm for containment algorithms The paradigm is based on

op erations on twodimensional conguration spaces As discussed in Section each of

these spaces represents the set of relative p ositions for a pair of p olygons The algorithm

applies three types of op erations in order to the conguration spaces restriction which

prunes the spaces and helps detect infeasibility evaluation which tries to nd a solution

and subdivision Sub division partitions one of the conguration spaces into two parts

The algorithm then recurses on each part while keeping the other conguration spaces

constant

We introduce new theory and techniques for each of these types of op erations for the case

of twodimensional containment problems in which the items and container may b e irregu

lar ie nonconvex and have multiple comp onents and the items may b e translated but

not rotated Our techniques can b e combined to form a variety of twodimensional transla

tional containment algorithms which follow the restrictevaluatesubdivide paradigm The

paradigm is designed so that unlike existing iterationbased algorithms containment algo

rithms based on the paradigm are adept at saying no even for slightly infeasible problems

At present there app ear to b e two approaches to containment within the restrict eval

uatesub divide framework direct and indirect Direct metho ds act on the conguration

spaces directly and these metho ds tend to b e based on computational geometry Indirect

metho ds act on convex approximations to the conguration spaces either inner or outer

approximations Indirect metho ds use linear programming or other types of mathematical

programming which is why they can only act on convex approximations Direct metho ds

have a more accurate view of the world but they can only op erate on a few conguration

spaces at a time three in our case Indirect metho ds can act on all the conguration spaces

simultaneously in a single op eration but they use only approximations to the conguration

spaces

This thesis presents two containment algorithms which follow our paradigm The rst

op erates directly on the conguration spaces and is therefore a direct algorithm We call the

second a hybrid algorithm b ecause it uses an indirect evaluation metho d and b oth direct

and indirect metho ds for restriction Our direct algorithm is also an approximate algorithm

b ecause it pro duces a conguration whose overlap is b elow a given tolerance Ironically

our hybrid algorithm whose indirect evaluation metho d op erates on approximations of the

conguration spaces is an exact algorithm b ecause it pro duces a conguration with no

overlap We briey discuss each algorithm individuall y b elow

Direct Algorithm

Our new direct algorithm for containment is an approximate algorithm which pro duces

a solution whose overlap is b elow a given tolerance As mentioned in Section for some

cutting applications CAD vendors round p olygon vertex co ordinates to integers In such

cases an overlap of less than one unit corresp onding to inches is acceptable For the

applications we consider the ratio of the largest value to the smallest nonzero value is usually

under this makes an approximate algorithm a practical choice Our approximate

algorithm uses our new direct techniques for restriction evaluation and sub division The

algorithm app ears in DM DM as well as in Section

Our direct restrictions are based on p olygon set op erations and so we call them geometric

restrictions They are p owerful to ols for detecting infeasibili ty We dene two general types

of restrictions valid restrictions which preserve all solutions to a containment problem and

semivalid restrictions which preserve a single solution if one exists We present a variety

of restrictions and several general prop erties of valid restrictions We examine in detail the

eectiveness of our geometric restrictions which are valid restrictions Our characterization

of the types of containment problems for which these restrictions are eective is based on

theoretical as well as exp erimental results

The evaluation metho d uses restriction together with a geometric metho d for maxi

mizing the intersection of translations of the conguration spaces The evaluation metho d

often nds a containment solution without any sub division The sub division metho d is a

sizebased one Its goal is to partition a conguration space into two parts such that each

has less area than the conguration space Our approximate algorithm has an extra layer

of structure on top of the restrictevaluatesubdivide paradigm This layer has a set of

containment subproblems to which coursegrained parallelism could b e applied in the fu

ture We create the subproblems by characterizing a valid conguration for translational

containment

The current implementation of this algorithm is fast for up to four items For k

the current implementation of our geometric restrictions based on p olygon set op erations

slows the algorithm down considerably Increasing the sp eed of our p olygon set op erations

is a sub ject of future work see Section In our exp eriments our approximate

algorithm p erforms fewer sub divisions than the faster hybrid algorithm and so we b elieve

the approximate algorithm has the p otential to b e comp etitive with the hybrid algorithm

Hybrid Algorithm

In addition to our direct algorithm we also present signicant improvements to the

restriction evaluation and sub division techniques of an existing indirect algorithm of

Milenkovic Mil Milenkovics indirect algorithm in its original form was slower than our

direct algorithm for infeasible problems and its practical upp er b ound on k was k The

improved indirect algorithm is currently our fastest containment algorithm for k

Our rst improvement to the indirect algorithm is a pro of that restrictions when used

in the indirect algorithm do not increase the algorithms worstcase running time if the

algorithm bases certain decisions on the unrestricted conguration spaces This is imp ortant

b ecause restrictions can add vertices to the conguration spaces and so they might have

increased the worstcase running time The pro of allows us to add our new direct geometric

restrictions to the algorithm It also allows us to apply a new restriction metho d developed

by Milenkovic which is based on linear programming

The second improvement to the indirect algorithm is related to the evaluation metho d

We apply the work of Li and Milenkovic on overlap resolution Li ML LMc LMa

to improve the evaluation step Their overlap resolution algorithm is an indirect algorithm

It uses inner convex approximations an approach which complements the outer approxi

mations of the indirect containment algorithm Our third improvement is our new practical

sub division technique which attempts to maximize the distance from the current evaluation

to the convex approximations of the sub divided conguration spaces

We call the resulting algorithm a hybrid algorithm b ecause it uses indirect metho ds

for evaluation developed by Li and Milenkovic and b oth direct and indirect metho ds for

restriction The hybrid algorithm is describ ed in MD as well as in Section

The hybrid algorithm in addition to b eing a formidable containment algorithm has

the prop erty that a partial containment solution from it is valuable This is b ecause each

evaluation step pro duces either a nonoverlapping solution or an overlapping conguration

for which a linear program has reached a lo cal minimum As a result the hybrid algorithm

when terminated early is the most p owerful heuristic known for generating a lo cal overlap

minimum

Overview of Chapter

In this chapter we rst give notation and technical background in Section Sec

tion establishes the NPcompleteness of translational containment Section describ es

our restrictevaluatesubdivide paradigm Section introduces the concept of size analy

sis Section supplements the discussion of related work in containment which app ears in

Section Section presents a characterization of translational containment problems

Section outlines the contents of the remaining chapters in this part of the thesis

Notation

The goal of translational containment is to translate k p olygonal regions P P P

k

into a p olygonal container without overlap If we denote by P the complement of the

container region C then containment is equivalent to the placement of k p olygons

P P P P in nonoverlapping p ositions

k

Denition Min GRS Ser Ser The Minkowski sum of two point

sets of R in our case is

A b A B fa b j a A b B g

bB

The Minkowski dierence is

A B A b

bB

For a p ointset A let A denote the set complement of A and dene A fa j a Ag

For a vector t dene A t fa t j a Ag and A t fa t j a Ag Note that

A t A ftg

Theorem Ser A B A B

Theorem states that the Minkowski sum and dierence are duals with resp ect to

complementation

Theorem GRS Ser B t A if and only if t A B

Figure illustrates Theorem Readers familiar with mathematical morphology

will recognize this as the hit transformation Ser There is an analogous miss trans

formation involving which is illustrated in Figure and stated in Theorem

Theorem Ser B t A if and only if t A B B A + (-B) A

-B

Figure B t A if and only if t A B

B

-B

A - (-B)

A

Figure B t A if and only if t A B

Denition Ser The op ening of A with respect to B is A B B

If B ts into A then the op ening of A with resp ect to B consists of all p oints of A which

are reachable by some part of B via translation

The symbol U i j k i j denotes the set of displacements from P to P

ij i j

such that they do not overlap each other For translations t and t P t and P t

i j i i j j

overlap if and only if t t U It follows that U U Since P cannot b e displaced

j i ij ij j i i

with resp ect to itself we dene U f g Expressed in terms of set op erations and

ii

Minkowski sums

U P P i j k i j

ij i j

Equation follows directly from Theorem The set U is the twodimensional free

ij

conguration space for placing P with resp ect to P Note that U is unbounded unless

j i ij

i or j assuming that the container and P P are b ounded

k

Let P and U denote the set of all P and U resp ectively Strictly sp eaking these

i ij

are lists even if two elements such as U and U are congruent they are maintained as

separate elements

Denition A conguration of P is a k tuple t t t where t is a trans

i k i

lation x y of P and t is arbitrarily set to A valid conguration of P is a

i i i

conguration of P which satises

t t U i j k

j i ij

A valid conguration is an exact solution to a translational containment problem It

corresp onds to a p oint in k dimensional space The set of p oints corresp onding to all valid

congurations for a given P is the k dimensional free conguration space for P

Denition An approximate conguration of P is a conguration such that the

distance of t t from U is for i j k

j i ij

In an approximate conguration no p oint of any p olygon in P is more than inside

of the b oundary of any other p olygon when the p olygons are laid out according to the

conguration

Denition Given U U for an instance of translational containment U is the set

ij

ij

of al l values of t t such that t and t are translations of P and P respectively in a

j i i j i j

valid conguration of P

is the pro jection of the set of all k dimensional valid congurations In other words U

ij

into U Clearly U U Also U U implies U U Let U denote the set of

ij ij ij j i

ij ij j i

all U

ij

In Section we dened the k NN problem the k r NN problem and their variations

see Denition and Denition We refer to the entire collection of twodimensional

translational containment problems including k NN k CN etc as translational contain

ment problems Note that we do not require the set of al l valid congurations a single

valid conguration suces Each problem has an approximate version which is to nd an

approximate conguration Each containment problem is an oline problem b ecause the

entire set P is available at the start of the containment problem

Let the number of vertices of P b e m We dene m max m We use m

i i ik i

frequently and it tends to b e larger than the other m Hence we distinguish m by

i

denoting it by n In general we express the running time of a containment algorithm in

terms of m n k and r

This is not the most general containment problem since it is restricted to two di

mensions do es not allow rotation and the representation of items is limited to p olygons

However this problem is still of great practical imp ortance Industries dealing with two

dimensional p olygonal items include aerospace ship building apparel sho e and furniture

manufacturing and steel construction In applications such as apparel sho e and furniture

manufacturing only a discrete set of rotations is typically allowed this can b e dealt with

by iterating over the angles In contrast metal pieces are often represented using curves as

b oundaries and continuous rotation is frequently allowed

Hardness

The main result of this section is that k NN is NPcomplete Before proving this we

establish two lemmas The rst shows that k RR a containment problem for rectangular

items in a rectangular container is NPhard

Lemma The k RR problem is NPhard

Pro of Li Li examines the twodimensional co ordinated motion planning problem of

strip compaction in which the motion of the p olygons is restricted to a strip of xed width

and arbitrary length and the goal is to minimize the length of the strip He shows this

problem is NPhard when all the p olygons are rectangles and only translations are allowed

He reduces the NPcomplete PARTITION problem to strip compaction We use a similar

reduction here to establish that k RR is NPhard In an instance of PARTITION GJ

we are given a nite set A and a size sa Z for each a A We ask Is there a subset

P P

sa We reduce the NPcomplete PARTITION sa A A such that

aAnA aA

problem to k RR For each a A we construct a rectangle of unit height and width sa We

P

sa PARTITION has a solution also construct a container of height and width

aA

if and only if there is a valid conguration of the rectangular items inside the rectangular

container This establishes that k RR is NPhard 2

Lemma Twodimensional translational containment is in NP

Pro of Milenkovic et al MDL show that the markermaking problem in the absence

of rotations is in NP The main idea of their argument applies to translational contain

ment They show that if a solution exists then there exists a p ossibly dierent solution

which is uniquely determined by its set of vertexedge contacts We observe that there are

only k degrees of freedom Therefore we can nondeterministically select the correct k

vertexedge contacts solve the set of linear equations and verify the solution This is a

p olynomialtime pro cess b ecause the linear system has a p olynomial number of equations

and a p olynomial number of linear equations can b e solved in time which is p olynomial in

the number of equations 2

Theorem Twodimensional translational containment is NPcomplete

Pro of Lemma shows that k RR is NPhard Since all the translational containment

problems are harder than k RR this proves that translational containment is NPhard

Lemma shows that translational containment is in NP which completes the pro of 2

The RestrictEvaluateSubdivide Paradigm

The set U enco des the entire containment problem and one can think of it as the input

to and current state of a containment algorithm We refer to U as the hypothesized solution

space or hypothesis A solution within the current hypothesis consists of a valid conguration

for the current set U

Our paradigm uses three op erations on the hypothesis

Restriction prune the hypothesis by applying restrictions to the current set U A restric

tion is an op eration on U which replaces some or all U s by subsets of themselves

ij

Naturally if any U U is replaced by the empty set then there is no solution

ij

Evaluation try to nd a solution within the given hypothesis The result is that either

yes a valid conguration exists within the hypothesis no a valid conguration

do es not exist within the hypothesis or maybe a valid conguration exists but it

has not yet b een found

Sub division divide the current hypothesis into two subhypotheses such that if a solution

exists within the current hypothesis then a solution must exist within one of the two

subhypotheses

The pseudoco de b elow describ es the ow of a general containment algorithm which

abides by our paradigm We present it in the form of a decision pro cedure which returns

YES or NO Of course if a valid conguration is found the conguration can b e stored

in a global data structure The routines RESTRICT EVALUATE and SUBDIVIDE

p erform the functions describ ed in the list of op erations given ab ove RESTRICT returns a

restriction of U EVALUATE returns a status ag indicating whether it decides YES NO

or MAYBE SUBDIVIDE partitions one of the conguration spaces U U into two parts

ij

U and U The algorithm then recurses on each part while keeping the other conguration

ij ij

spaces constant That is it creates U U n fU g fU g and U U n fU g fU g

ij ij

ij ij

and then recurses on U and U

CONTAINU k

U RESTRICTU k

if some U U return NO

ij

status EVALUATEU k

if status YES return YES

if status NO return NO

U U SUBDIVIDEU k

return CONTAINU k or CONTAINU k

A containment algorithm can b e designed by selecting a restriction metho d an evalua

tion metho d and a sub division metho d The correctness of the algorithm dep ends on the

correctness of the chosen metho ds Termination of the algorithm dep ends on the compat

ibility of the metho ds For example supp ose we have an algorithm which has a certain

worstcase running time based on a sub division metho d for which the number of reex ver

tices of U and U is less than the number of reex vertices of U Now supp ose we add

ij

ij ij

restrictions to this algorithm The restriction pro cess may increase the number of reex

vertices in the hypothesis This can increase the worstcase running time of the algorithm

A mismatch b etween evaluation and sub division metho ds can also b e problematic For

instance consider an algorithm which uses the sub division technique mentioned ab ove for

reducing the number of reex vertices together with a sizebased evaluator That is the

evaluator says no if it cannot nd a valid conguration in U and the size of U is b elow a

tolerance Sub division will eventually pro duce hypotheses containing convex p olygons but

those p olygons will not necessarily have size less than the tolerance If a valid conguration

exists within U in this case the algorithm will not terminate unless the evaluator happ ens

to nd it

Coursegrained parallelism can b e applied to this paradigm and is a sub ject for future

work In order to parallelize the general containment algorithm one would maintain a queue

of hypotheses instead of p erforming recursion Each pro cessor would remove a hypothesis

from the queue and restrict it and evaluate it If no solution were found the hypothesis

would b e sub divided and the two resulting subhypotheses would b e added to the queue

Each hypothesis represents a selfcontained containment problem and so pro cessors could

work on hypotheses indep endently Of course the enqueueing and dequeuing of hypotheses

should b e implemented as atomic op erations

One limitation of this approach is that the subproblems would not necessarily all b e

available at the start of the algorithm Some pro cessors might remain idle until a sucient

number of hypotheses were created

Approach to Running Time Analysis

In order to analyze the worstcase time complexity of a containment algorithm which

follows our paradigm one must know the time complexity of RESTRICT EVALUATE

and SUBDIVIDE In addition one needs an upp er b ound on the number of times CON

TAIN is invoked this is determined by the conditions for which EVALUATE decides

no Finally an upp er b ound on the total number of vertices of U is required

Calculating the total number of vertices of U is complicated by the p ossibility that

RESTRICT and SUBDIVIDE may introduce new vertices into U in spite of the fact

that each replaces some U s by subsets of themselves One way to treat this is to estimate

ij

the worstcase upp er b ound on the number of new vertices However this upp er b ound

may b ear little resemblance to the actual worstcase size which is attainable in practice

For example supp ose that RESTRICT and SUBDIVIDE use only p olygon set op er

ations such as intersection and union In theory for p olygons A and B jA B j jA B j

OjAj jB j but in practice jA B j jA B j jAj jB j On the one hand new vertices

are created by edgeedge intersections but on the other hand many vertices are discarded

when the union or intersection b oundary is computed

We introduce the concept of size analysis in order to capture the practical running time

of a containment algorithm which follows our paradigm Let s b e the maximum number

1

One measure of the size of U is the total area of all U in U

ij

of vertices pro duced by a p ossibly innite sequence of p olygon op erations which replaces U

by a subset of U In Chapter we are more sp ecic ab out the op erations In some cases

one can prove that s is nite Although s can b e exp onential in the original size of U in

practice it is usually not more than quadratic Since our analysis is based on s we refer to

size analysis as sanalysis in the remainder of the thesis

Related Work

In Section we reviewed the literature on containment Here we ll in some of the

technical details omitted by that discussion

k

A naive k NN algorithm requires Ok mn log mn time It searches for a valid

conguration by iterating over all choices of k contacting pairs among the p olygons and

k k

container There are Ok mn k m Omn p ossible choices of k vertexedge

contacts For each choice we can solve a set of k linear equations in Ok time the cost

of Gaussian elimination to obtain t i k This conguration can b e checked for

i

overlap in Olog n time assuming the following prepro cessing Precompute U according

to Equation The number of vertices in each of these p olygons has an upp er b ound of

Om n Prepro cess the p olygons in U so that a p ointinpolygon test can b e p erformed in

Olog mn time Kir To check a layout p erform a p ointinpolygon test for each t t

j i

k

in U This costs Ok log mn time The naive algorithm has running time in mn

ij

b ecause it must iterate over all p ossible sets of contacts whenever the answer is no

The following running times were given in Section

k k CN k NN

Omn log mn For Om n log mn AB Avn

Om n log m Dev Om n log mn AB Avn

Om n log m Dev Om n log mn Avn

Avnaim and Boissonnat also give a solution to the NP problem three nonconvex p olygons

in a parallelogram container using time in Om log m AB Avn Even though

the asymptotic running time of the NP algorithm contains a p olynomial whose degree

is high compare to the others the NP algorithm is actually more practical than some

of the other lower degree algorithms Avnaims NN algorithm in particular iterates

over all choices of edges from U U U U and U Avnaim uses a sweepline

algorithm to avoid iterating over the edges of U The worstcase running time of the NN

algorithm is therefore prop ortional to the pro duct of the sizes of these sets To determine

that a conguration is imp ossible the algorithm must iterate over all these choices Its

Om n log mn running time is worse than the Omn log n running time for the naive

algorithm for k For reasons outlined b elow it is faster than the naive algorithm in

practice

The m factor for NP arises from the worst case b ound on the number of vertices

of the outputs of several consecutive Minkowski sums and p olygon unionsintersections

In practice the worst case is usually a gross overestimate and unlike the m n lower

b ound for the NN algorithm the factor of m may not b e attainable At each step the

running time of the NP algorithm is sensitive to the output of the previous step and so the

algorithm takes advantage of the fact that the number of vertices almost certainly grows

2

See Section for a description of the NN characterization which allows this iteration

much more slowly than the estimate Recall our discussion of sanalysis in Section

An observation similar to the one made ab out p olygon intersection and union holds for

the Minkowski sum Using sanalysis the NN algorithm has running time in Os log s

whereas the NP algorithm has running time in Os log s The naive algorithm has running

k

time in Os log s for k this is Os log s With this analysis NP is faster than

NN and b oth are faster than the naive algorithm

Containment Characterization

Here we take advantage of the fact that the goal of our containment problem is to nd

a single valid conguration as opp osed to nding the entire set of valid congurations We

characterize a containment solution by showing that if a valid conguration exists for

a given containment problem then a valid conguration must exist where can b e

reached from by a nonoverlapping motion of the pieces and p ossesses characteristics

which facilitate the search for a solution In particular is a vertex of a comp onent of

the free conguration space and this comp onent contains In this case we can solve the

containment problem by nding This type of approach has b een used for containment

by Chazelle to solve NN with rotation Cha by Avnaim to solve NN with translation

only Avn and by Milenkovic et al to solve CN DML

Our characterization of a solution to k NN stems from a small number of simple obser

vations ab out contacts and degrees of freedom First we observe that b ecause k NN allows

translation in x and y each p olygon has two degrees of freedom Second the collection of

k p olygons has k degrees of freedom

There are two types of contacts The rst type involves a vertex and an edge A vertex

edge contact is a single contact b ecause it implies a single linear constraint The second

type involves two vertices A vertexvertex contact is a type of double contact b ecause it

implies two linear constraints A linear constraint reduces the number of degrees of freedom

by one if and only if it is linearly indep endent of the existing system of constraints

In terms of U a single contact of P with P means t t is on the b oundary of U and

i j j i ij

a double contact means t t is at a vertex of U

j i ij

In our characterization b elow let I b e an instance of k NN

Theorem If I has a valid conguration then I has a valid conguration with the

fol lowing characteristics

k contacts

contacts per polygon P i k

i

Pro of Assume I has a valid conguration We rst show that there is a valid congura

tion with k contacts by arguing as in MDL Less than k linear constraints cannot

determine the value of k variables and therefore there must b e at least one degree of

freedom There must therefore b e some simultaneous motion of the p olygons P i k

i

for which at least some subset of the p olygons move along lines while all p olygons retain

their contacts If some subset of the p olygons are moving along lines then eventually some

new contact must form One of three events must o ccur two p olygons collide neither

of which is P or two p olygons collide one of which is P or a new contact o ccurs

b etween two already contacting p olygons The o ccurrence of one of these events is guar

anteed by the fact that the complement of P is b ounded recall that P is the container

If two p olygons P and P collide then a new vertexedge contact is formed If P and P

i j i j

already have a vertexedge contact then that vertex may slide to the end of the edge and

form a vertexvertex contact We stop the motion when a new contact o ccurs Rep eating

this pro cess forms a set of k contacts

To establish the second part of the claim we observe that if a valid conguration for

I exists and a p olygon has fewer than two contacts then we can translate that p olygon

until it loses b oth degrees of freedom Translating P is equivalent to xing P and

translating the remaining P by the same amount in the opp osite direction This implies a

i

valid conguration in which each p olygon has at least two contacts 2

A containment problem can b e converted to a set of indep endent containment subprob

lems using Theorem A collection of indep endent subproblems can b e solved in parallel

if sucient pro cessors are available In the sp ecial case where some of the P are identical

i

equality of some of the U s reduces the number of subproblems

ij

The costeectiveness of iterating over a particular set of subproblems should b e carefully

evaluated when designing a containment algorithm Let contacting pair refer to a pair

of p olygons which is in contact The characterization tells us which contacting pairs can

o ccur The number of p ossible contacting pairs is purely a function of k not m or n Testing

the characterization requires solving a subproblem for each p ossible contacting pair If the

pair is in single contact we solve a boundaryrestricted subproblem by replacing U by

ij

its b oundary If the pair is in double contact we solve a vertexrestricted subproblem by

replacing U by its vertices Since k is a constant the characterization do es not increase

ij

the asymptotic running time in terms of m or n Nevertheless the number of ways to choose

k

contacting pairs is exp onential in k roughly k

For k the implication of the rst part of the characterization k contacts is

particularly nice If there exists a solution to NN then there exists a solution in which a

set of k determining contacts contains either a double contact or all single contacts

Testing for a double contact solution requires solving a vertexrestricted subproblem for each

U For a solution where six pairs of p olygons are in contact each P P pair must b e

ij i j

in contact This implies a subproblem in which every p olygon in U is b oundaryrestricted

Avnaim Avn takes advantage of this to eliminate a factor of m from the running time

of his NN algorithm

k

Unfortunately for k we must choose k out of p ossible contacting pairs The

number of ways to choose k pairs is exp onential in k Both a generalization of Avnaims

NN algorithm and the naive algorithm must iterate over all ways of choosing k single

contacts Using the second part of the characterization contacts p er p olygon also

generates an exp onential number of subproblems if we apply it to every p olygon Applying

it to only a single p olygon P requires that we check two cases

i

a double contact with at least one P j k i j or

j

a single contact with at least one P j k i j and a single contact with at

j

j k i j j least one P

j

Testing the rst case requires k vertexrestricted subproblems one for each U

ij

j k i j Each subproblem is vertexrestricted for U The second case requires

ij

k k subproblems Each subproblem is b oundaryrestricted for two U s This

ij

approach therefore requires solving Ok subproblems

Applying part of this characterization leads to a semivalid conguration space restric

tion in Chapter Partial characterization is also used in Chapter for our approximate

containment algorithm

Overview of Part One

The remainder of the containment part of the thesis contains three chapters Chapter

describ es our conguration space restrictions Chapter discusses evaluation and sub divi

sion techniques Chapter gives two dierent algorithms which can b e formed via sp ecic

choices of restriction evaluation and sub division techniques The rst of the two algo

rithms is an approximate and direct algorithm the second is our exact hybrid algorithm

Portions of our containment work also app ear in DML DM DM MD

3

A semivalid restriction is guaranteed to preserve at least one valid conguration if one exists

C h a p t e r

Conguration Space Restrictions

Introduction

Here we show how to restrict certain twodimensional conguration spaces asso ciated

with translational containment Recall from Section that a restriction of U replaces

some or all U s by subsets of themselves Naturally if any U U is replaced by the

ij ij

empty set then there is no solution for the hypothesis U We dene two general types

of restrictions valid restrictions which preserve all solutions to a containment problem

and semivalid restrictions which preserve a single solution if one exists Restrictions can

prune away invalid regions from the conguration spaces b efore a containment algorithm is

applied They can help an algorithm quickly detect infeasibili ty Restrictions can also b e

integrated into the b o dy of an existing containment algorithm

This chapter makes several general observations ab out restrictions of conguration

spaces for translational containment We present a variety of valid and semivalid restric

tions We examine in detail the eectiveness of our geometric restrictions which are valid

restrictions Our characterization of the types of containment problems for which these

restrictions are eective is based on theoretical as well as exp erimental results Most of our

restrictions are based on closed rather than regularized set op erations and so we discuss

this imp ortant implementation issue

Overview

Section provides notation for this chapter Section makes several general ob

servations ab out valid restrictions The next three sections present valid restrictions In

Section we present our geometric restriction give an example and discuss the eective

ness of this restriction In Section we describ e a linear programming restriction give

an example and discuss the eectiveness of this restriction Section gives a restriction

which is valid when one item is a subset of another Section gives a parallelizable valid

restriction based on unions Section gives a parallelizable restriction based on the char

acterization in Section Section gives a restriction for identical items Section

1

Regularized op erations replace each p olygon by the closure of its interior Our closed op erations simply

replace each p olygon by its closure See Section

discusses closed op erators on which many of these restrictions are based Section

summarizes this chapter and presents conclusions

Note Figures depicting U p olygons app ear throughout this chapter to illustrate the

ij

dierence b etween U s b efore and after a restriction is applied to U A U for i

ij ij

j k is unbounded in its original form as dened by Equation so we p erform the

following b ounding op eration b efore displaying a U

ij

U U U U

ij ij i j

This op eration is a valid restriction as established in Section

Notation

Denition A restriction is an operation on U that replaces some or al l U U by

ij

subsets of themselves A valid restriction preserves the invariant U U

ij

ij

is the set of all values of t t which b elong to a valid Recall from Section that U

j i

ij

the replacement of U in a valid restriction of U then conguration If we denote by U

ij

ij

U U U We also denote the set of all U for a particular valid restriction by U

ij

ij ij ij

Denition A semivalid restriction of U is a restriction of U having the property

that if there exists a valid conguration in U then there exists a valid conguration in the

restriction of U

When it is imp ortant to refer to an original U as dened by Equation we use the

ij

orig orig

orig

notation U and U for the set of all U

ij ij

Prop erties of Valid Restrictions

Here we discuss several general prop erties of any valid restriction for translational con

tainment

Boundary Intersection

Consider the following two restriction examples The rst example shown in Figure

is of four nearly rectangular items to b e placed in a nearly convex container Figure

shows two onecomp onent U p olygons for this example with U p olygons shaded in black

j

j

Figure shows two twocomponent U p olygons with U p olygons

ij

ij

The second example shown in Figure is of four oblong items to b e placed in a

nonconvex container Figure shows a onecomp onent U p olygon for this example

j

p olygons shaded in black Figure shows a twocomponent U p olygon with with U

ij

j

U p olygons

ij

These examples have the prop erty that each comp onent of U intersects the b oundary

ij

orig

of U That is they share part of the b oundary in common This phenomenon o ccurs

ij

frequently in practice The reason this b ehavior o ccurs often in practice is due to the

characterization of translational containment problems in DM DM summarized by

Theorem The following theorem formalizes the relationship b etween Theorem

and the b oundary intersection b ehavior

2

The algorithms which generate these examples app ear later in this chapter

Figure Boundary intersection example the containment problem

Figure Boundary intersection example two onecomp onent U s with U s

j

j

s Figure Boundary intersection example two twocomponent U s with U

ij

ij

Figure Boundary intersection example the containment problem

Figure Boundary intersection example a onecomp onent U with U s

j

j

Figure Boundary intersection example a twocomponent U with U s

ij

ij

Theorem If an instance of translational containment has a valid conguration then

for each j j k there exists i j i k such that at least one component of U

ij

orig

shares part of its boundary with U

ij

Pro of Part of Theorem implies the weaker condition that if a solution exists

then a solution exists such that for each j j k there is some i j i k

such that P and P are in at least single contact A contact corresp onds to a p oint on

i j

orig

the b oundary of U this p oint remains after any valid restriction b ecause it is asso ciated

ij

with a valid conguration Thus a comp onent of a replacement of U in a valid restriction

ij

orig

of U must intersect the b oundary of U for some i i k 2

ij

This explains comp onents of U that cling to its b oundary as in Figure and Fig

j

ure It also explains comp onents of U i k that cling to the inner b oundary

ij

which is the b oundary of P P see the righthand twocomponent U of Figure

i j ij

Theorem is an imp ortant consideration in designing a containment algorithm The

b oundary intersection b ehavior o ccurs frequently in practice and so it is unreasonable to

exp ect for example that the convex hull of a replacement p olygon is strictly inside the

original p olygon

Lo ose Fits

It is clear that little restriction can b e exp ected if the containment problem has a lo ose

tting solution In the extreme case of no container no restriction is p ossible at all

Annular Conguration Spaces

For a given set of items as the container b ecomes less restrictive each replacement of

a U p olygon in a restriction of U for i k assumes an annular shap e Here we use

ij

the terms annular and annulus in the top ological sense see Figure

This b ehavior o ccurs b ecause when the t is lo ose enough each p oint on the b oundary

of P P is a valid relative displacement That is each p ossible contact b etween P and

i j i

P is legal An example is shown in Figure In this example the outer b oundary of the

j

annulus is formed by our geometric restriction see Section

The annular shap e presents a challenge for certain types of containment algorithms For

example if the algorithm uses external approximations to the U s then it will consider a

ij

conguration to b e valid if every t t is within the approximation to U However if some

j i ij

t t is within the inner hole of the annulus then P and P overlap and the conguration

j i i j

is not valid

Size and sAnalysis

Restriction reduces the area of U but it is not guaranteed to reduce the number of

vertices of U This can cause problems in analyzing the running time of a restriction or a

containment algorithm For this reason for a given set of restriction op erations we choose to

express the running time of such an algorithm in terms of the maximum number of vertices

s generated by applying any sequence of the restriction op erations to U DM Expressing

running time in terms of s is what we call size analysis or sanalysis of the algorithm as

Figure An annular conguration space

introduced in Section The use of sanalysis gives a measure of the practical running

time of a containment algorithm

Supp ose U has a nite number of vertices Some sets of restriction op erations on U

have nite s even when applied an innite number of times One example is intersections

using vertical or horizontal halfplanes Intersections with arbitrary halfplanes however

cause s to b e innite The question of whether or not the op erations we use in our valid

restrictions cause s to b e innite is an op en problem and a sub ject of future work see

Section We show b elow that if al l p ossible valid restrictions are p erformed on U

the resulting number of vertices is nite

Theorem U has a nite number of vertices and a nite number of connected com

ij

ponents

has a nite number of vertices It then follows that the num Pro of We rst show that U

ij

b er of connected comp onents is also nite Recall from Section that m max m

ik i

Here we let M max m We establish a rough upp er b ound on the number of vertices

ik i

in U by rst nding an upp er b ound on the number of vertices of the k dimensional free

ij

conguration space S Each vertex of S is the intersection of k hyperplanes Let Q b e

an upp er b ound on the number of hyperplanes then the number of vertices of S is no

k

more than Q b ecause it is wellknown that the size of an arrangement of n hyperplanes

d

in d dimensions is n Ede Each hyperplane corresp onds to a contact b etween two

p olygons P and P For each p olygon pair there are at most M contacts and there are

i j

3

Knowing all p ossible valid restrictions is NPhard

k k pairs so Q M k k Thus an upp er b ound on the size of the free

k k k

conguration space is given by OM k k M k k Now U is a

ij

pro jection of S The pro jection step can introduce new vertices and so the number of

vertices in U is b ounded by the size of an arrangement of the hyperplanes Thus the

ij

2 2

k k k k k

number of vertices in U is b ounded by OM k k OM k k

ij

Therefore U has a nite number of vertices and connected comp onents 2

ij

We note that tighter b ounds have b een obtained for the size of the free conguration

space in sp ecial cases For example Avnaim and Boissonnat AB show that for two non

convex p olygons and a nonconvex container the free conguration space is of size OM

Recently for example Aronov and Sharir AS showed that for a convex p olyhedron B

translating in space among k convex p olyhedral obstacles A A with disjoint interi

k

ors the free conguration space for B has size OM k log k where M is the total size of

the Minkowski sums P A B for i k

i i

The number of connected comp onents of the restricted U is closely related to the num

b er of vertices We simply remark here that restriction can fragment U into many small

connected comp onents and that this should b e taken into account when designing a con

tainment algorithm

Identical Items

and U If P and P are identical with no rotations allowed then U U so U

i j i j

j i

can replace each other In this case P P is symmetric ab out the origin If any p oint

i j

p in U i k is removed by a restriction then p can also b e removed Thus U is

ij

ij

symmetric with resp ect to the origin

This symmetry reects the fact that given a valid conguration identical items pro duce

valid equivalent congurations If an algorithm exp ects to deal often with identical items

it is wise to take advantage of the equivalent congurations see Section

SteadyState Geometric Restriction

In DM DM we present restrictions which op erate directly on U The restrictions use

the Minkowski sum and a closed intersection op erator see Section Each element of U

is replaced using op erations that include other elements of U as input Theorem b elow

encompasses all three restrictions from DM DM Figure illustrates the theorem

Theorem U U U U h i j k h i j is a valid restriction

ij ij ih hj

Pro of The theorem states that a valid displacement from P to P must b e a valid

i j

displacement from P to P plus a valid displacement from P to P 2

i h h j

4

Guibas et al note GRS that if A is convex then A A is symmetric with resp ect to the origin

The extension to arbitrary A is trivial

5

Two congurations are equivalent if their t s corresp ond to a p ermutation of identical items

i Pj

U tj - ti c- i j t - t c- j h Uh j P i t - h ti c- Ui h P

h

Figure Geometric restriction

Avnaim and Boissonnats Solutions to NN and NP

We show that the op eration of Theorem can b e viewed as a generalization of

Avnaim and Boissonnats AB solutions to NN and NP

Avnaim and Boissonnat show for NN that the set of all the valid relative p ositions of

U U U This is an exact P with resp ect to P is given by in our notation U

ij i j j i

ij

solution Each element of the set U corresp onds to a valid conguration We observe that

ij

for k NN each valid displacement for two p olygons must also b e a solution for NN

Avnaim and Boissonnat observe that for NP a valid translation t exists for P only

if

t U U t t U t t

where t t U and t t U Thus U U U U U U is a

valid restriction for NP

For their solution to NP Avnaim and Boissonnat show that any vector in U U

U is guaranteed to have an asso ciated displacement for P with resp ect to P corresp ond

ing to a solution to NP The pro of relies on their application of Hellys Theorem Supp ose

we have three parallelograms which are the same ane transformation of dierent but

axisparallel rectangles If the three parallelograms intersect pairwise then all three have

a common p oint We observe that in the general case U U U for h i j

ih hj

ij

In our notation Avnaim and Boissonnats solution to NP applies U U U U

ij ij i j

i j followed by U U U for h i j Each element of U

ij ih hj ij

then corresp onds to a solution to NP

SteadyState Restriction

One would hop e that rep eated applications of the restriction in Theorem would

yield the set of U in the limit Actually this is always true only for k For k one

ij

can construct counterexamples but only with diculty For k it is easy to construct

counterexamples We iteratively apply the valid restriction of Theorem until no more

signicant shrinking o ccurs We denote the resulting restriction by SSGR steadystate

geometric restriction In the pseudoco de b elow E mpty U is a set containing k k

copies of the empty set

SSGRU k

do

for i to k

for j i to k

for h to k

if h i j

U U U U

ij ij ih hj

if any U U return E mpty U

ij

else U U

j i ij

S maximum fractional area shrinkage in U

d maximum diameter of a p olygon in U

while S and d

return U

The parameter is sp ecied by the user It is used to help judge when to terminate

the restriction pro cess The parameter is not sp ecied by the user It is the relative

area shrinkage For the program achieves a true steady state if the

maximum p olygon diameter is greater than and the maximum area is greater than in

which additional restrictions cannot shrink the p olygons further However this can require

an innite number of iterations We use and in our implementation these

are satisfactory for our applications Using nonzero values of and gives us a b ound on

the number of restriction iterations see Section

The steadystate restriction pro cess is quite p owerful We know that U U U

ih hj

ij

U U U for q h i j In for h i j However it is also true that U

ih hq q j

ij

order to generalize this result we dene the notion of a list restriction We then show in

Theorem that SSGR satises all list restrictions

Denition Given a list of indices i j the list restriction

q q

of U corresponding to is the restriction

ij

U U U U U U U

ij ij i j

q q

q 1 2 3 1 2 1

In the following theorem our use of the term steady state refers to the true steady

state describ ed ab ove in which

Theorem If multiple applications of SSGR reach a steady state then al l possible list

restrictions are satised

Pro of The pro of is by induction on the length of a list which is the number of indices

in the list The base case for a path of length two is true b ecause SSGR satises all list

restrictions of length two The induction hypothesis is that the list restriction for every list

of length q is satised Consider the list i j of length

a b c q

q We show that the list restriction for is satised First by the inductive hypothesis

the list restriction for the path i j of length q is satised

a c q

so

U U U U U

ij ij i j

a c q

1

Now b ecause a steady state has b een achieved applying SSGR to U do es not change

a c

U This means

a c

U U U U

a c a c a c

b b

and hence U U U Substitution yields

a c a c

b b

U U U U U U

ij ij i j

a c q

1

b b

which is the list restriction for Thus the list restriction for is satised 2

Running Time

Here we calculate the asymptotic running time of SSGR We assume

s is the largest number of vertices of any p olygon generated by a sequence of inter

section and Minkowski sum op erations on p olygons in U

is a real number representing a lower b ound on the maximum diameter of a p olygon

in U

is the fractional shrinkage in area required by each iteration of SSGR

Theorem The running time of SSGR is in Olog k s log s

Pro of Let r b e the number of iterations of the while lo op in SSGR We have

Olog r Olog

We p erform the op eration U U U U inside of three nested lo ops Each

ij ij ih hj

op eration takes Os log s time Each lo op executes k times Therefore the running time

is k r s log s

The total running time is therefore

Olog k s log s

2

Example

Figure shows an example from the apparel industry Three trim pieces are to b e

placed The nearly triangular shap e displayed in Figure is a scaled version of the U

j

p olygon for the rectangular trim piece with resp ect to the container on it the U p olygon

j

for the SSGR of U is shown as a black lled region More than of the area is eliminated

by the restriction pro cess all that remains is the tip Figure shows the twocomponent

U p olygon for the rectangular trim piece with resp ect to one of the other two trim pieces

ij

The U p olygon for the SSGR of U is shown as a black lled region Again more than

ij

of the area is removed by our restrictions SSGR takes three seconds to execute this

example on a MHz SPARCstation

Figure SSGR containment problem place convex items

Figure A onecomp onent U with U for the SSGR of U

j

j

for the SSGR of U Figure A twocomponent U with U

ij

ij

Eectiveness

In order to gauge the eectiveness of SSGR for k we applied it to more than

containment problems Some of these were infeasible examples and some were feasible

Most of these examples were drawn from apparel manufacturing Typical ranges for m and

n were m and n For our apparel examples we pro duced each

feasible containment problem by removing a group of neighboring items from an existing

layout To create an infeasible problem we moved some of the remaining items a small

distance into the container In all cases the area of the container was at least as large as

the sum of the item areas In addition each pair of items t into the container so that all

U s were nonnull b efore applying SSGR

ij

The actual running time of SSGR in practice dep ends on the values of k m n

and the sp eed of the underlying set op erations We currently use and

Although in theory SSGR can continue for many rounds b efore reaching a steady state

we nd that if we terminate SSGR when no p olygons area decreases by at least one

or two rounds is usually sucient For these values of and k our current

implementation of set op erations and the typical ranges for m and n given ab ove our

SSGR runs approximately ten times more slowly than the steadystate linear programming

restriction of Section On a MHz SPARCstation SSGR running times tend to range

from less than one second for small values of k m and n to several minutes for larger values

of k near m near and n near For more details see the running times for our

approximate algorithm in Section this algorithm uses SSGR

Our fo cus here is on how well SSGR restricts U We measure eectiveness as the

orig

p ercentage of area removed by SSGR averaged over all U s Since the U s are unbounded

ij

ij

and innite in area for i j we apply Equation b efore measuring p erformance As

exp ected little or no restriction o ccurs for lo ose ts

Infeasible Examples

Table shows results for infeasible examples We use the k CN and k NN notation

introduced in Section For each case where SSGR do es not detect infeasibility we give

the average relative p ercentage area restriction over all the U s In all the failure cases

ij

this gure is less than

In slightly more than of the cases SSGR detects infeasibili ty This suggests that

SSGR can b e valuable as a prepro cessing step for a containment algorithm

Type Detected Type Detected

CN yes CN yes

CN no CN yes

CN no CN no

NN yes NN yes

NN yes NN yes

NN no NN yes

CN no NN no

CN no

Table SSGR applied to infeasible examples

Feasible Examples

For the feasible examples k For of the feasible examples the average

relative p ercentage area restriction over all the U s is b elow We found that

ij

is ab ove and is ab ove This data shows a pattern similar to the infeasible

examples for our test cases it is rare to see a mo dest amount of SSGR restriction of around

Constructing Restrictive Examples

Our goal here is to provide insight into the types of situations in which SSGR p erforms

well Naively one might think that a tighttting example whose only solutions are highly

interlocking would have high restriction However the requirements are more subtle The

only valid congurations for the NN example in Figure are tighttting and highly

interlocking yet the average SSGR p ercentage for this example is only

In order to create a restrictive example we want U U U to b e false as much

ij ih hj

as p ossible That is we desire restrictive triples as dened b elow in Denition We

show b elow some ways of creating restrictive triples

Denition If U U U then P P P is a restrictive triple

ij ih hj i j h

Figure A NN example with SSGR restriction

1

2

3

Figure Lshap ed container and items

A simple Lshap ed container can b e used to induce restriction b ecause the base of the

L can b e used to trap an item Consider the example in Figure Restrictions will

reduce the area of U and U b ecause P can only t in the base of the L this prohibits

P and P from b eing in the base of the L The limited p ossibilities for P will also cause

restrictions to reduce the area of U SSGR for this example reduces the area of U and

U each by more than and the area of U by

Figure shows a NN example which has average SSGR restriction of The

shap e of the container greatly restricts the p ositions for the narrow p ointed item in the

middle of the column of unplaced items This means there are many restrictive triples

Swapping this item with the rectangular item at the b ottom right corner of the layout

pro duces an example with average SSGR restriction of only

Figure A NN example with average SSGR restriction

In b oth Figure and Figure the shap e of the container limits the p ossible

p ositions of one item P this in turn removes placement p ossibiliti es for the remaining

i

items Thus U U U for some i j

j i ij

orig

We dene a restrictive container as follows Consider U Apply Equation so

that each U is b ounded If for the resulting U there is some U U U then

ij j i ij

the container is restrictive Note that except for applying Equation we do not use

replacement p olygons in this denition Under these assumptions if there is a restrictive

triple which includes P then the container is restrictive Clearly if a containment problem

has no restrictive triple then the container is not restrictive

Figure shows a dierent type of situation Here the container is complicated and the

containment problem is infeasible SSGR detects the infeasibility However the container

is not restrictive b ecause the placement p ositions for a single item within the container are

not limited by adding a second item to the container In this example it is restrictions of

the form U U U U i j h which are instrumental in detecting the

ij ij ih hj

infeasibility

If we choose an unrestrictive container we must select the items carefully in order to

induce strong restriction For example given a rectangular container of height h and width

w we can form three items of height h and width w see Figure in which the items

orig

are shown placed in the container In this case each U is a vertical line segment of

j

Figure An infeasible CN example

length h Each U i j after applying Equation is a vertical line segment

ij

of length h with a segment of length h removed from its center Restrictions shrink

each U i j down to four p oints which are the endp oints of the two line

ij

segments These are propagated to U j leaving three p oints on its vertical line

j

spaced at intervals of h

1

2 h

3

Figure A CC example with an unrestrictive container

This example do es not work for k b ecause in that case there is no restrictive triple

which excludes P

Theorem Given a rectangular container of height h and width w and an integer

k for the translational containment problem with k rectangular items each of height

hk and width w the U i j k are unaected by restrictions of the form

ij

U U U U for which neither i j nor h is

ij ij ih hj

Pro of The U i j k are identical b ecause the items are identical Hence

ij

each replacement of such a U is the same Recall from Section that U U each

ij ij j i

restriction therefore reduces to U U U U This has no eect if U U U

ij ij ij ij ij ij ij

Each U after applying Equation is a vertical line segment of length hk k with

ij

a segment of length hk removed from its center This forms two vertical line segments

let a b c and d b e their endp oints from top to b ottom U a covers all of segment

ij

ab except for a segment of length hk extending downwards from a U b covers all of

ij

segment ab except for a segment of length hk extending upwards from b Because each of

the two segments comprising U is of length hk the union of these sums completely

ij

covers segment ab Similarly the union of the sums U c and U d cover segment cd

ij ij

Thus U is a subset of U U and therefore the U s i j k are unaected by

ij ij ij ij

restrictions of the form U U U U for which neither i j nor h is 2

ij ij ih hj

A containment problem which satises the conditions of Theorem clearly also has

no restrictive triples which include P Thus SSGR applied to such a problem pro duces no

restriction

1 2 3 4 5 6

Figure A NC example with average SSGR restriction

The previous example might suggest that a rectangular container cannot b e restrictive

for k This is not true It is easy to create a restrictive triple involving a rectangular

container for k using nonconvex items Figure shows one example for which the

items are placed in the container SSGR provides average restriction of in this case

with the area of some U s reduced by more than One of the restrictive triples in this

ij

example is P P P

An example for k with a rectangular restrictive container and convex items can b e

constructed using only slightly more eort It can b e done using rectangles and the idea

of guil lotine cuts An example is given in Figure the items are shown placed in the

container This example has average SSGR restriction Item participates in several

restrictive triples The amount of restriction is controlled by the width of item In order

to prevent items from tting side by side the width of item should b e less than half

the width of the container

Theorem Given a rectangular container of height h and width w and an integer

k for the translational containment problem with k rectangular items one of height h

and width z w and k of height hk and width w z the U i j k

ij

are aected by restrictions of the form U U U U for which neither i j nor

ij ij ih hj

h is

Pro of Assume wlog that the item of width z is item number We show that

U U U U which implies that the restriction U U U U

removes area from U Refer to Figure in which the origin is marked o The two

6

A guillotine cut is a common term in the cutting and layout world It refers to a metho d of applying a

sequence of horizontal and vertical cuts to an axisparallel rectangle Each cut go es all the way through the

remaining rectangle See for example DD 2

3 1

4

5

Figure A CC example with average SSGR restriction

shaded rectangles represent U Each rectangle has width z and height k hk

The rectangles are separated by a vertical distance of hk The two vertical dashed

lines represent U U Each line has length h and is at a distance w from the origin

The Minkowski sum U U consists of three vertical lines of length h adjacent lines are

separated by a distance of w Two of them are at a distance of w from the origin and hence

cannot intersect U One of the vertical lines runs through the origin Because it extends

a length of h ab ove and b elow the origin and each rectangle of U ends at a distance of

k hk ab ove or b elow the origin the intersection of U with this vertical line

consists of two vertical line segments shown as thick lines in Figure This intersection

is clearly a prop er subset of U 2

o

Figure U U U

Figure shows another guillotinelike layout with the p olygons placed in the con

tainer In such an example the area of some U p olygons is reduced by as much as

ij

For example the area of U is greatly reduced due to items and

Our nal example of how to construct a restrictive containment problem is shown in

Figure Figure depicts a highly restrictive NN example In this case the large

nonconvex item together with the two large ovals form a restrictive triple Figure shows

the eect of SSGR on two onecomp onent U s in this case each has more than of its

j

area removed by the restrictions 2 3 5 6

8 1 4 7

9

Figure A CC example with strong SSGR restriction

Figure A highly restrictive NN example

Figure A NN example eect of SSGR on two onecomp onent U s

j

Barriers to Restriction

Restrictions of the form U U U U are ineective when U U U

ij ij ih hj ij ih hj

or equivalently when U U U The following theorem provides a condition for

ij ih j h

which this is true

Theorem Let A and B be polygons and let the origin be denoted by O If either

O B or A is connected and no translated copy of A lies entirely within the component of

B that contains O then A A B

Pro of Consider a p oint p A To prove that A A B it suces to show that

p a b where a A and b B Translate A by p and denote this A If B contains O

p

B which contains O then p p O so were done Otherwise let B b e the comp onent of

No translated copy of A lies entirely within B this guarantees the existence of q p A

p

such that q p B If q p B then q p b B implies p q b so were done Now

assume q p B A is connected and so there exists a connected path from O A to

p p

q p A The endp oints of are also in dierent comp onents of the exterior of B so

p

must intersect B at some p oint b B Then b ecause A there exists a p A such

p p

that b a p This implies p a b which completes the pro of 2

The following corollary is immediate from the ab ove theorem

Corollary Let A be a simple bounded connected polygon such that the origin is

contained within the interior of the outer boundary of A Then A A A

Note It is not true in general that A A A even with the additional constraint

that A A Figure presents a counterexample In the gure A consists of two

p oints and A A However A A consists of three p oints which are not part of A

Therefore A A A

a) A b) A + -A

= origin

Figure Counterexample for A A A

The next corollary follows immediately from transitivity

Corollary Let A and B be polygons satisfying the conditions of Theorem and

let C be a subset of A Then C A B

In practice we observe that it is rare for SSGR to remove any area when all items

are identical Even when only some items are identical we observe limited restriction

This makes sense in light of the ab ove results For if all the items are identical then

U U U U If in addition U satises the conditions of Theorem on

ij ih hj j h ij

A and B then U U U and therefore no restriction will o ccur Although SSGR

ij ih j h

can b e ineective when items are identical Milenkovic has recently designed a restriction

to deal eectively with identical items see the brief description of his symmetry breaking

restriction in Section In addition we remind the reader that when items are identical

the number of subproblems created by using the translational containment characterization

of Section is reduced

When the b oundary of a U for i k is a closed curve it always contains the origin

ij

In this case the U satises a necessary condition for Theorem and its corollaries

ij

We tested the hypothesis that the extent to which the U s i j k are closed

ij

curves is a key factor in the eectiveness of SSGR For each of the more than feasible

cases we estimated the closure by sho oting rays from the origin at equally spaced angles

ab out the origin Let b e the fraction of rays which hit the U We recorded the average

ij

over all U s as well as the maximum and minimum for each example We then calculated

ij

correlation co ecients for each of these with resp ect to the total restriction p ercentage We

hop ed to nd high negative correlation indicating a linear relationship in which high and

a small amount of restriction were related

We did nd that whenever the average was high SSGR eectiveness was low For

eectiveness was and for efectiveness was The interlocking

NN example of Figure has average and SSGR restriction of less than

Some of its U s are shown in Figure

ij

However eectiveness is sometimes low even when average is not high This tends to

o ccur when several items are identical The correlation co ecient for average

meaning only of the restriction results can b e predicted using average The correlation

co ecient for maximum and for minimum Thus alone is not a

sucient predictor of SSGR eectiveness

Figure Selected U s for NN example

ij

SteadyState Linear Programming Restriction

A dierent metho d of restriction based on linear programming was developed by

Milenkovic and is describ ed in DM MD This steady state linear programming restric

tion technique SSLPR is an indirect one which uses the convex hulls of the conguration

spaces It works as follows Temporarily replace every element U U by its convex hull

ij

H U The set of constraints

ij

t t H U i j k

j i ij

can b e expressed as a linear program which is called the CLP constraint linear program

A p olynomialtime algorithm is given to pro ject the k dimensional feasible space F into

any element U of U If the pro jection is denoted F then the replacement

ij ij

U U F

ij ij ij

is a valid restriction

Example

We present an example of SSLPR from the apparel industry Figure depicts three

v shap ed items which are to b e placed in a nonconvex gap in a clothing marker Fig

ure shows two twocomponent U p olygons for this example Their replacements

j

7

Programming work on the linear programming restriction was p erformed by Umesh Shankar while at

the MIT Summer Research Institute Sha

are shaded in black Figure shows two U p olygons and their replacements The one

ij

comp onent p olygon on the left is unaected by restriction The area of the threecomp onent

p olygon on the right however is visibly reduced This example takes less than second to

execute on a MHz SPARCstation

Figure SSLPR containment problem place nonconvex items

s for SSLPR of U Figure Two twocomponent U s with U

j

j

s for SSLPR of U Figure A onecomp onent U with U

ij

ij

Eectiveness

Here we discuss the eectiveness of SSLPR We also compare the eectiveness of SSLPR

with SSGR Preliminary results on the eectiveness of the linear programming restriction

app ear in Sha

SSLPR has the prop erty that it cannot increase the number of reex vertices in U Of

course SSGR has no such guarantee

SSLPR approximates each U by its convex hull If all the U s are convex then SSLPR

ij ij

can give an exact solution to the containment problem If a U is very dierent from

ij

its convex hull then many invalid p oints will b e considered valid by the linear program

Therefore as Shankar observes Sha SSLPR provides b etter restriction when the U

ij

p olygons are similar to their convex hulls than when the U s and their convex hulls are

ij

dissimilar

Unfortunately most of the U s i j k are quite dierent from their convex hulls

ij

immediately after applying Equation b ecause each b ecomes the dierence b etween two

p olygons For this reason we observe very little SSLPR restriction for our collection of

more than test cases Only of the feasible examples have any SSLPR restriction

SSLPR is not able to detect infeasibility in any of the infeasible examples For all the cases

where SSLPR achieves some restriction the SSLPR of U is a sup erset of the SSGR of U

SSLPR clearly cannot b e exp ected to function well for examples having many annular

U s This includes lo ose ts and identical items

ij

The examples in which SSLPR is eective have restrictive containers that force the U

j

of some item to consist of a small single nearly convex comp onent For example for the

Lshap ed container of Figure and its three items SSLPR achieves an average of

restriction SSLPR do es not do well in situations for which the container is unrestrictive

For example Figure where SSGR reduces the area of some U s by up to has no

ij

SSLPR restriction

Based on the success of SSLPR on examples like that of Figure it is reasonable to

exp ect SSLPR to b e eective in propagating the eect of selecting a single nearly convex

comp onent of a U for consideration An example is shown in Figure where a single

ij

comp onent of a U on the far right is selected causing the area of the two twocomponent

ij

U s on the left to b e reduced This selection is useful in a containment algorithm which

ij

relies on sub division see Section For our current implementation SSLPR is roughly

ten times faster than SSGR this makes it a practical type of restriction to use within a

sub division containment algorithm

Figure Eect of SSLPR on U s when a single comp onent of a U is selected

ij ij

Although our tests suggest that SSGR is more p owerful than SSLPR there are in theory

cases for which SSLPR can provide more restriction than SSGR Also in our hierarchical

containment algorithm we have o ccasionally seen SSLPR remove area not removed by

SSGR see Section

The following is an example for which SSLPR is more p owerful than SSGR Consider

the container and three items in Figure The container is the union of the b oundaries

of two equilateral triangles Each triangle has sides of length s The p oints a b and c

at alternating reex vertices of the container form an equilateral triangle Each of the

three items has length s Each also has two holes each hole is of the way from an

endp oint The lo cal origin of each item is indicated in the gure The reader may verify

that U fb cg U fc ag and U fa bg Also U f a bg U f b cg

and U f a cg This example is infeasible b ecause any simultaneous placement of the

three items would force their endp oints to collide SSGR is unable to detect this infeasibili ty

b ecause the U s satisfy U U U However there is also no feasible solution to the

ij ij ih hj

CLP using the convex hulls of the U s and so SSLPR can detect the infeasibility

ij

It is easy to construct an example for which SSGR removes a region which SSLPR

cannot Consider again the containment problem of Theorem In that case each U

j

is a pair of parallel vertical line segments The convex hull of these segments will cause

the CLP to allow solutions in which item overlaps another item This in turn will cause

p oints of the U for an identical pair of rectangles which SSGR removes to b e valid for

ij

the CLP Thus p oints will b e removed by SSGR that are not removed by SSLPR

We conclude that SSGR and SSLPR are complementary restrictions

container local origin P3 P1 c

b P2

a holes

Figure Example for which SSLPR is more p owerful than SSGR

Subset Restriction

If one item P is a subset of another item P then the following theorem can b e used

i j

The theorem assumes that when the lo cal origins of the two items are aligned then P P

i j

P P and U P P Theorem If P P then for P U

i h h i i j h

hj j h

Pro of P P implies that P P P P Since P Q implies that Q P

i j i h j h

U P P P P so U P P For the second part U we have

j h i h i h

hj j h j h

and P P P P applied to U P P yield U P P This

i h h i i h h i

j h hj

immediately gives U P P 2

h i

hj

Corollary If P P then U U P P and U U P P are

i j j h j h i h hj hj h i

valid restrictions

We call the valid restrictions given by Corollary subset restrictions Subset re

strictions can b e useful when initially calculating U If a U is null then U need not b e

hi hj

calculated

Union Restriction

This section introduces a valid restriction which assumes that a particular U is the

ij

union of a collection of p olygons First we argue that if A U then restrictions on A

ij

are welldened if we replace U in U by A Recall from Section that U is the set of

ij

ij

all values of t t which b elong to a valid conguration and recall from Section that

j i

U is the replacement of U in a valid restriction of U Analogously A is the set of all

ij

ij

values of t t in A which b elong to a valid conguration and A is the replacement of A

j i

in a valid restriction

Lemma If A U then A U and A A U

ij

ij ij

Pro of The rst part follows immediately from A U To obtain the second part by

ij

denition A A this together with the rst part of the lemma imply A A U To

ij

obtain equality observe that if a p oint t t is in A U and hence in U it is part of

j i

ij ij

a valid conguration therefore t t must also b e in A 2

j i

S S

A A then U Theorem If U

h ij

h h

ij

h

S S

A Now A Pro of By denition of a valid restriction A A This implies

h h

h h h h

S S

since A U Lemma implies A Substituting this into A U A A

h ij h

ij h h

h h h

S S S S S

yields A U A This implies U A A Since U A this

h h ij h

h h h h h

ij ij

h h

S

simplies to U A 2

ij h

h

Theorem immediately yields a valid restriction which we call a union restriction

Coursegrained parallelism can b e used to implement this restriction In the pseudoco de

b elow let A b e the set of all the A p olygons whose union is U and supp ose there are

h ij

h h

is pro cessor hs l such p olygons U represents a copy of U for the hth pro cessor and U

ij

U is a set containing k k copies conguration space for P with resp ect to P E mpty

j i

of the empty set

UNIONRESTRICTU k i j A l

for h to l do in parallel

h

U U

h

A U

h

ij

h h

U ANYVALIDRESTRICTIONU k

U E mpty U

for s to k do

for t to k do

for h to l do

h

U U U

st st

st

return U

CharacterizationBased Restriction

We present here a restriction which do es not satisfy the criteria for a valid restriction

That is it do es not preserve the invariant U U However the restriction is useful

ij

ij

when only a single valid conguration is required b ecause if a valid conguration exists

a valid conguration also exists after the restriction Thus the restriction is a semivalid

restriction see Denition

The restriction is based on the containment characterization given in Section We

use a partial characterization based on the second part of Theorem which guarantees

that if a valid conguration exists then one also exists for which there are at least two

contacts p er p olygon We apply this to P and use the weaker condition that the p olygon

has at least one contact This means that if a valid conguration exists there must exist

a valid conguration for which some t t is on the b oundary of its U Therefore we

h h

preserve the existence of such a conguration if we replace each U by its b oundary apply

h

any valid restriction and then set U equal to the union of the restricted sets Coursegrained

parallelism can b e used here

h

As in the previous section in the pseudoco de b elow U represents a copy of U for

h

the hth pro cessor and U is pro cessor hs conguration space for P with resp ect to P

j i

ij

E mpty U is a set containing k k copies of the empty set

BOUNDARYRESTRICTU k

for h to k do in parallel

h

U U

h

BOUNDARYOFU U

h

h

h h

U ANYVALIDRESTRICTIONU k

U E mpty U

for i to k do

for j to k do

for h to k do

h

U U U

ij ij

ij

return U

Symmetry Breaking and Subset Substitution Restric

tions

Section observes that identical items pro duce equivalent congurations These

p ose a sp ecial challenge for SSGR as discussed in Section In recent work Milb

Milenkovic has developed a new form of restriction to overcome the diculty that SSGR

and SSLPR have with identical items His idea is to arbitrarily choose a vector v and

then imp ose the constraint that t v t v if items P and P are identical This has

i j i j

the eect of a reduction in the area of U A resymmetrizing step is ultimately

ij

necessary to make the symmetry breaking restriction a valid restriction without this it is

only a semivalid restriction

The symmetry breaking restriction can also handle nonidentical items through a valid

restriction called a subset substitution restriction The main idea of this restriction is as

follows If a p olygon A is a subset of each of a collection of p olygons then we can substitute

a copy of A for each of the p olygons in the collection calculate U using these copies of A

p erform restrictions on U for the copies of A and then use these restrictions as valid

restrictions for the U involving the original items Note that this is not the same as the

subset restriction of Section in that case b oth P and P are to b e placed simultaneously

i j

in the same layout and P is not substituted for P In the most general form of the subset

i j

substitution restriction one can replace each p olygon P by a subset P The P s can all

i

i i

b e the same as ab ove or they can all b e dierent or some the same and some dierent

Closed Op erators

Here we discuss an imp ortant design issue related to the type of set op erations used to

implement restrictions

Consider a general p olygon ie a collection of p olygonal comp onents where each com

p onent is connected

Denition A general polygon P is regularized if it is equal to the closure of its

interior

Figure b depicts a regularization of the nonregularized general p olygon of Fig

ure a Regularized p olygons are not sucient for our application Using only regular

ized set op erations can cause the algorithm to incorrectly conclude during a restriction that

no solution exists This can o ccur if the intersection of two p olygons is either a line segment

or a p oint In fact this situation can o ccur often for tight ts One example is a stack of

rectangles inside a rectangular container where each rectangle to b e placed has the same height as the container see Figure

(a) Non-regularized general polygon (b) Regularized general polygon

Figure Regularization example

A nonregularized p olygon do es allow isolated p oints and line segments see Figure a

Unfortunately it also allows isolated p oints or line segments to b e removed from its interior

Thus a nonregularized p olygon need not b e closed ie equal to its closure its b oundary

plus the closure of its interior Since the conguration space we op erate on is closed we

must deal with closed sets We therefore need closed p olygons Union and intersection

op erations on closed sets are dened in the normal way b ecause the union and intersection

of two closed sets is closed However the complement of a closed set is op en so we take

the closure of the complement of a closed p olygon

Correct implementation of the algorithm requires the use of robust closed set op erations

The set op erations must b e implemented robustly in order to minimize error accumulation

during the steadystate restriction pro cess Closed op erators are imp ortant to b oth the geo

metric and linear programming restrictions They are more crucial to geometric restrictions

since these rely more heavily on set op erations

AB A U B

Figure Two rectangles with degenerate intersection

For our rst implementation of SSGR we used robust intersection union and comple

ment op erators which handled only regularized general p olygons Our robust set op erators

are based on geometric rounding LMb MN Mila Milb In order to shrink p oly

gons to their b oundaries we added op erators which can handle line segments and p oints as

well as lists of p olygons However our underlying p olygon op erators were still regularized

We are currently redesigning these op erators so we will have a complete set of op erators for

closed p olygons

Summary and Conclusions

In this chapter we have made several general observations ab out restrictions for trans

lational containment For example we have observed that replacement p olygons often

have comp onents which intersect the b oundary of the original p olygon and shown when

and why this o ccurs These prop erties represent imp ortant considerations for designers of

translational containment algorithms

We have discussed the valid restriction SSGR in detail We have evaluated the eec

tiveness of SSGR and of Milenkovics SSLPR We conclude that SSGR is often much more

eective on containment examples than SSLPR SSLPR p erforms b est when the congura

tion spaces are similar to their convex hulls SSGR p erforms b est when a restrictive triple

of items exists Both restrictions p erform p o orly for lo ose ts identical items and other

circumstances that cause the conguration spaces to b e closed curves containing the origin

Both restrictions are eective in propagating the eects of selecting a single nearly convex

comp onent of a p olygon for consideration SSGR and SSLPR are complementary There

are cases for which SSGR can restrict more than SSLPR and cases for which SSLPR can

restrict more than SSGR

We have also introduced subset union and characterizationbased restrictions and

discussed Milenkovics symmetrybreaking restriction

C h a p t e r

Evaluation and Sub division

Introduction

In this chapter we present evaluation and sub division metho ds Recall from Chapter

that given a restricted hypothesis the evaluation step tries to nd a valid conguration

within the hypothesis If no solution is found by the evaluation step then the sub divi

sion step divides the current hypothesis into two subhypotheses such that if a solution

exists within the current hypothesis then a solution must exist within one of the two

subhypotheses To divide the current hypothesis we partition one of the conguration

spaces into two parts The algorithm then recurses on each part while keeping the other

conguration spaces constant

Section gives an overview of our work on evaluation Section outlines our

work on sub division Section gives an overview of this chapter

Evaluation

In order to evaluate a hypothesis we can invoke an exact algorithm for k NN at this

p oint or p erhaps a MIP algorithm such as that of DML However these alternatives

are costly For the purp oses of our general containment algorithm given in Section all

we really require is a fast test which generates a conguration and tests to see if it is a valid

conguration t t U i j k If the test succeeds then we have a solution

j i ij

As explained in Section the evaluator decides yes no or maybe It decides

yes if it nds a valid conguration within the current hypothesis It decides no if

it determines that there cannot b e a valid conguration within the current hypothesis

It decides maybe if it fails to nd a valid conguration in the current hypothesis but

it is unable to rule out the p ossibility that one exists In the maybe case additional

sub division is required

Our rst evaluation metho d is a greedy one which op erates directly on the conguration

spaces It shrinks each U to a p oint in turn then propagates the eects of that shrinking

ij

via SSGR If any U b ecomes empty during this pro cess then that combination of U

ij ij

p oints is not part of a valid conguration and so the evaluator do es not nd a solution

In this case it returns maybe If however no U b ecomes empty then the collection

ij

of singlep oint U s determines a valid conguration and the evaluator returns yes The

ij

key to the eectiveness of this pro cedure is a go o d choice of a shrinking p oint in a U

ij

We present several selection metho ds One of them pro duces valid congurations without

using sub division in of our test cases This metho d maximizes the intersection of

translations of the conguration spaces

The disadvantage of the greedy evaluation metho d is that it cannot op erate simultane

ously on the conguration spaces As k increases this b ecomes a more serious limitation

An evaluation metho d such as the indirect one of Milenkovic which is based on a con

tainment linear program CLP overcomes this limitation see the discussion of the CLP

in Section and Mil DM It approximates the U s by their convex hulls and uses

ij

linear programming to check if there exists a conguration which is valid with resp ect to

the convex hulls If not then the current U cannot have a valid conguration Thus this

evaluator is able to say no in contrast to the greedy evaluator If a valid conguration

is found with resp ect to the convex hulls and if each p oint found by the linear program is

within its asso ciated U then the conguration is a valid one Otherwise the congura

ij

tion is an overlapping one We apply the work of Li and Milenkovic on overlap reduction

Li ML LMc LMa to improve this evaluation metho d

Both of these evaluation techniques are p owerful enough so that they can in combination

with restrictions sometimes solve containment problems without any sub division

A containment algorithm based on CLP evaluation can solve a containment problem

using a single CLP evaluation if every U U is convex We present a theorem which

ij

sp ecies a condition under which a single CLP evaluation can solve a containment problem

for a restricted U This result has imp ortant implications It provides a test which can b e

used to decide when to switch from a direct to an indirect approach within a containment

algorithm It also leads in Section to a theorem which guarantees that the number

of worstcase sub divisions in certain containment algorithms is not increased by the use of

restrictions

Sub division

In this chapter we also discuss sub division metho ds We dene a set of p ossible goals for

sub division metho ds and then discuss several sub division metho ds which have one or more

of these goals One goal is to reduce the size of a U where size can b e interpreted in a

ij

variety of ways We present a sizebased sub division metho d which reduces the maximum

dimension of the b ounding b ox of a U Another goal is to reduce the number of combi

ij

natorial p ossibilities for a valid conguration We discuss two such combinatoriallybased

sub division metho ds which partition a U by extending one of its edges These metho ds

ij

move away from the current conguration if it is overlapping A dierent way to move

away is oered by our new distancebased sub division metho d

Overview

Section presents our greedy evaluation strategy Section describ es the over

lap reduction evaluation metho d Section gives a condition for which a single CLP

evaluation can solve a containment problem for a restricted U Section presents sub

division techniques Section denes sub division and discusses goals of sub division

Section discusses a sizebased sub division technique Section describ es two

combinatoriallybased sub division techniques Section discusses our distancebased

sub division metho d Section summarizes this chapter and states conclusions

Greedy Evaluation

Algorithm

The metho d we present here is a greedy strategy which shrinks each U to a p oint in

ij

turn then propagates the eects of that shrinking via SSGR If any U b ecomes empty

ij

during this pro cess then the chosen combination of single U p oints cannot b e part of

ij

a valid solution If on the other hand we succeed in shrinking each U to a p oint and

ij

then applying SSGR without any U b ecoming empty then a valid conguration exists see

ij

pro of of Theorem Section gives heuristics for selecting a shrinking p oint for

each U In the pseudoco de b elow the tolerance test varies dep ending on the sub division

ij

metho d used

GREEDYEVALUATEU k

if U fails tolerance test

return BUILDCONFIGURATIONU k

while no U U and some U has not b een shrunken to a p oint

ij ij

select smallest U U which is not a p oint

ij

select a p oint u U

ij ij

U fu g

ij ij

U SSGRU k

if no U U

ij

return BUILDCONFIGURATIONU k

return MAYBE

BUILDCONFIGURATIONU k

t

for j to k

select t U

j j

t t t

k

return YES

Theorem If each U has been shrunken to a point and a subsequent application

ij

of SSGR does not cause any U to be empty then GREEDYEVALUATE yields a valid

ij

conguration for P

Pro of By denition a valid conguration for P is a set of translations t i k such

i

that t t U i j k Since U j k and consists of a single p oint

j i ij j

let t b e that p oint Since t f g we have U t t Now for U i j k

j j j ij

SSGRU k U U U In particular for h u u u where

ij ih hj ij j i

u U u U and u U Since u t t and u t t u u t t

ij ij j j i i j j i i j i j i

Thus the p oints of U constitute a valid conguration and further restrictions cannot alter

that fact 2

Heuristics for Selecting u

ij

We present several heuristics for choosing a shrinking p oint u U In Section

ij ij

we compare the eectiveness of these metho ds in practice The most naive heuristic is to

select a p oint at random Our other heuristics are based on the following claim which gives

a necessary but insucient condition for the existence of a valid conguration

Claim If a conguration ft t g for P is valid then

k

U U t t

hi hj i j

j i

Pro of For xed h for each i U t t contains the origin The claim follows by

hi h i

translating each U t t i j by t t 2

hj h j i h

Claim means that a solution exists only if there are choices for the u which cause

ij

the translated U s to intersect SSGR enforces pairwise intersection of the translated U s

ij ij

However it do es not guarantee the multiple intersection in Claim This is illustrated

by Figure and Figure Figure shows a containment problem for three small

convex items Figure depicts the three U p olygons for this example unrestricted and

j

scaled up U is not translated U is translated by a vector in U and U is translated

by a vector in U In this case a solution is not found b ecause the p olygons do not have

a common intersection

Figure CN example which do es not yield a common intersection of translated U s

j

Avnaim and Boissonnats NP algorithm works b ecause whenever the container is a

parallelogram the U s are parallelograms with sides parallel to the container Avnaim

j

and Boissonnat prove that for parallelograms with parallel corresp onding sides pairwise

intersection implies multiple intersection This version of Hellys Theorem holds even if

k

Note One might b e tempted to conclude from this that our algorithm provides an exact

p olynomialtime solution for k NP However this is highly unlikely to b e true b ecause k NP

is NPcomplete see Section The key to this paradox is that Claim is necessary

Figure No common intersection of translated U s

j

but not sucient For NP we can select u and know that u and u exist and satisfy

Claim Unfortunately for k we cant necessarily obtain a selfconsistent set of

u s for which u u u for all h i j

ij ij ih hj

Convexity of Union

Theorem gives sucient conditions for a set of k p olygons convex or nonconvex

to have a common intersection

Theorem Given a set of polygons P fP P P g if P P is convex i j

k i j

i j k then

k

P

i

i

Pro of If P is nonconvex let p b e a p oint which is on the b oundary of P but is not

k k

on the b oundary of the convex hull of P which we denote by H P We claim p P

k k i

i k Since P is a closed p olygon it contains its b oundary thus p P Now let

k k

Q H P n P Because P P is convex H P P P This implies that Q P

k k i k k i k i

Since P is a closed p olygon it contains the b oundary of any subset of itself Therefore

i

P contains the b oundary of Q which contains p This establishes the claim that p P

i i

i k

1

The generalization from to k p olygons was suggested by Dan Roth

Now supp ose P is convex We prove this case by induction The base case for k is

k

trivially true The induction hypothesis is that our claim is true for k Now we consider

P We claim that P P is convex implies that P P for i k This is true

k i k i k

b ecause of the more general fact that if the union of two closed sets is connected then

they have a p oint in common To establish this fact we argue as follows Let P P b e

i k

connected p P and p P If either p P or p P we are done Otherwise since

i i k k i k k i

P P is connected there exists a path t t where p and p

i k i k

and either t P or t P for t Consider t supft j t P g The p oint

i k i

t is a limit p oint of P t as t increases from Let t infft j t P g We

i k

claim t t For if t t then there exists t such that t t t and t do es not

b elong to either P or P Therefore t P This establishes P P for i k

i k k i k

Now we want to apply the induction hypothesis to the set of k nonempty p olygons

T

k

fP P P P g to establish that P We claim we can do this b ecause

k k k i

i

P P P P is convex i j k This is true b ecause

i k j k

P P P P P P P

i k j k k i j

This is the intersection of two convex sets and is therefore itself convex This completes the

induction and establishes the theorem 2

Corollary Suppose P is a set of polygons satisfying the conditions of Theorem

Let P be convex and intersect al l the other polygons P P i k It fol lows

i

that

k

P

i

i

Pro of In the pro of of Theorem for the case where one of the p olygons is convex

we only used the prop erty that P P That prop erty is satised here b ecause of the

i k

conditions of the theorem 2

Note that we have an exact solution to NN if V V u and V u satisfy the

conditions of Theorem or Corollary However these results cannot give an exact

solution to k NN see the note in the previous section The results are still useful b ecause

they suggest a heuristic we can use in our k NN algorithm for selecting u Theorem

ij

suggests we choose u which maximizes the convexity of U U u The problem of

ij i j j i

nding the set of translations which maximizes the convexity of the union of a set of p olygons

is an op en one see Section In our implementation we nd an approximate answer

see Section

Maximizing Intersection Area

In GREEDYEVALUATE shrinking a particular U to a single p oint fu g xes the

ij ij

translation of U with resp ect to U Subsequent applications of SSGR can therefore

hj hi

cause the asso ciated p olygons in U to shrink A containment solution can only b e reached

however if each p olygon in U can b e shrunk to a p oint without causing any p olygon in U

to vanish

Supp ose we choose the shrinking p oint for a U to b e the p oint which shrinks U and

ij hi

U the least We might then have a b etter chance of preventing the p olygons in U from

hj

vanishing This suggests the following heuristic for selecting the shrinking p oint choose

u to b e the p oint in U such that the area of U U u is maximized If U and

ij ij hi hj j i hi

U are simple p olygons with a and b vertices resp ectively then the optimal u can b e

j h ij

found exactly in p olynomial time using a bruteforce conguration space metho d by solving

Oa b twodimensional problems Mit

Solutions to some closely related problems often provide large intersection area in prac

tice One p ossibility is to align the centroids of the p olygons Another is to maximize the

Hausdor distance b etween the p olygons An inexp ensive approximation to this is given in

ABB Their result states that if you sup erimp ose the lower left corner of the b ounding

p

b oxes of two p olygons the Hausdor distance b etween them is where is

the minimum Hausdor distance p ossible for the two p olygons Of course there is nothing

sp ecial ab out the lower left corner The pro of works for any corresp onding pair of b ounding

b ox corners

In practice we use a metho d which approximately maximizes the area of U U

hi hj

u We overlay a grid on each comp onent of U and at each grid p oint u we measure

j i ij ij

the area of U U u Section describ es this in more detail

hi hj j i

Comparing Heuristics for Selecting u

ij

We exp erimented with three dierent heuristics for selecting a shrinking p oint u U

ij ij

a random p oint a p oint which approximately maximizes the area of U U u

i j j i

and a p oint which approximately maximizes the convexity of U U u

i j j i

Heuristics and use a twodimensional grid to nd an approximate maximum For

we overlay a grid on each comp onent of U and at each grid p oint u measure the

ij ij

area of U U u We choose a grid resolution for each comp onent which gives ten

i j j i

grid p oints along the longest x or y dimension of the comp onent For each comp onent

we nd the average area and the maximum area From the comp onent with the highest

average value we select the p oint yielding the maximum value

For we again overlay a grid on each comp onent of U In this case however we

ij

measure the area of H U U u n U U u For each comp onent we

i j j i i j j i

nd the average area and the minimum area From the comp onent with the lowest average

value we select the p oint yielding the minimum value

The goal of our exp eriments was to see which of the three heuristics was able to solve

the most containment problems using only geometric restrictions and greedy evaluation

We p erformed several exp eriments Our early exp eriments with NN examples using geo

metric restrictions but not a steadystate lo op suggested that choices of u leading to valid

ij

congurations often have regions of large intersection area b etween the translated U s For

ij

that exp eriment we tested CN and NN examples using metho d A solution was

found without sub dividing in of the examples

Once we had the steadystate restriction pro cess in place we ran another exp eriment

using test examples for k The results app ear in Table

Table shows that maximizing the area of intersection heuristic p erforms b est

solving of the problems without sub division Maximizing convexity heuristic

solved of the problems and randomization heuristic only

Although the intersection metho d usually outp erforms the convexity metho d there are

cases in which convexity is able to nd a solution without sub division when intersection

cannot For example Figure shows three U p olygons for the example of Figure

j

Type Number of Examples Random Intersection Convexity

CC

CN

NN

CC

CN

NN

NN

Totals

Table Number of solutions found without sub division

The three p olygons almost have a triple intersection when u is chosen by the intersection

ij

metho d When the convexity metho d is used for the same example Figure shows that

a triple intersection results Note in Figure that the algorithm has matched each pair of

U p olygons along one side in an attempt to maximize the convexity of the union of each

ij

pair

The grid analysis metho d for nding an approximate maximum for intersection app ears

to b e eective However many set op erations are p erformed in order to choose a sin

gle u shrinking p oint We would like a metho d which is as eective but is faster see

ij

Section Our initial exp eriments with inexp ensive metho ds for encouraging large

intersection area such as aligning centroids and b ounding b ox corners see Section

suggest that these faster metho ds are not as eective as grid analysis

Overlap Reduction Evaluation

The disadvantage of the greedy evaluation metho d of Section is that it cannot act

simultaneously on the U s Thus our choices of shrinking p oints for the U s do not

ij ij

necessarily pro duce a consistent set of p oints leading to a valid conguration This limitation

can b e overcome by approximating the conguration spaces by their convex hulls

The metho d we discuss here is based on Milenkovics containment linear program called

the CLP see Section and Mil DM To create the CLP temp orarily replace every

element U of U by its convex hull H U The set of constraints

ij ij

t t H U i j k

j i ij

can b e expressed as a linear program

The use of CLP as an evaluator predates the use of the CLP for restriction If the CLP

is infeasible then no solution exists However if the CLP is feasible then an arbitrary

feasible solution may or may not b e a valid conguration If U U is not convex then it

ij

is p ossible that t t lies in the convex hull H U but not in U itself In that case the

j i ij ij

conguration is feasible with resp ect to the CLP yet P t and P t overlap

i i j j

We susp ected that applying an overlap reduction algorithm to the overlapping con

guration would greatly improve this evaluation metho d We tested this conjecture by

directly invoking an overlap reduction mo dule which was developed for another task within

Figure No common intersection after maximizing intersection

our pro ject Li and Milenkovic have a metho d for overlap reduction based on linear pro

gramming Li ML LMc LMa This was recently generalized and improved by

Milenkovic We decided to apply this algorithm to improve the p erformance of the naive

CLP Thus our rst attempt directly invoked the overlap reduction mo dule for each over

lapping conguration This was a breakthrough for our containment work Previously the

CLP algorithm had only b een fast for three or fewer p olygons We found that reducing

overlaps allowed this algorithm to solve containment for up to ten p olygons often without

sub division

However there was still ro om for improvement The overlap reduction mo dule op erates

directly on the original ie unrestricted U s and so it cannot take into account the

ij

restrictions that SSGR or SSLPR nd for U Our initial success motivated Milenkovic to

develop a new overlap resolution algorithm as describ ed in MD We briey summarize

the key features of this algorithm here Full details app ear in MD

Finding an overlap minimum even a lo cal minimum is a nonconvex problem Fortu

nately it is p ossible to rapidly nd a lo cal minimum in practice through iterated linear

programs For the problems we encounter in practice minimization app ears to require at

most two or three iterations The linear program used in this case is an extension of the

CLP called the overlap linear program OLP Building the OLP requires constructing a

set of inner convex approximations to the U s in a fashion similar to Lis use of a lo cality

ij

heuristic for compaction Li The OLP minimizes the maximum distance from the U

ij

to those inner approximations which simultaneously satisfy the CLP

2

The implementation was done by Iraklis Kourtidis a Harvard undergraduate

Figure Common intersection after maximizing convexity of the union

This evaluation technique is very p owerful Like the greedy evaluation metho d it can

sometimes solve containment problems without any sub division It is esp ecially adept for

obvious reasons at nding a valid conguration when a lo osetting one exists We defer

further discussion of its p erformance to Section

Evaluation of a Restricted U

A containment algorithm based on CLP evaluation can solve a containment problem

using a single CLP evaluation if every U U is convex In this section we sp ecify a

ij

condition under which a single CLP evaluation can solve a containment problem for a

restricted U

Following the notation of Chapter in Theorem b elow we denote the replacement

of U in a valid restriction of U by U and the collection of U s by U We also denote

ij

ij ij

orig

the convex hull of U by H U and we use U to denote U b efore any restriction has

ij ij ij

ij

b een applied to U

orig

Theorem If for every U U H U U then a single CLP evaluation

ij ij ij

solves the containment problem for U

Pro of If the CLP is infeasible then the containment problem for U is infeasible If the

orig

CLP is feasible then b ecause for every U U H U U every p oint of the form

ij ij

ij

orig

t t returned by the CLP is within U In this case the conguration t t t is

j i k

ij

valid 2

This result has two imp ortant implications We show in Section that Theorem

can b e used to guarantee that incorp orating restrictions into a CLPbased algorithm do es

not increase the worstcase number of sub divisions

In addition Theorem provides a test which can b e used to decide when to switch

from a direct to an indirect approach within a restrictevaluatesubdivide containment

algorithm Inside any evaluator one can test if the conditions of Theorem hold If

orig

so one can call a CLP evaluator which tests t t against U to solve the containment

j i

ij

problem for the current hypothesis

Sub division

We now turn to a discussion of sub division techniques Section denes sub division

and discusses goals of sub division Subsequent sections discuss sp ecic sub division metho ds

Section describ es our sizebased metho d Section discusses combinatoriallybased

metho ds Section gives a new distancebased metho d

Denition and Goals

Subdivision divides the hypothesis into two subhypotheses Sp ecically sub division

It creates two subhypotheses by replacing and U splits one U U into two parts U

ij

ij ij

U with U or U That is it creates U U n fU g fU g and U U n fU g fU g

ij ij ij

ij ij ij ij

Sub division can have a variety of goals

reduce the size of the U s which can b e interpreted as the number of vertices

ij

the number of reex vertices the number of comp onents the area or the maximum

dimension of the b ounding b ox for example

orig orig

is U b efore re less where U make the convex hull H U stick out of U

ij ij

ij ij

strictions have b een applied to U In particular if we dene the maximum overlap of

H U to b e

ij

orig

max dist u U

ij

uH U

ij

then sub division should make the maximum overlap of H U and H U smaller

ij ij

move away from the current conguration

reduce the number of combinatorial p ossibilities for a valid conguration

Dep ending on the containment algorithm one or more of the goals applies

The rst goal can b e accomplished by almost any reasonable splitting algorithm The

goal of reducing the maximum dimension of the b ounding b ox is appropriate for a direct

algorithm Reducing the number of reex vertices is appropriate for an indirect algorithm

which approximates the U s by their convex hulls We call a sub division metho d which

ij

fo cuses on the rst goal a sizebased sub division metho d

The last three goals make sense if the sub division metho d is used together with an evalu

ation metho d which always pro duces a conguration If the conguration is an overlapping

one then sub division is invoked The direct greedy evaluation metho d of Section do es

not pro duce a conguration when it answers maybe However the indirect overlap re

duction evaluation metho d of Section do es pro duce an overlapping conguration when

its answer is maybe

The second goal is appropriate for an indirect algorithm which approximates the U s

ij

orig

by their convex hulls This goal arises b ecause if H U U then U need not b e split

ij ij

ij

further Recall that Theorem guarantees that if this condition holds then a single

CLP evaluation solves the containment problem for the current hypothesis Recall also that

Theorem can b e used within any evaluator to identify a situation in which a single

CLP evaluation solves the containment problem for the current hypothesis This implies

that the second goal of sub division can b e viewed as an appropriate one for any containment

algorithm within our restrictevaluatesubdivide paradigm

Both the third and fourth goals have the eect of driving the evaluator away from

the current overlapping conguration Without this goal there is no guarantee that a

single sub division will pro duce subhypotheses which are easier to evaluate Evaluation

might investigate the same overlapping tentative solution in one of the subhypotheses

Metaphorically evaluation may get stuck in a rut and a large number of sub divisions

may b e required to move it out of the rut

A sub division metho d which emphasizes the third goal by maximizing the distance from

the current conguration is a distancebased metho d A metho d based on the fourth goal

is a combinatoriallybased metho d

SizeBased Metho d

As discussed ab ove a sizebased sub division metho d reduces the size of the U s which

ij

can b e interpreted as the number of vertices the number of reex vertices the number of

comp onents the area or the maximum x or y dimension of the b ounding b ox for example

We present here one sizebased metho d which reduces the maximal dimension of the

b ounding b oxes of the U s Our metho d op erates on the V fU j j k g which has

ij j

the maximum b ounding b ox dimension It cuts V with either a vertical or horizontal line

dep ending on the asp ect ratio of V

SIZESUBDIVIDEU k

V element of fU j j k g with maximum b ounding b ox dimension

j

B b ounding b ox of V

Assume x is the longest dimension of B

U fV left half of B g U n fV g

U fV right half of B g U n fV g

return U U

CombinatoriallyBased Metho ds

Here we discuss two sub division metho ds which satisfy the third and fourth goals Each

moves away from the current conguration and do es so in a way that reduces the number

of combinatorial p ossibilitie s Both can b e used with an indirect evaluation metho d which

approximates the U s by their convex hulls The rst part of Section discusses a

ij

metho d which extends an edge of a U This metho d was designed by Milenkovic to work

ij

with the CLP evaluator Mil DM The second part of Section describ es an edge

extension technique developed by Milenkovic MD which dep ends on feedback from an

overlap reduction evaluator

Each of these combinatoriallybased metho ds has an asso ciated worstcase number of

sub divisions which dep ends on the number of vertices in the U s If restrictions are applied

ij

to an hypothesis then the number of vertices in U may increase In the third part of

orig

Section we show that if we use the edges of the U s instead of the U s within

ij

ij

the evaluator and sub division metho ds then any valid restriction may b e applied to an

hypothesis without increasing the worstcase number of sub divisions

Extending an Edge

The sub division metho d of Mil DM selects a U U and extends an edge e of

ij

U into a line L The line L is used to cut the p olygon This metho d is used with the

ij e e

CLP linear programming evaluator In the absence of restrictions the worstcase number

of sub divisions is given by Theorem In Theorem and later in Theorem

LPa b is the time required to solve a linear program with a variables and b constraints

Theorem DM If subdivision is implemented using cutting lines of the form

L described above then a k NN algorithm which uses CLP evaluation runs in

e

k

Omn LPk Ok mn k m

time

Milenkovics pro of of Theorem rests on the fact that there are only Omn cutting

lines of the form L The number of hypotheses which must b e evaluated is shown to b e

e

the pro duct of the number of cutting lines each of which corresp onds to a cutting plane

in the k dimensional conguration space for the hypothesis times the number of dierent

p ossible vertices in the k dimensional conguration space The number of dierent p ossible

k

vertices is in Omn b ecause each vertex is the intersection of k cutting planes

The congurations asso ciated with a hypothesis are contained within a convex cell of

the k dimensional conguration space The cell is b ounded by the cutting planes for

the hypothesis This sub division metho d pro duces two subhypotheses asso ciated with

combinatorially dierent congurations b ecause their congurations are inside convex cells

b ounded by dierent sets of cutting planes

Extending the Closest Edge

This section summarizes a dierent sub division metho d designed by Milenkovic MD

that drives the evaluator to a conguration which is combinatorially dierent This algo

rithm in combination with SSLPR and a mo dication of the OLP of Section gives

containment a provable running time b ound but it sacrices practicality for the sake of

this b ound

The technique receives a p oint u from the OLP evaluator The p oint u corre

max max

sp onds to the pair of p olygons with the most overlap The cutting line is chosen to b e the

extension of the edge of the U which is closest to u

ij max

This type of combinatoriallybased sub division requires some mo dications to evalu

ation The mo died OLP has only a single distance constraint for each U and this

ij

constraint is determined by the closest edge of U to the current value of t t inside the

ij j i

convex hull H U We imp ose an arbitrary constant b ound on the number of iterations of

ij

overlap minimization to prevent it from solving an exp onential number of OLPs

With this sub division metho d the containment algorithm requires

k

k mn k m

O LP k k k Ok mn k m

k

k

time MD Here Ok mn k m k is the number of lo cal minima visited by the

algorithm and LP k k k Ok mn k m is the time for an evaluation

If we mo dify the containment algorithm we can claim the following running time which

has an exp onent of k instead of k

Theorem MD There exists a k NN algorithm which uses combinatoriallybased

subdivision and requires

k

k mn k m

O LP k k mn k m

k

time

Milenkovics pro of is sketched in MD For the pro of the containment algorithms

notion of a hypothesis is mo died Instead of using U as a hypothesis it uses F fF

ij

i j k g where F b egins as the convex hull of the original U All restriction and

ij ij

sub division acts on F without mo difying the U p olygons The restriction is basically

ij

the SSLPR of Section but we do not replace F by H F U and as a result

ij ij ij

restriction automatically terminates after one iteration Finally when we split a hypothesis

we immediately restrict b oth subhypotheses b efore recursing Evaluation acts on the F

ij

U p olygons and the splitting edge is selected from one of these as usual

ij

This may seem like a small improvement over the simple

k

Omn LPk Ok mn k m

LPbased algorithm DM the exp onent on mn is smaller but the number of variables

is larger However the new algorithm visits only lo cal overlap minima inside convex cells

b ounded by cutting lines There are reasons to exp ect the number of such minima to b e

indep endent of m and n and dep end only on an exp onential function in k

Incorp orating Restrictions

A containment algorithm which uses either of these combinatoriallybased metho ds has

an asso ciated worstcase number of sub divisions which dep ends on the number of vertices

in the U s If restrictions are applied to a hypothesis then the number of vertices in U

ij

may increase thus increasing the worstcase number of sub divisions We show here that

in each case the same small mo dications to evaluation and sub division allow us to use

restrictions without increasing the worstcase number of sub divisions

These mo dications are based on Theorem The rst mo dication is within the

orig

linear programming evaluator We test each t t for inclusion in U not U The

j i

ij

ij

second mo dication is that the cutting lines used for the sub division are extensions of the

orig

edges of the U s not the U s These mo dications preserve the running times of the

ij ij

algorithms as shown by the following theorem and corollary

Theorem Theorem holds for U if the evaluator tests each t t for inclusion

j i

orig orig

in U and subdivision uses extensions of the edges of the U s

ij ij

orig

Pro of Consider nonconvex p olygon U In the algorithm referred to in Theorem

ij

orig

in the worst case U is sub divided at every reex vertex The result is a set of convex

ij

orig

p olygons Now use the same partitioning lines to sub divide U U Each subp olygon

ij

ij

orig

of U is inside exactly one convex subp olygon of U hence the convex hull of each

ij

ij

orig

subp olygon of U is in U Now Theorem guarantees that a CLP evaluation which

ij

ij

orig

tests t t for inclusion in U solves the containment problem for U Thus the number

j i

ij

of sub divisions for the worst case is the same 2

Corollary Theorem holds for U if the evaluator tests each t t for inclusion

j i

orig orig

in U and subdivision uses extensions of the edges of the U s

ij ij

Theorem provides a way to incorp orate restrictions into the exact indirect k NN

algorithm of DM Mil without aecting the worstcase running time The sub division

metho d which results from applying Corollary to the metho d asso ciated with Theo

rem app ears in MD

DistanceBased Metho d

tj - ti

U U

ij ij

Figure Distancebased sub division

Extending the closest edge gives containment a provable running time b ound but it

sacrices practicality for the sake of this b ound Here we give a new cutting algorithm that

moves the conguration the maximum p ossible distance from the current conguration

Because it fragments the regions much less this algorithm is much more practical although

we do not have a provable running time b ound

Distancebased sub division attempts to move the tentative conguration as far as p os

sible from the current conguration As b efore let P t and P t b e a pair of p olygons

i i j j

with maximum overlap under the current conguration The sub division algorithm selects a

line L through t t t and uses L to cut U into U and U It selects the line L that

ij j i ij max

ij ij

maximizes the minimum distance d from t to H U and H U This guarantees that

ij

ij ij

all p oints within distance d of t are removed from further consideration in the algorithm

ij

see Figure In other words it eliminates some of the overlapping congurations which

are close to the current overlapping one The line L can b e computed in On log n

max ij ij

time where n jU j using a fairly intricate sweep algorithm We summarize here a

ij ij

simpler and more practical approximate algorithm with essentially the same order running

time

First compute the visibility p olygon V for H U U with resp ect to t If t cannot

ij ij ij ij

see the b oundary of H U in any direction then the maximum distance is zero and

ij

the algorithm chooses the line L through the nearest p oint to t on the b oundary of U

ij ij

Otherwise let ab b e an arc of the b oundary of H U that is visible from t Parameterize

ij ij

ab by piecewise linear for Let the cut line b e L t it partitions U

ij ij

into U and U Let U b e the p ortion of U containing a and U b e the p ortion of U

ij ij

ij ij ij ij

containing b For each value of let d and d b e the distances of t to H U and

ij

ij

H U resp ectively

ij

Theorem For and d d and d d

Pro of Let p b e the rst p oint b eyond t where the ray t intersects V Similarly

ij ij

let q b e the rst p oint b eyond t where the ray t intersects V We show that

ij ij

d d cannot o ccur For let r b e the closest p oint of H U to t We show

ij

ij

for Now all p oints of U on or to the right of L are in H U that r H U

ij

ij ij

for The p oints of U on or to the right of L are on or to the right of t q Let

ij ij

w b e the set of p oints on or to the right of t Because t can see all p oints

ij ij

on the arc ab no p oints of U are in the interior of w Therefore all p oints of U on or to

ij ij

the right of L are also on or to the right of L If r is a p oint of U then it must

ij

for If r is not a p oint of U then it is on a line b etween two therefore b e in H U

ij

ij

p oints of U and thus is also in H U for Therefore d d A similar

ij

ij

argument establishes that d d 2

Because d increases monotonically and d decreases monotonically the maximum

distance can b e found to any degree of accuracy by binary search on The running time

of the practical algorithm is On log n n log log n where the accuracy is and

ij ij arcs ij

the number n of arcs is the number of comp onents of U which is generally much

arcs ij

less than n

ij

Sub division is only invoked if the OLP fails to resolve all overlaps in this case it is

often true in practice that t t is very close to the b oundary of U It is often true that

j i ij

the overlap is b etween two p olygons as opp osed to b etween a p olygon and the container

Thus the situation often resembles that shown in Figure In this gure the shaded

regions are the comp onents of U

ij

In Section we show that distancebased sub division together with the overlap

reduction evaluation technique allow our hybrid algorithm to detect infeasibili ty b etter

than the naive CLPbased exact algorithm

3

This can b e found in On time GA Lee JS or in n log n time if the p olygon has holes

OR Restrictions tend to fragment U so an individu al U may have many comp onents this means

ij

holes may b e encountered

p

Figure Common situation for p t t

j i

Summary and Conclusions

In this chapter we presented several evaluation and sub division metho ds We oer two

evaluation metho ds Our greedy evaluator op erates directly on the conguration spaces and

employs SSGR The key to its eectiveness is a go o d choice of a shrinking p oint for each

U Selecting a p oint which maximizes the intersection area of translated U s app ears to

ij ij

work well in our exp eriments this strategy solves of the containment problems without

any sub division

The other evaluation metho d is an overlap reduction evaluator This is based on im

provements to an indirect containment linear program CLP evaluator A conguration

which is feasible for the CLP evaluator may b e overlapping If the overlaps can b e elimi

nated a valid conguration can b e found An overlap reduction evaluator is sometimes able

to solve containment problems without any sub division It is esp ecially adept at nding a

valid conguration when a lo osetting one exists

Our discussion of evaluation metho ds concludes with the observation that if the convex

hull of every U is within its unrestricted U then a single CLP evaluation solves the

ij ij

containment problem for the asso ciated hypothesis This test can b e used to decide when

to stop sub dividin g a hypothesis inside any containment algorithm which is based on our

paradigm

We oer four dierent p ossible sub division goals reduce the size of the U s

ij

make the convex hull of a U protrude less from its original U this is motivated by the

ij ij

observation of the previous paragraph move away from the current conguration and

reduce the number of combinatorial p ossibilities for a valid conguration We present

a sizebased sub division technique which abides by the rst goal and reduces the maximal

dimension of the b ounding b oxes of the U s We discuss two combinatoriallybased meth

ij

o ds developed by Milenkovic which satisfy the third and fourth goals We show that a

containment algorithm which uses either of these can use restrictions without increasing

the worstcase number of sub divisions We introduce a distancebased sub division metho d

which satises the third goal This practical metho d eliminates some of the overlapping

congurations which are close to the current overlapping one

C h a p t e r

Algorithms

Introduction

Our techniques can b e combined to form a variety of twodimensional translational

containment algorithms which follow the restrictevaluatesubdivide paradigm introduced

in Section As we noted in Section termination of the algorithm dep ends on the

compatibility of the techniques In this chapter we present two ways of combining techniques

into k NN containment algorithms

Our rst algorithm is an approximate algorithm That is it nds an approximate

conguration for k NN refer to Denition in Section The algorithm uses the

geometric restrictions SSGR of Section the greedy evaluator of Section and the

sizebased sub division metho d of Section All of these metho ds are direct and so this

algorithm is a direct approximate algorithm

The approximate algorithm has additional structure b eyond our paradigm It uses

the containment characterization of Section to create a set of k boundaryrestricted

containment subproblems Each of the subproblems is solved using restriction evaluation

and sub division Our approximate algorithm app ears in DM DM as well as in this

chapter

The second algorithm is an exact algorithm It uses b oth the geometric restrictions of

Section and the linear programming restrictions SSLPR of Section It uses the

overlap reduction evaluation of Section It employs the distancebased sub division of

Section so that when the p olygons of a hypothesis are sub divided into more convex

pieces this is done with the goal of moving the conguration as far as p ossible from the

current conguration We consider this exact algorithm to b e a hybrid algorithm b ecause

it uses an indirect evaluation metho d and b oth direct and indirect metho ds for restriction

Our hybrid algorithm is also describ ed in MD This algorithm currently yields our b est

practical results primarily due to its p owerful evaluation metho d

Ironically the approximate algorithm op erates directly on the actual U s whereas the

ij

exact algorithm uses approximations of the U s

ij

Both of our algorithms have practical running times for small numbers of items The

container and items may b e nonconvex Most of our examples are drawn from apparel

manufacturing For our apparel examples the number of vertices in the container ranges

from to and the number of vertices in each item ranges from to We pro duce

a feasible containment problem from an apparel layout by removing a group of neighboring

items from the layout To create an infeasible problem we move some of the remaining

items a small distance into the container

For ten or fewer items the hybrid algorithm typically requires several minutes or less

on a MHz SPARCstation The current implementation of approximate algorithm is fast

for up to four items For k the current implementation of SSGR which is based on

p olygon set op erations slows the algorithm down considerably Increasing the sp eed of our

SSGR implementation is a sub ject of future work see Section In our exp eriments

SSGR evaluates fewer hypotheses than the faster hybrid algorithm and so we b elieve the

approximate algorithm has the p otential to b e comp etitive with the hybrid algorithm

Implementation note Both of our algorithms require robust geometric techniques LMb

MN Mila Milb in order to function well in practice

Overview

This chapter contains one section for each of our two containment algorithms Section

discusses our approximate algorithm and gives exp erimental results Section describ es

our hybrid algorithm and presents exp erimental results Section summarizes this chapter

and states conclusions

An Approximate Containment Algorithm

Introduction

We present a numerically approximate algorithm for nding an approximate cong

uration for k NN refer to Denition in Section The value of is an input to

the algorithm In industrial cutting applications the containment solution acts as a guide

to a machine cutting out p olygonal shap es from a sheet of material If one chooses to

b e a fraction of the cutters accuracy then the solution to the approximate containment

problem is sucient for industrial purp oses In fact for some cutting applications CAD

vendors round p olygon vertex co ordinates to integers In such cases an overlap of up to

one unit corresp onding to inches is acceptable For the applications we consider the

ratio of the largest value to the smallest nonzero value is usually under this makes

an approximate algorithm a practical choice

Given a containment problem we use our characterization of translational containment

to create a collection of k containment subproblems see Section We solve each sub

problem by rst applying our steadystate geometric restrictions see SSGR in Section

and then using the greedy evaluator of Section If necessary we sub divide the congu

ration space using sizebased sub division to generate new subproblems The running time

k

of our algorithm is O log k s log s where s is the largest number of vertices in

a p olygon restricted by SSGR see the discussion of size analysis in Section In the

worst case s can b e exp onential in the size of the input but in practice it is usually not

more than quadratic

In a sense our algorithm substitutes sub division for the iteration used in Avnaims exact

NN algorithm see Avn and the discussion of related work in Section In prac

tice much iteration is required in an exact algorithm b efore hitting the right combination

of edges If the answer is no one must check al l combinations of edges Our SSGR

alone can often detect infeasibility see Section SSGR together with our greedy

evaluation metho d can often nd a valid conguration without requiring the algorithm to

use sub division see Section While restriction and sub division often p erform b et

ter than iteration iteration can have a much b etter theoretical worstcase running time

b ound Even when sub division is unnecessary the running times of our algorithm are in

Om n log mn for CN and in Om n log mn for NN These seem much worse than

the iterationbased metho ds but in terms of the size s of the largest p olygon generated by

SSGR the running times are b oth in Os log s as opp osed to Os log s for the iteration

based algorithms As mentioned in Section it is not clear that the worstcase results

for consecutive p olygon op erations are attainable The tests we have run indicate that the

running times of our algorithm are much faster than the b est times we would estimate for

the iterationbased solutions to NN

The highlevel description of our algorithm in the second part of this subsection draws

its structure from our characterization of containment b ecause the characterization allows

us to decomp ose k NN into a set of subproblems The algorithm solves each subproblem

by rst restricting U using SSGR testing for a solution using the greedy evaluation of

Section and sub dividing the conguration space if a solution is not found Section

establishes the correctness and running time of our algorithm Section discusses our

implementation and also presents containment examples

Applying the Characterization

Our philosophy is to avoid iteration as much as p ossible b ecause iteration contributes

to the worstcase cost of the algorithm particularly in terms of sanalysis For instance

Avnaim and Boissonnats algorithm for NP AB Avn has running time Os log s

and Avnaims algorithm for NN Avn has running time Os log s The algorithm for

NP is faster b ecause it avoids iterating over the edges and vertices of p olygons Like the

algorithm for NP we replace iteration with restriction as much as p ossible

There is another type of iteration one must consider This iteration is based on the

characterization of Theorem To apply the entire characterization one needs to choose

k

contacting pairs in a number of ways which is exp onential in k roughly k If one were to

k

generalize Avnaims algorithm for NN Avn to an algorithm for k NN the factor of k

would not b e a signicant part of the cost compared to the factor dep endent on m and n

2

k k k

roughly m mn For our approach however a factor of k is signicant

It is p ossible to use restriction and sub division and avoid iterating over any contacting

pairs In fact this is what we initially implemented However we feel that considering

contacting pairs is p otentially very useful For instance if we invoke a condition weaker

than the second part of Theorem to assume that a particular P is in contact with P

j

then we can replace U with its b oundary Note that this b oundary restriction covers the

j

cases where P has either a single or a double contact with some P Although we restrict

j

U to its b oundary we are not iterating over vertices or edges of U unlike Avnaims NN

j j

algorithm

This partial characterization implies a signicant restriction However the disadvantage

is that we must iterate over all k choices of j by solving k subproblems Our current

1

However as noted in Section these subproblems can b e solved in parallel In our current implemen

conjecture is that iterating over Ok choices of partial characterization will allow us to

avoid sub division often enough to oset the extra factor of k in cost We present data in

Section to supp ort this conjecture in the case of k

The b oundary restriction do es not add an extra factor of k in cost for containment

problems in which all the items are identical In this case all k subproblems are identical

and so only one subproblem must b e solved

The Algorithm

In the algorithm b elow P and U are set initially to the values given in Section If

at any p oint a valid conguration is found execution terminates with success We assume

that the tolerance test TOOSMALL is used within GREEDYEVALUATE The used

in TOOSMALL is the same used within SSGR BUILDCONFIGURATION is given in

Section Note that in order to p erform a b oundary restriction on a U we need only

j

orig

j

U represents a copy of U for the j th pro cessor intersect it with the b oundary of U

j

j

is pro cessor j s conguration space for P with resp ect to P and U

j

j

APPROXCONTAINU k

orig

U U

U SSGRU k

if some U U return NO

ij

if TOOSMALLU k

return BUILDCONFIGURATIONU k

Search for a b oundaryrestricted solution

for j to k do in parallel

j

U U

j orig

U U BOUNDARYOFU

j

j j

j

return SOLVESUBPROBLEMU k

SOLVESUBPROBLEMU k

U SSGRU k

if some U U return NO

ij

status GREEDYEVALUATEU k

if status YES return YES

if status NO return NO

U U SIZESUBDIVIDEU k

return SOLVESUBPROBLEMU k or SOLVESUBPROBLEMU k

TOOSMALLU k

V element of fU j j k g with maximum b ounding b ox dimension

j

B b ounding b ox of V

p p

if heig htB and w idthB return YES

return NO

tation we solve them sequentially

Analysis

Correctness

Claim If a valid conguration exists then the algorithm wil l nd an approximate

solution

Pro of The algorithm converges b ecause each sub division reduces the height or width of

the b ounding b ox of V by a factor of two stopping when the height and width reach the

p

tolerance

If a solution exists then our characterization guarantees that one of the b oundary

restricted subproblems has a solution We claim that our algorithm do es not throw away

any solutions to these subproblems This is b ecause Theorem guarantees that SSGR

is a valid restriction

Now we argue that any solution which is found is an approximate solution If GREEDY

EVALUATE nds a solution then Theorem guarantees that solution contains no over

lap hence it is a valid conguration A valid conguration is an approximate solution

The only other way the algorithm can nd a solution is through a call to BUILD

CONFIGURATION This o ccurs when the height and width of the b ounding b ox of V

p

In this case the diameter is less than for all p olygons in V In that are b oth

case we argue that no p oint of any p olygon is more than inside of any other p olygons

b oundary None of the p olygons overlap the container b ecause each t chosen in BUILD

j

CONFIGURATION is in U Thus we need only b ound the overlap b etween a pair of

j

p olygons P and P i j k

i j

Any u U having survived SSGR can b e expressed as t t where t U and

ij ij j i i i

t U If P is placed at t and P is placed at t P and P do not overlap Now let

j j i i j j i j

v and v b e the p oints of U and U chosen in BUILDCONFIGURATION Let D p q

i j i j

denote the distance b etween p oints p and q Since the diameter d of any U is less than

i

we have D v t and D v t Translating P from t to v can therefore cause

i i j j i i i

a p oint of P to b e at most a distance of inside P Translating P from t to v can at

i j j j j

most double this overlap Therefore the maximum overlap b etween two p olygons in the

conguration ft t t g is 2

k

Running Time

Here we calculate the asymptotic running time of our algorithm We assume

s is the largest number of vertices of any p olygon generated by SSGR see the discus

sion in Section

is the maximum overlap b etween two p olygons

is the fractional shrinkage in area required by each iteration of SSGR

k

Theorem The running time of our algorithm is in O log s log s k

Pro of Let S b e the number of sub divisions and R b e the running time of SSGR The

running time is dominated by S k R To nd S we rst assume that the maximum height

or width of the b ounding b ox of V is q The height of the sub division tree is therefore

Ok log q l og The k term corresp onds to the total number of p olygons that are

sub divided in the worst case The number of no des in the sub division tree is therefore

k

q q

k log log

2 2

O O

k k

q

O S O

From Section R is in Olog k s log s

The total running time is therefore

k

log k s log s S k R O

2

Results

This section describ es our implementation of the algorithm for approximate containment

We set equal to and to SSGR is used for k We have found that for k the

algorithm runs so quickly and so rarely requires sub division that one iteration of geometric

restriction is all that is needed

General Results

Table contains running times for our algorithm for a variety of examples for

k All running times given in the table are to the nearest second on a MHz

SPARCstation The setup time to calculate U p olygons is not included in the running

ij

time Infeasible examples are identied by All infeasible examples are ones for which

each pair of p olygons ts into the container and the area of the container is larger than

the total area of the p olygons Our restriction pro cess enables the algorithm to often detect

infeasibility very quickly

Figure through Figure show congurations achieved for four examples using our

algorithm The tightness of the layouts is typical In each gure the items placed by our

containment algorithm have dark shading Figure and Figure are NN examples

Figure is a NN example Figure is a NN example

Figure NN example time seconds

2

SPARCstation is a trademark of SPARC International Inc licensed exclusively to Sun Microsystems

Inc

Type Time Type Time Type Time

CC CC CC

CC CC CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN CN CN

CN NC NN

NN CN CN

CN CN CN

CN CN NN

NN NN NN

CC NN NN

NN NN NN

CC CC

Table Running times in seconds denotes infeasible example

Figure NN example time seconds

Figure NN example time seconds

Figure NN example time seconds

Table b elow presents running times in seconds for the approximate algorithm on

a dierent small collection of examples for k These tests are for a MHz

SPARCstation For each example we also give the number of hypotheses examined by the

approximate algorithm Judging the approximate algorithm purely by its running time can

b e deceptive Although the algorithm takes anywhere from to minutes in these exam

ples it is only examining or hypotheses Most of the running time is consumed by SSGR

whose current implementation is roughly ten times more slow than that of SSLPR Faster

implementations of SSGR will directly lead to faster running times for the approximate

algorithm In fact for an exp eriment in Section the number of hypotheses examined

by our fastest hybrid algorithm is greater than the number of hypotheses examined by

the approximate algorithm We therefore b elieve that given fast enough p olygon set op

erations the approximate algorithm has the p otential to b e comp etitive with the hybrid

algorithm

Type Running Time Number of Hyp otheses

NN

NN

NN

CN

CN

CC

Table Running time in seconds and number of hypotheses examined by approximate

algorithm

Solving Subproblems

In our comparison of evaluation heuristics for choosing a U shrinking p oint we rep orted

ij

in Table that the metho d of maximizing the intersection area solved of the

examples without sub division Here we maximize the intersection area of translated U s

ij

and we compare the eect of using k subproblems versus not using subproblems That is

we evaluate the eectiveness of applying a partial containment characterization

Our examples use k Figure shows an example of a feasible NN problem solved

using the characterization The darkly shaded items numbered and were

placed Note that three of the four items are in contact with the b oundary of the container

We rst compare the sequential cost in terms of the number of hypotheses examined for

infeasible as well as feasible examples Results are shown in Table For the examples

the subproblem approach examines a total of hypotheses whereas the nonsubproblem

approach examines hypotheses These results suggest that for k applying the

partial characterization to the sequential algorithm is b enecial

When all the items are identical the k subproblems generated by the characterization

are all identical and so we need only solve one of them The results ab ove contain

problems for which all items are identical The remaining problems are for nonidentical

items The results for identical item problems are listed separately in Table The total

number of hypotheses examined in the characterization case is whereas the number 25 8 28 7 26 21 27 6 47 5 37 61 63 11

58 10 44 62 45 13 46 32 30 31 55 48 36 12 49 57 33 50 38 15 35 43 14 39

22

16 17 40 41 23 56 42 60

20

Figure NN feasible example solved using partial characterization

Type Subproblems No Subproblems Type Subproblems No Subproblems

CC CC

CC CN

NN NN

NN NN

NN CC

NN CN

CN CN

NN CN

CN CN

CN CN

CN CN

CN CN

CN CN

CN CN

CN NN

NN CN

CN CN

CN CN

CN CN

NN NN

CC NN

NN CC

NN CN

Table Number of hypotheses examined by sequential algorithm denotes infeasible

example

examined in the noncharacterization case is For the nonidentical item problems

the total number of hypotheses examined in the characterization case is whereas the

number examined in the noncharacterization case is Thus for identical as well as

nonidentical item problems the characterization examines fewer hypotheses for k in

our exp eriments

Type Subproblems No Subproblems Type Subproblems No Subproblems

CN CN

CN CN

CN CN

CN NN

NN CN

CN CN

CN CN

CN CN

NN NN

NN CN

CC

Table Number of hypotheses examined for identical items denotes infeasible ex

ample

Intuitively we exp ect that a single b oundaryrestricted subproblem will not examine

more hypotheses than the nonsubproblem approach b ecause we are eliminating so much

of the search space Often this is the case However our exp eriments reveal that it is

p ossible for a b oundaryrestricted subproblem to evaluate a few more hypotheses than a

problem in which the b oundary restriction is not applied We b elieve that this phenomenon

is related to the evaluation metho d Recall that our evaluation metho d maximizes the

intersection area of U p olygons If a general p olygon contains p olygonal regions plus

ij

isolated edges and p oints the intersection heuristic only considers the p olygonal regions

If no p olygonal regions are present we currently resort to a simple alternative heuristic

Thus if the b oundary restriction causes many of the U s to consist of only isolated edges

ij

and p oints we currently lose the p ower of the evaluation heuristic Section suggests

a p ossible remedy for this

Assessing the costeectiveness of applying the partial characterization for k is

a sub ject for future work We b elieve that as k increases the partial characterization

will continue to b e costeective for identical item problems b ecause only one subproblem

must b e examined The partial characterization is less likely to have an advantage in

sequential tests for nonidentical items as k increases due to the increase in the number of

subproblems Once the critical value of k is identied for which this advantage is lost a

detailed comparison of the parallel cost will b e necessary in order to justify using the partial

characterization for values of k larger than the critical one Section discussed one way

in which coursegrained parallelism can b e applied to our algorithm A queue of hypotheses

can b e maintained Each hypothesis represents an indep endent containment subproblem

which is created via sub division Whenever a pro cessor is available it op erates on the

next hypothesis in the queue The subproblems generated by the characterization are also

indep endent from each other and so the hypotheses they generate are indep endent and can

b e added to the queue Note that applying the characterization creates subproblems which

are al l available at the start of the algorithm

We remark that the number of subproblems which must b e examined is smaller in

theory for k CN examples than for k NN This is due to the following theorem and corollary

Theorem If an instance of k CN for k has a valid conguration then that

instance has a valid conguration in which at least three items are in contact with the

boundary of the container

Pro of Consider a valid conguration for an instance of k CN for k Milenkovic

shows Mil that given a set P of nonoverlapping p olygons at least one of them can move

unobstructed to innity in the direction This disassembly lemma works for any

direction Thus for every direction d there is some p olygon P P such that P can move

to innity in direction d Let S b e the subset of p olygons in P which can move to innity

in at least one direction Let S b e a minimal subset of S one which covers all directions

using the smallest number of p olygons We now show that S contains at least two p olygons

First we observe that either every p olygon in P can move to innity in some direction in

which case we are done or at least one p olygon Q cannot It is easy to show that one

convex p olygon alone cannot surround another convex p olygon and so it takes at least

two p olygons to prevent Q from moving to innity Thus S contains at least two p olygons

Since S contains at least two p olygons and all directions are covered by p olygons in S at

least two p olygons P and P in S share a common direction d This means that we can

move b oth P and P in direction d until each hits the b oundary of the container Because

the direction d is indep endent of direction d and there are at least three p olygons we can

apply the disassembly lemma to P n fP g fP g to move a third p olygon P in direction

d until it hits the container 2

We note that three items is tight b ecause there are sets of four convex p olygons for

which only three can b e moved to innity

Corollary When solving an instance of k CN using the partial characterization ex

amining k subproblems is sucient

Corollary implies that examining one subproblem is sucient for CN examples

This however do es not yield the fastest known algorithm for CN Milenkovic Mil ob

served that for a valid CN conguration each of the three p olygons can b e moved to the

b oundary of the container This forms the basis of his Om n log mn time CN algorithm

Below we compare the p erformance of this very fast CN algorithm with our approximate

algorithm on CN examples

Comparison with Exact Algorithm for Convex Items

Table compares running times for Milenkovics CN exact algorithm DML Mil

with our approximate algorithm on CN examples Infeasible examples are identied by

The exact algorithm tests separating line orientations b etween pairs of convex p oly

gons Because b oth algorithms are so fast timing comparisons are based on calls to

each For feasible examples the exact algorithm p erforms ab out seven times faster than

the approximate algorithm on average For infeasible examples the exact algorithm is only

ab out twice as fast on average This is no accident When the exact algorithm was rst

designed the approximate algorithms p owerful restriction pro cess gave it a considerable

advantage over the exact algorithm for infeasible examples The exact algorithm was re

designed with the goal of detecting infeasibili ty quickly in mind The ma jor part of the

redesign was a multiple resolution metho d for evaluating sets of separating lines

Example Exact Approximate Example Exact Approximate

Table Exact vs approximate running times for CN examples calls each

Sub division

The vertical and horizontal cut metho d of Section has b een implemented For our

applications CAD vendors round p olygon co ordinates to integers so an of units is

suciently small It is rare for the algorithm to sub divide down to tolerance Often no

sub division is required at all to nd a valid conguration This is b ecause we have a heuristic

for selecting a shrinking p oint for each U which works well in practice see Section

ij

Sub division is rarely required for infeasible situations b ecause our restriction pro cess often

detects infeasibili ty early in the algorithm

A Hybrid Containment Algorithm

Introduction

Our hybrid algorithm is the result of signicant improvements to the restriction eval

uation and sub division techniques of an existing indirect algorithm of Milenkovic Mil

Milenkovics indirect algorithm in its original form was slower than our direct algorithm

for infeasible problems and its practical upp er b ound on k was k The improved

indirect algorithm is currently the fastest containment algorithm for k

Our rst improvement to the indirect algorithm improves its ability to detect infeasibil

ity by proving that restrictions when used in the indirect algorithm do not increase the

algorithms worstcase running time if we p erform an appropriate test within the evaluation

step and sub divide using an appropriate set of cutting lines This improvement is discussed

in detail in Section This improvement allows us to use b oth SSGR Section and

SSLPR Section in the algorithm without increasing the worstcase running time We

use some SSGR restriction at the top level and SSLPR at the hypothesis level

The second improvement to the indirect algorithm improves the ability of the evaluator

to lo cate a valid conguration We apply the work of Li and Milenkovic on overlap reso

lution Li ML LMc LMa to improve the evaluation step Their overlap resolution

algorithm is an indirect algorithm It uses inner convex approximations an approach which

complements the outer approximations of the indirect containment algorithm The success

of this exp eriment led Milenkovic to develop the overlap reduction evaluator describ ed in

Section We use that evaluator in the hybrid algorithm

A combinatoriallybased sub division algorithm yields a running time of

k

k mn k m

O LP k k mn k m

k

where LP a b is the time to solve a linear program with a variables and b constraints

although the actual running time dep ends on the number of lo cal minima which is likely

k

to b e far smaller than mn An alternative heuristicallybased sub division algorithm

the distancebased sub division metho d of Section gives containment an even b etter

running time in practice and is guaranteed to not create new lo cal overlap minima

Our practical distancebased sub division technique is our third improvement to the indi

rect algorithm This metho d attempts to maximize the distance from the current evaluation

to the convex approximations of the sub divided conguration spaces This technique is de

scrib ed in Section It moves the evaluator away from the current conguration so that

evaluation do es not get stuck in a rut It do es this by eliminating some of the overlapping

congurations which are close to the current overlapping one

We call our improved algorithm a hybrid algorithm b ecause it uses indirect metho ds

for evaluation developed by Li and Milenkovic and b oth direct and indirect metho ds for

restriction This algorithm is also describ ed in MD

The hybrid algorithm in addition to b eing a formidable containment algorithm has

the prop erty that a partial containment solution from it is valuable This is b ecause each

evaluation step pro duces either a nonoverlapping solution or an overlapping arrangement

for which a linear program has reached a lo cal minimum As a result the hybrid algorithm

when terminated early is the most p owerful heuristic known for generating a lo cal overlap

minimum

In our exp eriments the new algorithm clearly outp erforms purely geometric containment

algorithms such as the approximate algorithm of Section However it do es this by com

bining rather than replacing geometric techniques with linear programming This hybrid

algorithm demonstrates the manner in which linear programming can greatly increase the

p ower of geometric algorithms

HighLevel Algorithm Description

The algorithm starts with a queue Q of hypotheses containing a single hypothesis the

set of original U i j k as calculated using Equation We assume that this

ij

hypothesis has b een restricted using some geometric restrictions

HYBRIDCONTAINQ k

while Q is not empty

U DEQUEUEQ

U SSLPRU k

if some U U continue while lo op

ij

status OVERLAPEVALUATEU k

if status YES return YES

if status NO continue while lo op

U U DISTANCEBASEDSUBDIVIDEU k

ENQUEUEU Q

ENQUEUEU Q

return NO

Results

The examples we selected are primarily from the apparel industry We use SSLPR only

at the deep est levels of hypothesis splitting for two reasons The rst is cost Although

SSLPR is several times faster than SSGR it is not necessarily costeective to invoke it

prior to evaluating each hypothesis The second is that SSLPR restricts p olygons more as

their convex hulls b ecome b etter approximations to them

Comparison with Other Algorithms

We compared the p erformance of our hybrid algorithm with two algorithms the approx

imate algorithm of Section and the naive exact k NN algorithm of DM Mil which is

based on the CLP Table gives running times for feasible containment problems Run

ning times are expressed in seconds on a MHz SPARCstation Table gives running

times for infeasible containment problems Our new algorithm clearly outp erforms b oth of

the other algorithms For ve or more p olygons the dierence is dramatic Figure and

Figure depict congurations obtained by our algorithm

The approximate algorithm uses SSGR whose current implementation runs ab out ten

times more slowly than SSLPR A more fair comparison b etween the approximate and

hybrid algorithms counts the number of hypotheses examined instead of simply the running

time Table shows the results of such an exp eriment The approximate algorithm

examines a total of hypotheses whereas the hybrid algorithm examines From

this p ersp ective the approximate algorithm app ears more p owerful For the CC example

b oth algorithms nd a solution without any sub division each evaluates only one hypothesis

However the approximate algorithm requires seconds whereas the hybrid algorithm

nds the solution in only seconds The time dierence here is due to the dierence in the

sp eed of SSGR and SSLPR and to the fact that the greedy evaluator invokes SSGR each

time a U is shrunk to a p oint

ij

SSGR vs SSLPR

Here we discuss the eectiveness of SSGR and SSLPR within our new algorithm

We tested our algorithm on dierent feasible and infeasible containment examples for

k For each example we varied the type of restriction used no restriction

Type APPROX NAIVE LP HYBRID

NN

NN

CC

CC

CN

NN

NN

NN

NN

CC

NN min min

NN

NN

NN

CC

CN min min

CN

CN

NN min min

NN min min

CC

CN min min

NN min min

CC min min

CC

NN

Table Running times for feasible examples in seconds

SSGR SSLPR and SSGR followed by SSLPR In all cases we b egan the containment

algorithm by applying Equation which b ounds the unbounded U s

ij

Let N b e the number of hypothesis evaluations required if we use no restrictions at the

individual hypothesis level Let L b e the number of evaluations if we use SSLPR for each

hypothesis Let G b e the number of evaluations if we use SSGR for each hypothesis Finally

let GL b e the number of evaluations if we follow SSGR by SSLPR for each hypothesis

Table shows values of N L and G for some of our examples

The table omits GL b ecause it is almost always true that GGL However in one case

SSLPR eliminated something SSGR could not eliminate This o ccurred after many levels

of sub division

In all cases minG L GL N This is true of b oth feasible and infeasible cases

The dierence is often dramatic eg for one NN infeasible example N L and

G It is always the case that b oth GN and LN It is often true that jLGj is

small In of cases GL The total of G for the examples is only whereas the

total for L is

Sometimes G is slightly larger than L We b elieve that this phenomenon is due to a

sub division metho d we exp erimented with for these tests This metho d isolates an individual

comp onent of a U If restriction pro duces many comp onents just isolating one at a time

ij

can create many hypotheses In this case a cutting algorithm which moves the conguration

the maximum p ossible distance from the current conguration might b e preferable It is

p ossible that the b est sub division strategy might dep end on which type of restriction is

used at the hypothesis level For example since SSLPR is most eective when a p olygon is

similar to its convex hull sub division in this case should maximize the convexity of U and

ij

For SSGR p erhaps sub division should minimize the amount of closure of the two U

ij

subp olygons We are still evaluating sub division strategies for our hierarchical containment

algorithm

Our results suggest that b oth SSGR and SSLPR can dramatically reduce the number

of hypotheses which must b e evaluated Using SSLPR causes the algorithm to evaluate

more hypotheses than SSGR in our exp eriments However for our current implementations

of SSGR and SSLPR SSLPR is the most costeective restriction in this context b ecause

SSLPR is approximately ten times faster than SSGR

Sub division

In order to gauge the success of our sub division strategy we compared the number of

hypotheses evaluated by the naive exact algorithm versus the hybrid algorithm on infeasible

examples For this comparison we disabled the highlevel geometric restriction as well as

the hypothesislevel restrictions The sub division metho d we tested uses distancebased

sub division when the U consists of a single comp onent If the U to b e sub divided has

ij ij

multiple comp onents we isolate the comp onent which is nearest to the bad p oint The

results are shown in Table In every case the hybrid algorithm requires fewer evaluations

than the naive exact algorithm This suggests that a sub division strategy which uses the

information from a lo cal overlap minimum can b e eective

Figure NN example time seconds

Figure NN example time seconds

Conclusion

We now have b oth geometric and linear programmingbased metho ds for restriction

evaluation and sub division Each app ears to have strengths in dierent areas and they

can b e combined to achieve go o d results In particular geometric restrictions are very

helpful at the top level when the U are very nonconvex and we denitely apply them

ij

there This work in no way shows the sup eriority of either approach but instead shows how

well they can work together

Summary and Conclusions

This chapter has presented two k NN algorithms based on our restrictsub divideevaluate

paradigm The rst is a numerically approximate algorithm b ecause it pro duces an

approximate conguration It uses a partial containment characterization to pro duce a set

of k subproblems It uses SSGR a greedy evaluator and sizebased sub division to solve

each subproblem

The second algorithm is a hybrid algorithm It uses b oth geometric and linear program

ming restrictions an overlap reduction evaluator and distancebased sub division SSLPR

is used at the hypothesis level Our exp eriments suggest that distancebased sub division

helps the hybrid algorithm detect infeasibility This algorithm is sup erior to the original

CLPbased algorithm of Milenkovic

We give running times for b oth of these algorithms for a variety of k CC k CN and

k NN containment examples for k The hybrid algorithm is currently faster

than the approximate algorithm for k The hybrid algorithm typically solves our

containment examples in several minutes or less on a MHz SPARCstation for k

m and n We b elieve that the evaluation metho ds of the

two algorithms are of roughly the same eectiveness and that this dierence in sp eed is

primarily due to the fact that the current implementation of SSLPR is roughly ten times

faster than the current implementation of SSGR This conclusion is supp orted by the fact

that the number of hypotheses evaluated by the approximate algorithm in our exp eriment

is less than the number of hypotheses evaluated by the hybrid algorithm Sp eeding up our

implementation of SSGR is a sub ject of future work see Section We b elieve that

given fast enough p olygon set op erations the approximate algorithm has the p otential to

b e comp etitive with the hybrid algorithm

Type APPROX NAIVE LP HYBRID

NN

NN

NN min min

NN min min

Table Running times for infeasible examples in seconds

Type APPROX HYBRID

CC

CC

CC

CN

CN

CN

CN

NN

NN

NN

NN

CN

NN

NN

NN

CN

CN

CC

Table Number of hypotheses examined denotes infeasible example

Type N L G Type N L G

NN NN

CN NN

CN NN

CN NN

CN NN

CN NN

CN CN

CN CN

CN CN

NN CC

NN

Table Number of hypotheses evaluated for restriction options denotes infeasible

example

Type NAIVE LP HYBRID Type NAIVE LP HYBRID

CN CN

NN NN

NN NN

Table Number of hypotheses evaluated for infeasible problems no hypothesis restric

tion

Part II

Applications of Containment to

Layout

C h a p t e r

Preliminaries

Introduction

This part of the thesis gives examples of layout problems which can b e solved using

twodimensional translational containment for irregular p olygons The problems are of two

types minimal container and maximal item These applications supp ort our claim

that b eing able to quickly solve containment problems for up to ten items allows a variety

of layout problems to b e solved more eectively

Recall that our containment approach is a b ottomup one in which we maximize the

number of items for which algorithms are practical Clustering techniques for layout also

use a b ottomup approach Some of them even allow the items to rotate However the

metho ds which cluster more than two arbitrary nonconvex p olygons are greedy heuristics

Our containmentbased solutions to minimal container problems do not allow the items to

rotate but in contrast to the heuristics we establish an actual lower bound on the size of

the container for multiple items

In addition we b elieve that some p otentially promising layout techniques have b een

abandoned by the layout community b ecause they lack strong b ottomup metho ds The

primary example of this is prepacking Recall that a prepacking strategy generates feasible

groups for each container and then assigns groups to containers If the layout world had a

practical metho d for generating groups of items which t into each container this plus an

appropriate assignment strategy would make prepacking viable We demonstrate through

our containmentbased solutions to maximal item problems that prepacking can work

We also solve a problem which arises in multistage layout problems and which must b e

solved b efore a strategy such as prepacking can b e applied The problem is to transform a

single highly nonconvex container into a collection of containers

We remark that although the primary use of containment is for automatic solutions

to layout problems containment can also b e part of a collection of computeraided layout

to ols for humans as well as assist in training humans who solve layout tasks manually

Overview of Chapter

Section discusses our work on the container transformation problem Section

gives an overview of our work on minimal container problems Section discusses our

work on maximal item problems Section explains the structure of this part of the thesis

Overview of Container Transformation Work

The motivation for our container transformation work is the trim placement problem in

apparel manufacturing see Section Trim placement is the second stage of a twostage

layout pro cess for pants markers The items to b e placed are either large pattern pieces or

small trim pieces The rst stage places the large pattern pieces The container for the

second stage is the complement of the large placed pieces within the rst stage container

It is typically highly nonconvex Rather than op erate on this unwieldy container directly

we transform it into a collection of containers The trim placement phase places as many

of the small trim pieces as p ossible into the containers

An ideal transformation of the container b oth limits and decomposes it The limiting

pro cess removes unnecessary regions which are not reachable by any of the items to b e

placed We use restrictions see Chapter to remove regions which are clearly unreachable

The decomposition pro cess pro duces a collection of containers which may overlap each other

Overlap among containers makes it p ossible for placed items to overlap each other We

show how to balance the conicting goals of maximizing the number of containers while

minimizing the overlap b etween them Maximizing the number of containers pro duces

manageable containment problems We allow the user to select the probability that the

containers will b e overlapping

For eciency purp oses we introduce the notion of a breaking polygon This is a p olygon

which can b e translated to t inside any of the items to b e placed In order to nd a breaking

p olygon we nd the maximum area axisparallel rectangle MAAPR in a p olygon Our

theoretical work on the MAAPR problem uses fast matrix searching techniques from the

computer science literature and gives the fastest known asymptotic running time for this

problem On log n time for an nvertex p olygon

Our work on container decomp osition is applicable in general to multistage layout

problems b ecause the second stage of a multistage layout problem may involve a large

highly nonconvex container which needs to b e decomp osed Highly nonconvex containers

also app ear in industries in which defects in material cause the material to b e partitioned

into quality zones see Heistermann and Lengauers work with leather HL

Overview of Minimal Container Work

From the discussion of related work in layout in Section we see that solutions to

minimal enclosure problems are often required for the rst stage of a multistage layout

problem Minimal container problems also arise when nding the b est sto ck sheet size for

a given set of items or the b est cloth width in garment manufacturing Current solutions

to minimal enclosure problems for more than two arbitrary nonconvex items often allow

the items to rotate but they use greedy heuristics The heuristics cannot pro duce a lower

b ound on the size of the enclosure

We give four examples of minimal container problems strip packing nding mini

mal square enclosures nding minimal rectangular enclosures and nding tight convex

and nonconvex enclosures Before discussing our work on these problems in Section

we summarize related work on enclosure problems in Section

Related Work

Attempts to treat multiple p olygon enclosure problems in the literature typically use

greedy heuristics Adamowicz and Albano AA Haims and Freeman HF Amaral

et al ABJ Dagli and Tatoglu DT and Bailleul et al BTS pack nonconvex

items into rectangles to form comp osite items and then place the rectangles In AA

Adamowicz and Albano give an algorithm for pairwise clustering of irregular items in a

rectangle and describ e limited clustering options for more than two items They allow

p olygons to rotate They p erform pairwise clustering using an ob ject called the No Fit

Polygon NFP They also p erform limited clustering for more than two items by rst

clustering two large items and then placing small items within the b ounding b ox of that

cluster Amaral et al ABJ adopt the approach of AA for clustering items

Dagliand TotagluDT cluster pairs of items in a greedy fashion and allow the items

to rotate They rst cluster two items make them a unit cluster this unit with another

item and so on Prasad and Somasundaram PS and Babaev Bab form an ecient

cluster of items then build a rep eating pattern in order to nest sheetmetal blanks Ismail

and Hon IH use a genetic algorithm to cluster two similar items together the items are

allowed to rotate Dighe and Jakiela DJ use a hierarchical genetic algorithm to cluster

items The items are allowed to rotate Their algorithm uses a binary tree in which each

item together with values for its three parameters x y and constitutes a leaf and a

no de represents a search for the minimal enclosing rectangle of its two children Thus the

genetic algorithm seeks the b est binary tree for a set of items Milenkovic et al MDL

solve the sp ecialized problem of building item stacks of pants panels for layouts in apparel

manufacturing

In computational geometry algorithmic work app ears on various types of enclosure

problems for single items Finding a minimal enclosure for a single p olygon can also b e

viewed as a p olygon approximation problem as noted in CY

Chang and Yap dene inclusion and enclosure problems CY They dene an en

closure problem as follows EncP Q Given P P nd the smallest Q Q that

encloses P where P and Q are families of p olygons and is a real function on p olygons

such that

Q Q Q Q Q Q Q

Chang and Yap CY review work on a variety of such enclosure problems We briey

mention two examples of enclosure work Melissaratos and Souvaine MSa nd the min

imum concave quadrilateral circumscrib ed ab out a simple p olygon and ORourke OR

nds the minimal b ox circumscribing a set of threedimensional p oints

1

The NFP of p olygon A with resp ect to p olygon B is really just B A see Section

2

Chang and Yaps denition of P could b e extended to p oint sets for this case

Our Minimal Container Work

Our containmentbased solutions to minimal container problems do not allow the items

to rotate but in contrast to heuristics we establish an actual lower bound on the size of the

container for multiple items Our general approach to nding minimal enclosures is to nd

an optimal value for a parameter via binary search We remark that the binary search can b e

accelerated by using compaction techniques such as those developed by Li and Milenkovic

Li ML LMc LMa to improve a feasible solution and thereby help up date the

upp er b ound Our approach to these problems follows the common op erations research

approach of tightening upp er and lower b ounds to obtain an optimal value Containment

provides the lower b ounds in our case Our hybrid containment algorithm is appropriate

for minimal enclosure problems It is extremely fast for lo ose ts and so the initial stages

of the search are fast

For the problem of nding tight convex and nonconvex enclosures we show that re

moving unreachable p ortions of a tight rectangular enclosure can yield tight convex and

nonconvex enclosures which preserve all the containment solutions for the rectangle

Overview of Maximal Item Work

We give four examples of maximal item problems For this discussion let k

pr actical

b e the largest number of items for which current containment algorithms are feasible Our

problems are given a container and a collection of items nding maximally scaled copies

of items which t in the container given a container and a collection of k items

pr actical

for which the sum of the item areas do es not exceed the area of the container nding a

large subcollection which ts in the container given a container and a collection of

items for which either the sum of the item areas exceeds the area of the container or the

number of items is k nding a large subcollection of k items which

pr actical pr actical

ts in the container and problem for a collection of containers

Section contains an extensive survey of the relevant literature on layout and packing

problems It also reviews the limited layout literature on the assignment problem which

arises as part of problem

We discuss our work on maximal item problems b elow in Section

Our Maximal Item Work

For problem we use binary search combined with containment In problem the

given items cannot b e scaled they can only b e included in or excluded from the set The

key to solving this problem is to carefully choose which item to eliminate from an infeasible

subset We reject the most troublesome item which is identied using the results of the

overlap reduction evaluation metho d of the hybrid containment algorithm For problem

we randomly construct a set of items and solve problem This yields a rich collection of

n

sets which t into the container For each set of size n which ts we automatically have

subsets which t and which need not b e individual ly represented This work provides the

rst practical metho d for constructing sets of up to ten p olygons which t in a container

For problem we solve problem for each container and then apply a lo okahead

assignment strategy This is a prepacking strategy Containment thus allows us to trans

form a geometric optimization problem into a combinatorial optimization problem Our

results challenge the existing b elief that prepacking metho ds are impractical for layout

Arb

Overview of Part Two

Chapter discusses our work on container decomp osition Our container decomp osition

work also app ears in DM Our theoretical work on the MAAPR problem is summarized

in Chapter and also app ears in DMR DMR Chapter solves four minimal container

problems Chapter solves four maximal item problems including prepacking

C h a p t e r

Limited Gaps

Introduction

In this chapter we consider the following problem given a complex container and a set

of items to b e placed in the container transform the container by limiting and decomposing

it The limiting pro cess removes unnecessary regions which are not reachable by any of

the items to b e placed The decomposition pro cess pro duces a collection of containers

Maximizing the number of containers pro duces manageable containment problems

The motivation for our container transformation work is the trim placement problem in

apparel manufacturing see Section Trim placement is the second stage of a twostage

layout pro cess for pants markers The items to b e placed are either large pattern pieces or

small trim pieces The rst stage places the large pattern pieces The container for the

second stage is the complement of the large placed pieces within the rst stage container

This container is highly nonconvex and may have many comp onents An example is shown

in Figure In that gure the darkly shaded regions together form the second stage

container They represent gaps formed by neighboring pants panels The items to b e

placed during the second stage app ear stacked at the b ottom of the gure These items are

trim pieces Rather than op erate on this unwieldy container directly we transform it into a

collection of containers The trim placement phase places as many of the small trim pieces

as p ossible into the containers

Our work on container decomp osition is applicable to multistage layout problems in

general b ecause the second stage may involve a large highly nonconvex container Highly

nonconvex containers also app ear in industries in which defects in material cause the ma

terial to b e partitioned into quality zones see Heistermann and Lengauers work with

leather HL

An ideal transformation of the container b oth limits and decomp oses it We show how

the container can b e limited with the help of restrictions see Chapter The limiting

pro cess removes regions which are clearly not reachable by any item Identifying al l un

necessary regions is an NPhard problem The need for eliminating unreachable regions has

b een suggested by Amaral et al ABJ It is necessary to implement algorithms that

identify those gaps which cannot contain any shap e due to its dimensions or geometry

Figure Trim placement task

Karasic Kar conjectures that humans p erform this function intuitively when they place

items in a container

The decomp osition pro cess pro duces a collection of containers which may overlap each

other Overlap among containers makes it p ossible for placed items to overlap each other

We show how to balance the conicting goals of maximizing the number of containers while

minimizing the overlap b etween them As mentioned earlier maximizing the number of

containers pro duces manageable containment problems Our metho d allows the user to

select the probability that the containers will b e overlapping

For eciency purp oses we introduce the notion of a breaking polygon This is a p olygon

which can b e translated to t inside any of the items to b e placed In order to nd a breaking

p olygon we nd the maximum area axisparallel rectangle MAAPR in a p olygon Our

theoretical work on the MAAPR problem uses fast matrix searching techniques from the

computer science literature and gives the fastest known asymptotic running time for this

problem On log n time for an nvertex p olygon

This chapter describ es our eorts to provide a sound mathematical basis and a set of

algorithms for container limiting and decomp osition We call each comp onent of the limited

and decomp osed container a limited gap

Decomp osing the Container into Gaps

Given a collection of k p olygonal items P and a container C we seek a gap set G

fg g g g such that g C with the containment property if p P is placed inside

l i i

the container then it is contained entirely inside some g G Smaller gaps and more gaps

are desirable overlap among gaps is undesirable

The set of connected comp onents of the container has the containment prop erty but

it usually has to o few elements to improve tractability much in practice We will dene a

subset R of the container called the reachable region of P The connected comp onents of

P

R form a much b etter gap set than the container itself but R still is often insuciently

P P

decomp osed However it is the largest cardinality gap set we know of with nonoverlapping

gaps

If we p ermit gaps to overlap then it is p ossible for p olygons placed in dierent gaps

to overlap However if we construct the gaps prop erly then the probability of overlap

1

After creating the term limited gap we noticed the double connection of the name to the retail side of

the apparel business

will b e small We will give a rigorous notion of this probability Furthermore for any

given probability we will show how to construct a gap set called limited gaps such

that the probability that items in dierent gaps overlap is less than assuming a uniform

distribution

There is a tradeo b etween the number and size of gaps and the probability Many small

gaps imply small k for a containment problem for an individual gap but the probability of

overlap b etween items in dierent gaps is higher Since is a parameter to the construction

of the limited gaps we allow the p ossibility of nding the b est value of in the tradeo

Overview

Section describ es the container decomp osition metho ds we exp erimented with b efore

arriving at the notion of the limited gaps Section denes the limited gaps in terms of

the probability and gives an algorithm for constructing them Section presents two

metho ds for improving the eciency of limited gap construction These metho ds introduce

the new concepts of breaking polygons and inking polygons Section summarizes our

work on nding the maximum area axisparallel rectangle in a p olygon This is used to

construct a breaking p olygon Section summarizes this chapter and states conclusions

The Challenge of Constructing Gap Sets

Before dening the limited gaps we review the other container decomp osition metho ds

we exp erimented with Our metho ds assume that the container is the pro duct of the rst

stage of a twostage layout problem The rst stage places a collection of items which

b ecome obstacles in the second stage That is the container for the second stage is the

region within the original container which is the complement of the obstacles We also

assume that a transformation of the obstacles which improves the rststage layout is legal

Compaction

Li and Milenkovic have developed a compaction to ol MDL LMd Li ML LMc

LMa which plans a motion for a set of placed items under a set of applied forces We

attempted to eliminate holes and narrow necks in the container by applying a leftward

force to each obstacle p olygon In theory this pro cess is guaranteed to eliminate holes

b ecause each obstacle will b e in contact with at least one other obstacle However we

found that this strategy has three shortcomings it fails to close all the narrow necks

although the container comp onents b ecome simply connected unnaturally large regions

still exist and contact detection suers from numerical instability Through the use of

a conguration space approach the compaction algorithm avoids the question of contact

detection in order to run quickly and numerically robustly However in order to generate

a go o d decomp osition it is necessary to explicitly detect contacts and this proves to b e

numerically unstable

Partitioning Squares

Our second attempt involved choosing a narrowness tolerance We formed a partition

ing square with side of length and used this to partition the container The partitioning

Figure A partitioning square which fragments the container

pro cess is conceptually analogous to centering a partitioning square at each vertex of each

obstacle and then removing those squares for which the intersection with the set of ob

stacles is connected see Figure this illustrates a square which is not removed The

diculties with this approach are it introduces artifacts pieces of squares into the

layout it fragments the container in a way that leaves many small regions which are

not usable by the set of items to b e placed and choosing a universal is inherently

imp ossible The fragmentation issue can b e resolved by testing each region but this is

computationally exp ensive Cho osing is not p ossible b ecause P do es not naturally give

rise to a narrowness value Adopting a value corresp onding to regions which no item can

t through is insucient b ecause an item might b e able to reach into an arbitrarily narrow

neck from b oth sides thus making the neck usable see Figure The only natural

solution is to let the left and right regions overlap

Figure A neck which is usable although items cannot pass through it

Other Metho ds

We considered other metho ds such as computing a Voronoi diagram of the obstacles us

ing edges of the obstacles as sites For However such metho ds also rely on a narrowness

tolerance which is a fundamentally awed approach

Limited Gaps

We rst dene the set of limited gaps for P when P P for i j k Then

i j

we give a straightforward extension of the theory to noncongruent shap es For ease of

notation we denote P by p We also denote U by V recall from Section that U

j p

j j

is the replacement of U in a valid restriction of U

j

Reachable Regions

Denition The set R V p is the reachable region of p with respect to P

p p

2

One could use a breaking p olygon see Section to reduce the exp ense

orig

Note that if we use U the unrestricted U in place of V the reachable region

j p

j

b ecomes what is known in mathematical morphology and image analysis as the opening of

a p oint set Ser Ser At the other extreme if we use U in place of V we obtain V

p

j p

The set V p is a tight upp er b ound on the reachable region under set inclusion

p

A gap set G consisting of the connected comp onents of R has the containment prop

R p

erty and the comp onents have the added advantage of b eing nonoverlapping Unfortu

nately comp onents of R can contain arbitrarily narrow necks Ideally each comp onent

p

of R is generated by a single comp onent of V Unfortunately dilation by p can blend

p p

together two comp onents of V for cases in which p cannot t through a narrow neck of the

p

container but two copies of p can touch if they reach into the neck from dierent sides as

in Figure

By dilating each individual comp onent of V we can create a gap set G with higher

p V

cardinality than G and with no narrow necks Unfortunately these gaps can b e highly

R

overlapping The limited gap set will b e somewhere in b etween G and G

V R

One advantage of R is that it provides a nontrivial upp er b ound on the eciency of a

p

container as follows The eciency of packing copies of p in a container C cannot exceed

the ratio of areaR to areaC Most packing density b ounds in the literature apply only

p

when the p olygons are convex but this one works for any type of p olygon

Karasic Kar conjectures that human layout exp erts employ the op ening as a heuristic

criterion He notes that the op ening can b e used not only to evaluate the quality of a

p olygons placement but also for selecting the next p olygon to place The area of R can

p

also b e used within a greedy layout algorithm as a criterion for judging the placement of

p olygons Larger R is b etter in this case and the algorithm chooses a placement p osition

p

for each item which results in the most usable space for the remaining unplaced items

Dening Limited Gaps using Probability of Interference

Let v v V b e two connected comp onents If v p and v p do not intersect then

p

we can indep endently place copies of p into the container using translations from v and

v without interference If v p v p then we want to compute a probability

Probv v that p t p t We assume a uniform distribution on the connected

comp onents of V so t v and t v are chosen uniformly Assuming we can compute

p

Probv v we can nally dene limited gaps Given a probability comp onents v and v

interfere with each other if Probv v Partition the comp onents of V according to

p

the transitive closure of the interference relation into interference sets Finally dilate each

interference set by p to generate a gap The resulting set G of gaps is the limited gap

L

set for probability There are variations on this denition but the p oint is that one can

select the probability of interference for the gap set

We calculate Probv v as follows For each t v the set of t v such that p t p

t is p t p v and the probability that this choice of t results in interference

is Probftg v areap t p v areav The integral of Probftg v over all

t v gives us Probv v

We do not have an exact algorithm for this integral but we can approximate it by

sampling t v We can improve the eciency by sampling only the region v v p p

that can result in a nonzero value of Probftg v After computing the average value of

3

Eciency is the ratio of used area to total area

this probability we normalize by multiplying it by areav v p pareav

Finally if P contains noncongruent shap es then we can similarly dene and compute

Let V b e the set of all comp onents of the V regions Probv v for v V and v V

P p p

p

We partition V according to interference In this case v and v can only interfere if they

P

For each partition set V we dilate each comp onent come from dierent V and V

P p

p

v by the appropriate p P and then take the union v p to generate the gap

v

corresp onding to

Ecient Computation of Limited Gaps

In order to eciently construct the limited gaps we want to quickly partition V into in

P

terference sets We present two helpful partitioning techniques The rst technique involves

nding a breaking polygon a p olygon B that can b e translated to t inside any p P

The second technique uses the notion of inking polygons q inks p if the reachable region of

q inside p is all of p Section discusses the breaking p olygon technique Section

introduces the more p owerful concept of inking p olygons

Breaking Polygons

Let us denote a breaking p olygon of P by B To simplify the presentation we assume

that each p P has its origin p ositioned so that B p without translation Since B p

it follows that every p olygon in V is a subset of some p olygon in V

P B

We can use B to quickly group together comp onents of V which might intersect each

P

other Clearly two comp onents of V cannot intersect each other unless they are in the same

P

comp onent of V Furthermore since each connected comp onent of V is entirely within

B P

a connected comp onent of V the inclusion test consists only of a single p ointinpolygon

B

test

Since we want to maximize the number of comp onents of V we want to maximize the

B

area of B Finding the p olygon of maximum area which can b e translated to lie inside of

each p P is an interesting op en problem which we do not solve here In practice we nd

the maximum area axisparallel rectangle MAAPR of each p P Finding the MAAPR

quickly is a challenging problem in its own right and is the sub ject of DMR DMR We

briey summarize our MAAPR work in Section

We rep osition each p so that its origin is at the center of its MAAPR We choose B

to b e the intersection of all p P This guarantees that B contains a rectangle with the

minimum width and minimum height of all the MAAPRs This in turn provides a lower

b ound on the area of the b est breaking p olygon

Unfortunately the reachable region R of the breaking p olygon is not necessarily a

B

sup erset of R for each p P Consequently we are not guaranteed that if two comp onents

p

v and v V are in dierent connected comp onents of V then they do not interfere In

P B

fact there can b e a signicant amount of interference

Inking Polygons

We say p olygon q inks p olygon p if and only if p q q p A set of p olygons

Q is an inking set of a set of p olygons P if for every p P p q q p

q Q

4

We use the term breaking polygon b ecause V breaks or partitions V

B P

An inking set is valuable b ecause R R is a sup erset of each reachable region R

Q q Q q p

are connected comp onents then v p and Therefore for p p P if v V and v V

p

p

v p can intersect and hence Probv v only if they lie in the same comp onent of

R Furthermore since v p either lies entirely inside or entirely outside each comp onent

Q

of R we can simply p erform a p ointinpolygon test of any p oint of v p It is easy to

Q

generate this p oint without computing all of v p

For an inking set to b e useful R should not b e to o much larger than R On the

Q P

other hand R should b e easier to compute The rst condition implies that we desire

Q

the inking set whose smallest member has maximum p ossible area The second condition

implies that we desire the inking set of minimum complexity total number of vertices

The inking set of maximal area is the set P itself The inking set of minimum complexity

is a single p oint but if we sp ecify nonzero area then this is an op en question We desire

the answer to a doubly op en question of the inking sets of minimum complexity nd the

one whose smallest member has maximum area The next section gives a lower b ound on

the complexity of an inking set based on the notion of a hitting set

Hitting Sets

Let a b c b e three consecutive vertices of some p olygon p P such that angle abc op ens

into the interior of p If an inking set Q inks p then there must b e a set of consecutive

vertices a b c on some q Q such that angle a b c is a subset of abc if q is translated to

place b on top of b then a and c are on or in the interior of angle abc We say that angle

a b c hits angle abc

We can map angle abc to an interval arc on the unit circle by translating b to the

center of the circle and taking the arc in the interior of abc Clearly a b c hits abc if and

only if its interval is a subset We refer to the set of angles or intervals of P as that set of

arcs generated by all triples of consecutive vertices abc of p olygons p P

Given a set of intervals on the unit circle a hitting pointset S is a set of p oints such

that each interval contains at least one p oint of S in its interior Clearly the complexity of

Q is at least as great as the size of the minimum hitting p ointset of the angles of P

In the following discussion let M b e the total number of vertices in P

Theorem A minimal hitting pointset for M intervals on the unit circle can be found

in OM time

Pro of We rst give an OM log M time algorithm for nding the minimal hitting set

for a set of M intervals of the real line Then we show how to use this algorithm as part of

an OM time algorithm for intervals on a circle

The rst step in the line interval algorithm is to initialize the hitting set H to We

then sort the intervals by increasing xco ordinate of their right endp oints and pro cess them

in this order For each interval i if H contains a p oint that hits i then we do not change

H Otherwise we add the right endp oint of i to H

This algorithm runs in OM log M time b ecause we sort the intervals It can b e shown

that each step of the algorithm yields the minimal hitting set for the current set of intervals

whose rightmost p oint is furthest to the right

5

Actually to avoid degeneracy we add a p oint just slightly to the left of the right endp oint of i

Our algorithm for intervals on a circle rst sorts the interval endp oints creating a set

of M event p oints and M subintervals b etween event p oints The algorithm has an

outer lo op which considers each of these M subintervals in turn We add a single hitting

p oint to a subinterval and thus we can eliminate from consideration any interval that

contains this subinterval We can now cut the circle anywhere in this subinterval and then

apply the line algorithm This gives the minimal hitting set for this choice of subinterval

After considering all M subintervals we know which choice yields the minimum hitting

set We only have to sort once so the running time is in OM 2

We can generalize the notion of hitting p ointset to hitting intervalset recall an interval

of Q hits an interval of P if it is a subset Clearly we can replace each p oint in the

hitting p ointset by the subinterval in which that p oint lies However this might not

yield the hitting intervalset whose minimum length interval is maximized Since we do not

want skinny inking p olygons to avoid inking narrow necks of the container we want to

maximize this minimum angle This will also tend to maximize the minimum area of an

inking p olygon

For a given arc length L we can nd the minimum hitting intervalset whose members

are of length L We can do this in OM time using a mo dication of the p ointset

algorithm The algorithm on the line is exactly the same but unraveling the circle into

a line b ecomes more intricate For any given hitting set size h we can do binary search on

the value of L to nd the smallest value of L whose minimum hitting intervalset is h or

greater Since L can take on at most M M values we only have to run the OM

hitting intervalset algorithm Olg M times

Forming Inking Sets using Hitting Sets

Given the minimal sized hitting intervalset Q of h intervals for P with maximum

minimum length L we show here how to construct an inking set consisting of a set of h

isosceles triangles and a single square The isosceles triangles ink regions near the vertices

of P and the rectangle inks the remaining area If h is the minimum complexity of the

min

inking set then this algorithm yields an inking set of complexity h

min

We rst discuss the isosceles triangles We asso ciate an isosceles triangle with each

hitting set interval i as follows Consider the set S of angles abc of p olygons p P which

i

are hit by i For each angle abc nd the maximum height of a corner isosceles triangle

whose top is b and whose sides are aligned with ba and bc such that the triangle is in the

interior of p Let H b e the minimum height over all vertices in S Now form an inking

i i

set p olygon T which is the isosceles triangle of height H and top angle determined by i

i i

T can ink a corner isosceles triangle for abc of height H

i i

The size of the square s is constrained by two factors the narrowest neck in P and

the narrowest and most diagonal angle in P To treat the rst constraint we build a

Voronoi diagram of each p olygon in P under the L metric Lee If we surround each

site with the largest square which ts then s must b e smaller than the smallest of these

squares Let w b e the resulting width The second constraint requires that we calculate

p

w min H sin over all abc in P with angle and hitting interval i The width

i

of s is min w w

MAAPRs

This section considers the geometric optimization problem of nding the maximum area

axisparallel rectangle MAAPR in an nvertex general p olygon This rectangle problem

arises naturally in applications where a quick internal approximation to a p olygon is useful

One of its applications is nding breaking polygons see Section

Section summarizes our MAAPR work from DMR DMR This work gives an

On log n time algorithm for an nvertex general p olygon Section describ es a naive

algorithm which we use in practice to nd a breaking p olygon

Summary of MAAPR Results

Here we summarize our work on MAAPRs which is describ ed in detail in DMR

DMR We present the fastest algorithmic results for general p olygons with holes a

On log n time algorithm We also prove a lower b ound for this type of p olygon of time in

n log n In order to develop this algorithm we rst characterize the MAAPR for general

p olygons by considering dierent cases based on the types of contacts b etween the rectangle

and the p olygon

We present a general framework for solving the twocontact case of the MAAPR problem

which dominates the running time for a variety of p olygon types The framework involves

transforming the p olygon via vertex pro jection and inner rectilinear approximation into

another p olygon for which we can solve a related problem In the related problem we are

given a p oint set S and two subsets L and R of S The task is to nd the largest rectangle

containing no p oint of S which has lowerleft corner in L and upp erright corner in R This

problem can b e solved by transforming it into a monotone matrix searching problem Fast metho ds exist in the literature for nding the maximum element of such matrices

xy-monotone orthogonally convex horizontally convex vertically separated horizontally convex general

(n) O (n a(n)) O (n a(n) log n) O (n log n) O (n log 2 n)

Figure Algorithmic results for a variety of p olygon types

Using these metho ds leads to the following MAAPR results n time for an xy

monotone p olygon Onn time for an orthogonally convex p olygon where n

is the slowly growing inverse of Ackermanns function Onn log n for horizontally

vertically convex p olygons On log n for a sp ecial type of horizontally convex p olygon

6

We thank Jacqueline Huang for implementing this algorithm while she was an undergraduate at Harvard

University

7

A matrix is monotone if the column index of the row maximum moves to the right as the row index

increases

8

A simple p olygon consisting of two xymonotone chains is an xymonotone p olygon A chain is xy

monotone if it is monotone with resp ect to b oth the x and y axes A chain is monotone with resp ect to a

line l if a line orthogonal to l intersects the chain in exactly one p oint PS

9

An orthogonally convex p olygon is b oth horizontally and vertically convex This class contains the class

of convex p olygons

consisting of two ymonotone chains on opp osite sides of a vertical line and On log n

for general p olygons

MAAPR Characterization and Naive Algorithm

Here we characterize the MAAPR contained in a general p olygon P by considering

dierent cases based on the types of contacts b etween the MAAPR and the b oundary of P

and outline a naive algorithm for nding the MAAPR based on this characterization Others

have used contact classication for algorithmic development see for example MSa

MOS DKO The rst part of this subsection classies the types of contacts b etween

the MAAPR and the b oundary of P The second part introduces the notion of a determining

set of contacts The third part shows how to solve maximization problems asso ciated with

certain determining sets of contacts The fourth part presents our characterization theorem

for MAAPRs The fth part gives a naive algorithm based on the characterization theorem

Types of Contacts

Intuitively if an axisparallel rectangle is inside P it has four degrees of freedom param

eters and can grow until each of its four sides is stopp ed by contact with the b oundary

of P Contacts b etween the MAAPR and P are of two types a side of the MAAPR

with a vertex of P and a corner of the MAAPR with an edge of P In order to discuss

the rst type we require the notion of a reex extreme vertex introduced in SRW

Denition A vertex v of P is a vertical reex extreme vertex if there exists

such that for an open ball of radius about v and S exteriorP either no point of

S has y coordinate above v or no point of S has y coordinate below v A horizontal reex

extreme vertex is dened similarly

For type contacts a reex extreme vertex of P touches a side of the MAAPR and

stops growth in one direction we call this a reex contact Each reex contact can remove

one degree of freedom Two reex contacts with adjacent sides of the MAAPR x a corner

of the MAAPR For type contacts a corner of the MAAPR touches an edge of P forming

an edge contact

Determining Sets of Contacts

Denition A set of contacts C is a determining set of contacts if the MAAPR R

satisfying C has nite area and if the MAAPR R satisfying any proper subset C C has

greater or innite area

For example a set of four reex contacts one on each side of the rectangle is a deter

mining set

Note A determining set determines the area of the MAAPR but it do es not necessarily

determine a unique rectangle or MAAPR

Within a determining set we distinguish b etween two dierent subtypes of edge contacts

An edge contact is xed if the set of constraints uniquely determines the p oint of contact

with the rectangle not necessarily the MAAPR Otherwise it is a sliding contact

A xed contact can arise when there is no freedom to slide along an edge b ecause a

reex contact xes a co ordinate For example in Figure a the reex contact of the (a) Fixed contact (b) Sliding contact (c) Two dependent

sliding contacts

Figure Edge contact types for a determining set

determining set xes the xco ordinate of the edge contact which completely determines the

lo cation of the edge contact An edge contact with an adjacent side that has either a reex

or xed contact must also b e a xed contact

Two sliding edge contacts are dependent if the p osition of one determines the p osition

of the other otherwise they are independent An indep endent sliding contact requires that

the two adjacent sides of the MAAPR do not have any contact with P see Figure b

A sliding contact adjacent to another sliding contact is dep endent b ecause the two contacts

must share a co ordinate see Figure c

Maximization Problems

Here we examine maximization problems asso ciated with certain determining sets of

contacts Finding the MAAPR asso ciated with a determining set of contacts requires solving

a maximization problem if the set contains a sliding contact For a given set of contacts the

number of degrees of freedom is the number of undetermined parameters of the rectangle

Degrees of freedom within a determining set can only arise from sliding contacts b ecause

any other degree of freedom would result in a rectangle of innite area and therefore the

contacts would not form a determining set It follows that if a determining set consists of

only reex or xed edge contacts no maximization is required For each indep endent sliding

contact in the set we can parameterize the asso ciated edge The maximization problems

can then b e classied based on the number of parameters

Parameter Problems

The set of parameter maximization problems can b e further sub divided according to

the number of dep endent sliding contacts

The Basic Parameter Problem

The simplest parameter problem involves no dep endent sliding contacts just a single

indep endent one This is the basic parameter problem and it arises when one corner of

the MAAPR has a sliding contact and the opp osite corner is xed The basic parameter

problem can b e solved by parameterizing the edge asso ciated with the sliding contact and

maximizing a quadratic in one variable This can b e solved in O time

An alternate constanttime solution to the parameter problem is based on the following

lemma which demonstrates that the slop e of the MAAPR diagonal dep ends only on the

slop e of the p olygon edge We assume here that the edge is neither vertical nor horizontal

Lemma Slop e Lemma Given a point p and a line L with slope s the MAAPR

with one corner at p and opposite corner at point q on L has diagonal pq where the slope

of pq s

In other words if one corner of a MAAPR is incident on L the slop e of the MAAPRs

diagonal is the negative of Ls slop e

L: ax + by = d

s = -a/b

increasing area

(x c , y c ) = q

area of MAAPR: xy = c

p

Figure Slop e lemma

Pro of Assume p is at the origin and that the line L is given by ax by d see

Figure Wlog assume L intersects the x and y axes Note we ignore the

degenerate cases of horizontal and vertical lines for which the MAAPR is undened The

family of hyperb olas given by xy r represents curves corresp onding to rectangles of

constant area Moving away from the origin into the rst quadrant the hyperb ola branch

which is tangent to L provides the area c of the MAAPR asso ciated with L Let x y b e

c c

the co ordinates of the p oint at which L is tangent to the hyperb ola xy c

Now the tangent to xy c at x y is equal to L so the normal to xy c at x y

c c c c

is equal to the normal to L at x y The normal to xy c is F F y x evaluated

c c x y

at x y it is y x The normal to L at x y is a b Therefore

c c c c c c

a y

c

slop e slop e L pq

x b

c

2

Note that as a consequence of this lemma if p moves downward q moves downward

along its edge

Two Dep endent Sliding Contacts

Consider a pair of dep endent sliding contacts which share a co ordinate wlog y and

have an opp osite reex contact which determines one co ordinate of a side wlog y see

Figure a

To nd the MAAPR we parameterize edge p p by t yielding the following quadratic

in t to maximize

F t x xy y

A B tC D t p p 4 4 p p 2 t 2 t

(x,y) (x',y) (x,y) (x',y)

p p 1 1 p p 3 p 3 5 y' (x, y' ) p 6

(a) Pair of Constrained Sliding Contacts (b) Triple of Constrained Sliding Contacts

Figure Parameter problems with two and three dep endent sliding contacts

where

y b y y

A x B x x

m m

C y y D y y

y y

b y mx m

x x

p p Note that x is obtained by solving the line equation asso ciated with edge

Three Dep endent Sliding Contacts

For the case of three dep endent sliding contacts see Figure b we again parameterize

edge p p and express x in terms of y for edge p p Similarly we express y in terms of x

p p We again obtain a quadratic in t to maximize The dierence b etween this for edge

and the previous case is in the values of C and D

C y m x b D y y m x x

y y

m b y m x

x x

The Parameter Problem

There is only one type of parameter problem It has two indep endent sliding contacts

The following lemma allows us to reduce a parameter problem to a set of parameter

problems

Lemma Let e and e be nonintersecting line segments Consider the set E of

empty axisparallel rectangles which have diagonal ly opposite corners on e and e There

is a maximum area rectangle in E with at least one corner at an endpoint of e or e

Pro of One way to prove the claim is to parameterize each edge to obtain a quadratic in

two variables It is easily shown that the resulting surface is a saddle surface so that the

maximum is achieved along the b oundary of the unit patch implying that the MAAPR has

a corner at a vertex of one of the edges

A geometric argument is more intuitive however Let c on e and c on e b e opp osite

corners of a MAAPR let r b e the diagonal connecting c and c and by way of contra

diction assume that neither c nor c is at a vertex of e or e Now replace e and e by

the lines l and l containing them Consider the set S of all line segments that connect

l and l and are parallel to r The length of these line segments as a function of their

distance from r is monotonic If l and l are parallel the length is constant Otherwise

the length increases moving away from r in one direction and decreases in the opp osite

direction Move away from r in the direction of increasing length either direction if l is

parallel to l until either c or c is at a vertex of e or e and let r b e the new diagonal

Since jr j jr j the area of the rectangle whose diagonal is r is at least as large as the

area of the rectangle whose diagonal is r contradicting the assumption that the latter is a

MAAPR

2

Having established that the MAAPR has a corner at a vertex in this case we can

nd the MAAPR by considering in turn each of the four endp oints of e and e solving

the asso ciated parameter problems and then comparing the four resulting parameter

MAAPR areas

Characterization Theorem

To characterize the MAAPR we examine the p ossible determining sets of contacts By

enumerating the reex contacts b etween the MAAPR and P we derive the set of ve cases shown in Figure

# RC

4

3 1 FC

RC = Reflex Contact FC = Fixed Contact 2 2 FC 2 FC 1 ISC 2 FC 2 FC ISC = Independent Sliding Contact DSC = Dependent Sliding Contact

1 FC 1 3 FC 3 FC 2 DSC 1 ISC

0 2 ISC 3 DSC 4 FC

Figure Determining sets of contacts for the MAAPR

Theorem The determining set of the MAAPR of a general polygon P conforms up

to symmetry to one of the ve cases in Figure

Pro of A determining set has by denition at most one reex contact with each side of

the MAAPR For each of the p ossible numbers of reex contacts we show that the deter

mining set of a MAAPR of that type conforms up to symmetry to one of the congurations

shown in Figure In each case we must eliminate degrees of freedom b eyond those of

sliding contacts We observe that a determining set cannot contain b oth two adjacent reex

contacts and the xed contact b etween them this would b e redundant

Case In this case there is one reex contact with each side of the MAAPR Since each

reex contact removes one degree of freedom from the rectangle this set of contacts

is sucient to determine the MAAPR Removing any one reex contact allows the

rectangle to grow so all four contacts are necessary

Case Three reex contacts are not sucient to determine the MAAPR since the fourth

side can move outward We must add an edge contact which is xed b ecause it is

adjacent to a reex contact There is only one choice of p osition for this contact up

to symmetry It xes the remaining side of the rectangle

Case Two reex contacts can b e either adjacent or diagonally opp osite In b oth cases edge

contacts are needed to determine the MAAPR Since two degrees of freedom remain

the determining set contains at most two edge contacts

In the adjacent case we examine the p ossibility of edge contacts at the corners of the

rectangle excluding the corner b etween the two reex contacts There are two ways

that two edge contacts can app ear In b oth cases b oth contacts must b e xed so they

x the remaining sides of the rectangle If only one edge contact app ears it must

b e a sliding contact otherwise a degree of freedom remains The sliding contact is

diagonally opp osite to the corner xed by the reex contacts This contact is sucient

b ecause it represents a basic parameter problem

In the opp osite case any edge contact is xed hence there must b e two of them

There are two p ossible ways they can b e congured In b oth cases all four sides of

the rectangle are xed

Case One reex contact is not sucient to determine the MAAPR We can choose to

place edge contacts at any three of the four corners of the rectangle four would b e

redundant If there are three edge contacts they are all xed and they completely

determine the MAAPR There are two ways to congure three such contacts If

there are two edge contacts they can b e adjacent or diagonally opp osite If they are

adjacent they must b oth b e opp osite the reex contact otherwise a degree of freedom

remains These adjacent contacts are dep endent sliding contacts and they determine

the MAAPR b ecause they represent a parameter problem If they are diagonally

opp osite one is xed and the other is a sliding contact this is also a parameter

problem One edge contact is not sucient together with the one reex contact to

determine the MAAPR

Case In this case there are no reex contacts One sliding contact is not sucient to

determine the MAAPR If there are two sliding contacts they must b e opp osite if

they are to determine the MAAPR This is a parameter problem If there are

three edge contacts they are all dep endent sliding contacts They are sucient to

determine the MAAPR b ecause they represent a parameter problem If there are

four edge contacts they yield four equations in four unknowns for which the MAAPR

is completely determined This therefore forms a set of xed contacts

2

Corollary Given a determining set C for a MAAPR of a general polygon it fol lows

that jC j

A Naive Algorithm

Based on the ab ove characterization we can nd the MAAPR in a general p olygon by

nding the MAAPR under the constraints of each of the ve cases and selecting the largest

one

Theorem For each determining set of contacts in Figure the MAAPR can be

found in constant time

Pro of A reex contact yields in constant time one of the four parameters of the rectan

gle as do es a xed contact In all cases we can pro cess these contacts rst The remaining

situations are all either parameter problems or parameter problems which can b e solved

in constant time b ecause they only require maximizing a constant number of quadratic

forms 2

A naive MAAPR algorithm can use Theorem and supply it in each case all

p ossible determining sets for P These can b e identied using an algorithm with up to four

nested lo ops one for each element of the determining set For each MAAPR candidate we

can check if it is empty ie contains no edges or vertices of P in On time We conclude

Theorem The MAAPR of an nvertex general polygon can be found in On time

Summary and Conclusions

This chapter has discussed our container limiting and decomp osition work Limiting is

based on the reachable regions of the items A reachable region is found by using restrictions

combined with the opening morphological op erator Our decomp osition pro cess allows the

user to control the probability that gaps will overlap each other For eciency reasons

we introduce the notion of breaking polygons and inking polygons We have implemented

the breaking p olygon approach and found it to b e practical for forming limited gaps Our

implementation uses a naive algorithm for nding the maximumarea axisparallel rectangle

MAAPR in a p olygon Our theoretical work on the MAAPR problem yields the fastest

known asymptotic running time for this problem On log n time for an nvertex p oly

gon Figure is a screen dump which shows limited gaps for an example from apparel

manufacturing

We note that in applications which op erate on U s and do not directly op erate on the

ij

containers themselves the metho ds we present for clustering together U s can b e used

ij

without carrying out the nal construction of the limited gaps themselves

Figure Limited gaps example

C h a p t e r

Minimal Container Problems

Introduction

In this chapter we address four minimal container problems strip packing nding

minimal square enclosures nding minimal rectangular enclosures and nding tight

convex and nonconvex enclosures

In Chapter we cited the following denition of an enclosure problem given by Chang

and Yap CY EncP Q Given P P nd the smallest Q Q that encloses P

where P and Q are families of p olygons and is a real function on p olygons such that

Q Q Q Q Q Q Q

This denition is not sucient for our purp oses We need a more general denition of

an enclosure problem Our denition replaces P with P where P is a tuple of elements of

P We also let M b e a set of p olygon transformations We dene

E ncP M Q Given P P P P where P P nd the smallest Q

k i

Q that encloses P where P and Q are families of p olygons M is a set of p olygon

M

transformations P is the transformation of each item in P by a p ossibly dierent

M

transformation in M and is a real function on collections of p olygons such that

Q Q Q Q Q Q Q

Work on minimal enclosures in computational geometry uses the identity transformation

for M and do es not allow a collection of p olygons The particular twodimensional enclosure

problems we address here let P b e a collection of p olygons M b e translations b e the

area function and Q vary dep ending on the problem For example in strip packing Q is

the set of axisparallel rectangles of xed width

From the discussion of related work in layout we see that solutions to minimal enclosure

problems are often required for the rst stage of a multistage layout problem Minimal

container problems also arise when nding the b est sto ck sheet size for a given set of items

or the b est cloth width in garment manufacturing Section discusses computational

geometry work on various types of enclosure problems for single items Current solutions to

minimal enclosure problems for more than two arbitrary nonconvex items often allow the

items to rotate However b ecause they use greedy heuristics they cannot provide a lower

b ound on the size of the enclosure Popular approaches either place small items in gaps

inside the b ounding b ox of two large items AA or solve the problem incrementally by

adding one item at a time DT DJ

Our containmentbased solutions to minimal container problems do not allow the items

to rotate but in contrast to heuristics we establish an actual lower b ound on the size of

the container for multiple items Our approach to nding minimal enclosures is to nd an

optimal value for a parameter via binary search combined with containment The idea of

solving a geometric optimization problem using binary search on a parameter is found for

example in Chazelles seminal pap er on p olygon containment Cha We observe that the

binary search can b e accelerated by using compaction techniques such as those developed

by Li and Milenkovic Li ML LMc LMa to improve a feasible solution and hence

up date the upp er b ound Our hybrid containment algorithm is appropriate for minimal

enclosure problems It is extremely fast for lo ose ts and so the initial stages of the search

are fast

We prop ose the following general approach to minimal enclosure problems involving a

single parameter Our approach is a binary search with compaction used to up date the

upp er b ound obtained by containment Note that the binary search approach works only

if the function b eing minimized decreases monotonically as the parameter decreases In

this binary search the function can b e thought of as a binary one which returns if the

containment problem is feasible and otherwise

MINIMALENCLOSUREP k

do

large initial value

max

min

tolerance value

while

max min

cur r ent max min

Q container of size

cur r ent

if CONTAINMENTP k Q

place p olygons according to conguration

COMPACTIONP k Q

max

else

min cur r ent

return

max

Overview

In Section we use binary search on length together with containment to solve a two

dimensional strip packing problem In Section binary search on length is combined with

containment to nd tight axisparallel square enclosures for collections of items We extend

this approach in Section to nding tight axisparallel rectangular enclosures which is

a common prepro cessing step in many layout algorithms which pack nonrectangular items

It can also b e applied to the problem of nding the b est sto ck sheet size for a given set

1

Our current implementations do not use compaction adding it is a sub ject of future work

of items or the b est cloth width in garment manufacturing In higher dimensions this

technique could help determine the b est packaging for a pro duct In Section we show

that removing unreachable p ortions of a tight rectangular enclosure can yield tight convex

and nonconvex enclosures which preserve all the containment solutions for the rectangle

Section summarizes this chapter and states conclusions

Strip Packing

Here we use binary search on length together with containment to solve a twodimensional

strip packing problem We illustrate how containment can b e used for strip packing by solv

ing an incremental layout task from the apparel industry Figure shows an incremental

layout task A garment containing items has already b een laid out and the task is to

add a second garment to this layout while minimizing the length of the strip This type

of problem is b ecoming more imp ortant as the apparel industry moves in the direction of smaller lot sizes and customized garments

5 3

0 2 14

6

7

15 10 11

14 12

8

13

9

Figure Incremental layout task

Let the length b e Figure shows a very lo ose initial layout corresp onding to

inches Note that only the six large items are placed The two small ones can easily

b e inserted into the nal layout in a number of places so our search on length ignores them

Figure shows the tightest layout obtained for this problem inches

One alternative to this approach is to use an improvement strategy Improvement meth

o ds for layouts of nonconvex items are surveyed by Dowsland and Dowsland DD Meta

heuristic techniques such as simulated annealing genetic algorithms and tabu search can

b e applied However they are unable to establish a lower b ound on Another improvement

strategy uses the compaction techniques of Li and Milenkovic Li ML LMc LMa

MDL LMd Compaction is also unable to establish a lower b ound Compaction alone

can b e applied in a given direction to simulate a gravitational force However this technique

can only pro duce a continuous motion of the items It is unlikely to pro duce the tightest

p ossible strip packing esp ecially if the items are nonconvex In order to pro duce a tight Name: multnew1 Width: 23.50 in Length: 101.24 in Pieces: 16 Efficiency: 56.35%

5 13 3

0 10 2 8 14 9

6 15

7 14

11

12

Figure Lo ose layout

Name: multnew4 Width: 23.50 in Length: 77.09 in Pieces: 16 Efficiency: 74.93%

5

3 15

0 13 2

14 8 9 10 11 12

6

7 14

Figure Final layout

packing we must allow the items to move discontinuously as decreases This jumping

b ehavior can b e obtained using forms of compaction based on mixed integer programming

but current implementations are currently to o slow to b e practical

Name: multiple Width: 23.50 in Length: 85.48 in Pieces: 16 Efficiency: 67.58%

5 13

0 8 2 10 1 9

3 11 4 12

6 14

7 15

Figure Compaction solution

We compare our solution based on binary search and containment with the solution

obtained by rst compacting the layout of Figure and then placing the two small items

Compaction gives see Figure whereas for the containment ap

proach

Although the binary search technique obtains a tighter layout than compaction alone

compaction can still play an imp ortant role in this problem and in all our enclosure prob

lems It can certainly help to up date an upp er b ound quickly thereby accelerating the

binary search as noted in Section

Minimal Square Enclosures

In our second problem binary search on a scaling factor can b e combined with contain

ment to nd the minimal enclosing axisparallel square for a set of p olygonal items where

the orientation of each p olygon is xed One parameter suces to characterize the square

We denote this by it is equal to the length of a side of the square We use binary

search on combined with containment

We b egin with a square which is guaranteed to b e large enough to hold the items Our

rst guess consists of a square whose side is the maximum of the height and width of the

b ounding b ox of the following shap e

P P P P P

k k

The k items can certainly t into this square

Because the area function decreases monotonically as decreases minimizing

yields the minimum area square enclosing the items The same is true if we apply a pure

scaling to any p olygon Thus the same metho d can b e used for example to nd the

minimal regular hexagon of xed orientation enclosing a collection of items

Figure Minimal square enclosure for nonconvex items

Figure shows the minimal square enclosure for three items An improvement metho d

which only allows continuous motion of the items is incapable of nding this square enclosure

b ecause there is no continuous motion of the items which can nest the rectangle inside

the Cshap ed item

Figure shows a minimal square enclosure for four nonconvex apparel pattern pieces

This runs in seconds on a MHz SPARCstation Each of the four p olygons has

vertices The pieces are identical except that two are rotated by The conguration pro

duced by the containment algorithm is a rep eating pattern Indeed one p ossible application

of our minimal enclosure work is to identify go o d rep eating patterns for identical nonconvex

ob jects Although much work has b een done on lattice packings for convex ob jects there

is still ro om for work on nding go o d rep eating patterns for identical nonconvex ob jects

It would b e interesting to exp eriment with dierent types of regular p olygonal enclosures

eg square hexagon for a given set of identical items to see which gives the b est result

Figure shows the minimal square for ve items this takes seconds on a MHz

SPARCstation

Figure Minimal square enclosure for items

2

We thank Matt Buonomano of Gerb er Garment Technologies for suggesting this application

Figure Minimal square enclosure for nonconvex items

Implementation note an appropriate form of compaction for the square enclosure prob

lem is one which gravitates items toward the center of the square

Minimal Rectangular Enclosures

We extend this approach to nding tight rectangular enclosures which is a common

prepro cessing step in many current algorithms which pack nonrectangular items It can

also b e applied to the problem of nding the b est sto ck sheet size for a given set of items

or the b est cloth width in garment manufacturing For layout algorithms which build strips

AA or columns MDL of items this approach can help determine the b est cluster In

higher dimensions this technique could help determine the b est packaging for a pro duct

Characterizing a rectangle requires two parameters One could parameterize by asp ect

ratio a and a scaling factor Unfortunately although is monotonic with resp ect to

it is not monotonic with resp ect to a Thus we cannot p erform binary search on a Instead

we can sample a

We choose instead to parameterize the rectangle by height h and width w In this case

as well the area function is only monotonic with resp ect to one of the parameters We

choose to sample w and p erform binary search on h for each sampled value of w It is

straightforward to obtain upp er and lower b ounds on w Let h b e the maximum height

max

of any item and w b e the maximum width Then one b ound on w can b e obtained

max

by letting the width of the container b e w and using binary search on height combined

max

with containment to nd the minimum asso ciated height The other b ound is achieved by

letting the height of the container b e h and using binary search on width combined

max

with containment to nd the minimum width w The minimal rectangular enclosure

min

algorithm contains an outer lo op which samples w in b etween the two b ounds For each w

it invokes a pro cedure which p erforms binary search on h for a particular value of w

Implementation note there are two ways to use compaction to accelerate the minimal

rectangle algorithm First of all downward compaction can b e used within the binary search

on h for xed w The second application of compaction relies on the fact that the minimal

h as a function of w increases monotonically as w decreases Steps in the function can

b e identied using compaction as follows After the minimal h is obtained for a given w

place the items within a w by h rectangle and apply leftward compaction to the righthand

b oundary of the rectangle Hop efully compaction will move w b eyond the next sample

p oint so that a binary search is avoided For this reason we suggest that w b e sampled in

decreasing fashion

We present three examples of nding minimal rectangles The rst example is three

rectangles in Figure This was found in seven seconds on a MHz SPARCstation

The second is three identical nearly nonconvex apparel pattern pieces in Figure This

required less than ve minutes The third is three nonconvex p olygons in Figure

Milenkovic has recently suggested MD an alternative metho d for nding minimal

rectangular enclosures of multiple items He p oses the following problem given shap es

P P P and area is there a rectangle of area which contains translated copies of

k

the shap es He solves the problem by mo difying the hybrid containment algorithm With

the mo dication one can nd the minimum numerically by binary search

Figure Tight rectangular enclosure for convex items

Figure Tight rectangular enclosure for nearly identical nonconvex items

Figure Tight rectangular enclosure for nonconvex items

Tight Convex and Nonconvex Enclosures

Figure Tight nonconvex enclosure for items

Section observed that oneparameter binary search together with containment can

not only nd the minimal enclosing square but it can also nd the minimal scaling factor

applied to any p olygonal enclosure

In this section we introduce a dierent way to obtain tight convex and nonconvex enclo

sures One can easily generate tight enclosures from a conguration of items within a tight

square or rectangular enclosure C For example one can use the convex hull of the items

to obtain a convex enclosure

However if we want the enclosure to preserve all the valid congurations of C we need

a dierent approach We use the reachable region as dened in Chapter to form a

container The pro cedure is simple First nd U for the items with resp ect to C Next

S

P This C is a container which U apply restrictions to U Then form C

j

j k

j

has all the valid congurations asso ciated with C It reveals p ortions of C which cannot b e

reached by any of the items when they are placed simultaneously in C

Figure shows a tight nonconvex container obtained from the rectangular enclosure

of Figure In Figure the container is the black lled region inside the rectangle

and the outlines of the original items are shown to the right for reference This container

was formed using reachable regions which were in turn obtained from U s All of the

j

white space inside the rectangle and outside the black region is unreachable and can b e

removed with no consequences In the gure we can easily see that three of the four corners

of the rectangle are sup eruous for the three given items The convex hull of this container

is a convex container which has the same valid congurations as the rectangle

This technique can b e applied for container design In some cases it can b e used to help

humans solve containment problems Observe that the container and items of Figure

immediately suggest a legal conguration to the human eye

Summary and Conclusions

This chapter has addressed four minimal container problems strip packing nding

minimal square enclosures nding minimal rectangular enclosures and nding tight

convex and nonconvex enclosures Our general approach to solving these problems is to

use binary search combined with containment The binary search can b e accelerated using

compaction techniques

Previous work on minimal enclosures in computational geometry considers only one

item Work in the layout literature allows multiple items but is heuristic and typically

greedy for more than two items Our work represents the rst nonheuristic multiple

item minimal enclosure work for more than two items Our containmentbased solutions to

minimal container problems do not allow the items to rotate but in contrast to heuristics

we establish an actual lower bound on the size of the container for multiple items

C h a p t e r

Maximal Item Problems

Introduction

In this chapter we give four examples of maximal item problems given a container

and a collection of items nding maximally scaled copies of items which t in the container

given a container and a collection of k items for which the sum of the item areas

pr actical

do es not exceed the area of the container nding a large subcollection which ts in the

container given a container and a collection of items for which either the sum of the

item areas exceeds the area of the container or the number of items is k nding

pr actical

a large subcollection of k items which ts in the container and problem

pr actical

for a collection of containers

For problem we use binary search combined with containment In problem the

given items cannot b e scaled they can only b e included in or excluded from the set The

key to solving problem is to carefully choose which item to eliminate from an infeasible

subset We reject the most troublesome item which is identied using the results of the

overlap elimination evaluation metho d of the hybrid containment algorithm For problem

we randomly construct a set of items and solve problem This yields a rich collection

of sets which t into the container For each set of size n which ts we automatically have

n

subsets which t and which need not b e individuall y represented This work provides the

rst practical metho d for constructing sets of up to ten p olygons which t in a container

For problem we solve problem for each container and then apply a lo okahead

assignment strategy This is a prepacking strategy Containment thus allows us transform

a geometric optimization problem into a combinatorial optimization problem Our results

challenge the existing b elief that prepacking metho ds are impractical for layout Arb

Overview

Section solves problem Section solves problem Section solves prob

lem Section solves problem Section summarizes this chapter and states

conclusions

Maximally Scaled Items

In this section we are concerned with positive homothets of items A p ositive homothet

of an item P is a scaled copy of P with scaling factor We do not allow rotation

i i i

of the homothets Given a container a set of k items which has a valid conguration in

the container and a real number we p ose the following general problem nd a valid

conguration of p ositive homothets of the items in the container for which the sum of the

areas of the homothets is at least We call this the maximal positive homothet problem

MAXHOMOTHET for a container Maximizing the value of yields a tight packing

of the container

Claim The maximal positive homothet problem is NPhard

Pro of We reduce an instance of the NPcomplete PARTITION problem to an instance

of MAXHOMOTHET An instance of PARTITION has a set A of items Each a A has a

P

p ositive integer size sa Let sa Q We build a twocomponent container Each

aA

comp onent is a rectangle of height and width Q For each a A construct a rectangle

of height and width sa Now if jAj scale each of these rectangles by

where and

X

sa Q

aAn

where is the item in A of minimum width

This guarantees that the scaled rectangles t into the container Let Q Now solve

MAXHOMOTHET We claim MAXHOMOTHET has a solution if and only if PARTI

TION has a solution For if PARTITION has a solution then there exists a valid congu

ration of rectangles of height and width sa for a A This conguration has area Q

and it represents a scaling of at least for each item we constructed for MAXHOMOTHET

so it is a solution to our instance of MAXHOMOTHET

Now we argue that if MAXHOMOTHET nds a solution then that solution is a solution

to PARTITION Because we scaled by no two items can b e stacked vertically within

a comp onent of the container This means that in order to completely ll the container

each item must b e restored to its full height This yields a solution to PARTITION 2

We examine heuristics for obtaining a go o d but not necessarily optimal solution to the

problem of maximizing the value of for MAXHOMOTHET One p ossible approach is to

force all items to have the same scaling factor This is easy to solve using binary search on

the scaling factor It has the advantage that a solution can b e found either by scaling the

container or the pieces If the number of vertices in the container is much smaller than the

sum of the number of vertices in the items then it is appropriate to scale the container

Another p ossibility is a greedy approach A greedy scaling algorithm would x the

scaling factor of one item during each iteration The xed item would b e the one whose

p ositive homothet can have maximum area

Each of these strategies can b e appropriate under dierent circumstances To illustrate

this we consider a maximal homothet problem for a collection of identical circular items

and a circular container Supp ose the container has a radius of and there are items It

is easy to show that if each of the given circles has radius less than then the area of the

Figure Scaling circles

p ositive homothets is greatest under a greedy strategy If however each circle has radius

greater than the greedy approach is inferior to applying the same scaling factor to each

circle The left p ortion of Figure shows a common scaling factor applied to the circles

and the right p ortion shows a greedy scaling

Yet another approach is an enhancement to the common scaling factor approach sug

gested by Milenkovic Mila In this approach one maintains a set Q of items whose

scaling factors are xed and a set S of items whose scaling factors are not yet xed While

S the algorithm scales items in S up as much as p ossible by the same scaling factor

The scaled items of S must t into the container along with the items in Q Then for

each item of S if it cannot b e scaled more than by we remove it from S and add it to Q

We present an approach to the maximal homothet problem which has most of the

advantages of b oth the greedy and the enhanced common scaling factor approaches and

is sup erior to b oth on some inputs As in the enhancement to the common scaling factor

algorithm we maintain a set Q of items whose scaling factors are xed and a set S of items

whose scaling factors are not yet xed We use the area of SSGRU as a rough measure

i

of the freedom of an item P We asso ciate a parameter with the area of these U s

i i

The value of is a real number whose minimum and maximum values are the minimum and

maximum areas resp ectively over all SSGRU for i k For a given value of we

i

dene a subset S of S S fP S jar eaS S GRU g As stated this causes

i i

b oth P and P to b e in S if ar eaS S GRU ar eaS S GRU Thus whenever

i j i j

an item is in S all identical copies of it are also in S To avoid this diculty we

mo dify the area function slightly so that for i j ar eaS S GRU ar eaS S GRU

i j

As ranges from to S changes k times For each of these k events we

max min

scale S up as much as p ossible using a common scaling factor for the items in S

The maximum common scaling factor is found using binary search on a parameter For

the maximum common scaling factor we record the total area of the scaled and unscaled

items Let b e the scaling factor asso ciated with the event of maximum total area and

max

S b e the asso ciated subset We scale items in S by If an item in S

max max max max

cannot b e scaled by more than we remove it from S and add it to Q We then up date

max

the set of events and rep eat the pro cess

Pseudoco de for the complete algorithm is given b elow The tolerance for the search on

is We denote the scaling of each element of a set S by a scaling factor as follows

S

MAXHOMOTHETP

Q

S P n P

max ar eaS S GRU

max P S i

i

min ar eaS S GRU

min P S i

i

Form event list

while S

best best max

for each event in event list

S fP S jar eaS S GRU g

i i

SCALABLES P Q S n S

if total area for total area for

best

best best

S fP S jar eaS S GRU g

best i i best

S S

best best best

S fP S jSCALABLE fP g P Q S n fP g g

best i best i i

Q Q S

best

S S n S

best

SCALABLES C S

max init

min

while

max min

cur r ent max min

if S S ts in C

cur r ent

min cur r ent

else

max cur r ent

return

min

P

Here is a simple way to establish Set ar eaC ar eaP

init init i

P S S

i

We stated ab ove that this algorithm p ossesses most of the advantages of the greedy

and the enhanced balanced strategies Here we elab orate on this p oint We rst show how

our algorithm is similar to the greedy algorithm Our event list contains an event which

corresp onds to scaling up a single item If we included an event for scaling up each P

i

individuall y we would b e testing all the p ossibilities considered by the greedy algorithm

In contrast our algorithm has only one singleitem scaling event However the scaled item

is the P whose U has the largest area This is a rough measure of the freedom of an

i

i

item When all items are identical our algorithm clearly makes the same choice as the

greedy algorithm We exp ect that in many cases in practice it will make the same choice

as the greedy algorithm Figure gives an example of MAXHOMOTHET b ehaving in

a greedy fashion for three items In this example only one of the items is scaled up its

scaling factor is

Figure Scaling up items in a greedy fashion

We now show how our algorithm is similar to the enhanced balanced strategy Our event

list contains an event which corresp onds to scaling up all items simultaneously by the same

scaling factor This is also done by the enhanced balanced strategy In addition we only

x the scaling factor for an item if it cannot b e scaled up further This is also a feature

of the enhanced balanced algorithm Figure gives an example of MAXHOMOTHET

b ehaving like the enhanced balanced strategy In this example all of the items are scaled

up by a factor of

Figure Scaling up items in an enhanced balanced fashion

There exist inputs for which our algorithm obtains a b etter solution than the greedy

algorithm A simple example is the previously mentioned circle problem in which the

container is a circle of radius and each of items is a circle of radius greater than In

general if the solution found by the enhanced balanced strategy is b etter than the solution

found by the greedy strategy for a given input then our algorithms solution will b e b etter

than the greedy algorithms solution for that input

There also exist inputs for which our algorithm obtains a b etter solution than the en

hanced balanced algorithm One such input consists of a circular container of radius and

circular items each of radius less than Because the items are identical our algorithm

makes the same choice as the greedy algorithm in this case

Our algorithm not only combines the p ower of the greedy and enhanced balanced strate

gies It also considers p ossibilities not considered by either of these two strategies These

p ossibilities corresp ond to events which scale up j items simultaneously for j k

Figure is an example in which MAXHOMOTHET scales up two items by the same

factor of the third item is not scaled

Figure Scaling up two items

Implementation note In applications where a scaling factor is involved one can use the

subset restriction of Section to attempt to sp eed up the containment algorithm

An Elimination Technique

In this section we consider the following problem given a container and a collection of

k k items for which the sum of the item areas do es not exceed the area of the

pr actical

container nd a large subset of the items which ts in the container An example of such

a problem is illustrated by Figure In this gure we are given nine items and must nd

a subset of them which ts into the container The container is depicted as a black lled

region The given items cannot b e scaled they can only b e included in or excluded from

the set

We present here a heuristic approach to this problem which is based on an elimination

technique and is therefore a topdown metho d The ow of the pro cedure is shown b elow

for a container C and an initial collection of items S The advantage of this topdown

approach is that a subset is found using at most k calls to containment Of course once

n

a subset of size n is found we obtain subsets for free and need not represent them

separately

GENERATESUBSETS C

while S do es not t into C

S S n CHOOSES

return S

However nothing is ever truly for free The price we pay here is that we must resolve the

dicult issue of how to choose an item to remove from the subset If this is not done well

the following scenario can easily o ccur Supp ose we always eliminate the item of smallest

area If a small number of the largest items in the subset cannot t together into the

container the subset pro duced by our pro cedure might only contain one or two items This

might not pack the container tightly

Figure Find a large subset which ts

Intuitively it makes sense to ask why a given infeasible subset do es not t If the

b ottleneck can b e found we can eliminate one of the items involved in the b ottleneck We

know how to obtain a go o d answer to this question b ecause when the hybrid containment

algorithm fails it can give us information ab out the lo cal overlap minimum it has obtained

Recall that our distancebased sub division metho d of Section selects a U to sub divide

ij

based on feedback from the evaluation step In that case we sub divide the U which is

ij

1

One measure of size is the number of items another is the total area of the items

Figure A large subset which ts

asso ciated with the greatest overlap b etween two items These two items are in some sense

the most troublesome In the current application we can eliminate one of these two items

from the subset We choose to eliminate the smaller of the two This approach works

well Figure shows a solution to the subset problem of Figure Our approach nds

a collection of seven items which t into the container This packing is fairly tight

Implementation note To control running time it is p ossible to limit the number of

hypotheses examined by the hybrid algorithm This causes it to give up early in some

cases However b ecause every hypothesis evaluation pro duces a lo cal overlap minimum we

still obtain useful overlap information when the algorithm terminates early

Randomized Subset Construction

Here we address the following problem given a container and a collection of items for

which either the sum of the item areas exceeds the area of the container or the number

of items is k nd a large subcollection of k items which ts in the

pr actical pr actical

container

Whenever the total area of the items exceeds the area of the container the containment

problem is infeasible and there is no need to run a containment algorithm Whenever

the number of items exceeds k it is also not appropriate to run a containment

pr actical

algorithm In b oth of these cases our goal is to nd a subset S of the given set of items

which satises the conditions of the problem addressed in Section The elimination

technique of Section can then b e applied to S

One way to pro duce S is to use randomness Using randomness has the advantage that

we can create a diverse collection of subsets by rep eating the pro cess We then apply the

elimination technique to each subset We select the resulting subset which has the largest

area and therefore provides the tightest packing of the container One can randomly exclude

items from the collection until the subset satises the requirements of S Alternatively one

can select items randomly in a b ottomup fashion When the number of items is large is

large ie k as in our applications the latter approach is more ecient

pr actical

We oer two examples of the success of this randomized approach In b oth examples

some of the items can b e reected in the xaxis or rotated by a multiple of Our con

struction pro cess takes these p ossibilitie s into account by randomly selecting orientations

Figure p ortrays a collection of items and a container lled in black Figure shows

a collection of three items which pack the container tightly We generated the following ten

Figure Items and container for randomized construction task

16 17 52 18 36 19 53 21 20 54 57 37 55 22 38 56 23 24 39 58 25 40 59 26 60 27 41 42 61 28 43 62 29 44 63 30 45 64 65 31 46 66 67 47 68 32 69 70 48 71 33 49 50 34 51

35

Figure Randomly constructed item group

Figure Randomly constructed item group

groups for this container

Figure gives another example In this case a collection of ve items is

placed in the container We generated groups for this container

Pseudoco de for a group generation pro cedure for a container C and a collection of items

P is given b elow We maintain a t list G and a mist list M which are b oth initially

empty To generate a group g which ts we rst initialize the current group g Then

while the total area of items in g do es not exceed the container area and the number of

items in g is k we randomly add items to g Let randomP return a randomly

pr actical

selected item P i from P Now we attempt to disqualify g by checking if any group

i

in the mist list is a subset of g If g is not disqualied we obtain a subset of g which ts

by invoking GENERATESUBSET from Section We add the subset to G Let b e a

stopping condition for generating groups for a container

GENERATEGROUPSP C

G

while not satised

g

P

while ar eaP ar eaC and jg j k

i pr actical

P g

i

g g randomP

if there exists m M such that m g

M M g

else

g GENERATESUBSETg C

Add g to G

return G

The question of what constitutes an eective stopping criterion is an op en one A

running timepacking density tradeo clearly exists Our exp erience suggests that a go o d

balance b etween these two factors can b e achieved if the number of groups is inversely pro

p ortional to the capacity of the container We have tested our group generation pro cedure

on hundreds of examples and veried that our stopping criterion pro duces tight packings

Ultimately the b est stopping condition can dep end on what the groups will b e used for

We therefore defer further discussion of this to the next section

Prepacking

Given a packing problem for a collection of containers and a collection of items a

prepacking approach has two steps generate groups of items for each container and

assign groups to containers The goal is to place a maximal subset of the items

Section oers a group generation pro cedure which uses containment This solves problem

Problem is a combinatorial optimization problem There is a rich literature on

combinatorial optimization

The optimal solution to the assignment problem can b e obtained using a matching mo del

based on mixed integer programming We developed one such mo del A Bo olean variable

2

We did not implement the mist list so it is not clear whether or not it is costeective in general

3

Area is one p ossible measure

g in our mo del represents the assignment of group k to container j A Bo olean variable p

k j ij

represents the assignment of item i to container j The mo del has three types of constraints

The rst type of constraint is of the form

X

g

k j

k

There is one constraint of this type for each container Each constraint prevents a container

from having more than one group assigned to it The second type of constraint is

X

p

ij

j

There is one constraint of this type for each item Each constraint prevents an item from

b eing assigned to more than one group The third type of constraint forces all items in a

group to b e assigned together This is of the form

p g

ij k j

There is one constraint of this type for each item in each group One p ossible ob jective

function is to maximize the following

X

g

k j

k j

We originally intended to use this mo del under the assumption that each group contains

at most three items If we allow up to ten items in a group it is not clear that this approach

is practical given the current stateoftheart in mixed integer programming Consider for

example a typical prepacking application in apparel marker making A typical pants

marker has approximately containers If containment pro duces a item group for each

container this yields subgroups for each container The number of Bo olean variables

could b e as large as in this case

At the other extreme a greedy algorithm can b e used for assignment There are many

p ossible approaches in b etween mixed integer programming and a greedy strategy Finding

the ultimate assignment technique for prepacking is b eyond the scop e of this containment

oriented thesis However we oer an intermediate approach which runs quickly provides

lo okahead and is quite exible Our results challenge the b elief that prepacking strategies

are impractical Arb

Assignment Strategy

Our assignment strategy requires three functions The rst is a comparison function

f g g which accepts two groups g and g returns g if g g and returns g otherwise

Let C b e a collection of containers The second function is an ordering function f C C

for containers The third is an evaluation function hC g which accepts a container C C

and a group g and returns a real number

The rst step of our assignment pro cess is to sort the groups for each container according

to f Then while some item remains unassigned p erform the following For each container

select the rst group in its ordering for which there are sucient unassigned items Apply

hC g to obtain a value for this group Select the C g pair with the b est value and

p erform this assignment

The evaluation function h uses a greedy lo okahead strategy which requires the ordering

function f for containers For a given container and its rst group tentatively p erform this

assignment Now examine each remaining container according to the container ordering

For each container tentatively assign the highest group according to f whose items are

currently tentatively unassigned When tentative assignments have b een p erformed for

all containers return which is the total area of all tentatively assigned items

In the pseudoco de b elow C is a collection of containers and G is the output of GENERATE

GROUPS for all the containers C C is an individual container and G G is the

i i

collection of groups pro duced by GENERATEGROUPS for C An available group g G

i i

is one whose items are all available ie unassigned

ASSIGNP C G

for each container C C

i

Sort G G according to f

i

while some P P i is available

i

for each container C C

i

g rst available group of G

i

hC g

i i

B estI index of container with b est

Assign items of g for C to C

B estI B estI

Results

To justify our claim that prepacking can b e practical we present the results of our

exp eriments with applying prepacking to a trim placement problem for pants markers in

apparel manufacturing see Section for a description of the trim placement problem

Table presents results of our group generation and assignment pro cedures for ex

amples For each example we give the name of the marker layout the number of trim

items which must b e placed and results for three trim placement strategies The three

strategies are FirstFit our assignment strategy called Match in the table and

our assignment strategy followed by FirstFit on the unplaced items For each strategy we

give the number of items left unplaced and the total area of the unplaced items

Our FirstFit strategy is a greedy heuristic which places each item at the leftmost

available p osition The items are sorted by decreasing area and are placed in that order

The heuristic has two additional features which allow it to pro duce layouts whose waste

p ercentage is on the average only ab out larger than what exp erienced humans achieve

The rst additional feature tries all legal ips and discrete rotations by multiples of

for each item and selects the b est one The second feature uses a variation on compaction

to bump each placed item in a particular direction in an eort to reduce fragmentation

of the available space

There is a number of ways to interpret this data Comparing the total number of items

left unplaced assignment plus FirstFit places more items than FirstFit alone Averag

ing the p ercentage of the items which are left unplaced shows that assignment plus FirstFit

leaves only an average of of the trim items unplaced whereas FirstFit leaves of

FirstFit Match MatchFirstFit

marker name ntrim nleft area left nleft area left nleft area left

c e e

b e e e

b e e e

b e e e

d e e e

c e e e

kt e e e

kt e e e

kta e

kt e e e

a e e

a e e e

a e e e

a e e e

it e e e

ita e e e

it e e e

e e

Table Prepacking results

them unplaced assignment plus FirstFit is b etter by this measure It is also valuable

to compare the area of the unplaced items A raw comparison of total area shows that

assignment plus FirstFit placed more area than FirstFit To remove any dierences

in scale averaging the p ercentage of the area which is left unplaced shows that assignment

plus FirstFit leaves only an average of of the area unplaced whereas FirstFit leaves

of the area unplaced assignment plus FirstFit is b etter by this measure All of

these comparisons show the quality of assignment plus FirstFit to b e sup erior to FirstFit

alone

We illustrate our results by showing layouts for two examples For the rst example Fig

ure shows the trim placement task Figure shows the layout obtained by FirstFit

Figure shows the layout obtained by our assignment pro cedure and Figure shows

the layout after assignment followed by FirstFit Figure Figure Figure and Figure show the same progression for our second example

Name: 37188c-trim Width: 59.75 in Length: 130.28 in Pieces: 54 Efficiency: 76.45%

5 3 7

11 6

1

8 9 0

10 2 4

49 12 23 38 50 13 29 51 39 52 24 14 30 53 15 40 31 16 25 41 32 17 42 18 33 26 43 34 19 44 35 20 27 45 36 21 46 37 22 28 47

48

Figure Trim placement task for cmrk

Additional quality comes at the cost of higher running time Our FirstFit strategy

requires under ve minutes whereas our new strategy currently requires one to two hours

for a item example on a MHz SPARCstation In apparel manufacturing a human

takes ab out hour for an example of this size One to two hours is within the realm

of practicality For our current implementations of containment and assignment ab out

of the running time is consumed by group generation and of this almost all the

time is sp ent in the containment algorithm This means that a dramatic increase in the

sp eed of our hybrid containment algorithm will also have a dramatic impact on the sp eed Name: 37188c-ffit Width: 59.75 in Length: 130.28 in Pieces: 54 Efficiency: 86.78%

51 50 48 14 18 24 45 22 31 16 5 3 7 35 15 34 33 23

11 20 30 13 6 29 28 47 1 26 25 46 17 8 9 0

32 12 10 2 4

21 27 53 52 49

19 36 37 38 39 40 41 42 43

44

Figure FirstFit for cmrk

Name: 37188c-matchk Width: 59.75 in Length: 130.28 in Pieces: 54 Efficiency: 87.27%

52 51 30 21 25 26 37 5 3 7 34 49 32 20

15 29 47 11 17 23 6 35 39 36 27 48 31 1 46 24 45 38 8 9 0

33 12 14 10 2 4 40 16 13 28 41 22 50 53

18 19 42 43

44

Figure Assignment for cmrk Name: 37188c-matchk2 Width: 59.75 in Length: 130.28 in Pieces: 54 Efficiency: 87.82%

52 51 30 21 25 26 424344 37 5 3 7 34 49 32 20

15 29 47 11 17 23 6 35 39 36 27 48 31 1 46 24 45 38 8 9 0

33 12 14 10 2 4 40 16 13 28 41 22 50 53

18

19

Figure Assignment plus FirstFit for cmrk

Name: 41132-trim Width: 59.75 in Length: 182.13 in Pieces: 72 Efficiency: 78.65%

6 13 2 9

7 3 12 8

14 10 5 1

15 11 4 0

16 49 17 34 18 50 19 35 51 20 52 21 36 53 22 54 23 37 24 55 25 38 56 26 57 27 39 58 28 59 40 29 60 41 61 30 42 31 62 43 63 44 64 32 65 45 66 67 46 68 33 69 70 47 71

48

Figure Trim placement task for bmrk Name: 41132-ffit Width: 59.75 in Length: 182.13 in Pieces: 72 Efficiency: 89.04%

28 26 47 16 24 29 40 23 22 17 69

6 13 2 9 36 37 62 55 33 54 32 21 53 42 7 3 12 8 20 45 46 14 10 5 44 1 38 34 39 63 19 43 71 35 68 15 11 4 0 70 18 25 31 30 41 27

48 49 50 51 52 56 57 58 59 60 61 64 65 66

67

Figure FirstFit for bmrk

Name: 41132-matchk Width: 59.75 in Length: 182.13 in Pieces: 72 Efficiency: 89.67%

67 69 26 53 24 40 31 56 66 68

6 13 2 9 43 18 70 57 21 39 37 34 20 59 36 54 55 7 3 12 8 47 44

23 45 14 10 5 42 1 41 35 38 63 33 17 58 32 46 22 62 15 11 4 0 61 71 65 30 52 28 19 60 27 29

16 25 48 49 50 51

64

Figure Assignment for bmrk Name: 41132-matchk2 Width: 59.75 in Length: 182.13 in Pieces: 72 Efficiency: 90.41%

67 69 26 53 24 40 495051 31 56 66 64 16 68

6 13 2 9 43 18 70 57 21 39 37 34 20 59 36 54 55 7 3 12 8 47 44

23 45 14 10 5 42 1 41 35 38 63 33 17 58 32 46 22 62 15 11 4 0 61 71 65 30 52 28 19 60 27 29

25

48

Figure Assignment plus FirstFit for bmrk

of prepacking

Our b est trim placement strategy for pants markers in apparel manufacturing is neither

FirstFit nor prepacking It places items in approximately ten minutes and its waste is in

the pro duction quality range Neither FirstFit nor our current prepacking implementation

currently generate results which are consistently in the pro duction quality range Our b est

strategy employs sp ecial heuristics to place the largest items rst uses containment to

construct small groups of at most three items a naive greedy assignment strategy and

compactionbased techniques combined with FirstFit to place any remaining items

Although it achieves excellent results for pants markers its applicability to other do

mains is limited In contrast our prepacking approach is completely general It can b e

applied to any domain The same is true of FirstFit

Our b est pants strategy also do es not have much growth p otential That is we do not

exp ect that adjustments to parameters of this algorithm will signicantly reduce the waste

of the asso ciated layouts The same is true of FirstFit However our prepacking approach

has tremendous growth p otential Its initial results are go o d and improvements in the

assignment strategy or the group generation pro cess will improve the quality of its results

Future research will b enet from determining whether the current group generation

pro cess or the assignment strategy is the limiting factor We have attempted to p erform

assignment manually using the groups we generate and our initial results show that sur

prisingly the assignment strategy is less limiting than group generation

There are many parts of the group generation pro cedure which can b e altered the ran

dom pro cedure for building a group the elimination technique the containment algorithm

and the number of groups Our initial exp eriments have imp osed a number of articial

limitations Our current implementation limits the size of a subset to ten our waste gures

would probably improve with a higher limit We also limit the number of hypotheses eval

uated by the hybrid algorithm to less than and we build no more than groups for a

container

This returns us to the stopping condition issue raised in Section It is impractical to

generate al l p ossible groups for each container How do we determine if a given collection of

groups is satisfactory for the assignment phase without running the assignment algorithm

This is b eyond the scop e of the thesis Investigating ways to obtain a lower b ound on

waste for a given collection of groups is a sub ject of future work Given a lower b ounding

technique one could iteratively determine a b ound and selectively generate more groups

until the desired waste level was achieved

Summary and Conclusions

This chapter has addressed the following maximal item problems given a container

and a collection of items nding maximally scaled copies of items which t in the container

given a container and a collection of k items for which the sum of the item areas

pr actical

do es not exceed the area of the container nding a large subcollection which ts in the

container given a container and a collection of items for which either the sum of the

item areas exceeds the area of the container or the number of items is k nding

pr actical

a large subcollection of k items which ts in the container and problem

pr actical

for a collection of containers

For problem we oer a heuristic which uses binary search combined with contain

ment The heuristic has most of the advantages of the greedy and the enhanced balanced

strategies It b eats b oth of these approaches on some inputs

The remaining three problems are all related to our prepacking strategy We use an

elimination strategy for problem which uses feedback from the hybrid containment

algorithm to identify troublesome items For problem we randomly construct a subset

of items and then solve problem This pro cess considers multiple discrete orientations

for items For problem we nd groups of items which can t into each container and

then apply a lo okahead assignment strategy We demonstrate what we b elieve is the rst

practical application of prepacking We are able to generate a suciently rich collection of

groups for each container so that our assignment strategy followed by a FirstFit strategy

can outp erform a FirstFit strategy This pro cess takes one or two hours for a item

example using the current implementation of our hybrid containment algorithm There are

many ways to improve our group generation and assignment pro cesses We b elieve that in

addition to demonstrating the feasibility of prepacking this approach has the p otential to

eventually match the pro ductionquality results of our b est algorithm for trim placement

in apparel manufacturing

Part III

Conclusion and App endix

C h a p t e r

Conclusion and Future Work

Conclusion

This thesis demonstrates that although containment is NPhard it is fruitful to

develop algorithms for containment as opp osed to heuristics design containment algo

rithms so that they say no almost as fast as they say yes use geometric techniques

not just mathematical programming techniques and maximize the number of items for

which the algorithms are practical

Our approach to containment has a number of imp ortant features First we intro

duce a restrictevaluatesubdivide paradigm Second we develop new theory and practical

techniques for the op erations within the paradigm The techniques are appropriate for two

dimensional containment problems in which the items and container may b e irregular ie

nonconvex and have multiple comp onents and in which the items may b e translated but

not rotated Our techniques can b e combined to form a variety of twodimensional transla

tional containment algorithms which follow the restrictevaluatesubdivide paradigm The

paradigm is designed so that unlike existing iterationbased algorithms containment algo

rithms based on the paradigm are adept at saying no even for slightly infeasible problems

Infeasible problems o ccur frequently in practice

We develop geometric restrictions which are p owerful conguration space pruning tech

niques They often detect infeasibility without any evaluation or sub division We give two

algorithms which use geometric restrictions and are based on the restrictevaluatesubdivide

paradigm We obtain the rst practical running times for NPcomplete twodimensional

translational containment problems for up to ten nonconvex items in a nonconvex container

Our examples are drawn primarily from the apparel industry Each item is represented as

a p olygon which typically has from to vertices The container is also represented

as a p olygon it typically has from to vertices The items and container may b e

nonconvex

We demonstrate that viewing containment as a feasibility problem has many b enets

for layout optimization problems We present an eective metho d for nding minimal

enclosures which uses containment to p erform binary search on a parameter We note that

compaction can b e used to accelerate the search This work represents the rst practical

approach to nding minimal enclosures for multiple nonconvex items Clustering is used

often in layout but current clustering techniques for more than two items are heuristic

Our minimal enclosure work should lead to more p owerful clustering metho ds and is an

example of how strong b ottomup techniques from computational geometry can help the

layout community

We b elieve that some p otentially promising layout techniques have b een abandoned by

the layout community b ecause they lack strong b ottomup metho ds The primary example

of this is prepacking We challenge the view that prepacking is impractical for multiple

container packing problems by generating a rich collection of groups for each container

using containment and then applying an assignment strategy

Our advances in containment will help automate layout for industrial pro cesses that rely

on twodimensional packing of ob jects Our results are particularly relevant to industries

which deal with irregularly shap ed items This includes industries such as aerospace ship

building apparel and sho e manufacturing furniture pro duction and steel construction

Future Work

Section invites other researchers to exchange containment data with us We hop e

this will result in a broad set of containment b enchmarks which can b e used to evaluate

the eectiveness of dierent containment algorithms In addition to soliciting containment

problems from a variety of sources we plan to automate the pro cess of creating containment

problems from existing layouts

Here we oer directions for future research on containment problems and applications of

containment to layout Section describ es problems related to containment algorithms

and Section discusses applications

Containment

There are several directions for future work in containment One direction is to increase

the dimensionality of the containment problems we address For instance many imp ortant

threedimensional packing and layout problems could b e solved using threedimensional

containment algorithms Another way to increase the dimensionality of the containment

problem is to allow rotation Rotational containment adds an extra degree of freedom to

each item by allowing it to rotate continuously within a range of angles Many layout

problems allow continuous rotation of items particularly problems related to sheet metal

work Section reviewed work in this area There is clearly ro om for much work on

rotational containment involving more than one item

There are ways rotation could b e dealt with in a heuristic fashion The rst way in

volves our minimal enclosure work Recall that compaction can b e used to up date the

upp er b ound Li and Milenkovic have rotational as well as translational compaction al

gorithms Rotational compaction could b e applied to the translational solution as a nal

p ostpro cessing step In our hybrid translational containment algorithm one could de

velop a rotational overlap reduction evaluator Using this evaluator the hybrid algorithm

would try to pro duce a valid rotational conguration from each overlapping translational

conguration found by the linear program

A second direction for future work involves improving our algorithms for translational

containment so that larger numbers of items more than ten may b e placed in a practical

amount of time One way to obtain a sp eedup is to apply coursegrained parallelism

Throughout the thesis we have identied parts of our work which are natural candidates

for coursegrained parallelism

Some layout applications represent ob jects using circular arcs in addition to p olygons

and so enriching our underlying ob ject representation is a worthwhile goal

There is a considerable literature on rectangle packing and integer programming that

remains untapped for general k NN containment Integer programming requires a great

deal of nesse to apply correctly and we have b een disapp ointed so far with results we

have obtained using stateoftheart mixed integer programming packages Our work on

combining computational geometry and linear programming is a large step towards the

ultimate goal of usefully combining computational geometry and integer programming

Exact covering problems such as solving jigsaw puzzles can b e solved using contain

ment algorithms For the nonexact case we hop e to develop algorithms which decide if a

collection of items can cover another item

We plan to develop more valid and semivalid restrictions for translational containment

We will continue to explore the question of which restriction op erations allow s the max

imum number of vertices in a restricted p olygon to remain nite even when an innite

number of op erations is applied

The following problems are asso ciated with our greedy evaluation metho d

Given p olygons A and B is there a translation t for which H A t B is convex

Find t which maximizes the convexity of A t B

Solve these problems for convex A and B

Given a collection of p olygons P how fast can we nd the translation t for each

p

p P such that the area of p t is maximized This is also useful for nding

pP p

the maximum area breaking p olygon

The shrinkingp oint heuristic which maximizes the area of intersection of translated U s

ij

works well unless the U s consist only of isolated edges and p oints This case can o ccur

ij

when we form subproblems using a b oundary restriction In this case we prop ose using a

distancebased heuristic instead of an areabased one

These problems arise in relation to sub division

Sub divide in a that encourages translations of U s to intersect

ij

Given a set of p olygons P how fast can we nd the line L which partitions P into P

and P such that the area of H P H P H P is minimized

Potential improvements to the approximate algorithm include

Use multiple resolution techniques

Invoke a linear programmingbased algorithm when the convex hulls of the restricted

U s are all inside their resp ective unrestricted U s

ij ij

Extend the sizebased sub division used in this algorithm so it sub divides U s for

ij

which i

We plan to evaluate the costeectiveness of using a partial characterization to pro duce k

subproblems for k Our current exp eriments suggest that it is b enecial for k

even when the subproblems are solved sequentially We exp ect that for nonidentical item

problems a critical value of k exists b eyond which the sequential advantage is lost A de

tailed comparison of the parallel cost will b e necessary in order to justify using the partial

characterization for values of k larger than the critical one Coursegrained parallelism can

b e applied to our algorithm by maintaining a queue of hypotheses Each hypothesis repre

sents an indep endent containment subproblem which is created via sub division Whenever

a pro cessor is available it op erates on the next hypothesis in the queue The subproblems

generated by the characterization are also indep endent from each other and so the hypothe

ses they generate are indep endent and can b e added to the queue We plan to construct a

program which uses a queue and simulates the parallel execution of our algorithm

Applications of Containment to Layout

In our work on container transformation we currently approximate the area integral of

Probftg v for t v via sampling We seek ecient algorithms for computing this integral

exactly

Pursuing more ecient algorithms for nding the exact MAAPR is certainly one di

rection for future work We are interested in faster algorithms or lower b ounds for these

p olygon types

Orthogonally convex

Horizontally convex

Vertically separated horizontally convex

Another direction of practical imp ortance is to nd a fast approximate MAAPR algorithm

Such an algorithm would b e very helpful in our applications

There are many op en problems asso ciated with the concept of inking sets The problem

of minimizing the number of vertices while maximizing the minimum area of inking set

pieces is op en even for convex p olygons Given a collection of p olygons the problem of

nding a p olygon representing the maximal common subset of translations of these p olygons

is useful not only for inking sets but also for the subset substitution restriction

Future work on our minimal enclosure applications includes implementing our idea of

using compaction to accelerate binary search We also plan to exp eriment with using our

minimal enclosure algorithms for nding rep eating patterns of irregular ob jects

Future work on maximal item problems includes improving our algorithm for solving

the maximal homothet problem Our prepacking work can b e improved by obtaining lower

b ounds for assignment and feeding these results back into the group generation pro cess

C h a p t e r A

Containment File Format

This app endix describ es the simple le format we prop ose for twodimensional p olygonal

containment data The format rst describ es the p olygonal container and then each of the

p olygonal items to b e placed For each p olygon the number of vertices precedes the list of

x and y vertex co ordinates Data for each vertex app ears on a separate line The vertices

are listed in counterclockwise order so that the inside of the p olygon is to the left of each

directed edge

The small example on the next page is for a CC problem for which our approximate

algorithm nds a valid conguration in one second on a MHz SPARCStation In this

example the container is a triangle and each of the three items is also a triangle

container vertices

items

item vertices

item vertices

item vertices

Bibliography

AA M Adamowicz and A Albano Nesting twodimensional shap es in rectangular

mo dules ComputerAided Design

AB F Avnaim and J Boissonnat Simultaneous Containment of Several Polygons

In Proceedings of the rd ACM Symposium on Computational Geometry pages

AB F Avnaim and J Boissonnat Polygon placement under translation and rota

tion In Proceedings of the th Annual Symposium on Theoretical Aspects of

Computer Science Lecture Notes in Computer Science pages

SpringerVerlag

ABB H Alt B Behrends and J BlomerApproximate matching of p olygonal shap es

In Proceedings of the th Annual ACM Symposium on Computational Geometry

pages

ABJ C Amaral J Bernardo and J Jorge MarkerMaking Using Automatic Place

ment of Irregular Shap es for the Garment Industry Computers and Graphics

Ada M Adamowicz The optimum twodimensional al location of irregular multiply

connected shapes with linear logical and geometric constraints PhD thesis

Electrical Engineering Department New York University

Arb A Arb el Largescale optimization metho ds applied to the cutting sto ck problem

of irregular shap es International Journal of Production Research

AS A Albano and G Sapupp o Optimal Allo cation of TwoDimensional Irregular

Shap es Using Heuristic Search Metho ds IEEE Transactions on Systems Man

and Cybernetics SMC

AS B Aronov and M Sharir On Translational Motion Planning in Space In

Proceedings of the th Annual ACM Symposium on Computational Geometry

pages

Avn F Avnaim Placement et deplacement de formes rigides ou articulees PhD

thesis Universitede FrancheComteFrance

Bab P V Babaev The optimal cutout of materials with help of a computer

Mashinostro enje

BFM B Baker S Fortune and S Mahaney Polygon Containment under Translation

Journal of Algorithms

BG D Bohme and A Graham Practical Exp eriences with Semiautomatic and

Automatic Partnesting Metho ds In C Kuo K MacCallum and T Williams

editors Computer Applications in the Automation of Shipyard Operation and

Ship Design III pages NorthHolland Publishing Company

BHW J Blazewicz P Hawryluk and R Walkowiak Using a tabu search approach

for solving the twodimensional irregular cutting problem Annals of Operations

Research

BK A Bezdek and G Kertesz Counterexamples to a packing problem of L Fejes

Toth In K Boroczky and G Fejes Toth editors Intuitive Geometry North

Holland New York

BTS J Bailleul K Tiaibia and R So enen Nesting Two Dimensional Irregular

Shap es In Anisotropic Material In TMR Ellis and OI Semenkov editors

Advances in CADCAM pages NorthHolland

CG R CuninghameGreen Geometry Sho emaking and the MilkTray Problem

New Scientist August

Cha B Chazelle The Polygon Containment Problem In Preparata editor Advances

in Computing Research Volume Computational Geometry pages JAI

Press Inc Greenwich Connecticut

CK LP Chew and K Kedem Placing the largest similar copy of a convex p olygon

among p olygonal obstacles In Proceedings of the th Annual ACM Symposium

on Computational Geometry pages

CMTS N Christodes A Mingozzi P Toth and C Sandi Combinatorial Optimiza

tion John Wiley and Sons Chichester

CY JS Chang and CK Yap A Polynomial Solution for the Potatop eeling Prob

lem Discrete and Computational Geometry

DBB D Dori and M BenBassat Ecient Nesting of Congruent Convex Figures

Communications of the ACM

DD Kathryn A Dowsland and William B Dowsland Solution Approaches to Ir

regular Nesting Problems Invited review to appear in European Journal of

Operational Research

DD K A Dowsland and W B Dowsland Packing Problems European Journal of

Operational Research

Dev O Devillers Simultaneous Containment of Several Polygons Analysis of the

Contact Congurations Technical Rep ort INRIA

DF H Dyckho and U Finke Cutting and Packing in Production and Distribution

A Typology and Bibliography PhysicaVerlag Heidelb erg

DJ R Dighe and M Jakiela Solving Pattern Nesting Problems With Genetic Al

gorithms Employing Task Decomp osition And Contact Detection In Evolu

tionary Computation MIT Press Cambridge MA

DKO N DePano Y Ke and J ORourke Finding Largest Inscrib ed Equilateral

Triangles and Squares In Proceedings of the th Al lerton Conference on Com

munications Control and Computing pages

DM K Daniels and V J Milenkovic Multiple Translational Containment Part

I An Approximate Algorithm Algorithmica special issue on Computational

Geometry in Manufacturing accepted subject to revisions

DM K Daniels and V J Milenkovic Limited Gaps In Proceedings of the th

Canadian Conference on Computational Geometry pages

DM K Daniels and V J Milenkovic Multiple Translational Containment Approx

imate and Exact Algorithms In Proceedings of the th Annual ACMSIAM

Symposium on Discrete Algorithms

DML K Daniels VJ Milenkovic and Z Li Multiple Containment Metho ds Tech

nical Rep ort Center for Research in Computing Technology Division of

Applied Sciences Harvard University

DMR K Daniels V J Milenkovic and D Roth Finding the Maximum Area Axis

Parallel Rectangle in a Simple Polygon Computational Geometry Theory and

Applications accepted subject to revisions

DMR K Daniels V J Milenkovic and D Roth Finding the Maximum Area Axis

Parallel Rectangle in a Polygon In Proceedings of the th Canadian Conference

on Computational Geometry pages

DT C Dagliand M Tatoglu An approach to twodimensional cutting sto ck prob

lems International Journal of Production Research

Due G Dueck New Optimization Heuristics The Great Deluge Algorithm and the

RecordtoRecord Travel Journal of Computational Physics

Dyc H Dyckho A typology of cutting and packing problems European Journal of

Operations Research

Ede H Edelsbrunner Algorithms in Combinatorial Geometry SpringerVerlag New

York

For S Fortune A Fast Algorithm for Polygon Containment by Translation In

Proceedings of the th Col loquium on Automata Languages and Programming

pages SpringerVerlag

For S Fortune A Sweepline Algorithm for Voronoi Diagrams Algorithmica

GA H El Gindy and D Avis A Linear Algorithm for Computing the Visibili ty

Polygon from a Point Journal of Algorithms

GC R Grinde and T Cavalier Containment of a Single Polygon Using Mathemat

ical Programming Technical Rep ort IMSE Working Paper The Penn

sylvania State University Department of Industrial and Management Systems

Engineering

GG P Gilmore and R Gomory Multistage Cutting Sto ck Problems of Two and

More Dimensions Operations Research

GJ M Garey and D Johnson Computers and Intractability A Guide to the Theory

of NPCompleteness WH Freeman and Company San Francisco

GRS L Guibas L Ramshaw and J Stol A Kinetic Framework for Computa

tional Geometry In Proceedings of the th IEEE Symposium on Foundations

of Computer Science pages

Gura O Gurel Additional considerations on marker layout problem by graph theory

Technical Rep ort IBM Scientic Centre

Gurb O Gurel Marker layout via graph theory An attempt for optimal layout of

irregular patterns Technical Rep ort IBM Scientic Centre

Gur O Gurel Circular graph of marker layout Technical Rep ort IBM

Scientic Centre

HF M Haims and H Freeman A multistage solution of the templatelayout prob

lem IEEE Transactions on Systems Science and Cybernetics

Hin A Hinxman The trimloss and assortment problems A survey European

Journal of Operations Research

HL J Heistermann and T Lengauer Ecient Automatic Part Nesting on Irregular

and Inhomogeneous Surfaces In Proceedings of the rd Annual ACMSIAM

Symposium on Discrete Algorithms

HL R Heckmann and T Lengauer A Simulated Annealing Approach to the Nesting

Problem in the Textile Manufacturing Industry In R Burkhard P Hammer

T Ibaraki and M Queyranne editors Mathematics of Industrial Systems Vol

ume Annals of Op erations Research J C Baltzer AG Science Publishers

Amsterdam

HT D Hinkle and C Toomey Clavier Applying CasedBased Reasoning to Com

p osite Part Fabriciation In AAAI Sixth Innovative Applications of Articial

Intel ligence Conference pages

HW N Hyer and U WemmerlovGroup technology in the US manufacturing indus

try a survey of current practices International Journal of Production Research

IH H Ismail and K Hon New approaches for the nesting of twodimensional shap es

for press to ol design International Journal of Production Research

IS S Israni and J Sanders Twodimensional cutting sto ck problem research A

review and a new rectangular layout algorithm Journal of Manufacturing Sys

tems

IS S Israni and J Sanders Performance testing of rectanular partsnesting heuris

tics International Journal of Production Research

JGJ EG Coman Jr MR Garey and DS Johnson Approximation Algorithms for

BinPacking An Up dated Survey In G Ausiello M Lucertini and P Serani

editors Algorithm Design for Computer System Design pages Springer

JL EG Coman Jr and G S Lueker Probabilistic Analysis of Packing and Par

titioning Algorithms Wiley and Sons Inc New York

JS B Jo e and RB Simpson Corrections to Lees Visibility Polygon Algorithm

BIT

Kar J B Karasic Formalization of Heuristic Tactics Used by Human Beings in

Searching for the Closest Packing of Arbitrary Ob jects in a Given Domain

Cybernetics and Systems An International Journal

Kha L G Khachian A p olynomial algorithm in linear programming Soviet Math

ematics Doklady

Kir D G Kirkpatrick Optimal Search in Planar Sub divisi ons SIAM Journal on

Computing

KK G Kup erb erg and W Kup erb erg DoubleLattice Packings of Convex Bo dies

in the Plane Discrete and Computational Geometry

KL F Karoupi and M Loftus Accommo dating diverse shap es within hexagonal

pavers International Journal of Production Research

Law E Lawler Combinatorial Optimization Networks and Matroids Holt Rinehart

and Winston New York

Lee DT Lee Twodimensional Voronoi diagrams in the L Metric Journal of the

p

ACM

Lee D T Lee Visibili ty of a Simple Polygon Computer Vision Graphics and

Image Processing

Li Z Li Compaction Algorithms for NonConvex Polygons and Their Applications

PhD thesis Harvard University Division of Applied Sciences

LLKS E Lawler J Lenstra A Rinno oy Kan and D Shmoys editors The Traveling

Salesman A Guided Tour of Combinatorial Optimization John Wiley and

Sons Chichester

LMa Z Li and V J Milenkovic A Compaction Algorithm for NonConvex Polygons

and Its Application In Proceedings of the th Annual ACM Symposium on

Computational Geometry pages May

LMb Z Li and V J Milenkovic Compaction and Separation Algorithms for Non

Convex Polygons and Their Applications Technical Rep ort TR Center

for Research in Computing Technology

LMc Z Li and V J Milenkovic The Complexity of the Compaction Problem In

Proceedings of the th Canadian Conference on Computational Geometry A

Lubiw and J Urrutia Editors pages August

LMd Z Li and V J Milenkovic The Complexity of the Compaction Problem In

Proceedings of the th Canadian Conference on Computational Geometry pages

Waterloo Canada

MD V J Milenkovic and K Daniels Translational Polygon Containment and Min

imal Enclosure using Geometric Algorithms and Mathematical Programming

In Submitted to the th Annual IEEE Conference on Foundations of Computer

Science

MDL V J Milenkovic K Daniels and Z Li Automatic Marker Making In Proceed

ings of the rd Canadian Conference on Computational Geometry

MDL V J Milenkovic K Daniels and Z Li Placement and Compaction of Non

convex Polygons for Clothing Manufacture In Proceedings of the th Canadian

Conference on Computational Geometry pages

Meg N Megiddo Applying Parallel Computation Algorithm in the Design of Serial

Algorithms Journal of the ACM

MH G Moreau and P Hardavin Marker layout problem An exp erimental attempt

Technical Rep ort IBM New York Scientic Center

Mil V J Milenkovic Exact Algorithms for Multiple Containment Algorithmica

special issue on Computational Geometry in Manufacturing accepted subject to

revisions

Mila V J Milenkovic Applications of Geometric Rounding to Polygon and Polyhe

dron Mo deling In AROMSI Computational Geometry Workshop

Milb V J Milenkovic Robust p olygon mo delling ComputerAided Design

September

Mila V J Milenkovic Enhanced Balanced Scaling Strategy Personal communication

April

Milb V J Milenkovic A Symmetry Breaking Restriction Personal communication

March

Min H Minkowski Volumen und Ob erache Mathematische Annalen

Mit J Mitchell Comment at MSI Workshop Octob er

MK Y Mo on and Y Kao Automatic Generation of Group Technology Families

during the Part Classication Pro cess The International Journal of Advanced

Manufacturing Technology

ML V J Milenkovic and Z Li A Compaction Algorithm for Nonconvex Polygons

and Its Application European Journal of Operations Research to appear

ML A Mangen and N Lasudry Search for the Intersection Polygon of any Two

Polygons Application to the Garment Industry Computer Graphics Forum

MN V J Milenkovic and L R Nackman Finding Compact Co ordinate represen

tations for p olygons and p olyhedra In Proceedings of the th Annual ACM

Symposium on Computational Geometry pages

MOS M McKenna J ORourke and S Suri Finding the largest rectangle in an

orthogonal p olygon In Proceedings of the rd Al lerton Conference on Com

munication Control and Computing pages

Mou D M Mount The Densest DoubleLattice Packing of a Convex Polygon Tech

nical Rep ort UMIACSTR CSTR University of Maryland January

MSa E Melissaratos and D Souvaine On Solving Geometric Optimization Prob

lems Using Shortest Paths In Proceedings of th Annual ACM Symposium on

Computational Geometry pages

MSb D Mount and R Silverman Packing and covering the plane with translates of

a convex p olygon Journal of Algorithms

NH M Nakajima and K Hayashi Automated Parts Layout Planning in Garment

Industry By Using Group Technology In Computers in the World of Textiles

pages Textile Institute Annual World Conference

OF J F Oliveira and J A Ferreira Algorithms for Nesting Problems In RVV

Vidal editor Lecture Notes in Economics and Mathematical Systems Applied

Simulated Annealing SpringerVerlag

OR J ORourke Finding Minimal Enclosing Boxes International Journal of Com

put Inform Sci June

OR Joseph ORourke Art Gal lery Theorems and Algorithms Oxford University

Press

PS C Papadimitriou and K Steiglitz Combinatorial Optimization Algorithms and

Complexity PrenticeHall Englewoo d Clis New Jersey

PS F Preparata and M Shamos Computational Geometry An Introduction

SpringerVerlag New York

PS Y Prasad and S Somasundaram CASNS a heuristic algorithm for the nesting

of irregularshap ed sheetmetal blanks ComputerAided Engineering Journal

pages April

QS W Qu and J Sanders A nesting algorithm for irregular parts and factors

aecting trim losses International Journal of Production Research

Ree Colin Reeves editor Modern Techniques for Combinatorial Problems Halsted

PressJohn Wiley and Sons Inc New York

Rog CA Rogers The closest packing of twodimensional convex sets Acta Math

Ser J Serra Image Analysis and Mathematical Morphology volume Academic

Press New York

Ser J Serra editor Image Analysis and Mathematical Morphology volume The

oretical Advances Academic Press New York

Sha U Shankar Restricting Search Spaces for Translational Containment Using

Linear Programming Technical rep ort MIT Summer Research Institute

SP P E Sweeney and E R Paternoster Cutting and Packing Problems A Catego

rized ApplicationOriented Research Bibliography Journal of the Operational

Research Society

SRW S Schuierer GJ E Rawlins and D Woo d A Generalization of Staircase

Visibility In Proceedings of the rd Canadian Conference on Computational

Geometry pages

TW M Tanaka and T Wachi Computerized Marker Making Journal of The Textile

Machinery Society of Japan

YLW C Yuzu L Lujun and Wangwei An exp ert system for automatic allo cation of

d irregular shap es In Expert Systems in Computer Aided Design Conference

IFIP pages