<<

Compaction Algorithms for Non- Convex Polygons and Their Applications

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

Citation Li, Zhenyu. 1994. Compaction Algorithms for Non-Convex Polygons and Their Applications. Harvard Computer Science Group Technical Report TR-15-94.

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

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

Compaction Algorithms for

NonConvex Polygons and

Their Applications

A thesis presented

by

Zhenyu Li

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 Zhenyu Li

All rights reserved

Contents

List of Figures

Introduction

Automated Marker Making

Cutting and Packing Problems

Twodimensional Packing and Marker Making

Pro ject Background

Problem Representation for Marker Making

Compaction

Description and Examples

Motivation

Denitions and a Lower Bound

Related Work

Contribution

A PositionBased Optimization Mo del

A VelocityBased Optimization Mo del

Complexity

Organization of the Thesis

Compaction Using a VelocityBased Optimization Mo del

High Level Description of the Compaction Algorithm

Collision Detection

Collision Detection For Two Translating Polygons

A Collision Detection Algorithm

Finding Vertexedge Touching Pairs

Type of Contact

A Simple Algorithm

A Sweepline Algorithm

An Alternative Algorithm

Nonp enetration Constraints

Bounds on the Velocities

NonPenetration Constraints for VertexVertex Contacts

Performance

The Theory of Minkowski Sum and Dierence

Background

Polygon Intersection and Containment Problems

Conguration Space Approach

Denitions and Prop erties

Applications Intersection and Containment

Intersection

Containment

Algorithms for Computing Minkowski Sums

Convex Polygons

Simple Polygons

Starshap ed Polygons

Monotone Polygons

Compaction Using a PositionBased Optimization Mo del

The Theory of a PositionBased Optimization Mo del

NonOverlapping Conditions for Two Translating Polygons

A Lo cality Heuristic

Linear Constraints with the Boundaries of the Container

The Positionbased Compaction Algorithm

Running Time and Robustness

Compaction Functions

Leftward Compaction

Vector Compaction

Bumping

Gravity Compaction

Separation of Overlapping Polygons and Database Driven Marker Mak

ing

Denition and Complexity

Algorithm for Separating Overlapping Polygons

Layout Made Easy

Database Driven Automated Marker Making

Shap e Criteria

An Example

Cut Planning

Compaction with Small Rotations

Rotational Compaction by Relaxation

Translational Relaxation of a Single Polygon

Rotational Compaction of a Single Polygon

Algorithm for Rotational Compaction Using Relaxation

Rotational Compaction Using Linearization

Formulation for Translation Only Compaction

Other VertexEdge Supp orting Pair

Linearization

The Algorithm

Examples

Comparison of the Two Rotational Compaction Metho ds

Floating

Distance Between Polygons

Controlling the Distance Between Polygons

Linear Constraints for Floating

Maximize the Minimum Distance Between Polygons

Separating Polygons by a Sp ecic Distance

Maximizing the Overall Distance b etween Polygons

Uniform Distribution of Free Areas

Maximize the Minimum Distance Between Polygons An Alternative Metho d

Floating For Overlapped Layouts

Mixed Integer Programming Mo del for Compaction and TwoDimensional

Packing

Limitation of the Lo cality Heuristic

MIP Formulation for Optimal TwoDimensional PackingCompaction

Algorithms for Finding Convex Covering

MIP Formulation for Multiple Containment Problem

The Complexity of the Compaction Problem

Introduction

The PSPACEHardness of Compaction

Review of the Warehouseman Problem

PSPACEhardness Pro of

Compaction in an Exp onential Number of Moves

Finding a Lo cal Minimum Requires an Exp onential Number of Moves

Conclusion

A Vectors and Cross Pro ducts

Bibliography

List of Figures

A human generated pants marker in apparel manufacturing

Marker co ordinate systems and p oints on the b oundary of a piece

Another leftward compaction example

General compaction minimizing the area of the b ounding

Strip compaction minimizing the length of a xed width b ounding rectangle

Reduction of strip compaction to general compaction

Reduction of PARTITION to strip compaction

An example of vertexedge contact

An example of vertexvertex contact

a The vertex A of P touches the edge BC of Q P moves with velocity u

and Q moves with velocity v b The p osition of P and Q after time interval t

A vertexedge supp orting pair

The Minkowski sum for a circle and a square

The Minkowski sum and intersection detection

Minkowski sum and nonoverlapping placement

The Minkowski dierence and p olygon containment problem

The Minkowski sum of two starshap ed p olygons

The nearest convex region in the exterior of the Minkowski sum

An example of leftward compaction input

An example of leftward compaction output

The human generated pants marker in Figure after leftward compaction

Left A human generated pants marker RightThe human generated marker

after compaction

An example of vector compaction

An example of op ening a gap

An example of gravity compaction

Reduction of PARTITION to separation of overlapping p olygons

Minkowski sum of two slightly overlapped p olygons

Marker generated by matching and substitution

Marker after elimination of overlaps and leftward compaction Length

in eciency

Marker after adjustment on small p olygons Length in eciency

The corresp onding marker generated by a human Length eciency

An example of translational relaxation for p olygon

An example of rotational relaxation for p olygon

An example of rotational compaction using relaxation a human generated

marker and the result rotational compaction using relaxation

An example of rotational compaction using relaxation continued the com

parison with translational only compaction on the same marker

A single iteration of rotational compaction using linearization

The nal result of rotational compaction using linearization after successive

iterations

An example of rotational compaction using linearization a human generated

marker and the result of rotational compaction using linearization

An example of rotational compaction using linearization continued the

comparison with translational only compaction on the same marker

An example of oating

C d the convex set obtained by translating the b oundary lines of C by a

distance of d

The translated convex set for slightly overlapped p olygons

The limitation of the lo cality heuristic

Reduction of PARTITION to selecting the right combination of convex subsets

Successful selection of the right combination of convex subsets solves PAR

TITION

Length cannot b e shortened without exchanging the p ositions of the p olygons

Example of nding optimal compaction using MIP formulation

Correctness of the convex covering algorithm

Quadratic running time of the convex covering algorithm

Example of trim placement using multiple containment algorithm

The reduction of warehouseman problem from the symbol transp osition prob

lem

The construction of a domino

The reduction of compaction from the symbol transp osition problem through

the reduction of the warehouseman problem

Construction and the initial state of a blo ck

a The nal state b A deadend situation

The construction of a motion propagation device

The replication and concatenation of the motion propagation device

A Denition of vectors

A The geometric interpretation of cross pro duct

Abstract

Given a twodimensional nonoverlapping layout of convex and nonconvex p olygons

compaction refers to a simultaneous motion of the p olygons that generates a more densely

packed layout In industrial twodimensional packing applications compaction can improve

the material utilization of already tightly packed layouts Ecient algorithms for compact

ing a layout of nonconvex p olygons are not previously known

This dissertation oers the rst systematic study of compaction of nonconvex p olygons

We start by formalizing the compaction problem as that of planning a motion that minimizes

some linear ob jective function of the p ositions Based on this formalization we study the

complexity of compaction and show it to b e PSPACEhard

The ma jor contribution of this dissertation is a p ositionbased optimization mo del that

allows us to calculate directly new p olygon p ositions that constitute a lo cally optimum

solution of the ob jective via This mo del yields the rst practically

ecient algorithm for translational compactioncompaction in which the p olygons can only

translate This compaction algorithm runs in almost real time and improves the material

utilization of pro duction quality humangenerated layouts from the apparel industry

Several algorithms are derived directly from the p ositionbased optimization mo del to

solve related problems arising from manual or automatic layout generation In particular

the mo del yields an algorithm for separating overlapping p olygons using a minimal amount

of motion This separation algorithm together with a database of humangenerated markers

can automatically generate markers that approach human p erformance

Additionally we provide several extensions to the p ositionbased optimization mo del

These extensions enables the mo del to handle small rotations to oer exible control of

the distances b etween p olygons and to nd optimal solution to twodimensional packing of

nonconvex p olygons

This dissertation also includes a compaction algorithm based on existing physical sim

ulation approaches Although our exp erimental results showed that it is not practical for

compacting tightly packed layouts this algorithm is of interest b ecause it shows that the

simulation can sp eed up signicantly if we use geometrical constraints to replace physical

constraints It also reveals the inherent limitations of physical simulation algorithms in

compacting tightly packed layouts

Most of the algorithms presented in this dissertation have b een implemented on a SUN

TM

SparcStation and have b een included in a software package licensed to a CAD company

Acknowledgement

This thesis is the pro duct of my work on the automated marker making pro ject at Harvard

University I would like to thank the Alfred P Sloan Foundation and the TextileClothing

Technology Corp oration for funding the pro ject

I am much indebted to my thesis advisor Professor Victor Milenkovic of Harvard Uni

versity for the huge amount of eort he sp ent in guiding my research He is always there to

share his quick wit to clarify and enhance my thinking and to spark new ideas Without

his timely guidance this thesis would not have b een completed His engineering savvy and

active leadership in the marker making pro ject is indisp ensable for the successful imple

mentation of the compaction algorithms presented in this thesis This whole thesis can b e

considered joint work with him I thank him for b eing a guru in almost every asp ect

Many thanks to Professor Fred Ab ernathy the principal investigator of a pro ject of

which the marker making pro ject is a part I thank him for his encouragement for oering

his insight on textile and apparel industry and for enlightening and enjoyable conversations

Many thanks to Professor Harry Lewis and Professor Les Valiant for serving in my

program committee and for their interests in my thesis work

Sp ecial thanks to Karen Daniels for b eing a wonderful ocemate and a great teammate

on the marker making pro ject We have shared the learning pro cess of several courses and

had fruitful co op erations on the marker making pro ject Her careful reading and criticism

of my writings have b een extremely helpful

Thanks to Professor Leonidias Guibas for his illuminating computational geometry class

at MIT to Dr Richard Szeleski of DEC Cambridge Research Lab oratory for helpful discus

sions and for drawing our attention to the physically based simulation metho d to Murray

Daniels Karens husband of MITRE Corp oration for providing user interface software and

for his generous help in customizing the software to Binhai Zhu of McGill University for

interesting discussions ab out computational geometry and a joint work

I would also like to thank the undergraduate students who have worked on geometric

algorithms under the sup ervision of Professor Milenkovic most of them have made direct

contributions to the marker making pro ject Ra jarshi Bhattacharyya Jackie Chang Shiv

ashish Chatterjee Sanjoy Dasgupta Jacqueline Huang Matt LaMantia Sanjay Madan

Kirat Singh Venkatesh Reddy and Lee Wexler I would esp ecially mention Sanjay Madan

He started working on the marker pro ject in June and worked directly on the com

paction software He help ed to reorganize the compaction software and to implement new

compaction functions

I thank my fellow graduate students at Aiken Computation Lab oratory for making it

an interesting place to work Thanks also to Carol Harlow and Baiba Menke for providing

administrative assistance to the computer system supp ort stas at Aiken for managing our

pro ject machines and for answering system related questions

Lastly I thank my wife for her understanding supp ort and love

Chapter

Introduction

Automated Marker Making

Cutting and Packing Problems

In the past thirty years a class of problems categorized as Cutting and Packing problems

DD Dyc SPb have b een topics of extensive study in b oth op erations research

and computer science b ecause of their extremely wide application areas and their great

theoretical challenge Some of the wellknown packing problems in the class include

Onedimensional Bin Packing The problem of putting variable sized items the sizes

are represented as integers into bins of the same capacity and minimizing the number

of bins used sub ject to the condition that the total size in each bin do es not exceed

the capacity ECL

Cutting Sto ck An extension of the onedimensional Instead of

having the same capacity the bins have k dierent capacities where k is xed There

are unlimited supplies of bins for each capacity Bins of the same capacity are assigned

the same cost The ob jective is to minimize the total cost while packing the items

into these dierent sized bins GG GG This problem is also called variable

sized bin packing when the cost of a bin is prop ortional to its capacity Mur

Twodimensional Bin Packing The problem of packing a set of of dierent

height and width into rectangular bins such that the rectangles do not overlap with

each other The bins are of the same width and height Usually there are additional

restrictions on the orientation of the rectangles such as the edges of a rectangle must

b e parallel to those of the bin that contains it and no rotation of a rectangle is allowed

The ob jective is to use the minimal number of bins to pack all the rectangles CMD

A variation of the problem is called strip packing instead of using many bins of the

same size a bin of xed width and unlimited length is used and the ob jective is to

pack all the rectangles using minimum length BECR ECS

Twodimensional Packing Generalizations of twodimensional bin packing in which the

ob jects b eing packed can b e nonrectangular and the restrictions on orientation can

also b e lifted

It is wellknown that the onedimensional bin packing problem is NPcomplete GJ

The NPhardness of the other packing problems can b e shown by a reduction to the one

dimensional bin packing problem The twodimensional packing problems in which ob jects

are not allowed to rotate can b e shown to b e in NP and therefore NPcomplete by an

argument similar to the one used in MDL In spite of the extensive research eorts

devoted to these problems most of the problems still lack solutions that are satisfactory in

practice a fact that demonstrates the inherent diculty of the problems

Another interesting Cutting and Packing problem is that of packing the maximum num

b er of copies of a single item Typically the material and the item are b oth rectangles and

only one orientation is allowed There are variations involving nonrectangular material

or item and multiple orientations Gar Closely related to this problem is the covering

problem what is the minimum number of copies needed to cover the sheet of material

CKSS The tiling problem G is a combination of packing and covering cover the

whole plane with nonoverlapping copies of a single item or a few items

Twodimensional Packing and Marker Making

Problems of packing nonrectangular p olygonal ob jects onto a rectangular strip of ma

terial are of central imp ortance to the sheet metal ship building furniture leather and

textile industries These problems are also known as polygon nesting or layout problems

The nonrectangular p olygonal ob jects to b e packed are also referred to as irregular shapes

in the op erations research literature The ob jects represent pieces to b e cut from a sheet of

material The output pro duced by a twodimensional packing algorithm is called a layout

In apparel manufacturing the pro cess of strip packing a set of p olygons which corre

sp ond to garment pieces on a roll of cloth of xed width but unlimited length is called

marker making The layout generated by the pro cess is called a marker In practice a

marker is not the optimal strip packing but one of near minimum length The shap es of

garment pieces are mostly nonrectangular as depicted in Figure

The material utilization or the eciency of a marker is the ratio of the area o ccupied

by the garment pieces to the area of the strip of cloth A source in the textile industry

estimates that ab out p ercent of the cost in apparel manufacturing is due to the cost of

material Therefore the eciency is considered the most imp ortant factor in judging the

quality of a marker

Currently marker making is done by exp erienced human marker makers with the assis

tance of interactive CAD systems One of the easiest types of markers to generate is the

pants marker But even for this type of garment a human marker maker needs ab out a half

year of training b efore heshe can generate markers of acceptable eciency In ab out

minutes an exp erienced human marker maker can generate a pants marker with eciency

of around p ercent which is estimated to b e within p ercent of the optimal The marker

shown in Figure is generated by a human marker maker Current automated marker

making systems fall short of human p erformance by to p ercent in marker eciency for

pants markers

Pro ject Background

The results presented in this thesis are developed from the automated marker making

pro ject sup ervised by Professor V Milenkovic at Harvard University The goal of the pro ject

is to match human p erformance on pants markers

Because of the diculty of the general twodimensional strip packing problem embo died

in automated marker making it is necessary to rst concentrate on a relatively simple

domain such as pants Pants markers are chosen as the target b ecause their pieces can

b e easily classied by size and the art of making high eciency pants markers has b een

mastered by exp erienced human marker makers whose knowledge can provide valuable

heuristics on algorithm design It is hop ed that the techniques developed in this pro ject

can b e carried over to other domains such as jacket markers or blouse markers and other

industries such as sheet metal and ship building

In pants markers there is a clear distinction b etween large pieces which are called panels

and small pieces which are called trim pieces As can b e seen from Figure the panels

are the front and back pieces and the trim pieces are waist bands packet facings b eltlo ops

etc From observing the marker making pro cedure of the b est human marker makers we Figure A human generated pants marker in apparel manufacturing

Name: 45725a Width: 59.75 in Length: 321.88 in Pieces: 126 Efficiency: 90.62%

discovered that the task of making pants markers is clearly divided into two steps rst

place all the large panels and then place all the trim pieces in the gaps the uno ccupied

areas left over b etween the large panels or b etween a large panel and the b oundaries of

the marker Consequently our pro ject decomp oses the placement task into two parts the

placement of large panels and the placement of the trim pieces

In addition to panel and trim placement a third part of our pro ject fo cuses on solving

a dierent problem which we call the compaction problem Compaction takes a human or

machine generated layout as input and generates a more ecient layout by simultaneous

motion of the p olygons Our goal is to nd practical algorithms for compaction The results

presented in this thesis are obtained from my work on the compaction part of the pro ject

Problem Representation for Marker Making

In marker making the garment pieces are represented by p olygons which are digitized

from the garment patterns drawn by human pattern designers In the rest of the thesis

we will use the terms piece and polygon interchangeably The vertices of a p olygon are the

sample p oints on the b oundary of a pattern and each pair of vertices is connected by an

edge ie a straight line segment There are more vertices and shorter edges in regions

of higher curvature and fewer vertices and longer edges in regions of lower curvature In

Figure we identify the vertices in the upp er left part of a pattern piece piece with

small dots There is a lo cal co ordinate system attached to each piece The origin of the lo cal

co ordinate system is usually xed at the center of the bounding box of the piece the smallest

rectangle containing the piece with sides parallel to the co ordinate axes The co ordinates of

the vertices are sp ecied in the lo cal co ordinate system The p osition of piece in the marker

is given with resp ect to a global co ordinate system The origin of the global co ordinate

system corresp onds to the lower left corner of the rectangular sheet of cloth on which the

pieces should b e laid The placement of the pieces is restricted to a horizontal rectangular

strip in the rst quadrant of the global co ordinate system The strip which represents a roll

of cloth will b e called the marker region

The marker region is b ounded from the left by the y axis and is op en on the right

After the panel placement phase the uncovered regions remaining in the marker region are

broken into a set of connected comp onents DM We use the term gaps to refer to these

comp onents in trim placement and compaction Gaps are represented as p olygons

The rules of marker making sometimes p ermit a piece to change its orientation by y global coordinate system local coordinate system

4

3 0

5

1 2

6 x

Figure Marker co ordinate systems and p oints on the b oundary of a piece

rotating andor ipping in the lo cal co ordinate system A basic rotation amount is sp ecied

for each piece The amount is usually or degrees A piece can b e rotated by

a multiple of its basic rotation amount ab out its lo cal origin In addition to multiples

of its basic rotation amount a piece can also rotate by some small amount called tilt

which is usually less than degrees but can b e as large as or degrees dep ending on

the individual apparel manufacturer In the sample pro duction markers we have from a

large pants manufacturer more than p ercent of the pants markers contain tilted pieces

Flipping of a piece is done with resp ect to the lo cal x axis

Compaction

Description and Examples

The central topic of this thesis is compaction Informally compaction can b e thought

of as the action of squeezing out the extra free spaces in an existing layout to pro duce a

shorter layout and hence a tighter packing of the p olygons Supp ose we view the pieces as

rigid b o dies and imagine that we could apply forces on them Then we can make a tighter

packing by pushing the right b oundary of a marker to the left to shorten its length

The analogy of compaction using rigid b o dies and forces naturally leads to the formu

lation of compaction as planning a continuous motion for the p olygons to minimize an

ob jective energy function Usually the ob jective function is the area of the strip of ma

terial used by the layout which is equivalent to the length of the strip since its width is

xed In this formulation ipping a p olygon or rotating it by its basic rotation amount

usually or degrees are not allowed since they are not continuous motions On the

other hand continuous motions such as translation and tilting a piece within its tilt limits

are p ermitted

Figure shows an example of compaction A human generated jacket marker is shown

on the left The compacted marker is shown on the right The marker eciency has b een

improved by more than p ercent after compaction In this example p olygons are allowed

to translate and tilt

Motivation

A marker acts as a cutting plan for a human or rob otic cloth cutter Usually many

layers are cut at the same time also the same marker may b e used many times as a cutting

plan It follows that even a small p ercentage increase in eciency for a marker results in a

large savings in material For pants manufacturing each time a marker is used sixty layers

of cloth are cut at the same time and a p ercent increase in eciency represents a savings

of ab out A representative of a large pants manufacturer estimates that a p ercent

average improvement in eciency will save his company ab out two million dollars p er year

Compaction proves to b e an extremely hard task for humans Pro duction quality mark

ers are packed very tightly every piece is touching its surrounding pieces so there is no

ro om for moving only one piece Thus moving one piece at a time can not shorten the

marker length We can verify this fact by the following strategy First order the pieces Figure Right Name: 24306f−1x Width: 46.00 in Length: 234.44 in The marker after leftward compaction Pieces: 96 Efficiency: 71.39% Another leftward compaction example

Left Name: 24306f−1x−re Width: 46.00 in Length: 224.09 in

A human generated jacket marker Pieces: 96 Efficiency: 74.69%

from left to right according to the left b oundary of the b ounding b ox of each piece Next

visit the pieces sequentially according this order and move each piece as far to the left as

p ossible without overlapping other pieces Most of the pro duction markers we tested using

this strategy did not show improvements in eciency

Therefore the ability to move many pieces at the same time is essential to compaction

However it is b eyond the capability of human marker makers to handle the simultaneous

motion of many p ossibly hundreds of pieces This gives rise to the demand for ecient

computer algorithms for compaction In addition to the direct b enet of cost savings

compaction algorithms can also facilitate manual or automated marker making

Denitions and a Lower Bound

In this section we give a denition of compaction and show a preliminary hardness

result that compaction is NPhard The pro of is simple and easy to understand We use

the result here just to illustrate the diculty of the problem We will return to the same

topic in Chapter where we show that the problem is PSPACEhard

We dene the compaction problem as a twodimensional co ordinated motion planning

problem for a set of ob jects such that the area of the b ounding convex hull or the b ounding

rectangle of the ob jects is minimized see Figure We consider only the case where

the ob jects are rigid b o dies and are represented as p olygons A translational compaction

problem is a compaction problem in which the p olygons are only allowed to translate A

rotational compaction problem is a compaction problem in which the p olygons are allowed

to translate and rotate In contrast with the strip compaction problem dened in the next

paragraph we will refer the compaction problem dened in this paragraph as the general

compaction problem

Since our interest in studying compaction arises from strip packing applications sp ecif

ically marker making in which the motion of the ob jects is restricted to a strip of xed

width and arbitrary length we dene strip compaction to b e a sp ecial form of the com

paction in which the motion of all the p olygons is conned to a b ounding rectangle whose

top left and b ottom sides are xed and whose right side can move freely The goal is to

minimize the length of the b ounding rectangle see Figure

As far as the complexity of motion planning is concerned it is easy to show that general

compaction is at least as hard as the strip compaction We prove this fact by the reduction

1

In Chapter we will show how to implement this strategy

2

Some markers we have successfully compacted contain more than pieces

Figure General compaction minimizing the area of the b ounding rectangle

Figure Strip compaction minimizing the length of a xed width b ounding rectangle

Figure Reduction of strip compaction to general compaction

Figure Reduction of PARTITION to strip compaction

of strip compaction to general compaction shown in Figure Given a set of p olygons

as an input to strip compaction we make it an input to general compaction by adding a

rectilinear container p olygon and a piston p olygon that jointly enclose the original set

of p olygons The piston p olygon can slide horizontally but has no vertical freedom It is

clear that the strip compaction problem has a minimum length if and only if the general

compaction problem has a minimum area b ounding b ox or b ounding convex hull

Therefore a lower b ound for strip compaction naturally establishes a lower b ound for

general compaction Next we show strip compaction is NPhard

Theorem The strip compaction problem is NPhard even when al l the polygons are

rectangles and can only translate

Pro of We reduce the NPhard PARTITION problem to strip compaction The PARTI

TION problem is dened as follows Given a set S of integers decide if S can b e partitioned

into two subsets S and S such that the sum of the elements of S equals the sum of the

elements of S We reduce PARTITION to compaction by the construction shown in Fig

ure For an instance fa a a g of PARTITION we build rectangles of height and

n

length a i n We put the rectangles into a container of height PARTITION

i

P

has a solution if and only if the blo cks can b e compacted to the length a 2

i

In the rest of the thesis we will refer the strip compaction problem as the compaction

problem or simply compaction

Related Work

As far as we know no ecient algorithm has b een previously published on how to

compact nonconvex p olygons see SPa for a survey of current results In industry

several CAD rms have tried some one piece at a time metho ds which are not successful

in practice

VLSI Design

Previous research eorts in compaction are largely concentrated in the eld of VLSI de

sign AKS Len Map MFS SSVS Won Mal The idea of compacting

a VLSI circuit layout is quite natural since it allows more transistors to b e packed in the

same area

The layout problems in VLSI design are generally quite dierent from p olygon nesting

problems The basic ob jects in a VLSI layout are rectangles which represent gates and

variablelength rectilinear wires that link the gates There are minimum separation condi

tions imp osed on the lo cation of the rectangles For example one such condition might b e

that the lower b oundary of a rectangle b e three distance units ab ove the upp er b oundary

of another rectangle

Finding the minimum area compaction for a VLSI layout is NPcomplete The general

compaction problem is usually decomp osed into two onedimensional problems in the x

and y direction in which rectangles can only slide horizontally or vertically By exploiting

the sp ecial forms of the inequalities which express the constraints each inequality has

two variables onedimensional compaction can b e reduced to calculating the longest or

shortest path in a constraint graph Len Won In AKS a sweepline type of

algorithm to solve the onedimensional compaction of layout consists of only rectangles

ie no wires Other techniques include simulated annealing MFS and zonerening

SSVS a technique which simulates the crystal renement pro cess

The ab ove mentioned techniques dep end on the simple shap e rectangular or rectilinear

of the ob jects in order to build constraints on the relative p ositions of the ob jects Most of

them cannot make further improvement to a layout in which the left and right b oundaries of

the rectangles are touching or have met the minimum separation condition We found that

the techniques are not readily extendible to nonrectangles and not capable of squeezing

out the last few fractions of a p ercent of material waste in an already tightly packed layout

Physically Based Simulation

Physically based simulation metho ds provide a plausible approach to compaction These

metho ds simulate the pieces as rigid b o dies and apply a set of forces to move the b o dies in

the desired direction A lo cal minimum is reached when the b o dies cannot b e moved further

3

Rectilinear means that the edges are parallel to the co ordinate axes Sometimes the term orthogonal is

used instead

These simulation metho ds fall into two types spring mo del and contact force mo del The

diculty we have found with physically based simulation metho ds is that these algorithms

run very slowly

Spring mo del metho ds also called penalty methods MW PB allow the pieces to

interpenetrate slightly A restoring force is determined by the amount of interpenetration

From these forces the motion of the pieces is computed by numerical integration This

integration is carried out by cutting time into steps Small steps are required to ensure

accuracy and numerical stability of the integration however small steps means many steps

and greater computational cost Furthermore strongly enforcing the nonoverlapping con

dition implies a strong restoring force and stronger forces require smaller steps It is

generally very dicult to choose an acceptable step size esp ecially when many dierent

forces are involved Layout compaction involves hundreds of frequently changing contacts

each change of contact requires a new numerical integration and each numerical integration

requires many steps Hence under the spring mo del solving a compaction problem requires

many steps and a long running time Due to its long running time the spring mo del is not

suitable for compaction

Contact force mo del metho ds also called analytical methods Bar BB have b een

recently studied in computer graphics Contact forces are introduced at contact p oints

to prevent interpenetration A system of dierential equations is solved to nd a set of

consistent contact forces The b o dies then move with constant velocities in accordance with

the contact forces A collision detection algorithm is used to nd the time interval until

the next collision o ccurs The simulation pro ceeds from time interval to time interval until

the lo cal minimum is reached Contact force metho ds have the advantage that the time

intervals are much larger and more easily determined than the time steps of the spring mo del

metho ds However there still are diculties Solving the system of dierential equations

for determining the contact forces is timeconsuming for problems of nontrivial size

Even setting these diculties aside our exp erience shows that in the case of many

contacts the lo cal minimum is reached only after many time intervals b ecause the pieces

tend to rattle against each other

Another problem of contact force metho d is that it is NPhard to resolve vertexvertex

contacts Basically the problem is that when two vertices from two p olygons are in contact

one has to choose which way the vertices pass each other Do es one go to the others

left or right There are situations where the p olygons are lo cked with each other We

can show that it is NPhard to determine if there is a simultaneous choice of motion for

each pair of vertices that unlo ck the layout This problem p ersists for the velocity and

p osition based compaction algorithm we developed in this thesis However the o ccurrence

of a lo cked layout is extremely rare and we b elieve it do es not have much impact in practice

Rob ot Motion Planning

In the area of rob ot motion planning research has b een concentrated on how to plan the

motion of a single ob ject in an environment consisting of p olygonal or p olyhedral obstacles a

problem referred to as the generalized movers problem Rei Rei SS The problem

is shown to b e PSPACEhard by John Reif Rei Rei and the current b est algorithm

for it is that of Canny which runs in single exp onential time Can

The research on planning simultaneous motion of many ob jects has b een limited to a

few negative results The b est known of them is the PSPACEhardness result obtained by

Hop croft Schwartz and Sharir on the Warehousemans problem The result states that

planning the co ordinated motion for a set of rectangles inside a rectangular container is

PSPACEhard

However the techniques developed in the context of single ob ject motion planning

esp ecially the conguration space approach LPW prove to b e extremely useful in com

paction For planning the motion of a p olyhedron in three the conguration

space is the sixdimensional space of all the p ossible values for the three p ositional pa

rameters and the three rotational parameters The conguration space is partitioned into

connected comp onents classied as free space or forbidden regions Each p oint in a free

space gives a conguration p osition and orientation of the p olyhedron which is clear of

obstacles The b oundaries b etween free spaces and forbidden regions are generally high

degree algebraic surface patches However if the p olyhedron is only allowed to translate

and the environment consisting of only p olyhedral obstacles then the b oundaries of free

spaces are p olyhedral surfaces

Contribution

A PositionBased Optimization Mo del

The main contribution of this thesis is the rst fast and practical algorithm for com

pacting a layout consisting of nonconvex p olygons The algorithm has b een implemented

and tested on pro duction quality human generated markers Our exp eriments show that

even though pro duction quality markers are very tightly packed almost all of them can b e

improved in eciency by our compaction algorithm The algorithm runs in almost real time

in practice Thus it solves industrially signicant problems and lls a gap in the research

of compaction algorithms

The key to the algorithm is a p ositionbased optimization mo del which is essentially a

linear programming formulation of co ordinated motion planning of many translating ob jects

under a set of forces These forces are dened by a p otential function on the p ositions

of the ob jects The mo del is based on the conguration space approach LPW in rob ot

motion planning and a new locality heuristic The lo cality heuristic enables us to nd a

maximal convex subset of the free space and makes the direct calculation of p ositions of the

p olygons p ossible via linear programming

The p ositionbased optimization mo del is highly exible Various types of layout tasks

can b e accomplished by sp ecifying appropriate forces applied on the p olygons and by adding

andor mo difying constraints For example to solve the compaction problem itself we can

add an imaginary piston piece on the right of the layout and sp ecify a leftward force

applied to the piston piece In the trim placement phase we often need to enlarge a gap

in order to put more pieces or larger pieces in the gap Such a task can b e accomplished

by sp ecifying forces that push away the pieces surrounding a gap Other tasks such as

simulating ob jects in a gravitational eld xing some p olygons while allowing others to

translate or even eliminating the overlap among the pieces in a marker can b e accomplished

directly by applying the optimization mo del

It is interesting to notice that the p ositionbased mo del is capable of eliminating overlaps

in a marker This is b ecause the slack variables for each nonoverlapping constraint in our

mo del exactly corresp ond to the amount of overlap b etween pairs of p olygons We realized

that we could extend the mo del by making these variables explicit in the constraints and

adding them to the original ob jective of our mo del The extended p ositionbased mo del

can eliminate overlaps apply forces and even oat pieces away from each other negative

overlap in any desired combination

The overlapelimination algorithm has b een applied in database driven automated marker

generation The underlying idea is to collect high quality markers generated by exp erienced

human marker makers into a database When a new marker making order comes in we

search the database for a similar marker Then we match the pieces and do a piecewise

substitution of the corresp onding pieces The substitution pro cess will inevitably introduce

overlaps By applying separation and leftward compaction we can generate a marker of

sucient quality automatically A CAD company in the textile industry is now vigorously

pursuing the database driven automated marker making idea

We have studied several other extensions to the p ositionbased optimization mo del

We oer two metho ds relaxation and linearization to extend the mo del to handle small

rotations tilts These metho ds are the rst known attempts for solving the rotational

compaction problem In another extension we replace the linear programing formulation

used in the mo del with a mixed integer programming MIP formulation We use the MIP

formulation to nd the optimal solution of the twodimensional strip packing problem and

to solve the multiple containment problem the problem of placing nonconvex p olygons in

a nonconvex container

A VelocityBased Optimization Mo del

Another contribution of this thesis is a velocitybased mo del for p erforming compaction

tasks This mo del is more in line with the physically based simulation metho ds using con

tact forces However by removing the concepts of mass and force and directly computing

velocities this mo del yields a new more ecient timeintervalbased simulation technique

for translational compaction We had exp ected that direct computation of velocities would

allow our algorithm to solve the compaction problem in a reasonable amount of time Unfor

tunately when compacting tightly packed layouts our simulation metho d runs two orders

of magnitude slower than the the compaction algorithm derived from the p ositionbased

mo del Even though our new velocitybased simulation techniques reduced the running

time by at least an order of magnitude over previous physical simulation metho ds the al

gorithm still to ok hours to run on typical markers on a MIPS workstation b ecause of the

number of times it had to recompute velocities This can b e viewed as a imp ortant negative

result that demonstrates the inherent limitation of the physically based approach

Nevertheless our velocitybased mo del provides an interesting alternative to the current

physically based simulation metho ds For example formulating the nonp enetration con

straints is quite involved in physically based simulation metho ds In our metho d however

the nonp enetration constraints are purely geometric and are very easy to set up In ad

dition we have observed from exp eriments that our simulation metho d is quite ecient in

bringing lo osely packed layouts to a relatively tight status We b elieve our metho d will give

b etter p erformance in the simulation applications such as animation for which ob eying

physical laws is not essential

Both the p ositionbased and the velocitybased mo dels apply to general p olygonal shap es

Therefore the algorithms can b e applied not only to markers of all types of garments but

also to p olygon nesting problems in other industries

Complexity

In this thesis we also study the lower b ound of the compaction problem We show com

paction to b e PSPACEhard by a reduction from the PSPACEhard symbol transp osition

problem through the wellknown Warehouseman problem HSS In addition we give the

rst explicit constructions that show an exp onential number of moves is necessary in the

worst case for the compaction problem More sp ecically we give two such constructions

The rst construction shows that an exp onential number of moves is required even if the ob

jects involved in compaction are as simple as rectangles and Ushap ed ob jects The second

construction is more contrived But it shows that nding a lo cal minimum of compaction

using the compaction algorithm in Chapter requires an exp onential number of moves

Organization of the Thesis

The rest of the thesis is organized as follows

Chapter presents a new velocitybased compaction algorithm This algorithm simpli

es the existing contactforce based physical simulation approach The algorithm solves a

velocitybased optimization mo del to generate a set of velocities for the set of p olygons in a

layout and then simulates motion until a new contact o ccurs We discuss its long running

time for tightly packed markers and why that is an inherent drawback of physically based

metho ds

Chapter gives background knowledge ab out conguration spaces Minkowski sums and

Minkowski dierences which play a central role in the p ositionbased optimization mo del

When planning the translational motion of a p olygon in a environment consisting of a single

p olygonal obstacle the conguration space can b e obtained by calculating the Minkowski

sum of the p olygon and the obstacle We show that for certain classes of p olygons star

shap ed the Minkowski sum can calculated very eciently The p ositionbased mo del can

b e applied to nonstarshap ed p olygons by decomp osing them into starshap ed p olygons

Chapter develops the p ositionbased optimization mo del which directly determines

new p ositions for the p olygons We then give several algorithms based on the mo del to

solve the compaction problem and p erform some layout related tasks As a result of the

direct calculation of p ositions the algorithms based on the mo del do not use simulation nor

do the have time as an explicit parameter

Chapter denes the problem of separating overlapping p olygons studies its complexity

and shows how the p ositionbased mo del yields a separation algorithm that nds a lo cally

optimal solution to this problem We next demonstrate that by combining the separation

algorithm and a database of human generated markers we can have an automated marker

making system that very quickly generates markers close to human p erformance

Chapters and contain extensions to the p ositionbased optimization mo del Chap

ter develops two rotational compaction algorithms Chapter introduces variables which

represent distances b etween p olygons into the p ositionbased mo del We use these distance

variables to control the amount of overlaps b etween p olygons or to oat p olygons away from

each other Chapter introduces a mixed integer programming MIP formulation which re

places the linear programming LP formulation in the original p ositionbased mo del Then

we show that the twodimensional strip packing and the multiple containment problems can

b e reduced to a mixed integer program through the MIP formulation

Chapter studies the complexity of the compaction problem We show that compaction

is PSPACEhard even for rectangles We then give two explicit constructions to show that

co ordinated motion planning in general and compaction in particular require an exp onential

number of moves in the worst case

Finally Chapter concludes the thesis by summarizing the results and discussing op en

problems and directions for future work

Chapter

Compaction Using a

VelocityBased Optimization

Mo del

In this chapter we give an optimization mo del for determining the velocities of rigid

b o dies under a set of forces and we use this mo del to create a velocitybased compaction al

gorithm Like the previously prop osed physically based simulation metho ds Section

our algorithm uses time intervals to advance the simulation steps However by ignoring the

dynamic prop erties of the rigid b o dies our simulation metho d is simpler and faster than

the previous simulation algorithms using the contact force mo del

High Level Description of the Compaction Algorithm

Let us for the moment view the p olygonal pieces in a marker as frictionless rigid b o dies

and simulate their motions within a rigid rectangular container We see that compaction

can b e p erformed by applying forces to the pieces in the desired directions For example to

shorten the length of a layout we can add a piston piece on the current right b oundary

of the layout and by assign a leftward force to the piston piece Hence it is quite natural

to apply physically based simulation metho ds for compaction

As reviewed in Section there are two basic approaches to physically based simula

tion metho ds the spring mo del and the contact force mo del Spring mo del based metho ds

have numerical problems caused by the sti dierential equations asso ciated with the spring

forces introduced b etween contact p oints These metho ds are not seemed to b e suitable to

our application We will therefore concentrate on the contact force mo del

In contact force based algorithms the simulation pro cess pro ceeds according to time

intervals The control lo op of a typical contact force based simulation algorithm consists of

three steps collision detection building nonp enetration constraints and solving

for a set of new motions Let t b e the starting time of the current simulation step A

k

contact force based simulation rst calculates the next collision time t using a collision

k

detection algorithm according to the current motions of the ob jects It then advances

the simulation to t using the current motions Next a set of nonp enetration constraints

k

are built for the ob jects that are in contact at t The constraints ensure that the new

k

motions calculated will not cause interpenetration among the ob jects currently in contact

The algorithm then concludes the current simulation step by up dating the motions of the

ob jects with a set of new motions calculated from the nonp enetration constraints The end

time t for the current simulation step b ecomes the starting time of the next step The term

k

time interval refers to the time b etween two simulation steps which is the time b etween

two consecutive collisions

Our velocitybased algorithm uses the same general control lo op as the contact force

based simulation algorithms for rigid b o dies However we replace the contact force mo del

with a velocitybased optimization model which allows us to calculate velocities using lin

ear programming Our mo del is based on the observation that for compacting a two

dimensional layout the most imp ortant prop erty of the ob jects is rigidity Rigidity ensures

that no interpenetration can o ccur among the pieces If translation is the only motion

allowed then the rigidity condition for an ob ject is that every p oint on the ob ject has the

same velocity As shall b e shown later the nonp enetration condition for two touching

ob ject can b e expressed as a set of linear constraints on the velocities of the two ob jects

These constraints plus an ob jective that maximize the velocities in the direction of the

forces comprise a velocitybased optimization mo del which replaces the Newtonian physics

based dierential equation formulation to solve for a new set of velocities

We now give the high level description of the velocitybased compaction algorithm and

then supply several low level details in the following sections

Step Initialization The input is a layout consisting of N p olygons and a constant

force f i N for each p olygon The forces represent the desired directions

i

1

The initial motion at t might b e simply a leftward motion of the piston piece

0

we want the p olygons to move Assign a velocity variable v v v to p olygon

i ix iy

i i N The magnitudes of the velocities of the movable p olygons are b ounded

by a constant c that is c v v c for i N Initially each v is set equal

ix iy i

to f and scaled down to satisfy the magnitude constraint

i

Step Let the current time b e t Find the next collision time t using a collision

k k

detection algorithm to b e describ ed later Let t t t b e the time interval

k k

b etween the current time and the next collision time If Steps and have b een

executed at least once and if t is less than a predened threshold terminate the

algorithm Otherwise translate p olygon i i n by tv and go to Step

i

Step Identify all the vertexedge touching pairs at time t A vertex and an edge form

k

a vertexedge touching pair if the vertex and the edge are from two dierent p olygons

and the vertex is incident on the edge

For each of the vertexedge touching pairs A B C where A is a vertex of p olygon

P and BC is an edge of p olygon P i j generate a constraint on the velocities of

i j

P and P such that if P and P move with velocities satisfying the constraint then

i j i j

the two edges of P adjacent to A cannot overlap BC As will b e shown later the

j

constraint is a linear inequality in v and v

i j

Step Set up a linear program that maximizes f v The linear program is sub ject to

i i

the nonp enetration constraints built in Step and the upp er and lower b ounds on

the magnitude of the velocities as sp ecied in Step This ob jective and constraint

set form our velocitybased optimization model Solving the linear program yields a

new set of velocities Goto Step

Collision Detection

Collision Detection For Two Translating Polygons

Given a pair of translating p olygons P and Q we rst note that if an edge e of P and

P

an edge e of Q are going to collide the rst collision b etween e and e cannot o ccur

Q P Q

solely on two interior p oints of P and Q In other words at the earliest collision time at

least one vertex is involved Therefore we can capture the earliest collision time by only

considering the vertices of P and the edges of Q and vice versa

Let the velocities of P and Q b e u and v resp ectively Let A b e a vertex of P and BC an

edge of Q Let the starting time of the current simulation step b e t We dene function

k

CollisionTime A BC u v t t to return the collision time b etween A and BC if the

k k

collision o ccurs b efore t Otherwise CollisionTime A BC u v t t just returns t

k k k k

Note that the collision time b etween A moving with velocity u and BC moving with

velocity v is the same as the collision time b etween a static BC and A moving with relative

velocity u v Thus there is a collision b etween A and BC within time interval t t t

k k

0 0

if and only if the line segment AA intersects the line segment BC where A A t u v

is the new lo cation of A relative to BC at time t Therefore collision detection for a

k

moving vertex and a moving edge within a presp ecied time is reduced to the problem of

testing whether two line segments intersect and nding the intersection p oint Milenkovic

Mil prop osed a numerically robust algorithm for line segment intersection which is used

in the implementation of our algorithm

A Collision Detection Algorithm

Let t b e the starting time of the current simulation step The algorithm for nding

k

the next collision time among the ob jects is as follows

Algorithm for Collision Detection

Input a layout L consists of N p olygons P P P

N

The velocities of these p olygons are v v v

N

for every pair of p olygons P P and Q P i N j N i j

i j

for every vertex A in P and every edge BC in Q

t CollisionTime A BC v v t t

k i j k k

During the execution of the algorithm the variable t records the earliest collision time

calculated so far Initially t is assigned T where T is a predened value For simplicity we

k

give T a relatively large value within which a collision is likely to o ccur The next collision

time t is then reduced successively when CollisionTime A BC v v t t nds an

k i j k k

earlier collision time When the algorithm terminates t holds the time of the earliest

k

collision

Assuming the maximum number of vertices in a p olygon is M the collision detection

algorithm clearly runs in O N M time The algorithm is simple and easy to implement

Note that if there is no collision o ccurs within time interval T then it is safe to advance

the simulation by T That is assuming the velocity of p olygon P is v for i N

i i

translated every p olygon P to its new p osition P T v i N and resume the

i i i

simulation at that p oint

The algorithm although simple includes the steps necessary for a collision detection

algorithm The running time can b e improved in various way For example for p olygons

P and P we can rst test whether their b ounding b oxes collide within time interval T If

i j

not then we can omit the collision detection for P and P

i j

Another way of improving the running time is that instead of checking all O N pairs

of p olygons we can rst eliminate the pairs that cannot collide in time T and only check

the remaining pairs We eliminate a pair by testing their extended bounding boxes For a

p olygon P its extended b ounding b ox B is the minimal area axis parallel rectangle that

i i

includes b oth P and P v T Obviously if B and B i j do not intersect P and P

i i i i j i j

cannot collide within T By using a sweepline algorithm PS we can identify all K pairs

of overlapping B s in O N log N K time If we choose T to b e small which we do for

i

a tightly packed layout then only the extended b ounding b oxes of a pair of neighboring

p olygons can intersect In that case K is linear in N since the neighboring graph of a

layout is a planar graph Hence the running time of the sweepline algorithm is actually

O N log N And since for each neighboring pairs we check O M vertexedge pairs

at most the overall running time of the collision detection algorithm can b e reduced to

O N log N M in practice

We can further improve the running time for determining when the rst contact b etween

P and P o ccurs from O M to O M log M again using a sweepline algorithm The

i j

sweepline is parallel to v v As we sweep through each vertex A of P we determine

i j

the smallest t such that A tv v is on an edge of Q Similarly as we sweep through

i j

each vertex B of Q we determine the smallest value of t such that B tv v touches

j i

P By maintaining a dynamic list of active edges of P and Q along the sweepline we can

determine each value of t in O log M time This improvement reduces the overall running

time of the collision detection algorithm to O N log N M log M

Finding Vertexedge Touching Pairs

Type of Contact

In our application the input to the compaction algorithm is a nonoverlapping layout

That is in the initial conguration no p oint of a p olygon P can b e in the interior of another

i

p olygon P for i j i j n It follows that the next collision can only o ccur on the

j

b oundaries of the p olygons

For two p olygons that are in contact at the next collision time t the contact among

k

the p oints on the b oundaries of the two p olygons can b e classied into the following types

vertexedge contact

edgeedge contact

vertexvertex contact

As shown in Figure and Figure an edgeedge contact can b e broken into two

vertexedge contacts and a vertexvertex contact can b e broken into four vertexedge con

tacts So we only need to concentrate on nding all the vertexedge contacts ie the

vertexedge touching pairs

A Simple Algorithm

A simple algorithm for nding all the vertexedge touching pairs is to check every pair

of p olygons and for each pair of p olygons test the vertexedge incidences for every vertex

of one p olygon against the edges of the other p olygon This algorithm is essentially the

same as the simple collision detection algorithm and runs in O N M time

A Sweepline Algorithm

Given a layout of N nonoverlapping p olygons we can nd all the vertexedge touching

pairs in the layout by calculating the arrangement of the NM edges in the layout explicitly

Ede The pairs of intersecting edges in this arrangement has the prop erty that their

intersection o ccurs at the place where one vertex of an edge is incident on the other edge

Hence the pairs of intersecting edges in the arrangement forms the vertexedge touching

pairs

By Chazelle and Edelsbrunners result CE the arrangement of the O NM edges

can b e computed optimally in O NM logNM K time where K is the total number D D

B B A C C A A C F F E

E

Figure The nonp enetration constraint for an edgeedge contact can b e broken into two

vertexedge contacts A C B and C AF

E

F

A

C

D

B

6

Figure The nonp enetration constraint for an vertexvertex contact b etween F AE

6

BCD can b e broken into four vertexedge contacts A B C A C D C F A and and

C AE

intersecting edge pairs which in our case are vertexedge touching pairs Assume that there

is no more than a constant integer c number of vertices incident on one p oint there is

at most O NM vertexedge touching pairs Hence the algorithm runs in O NM logNM

time

An Alternative Algorithm

The previous two algorithms run separately with the collision detection algorithm The

two algorithms assume that the collision detection algorithm has run to the end and the

simulation has b een advanced by a time interval t found by the collision detection algorithm

An alternative metho d for nding vertexedge touching pairs is to augment the collision

detection algorithm of Section This metho d generates a list of vertexedge touching

pairs during the execution of the collision detection algorithm

Assume t is the next collision time calculated when the collision detection algorithm

k

terminates If vertex A of p olygon P and edge BC of p olygon Q yield the earliest collision

time so far then A BC is a candidate vertexedge touching pair at time t We use a list

k

L to record the all the candidate vertexedge touching pairs If t the collision time b etween

0

A and BC is the earliest collision time recorded so far then we include A BC in L Let t

0

b e the collision time b etween D and EF the next vertexedge pair to b e checked If t t

then A B C and the vertexedge pairs currently in L cannot b e vertexedge touching pairs

0

at t Therefore we delete the elements in L and insert the pair D EF into L If t t

k

0

then D EF is app ended to L as a candidate In the last case which is t t L is not

changed When the collision algorithm algorithm terminates L contains all the vertexedge

touching pairs at time t Since this algorithm is part of a collision detection algorithm it

k

runs in the same time as the collision detection algorithm namely O N log N M log M

Nonp enetration Constraints

The purp ose of the nonp enetration constraints is to ensure that starting from the

next collision time a vertexedge touching pair cannot interpenetrate each other when the

simulation advances

Let A b e a vertex of p olygon P that is touching edge BC of p olygon Q at the collision

time The p oints on the b oundary of a p olygon are ordered counterclockwise ie the

interior of p olygon Q is on the left side of the directed edge BC Polygon P is to b e moved

with velocity vector u and p olygon Q with velocity vector v After a time interval t A is u Q Q A A+ u t C C+ v t B P v B + v t P

(a) (b)

Figure a The vertex A of P touches the edge BC of Q P moves with velocity u and

Q moves with velocity v b The p osition of P and Q after time interval t

0 0 0 0 0

moved to A A ut and edge BC is moved to B C where B B v t and C C v t

0 0 0 0

See Figure The condition that A do es not p enetrate B C requires that A stay on the

0 0 0 0 0

righthand side of the directed edge B C ie A C and B should b e in counterclockwise

order By Lemma A see App endix A this condition can b e expressed as

0 0 0 0

B A B C

that is

A ut B v t C v t B v t

This simplies to

A B C B A B u v t

and

BA BC BA u v t

since A was touching BC

BA BC

and since t the nonp enetration constraint b ecomes

AB u v

which expands to

A B u A B v A B u A B v

y y x y y x x x y x x y

Thus we have shown that the nonp enetration constraint is a linear inequality on the

velocities u and v

In the ab ove formulation vertex A must not b e incident on vertex B since in that case

the constraint we have just derived will b e a null constraint When A is incident on B we

can derive the nonp enetration constraint from

0 0 0 0

B C A C

which expands and then simplies to

u v AC

Bounds on the Velocities

In the algorithm we have sp ecied upp er b ounds on the magnitude of the veloci

ties These b ounds are necessary b ecause from the previous section we see that the non

p enetration constraints derived forms homogeneous system of inequalities That is in the

constant terms of the constraints are all zeros It is p ossible that optimizing the the ob jec

tive function f v can cause the velocities to increase without b ound On the other hand

i i

simultaneously scaling of all the velocities will not aect the b ehavior of the simulation

Sp ecically if the velocities are all scaled up by a factor of F then the time interval t

b etween the current time and the next collision will b e scaled down by a factor of F accord

ingly Therefore the net eect is still that each of the p olygons is translated by the same

amount

NonPenetration Constraints for VertexVertex Con

tacts

We have seen that the a vertexvertex contact is broken into four vertexedge contacts

However as we will see it is not necessary to build nonp enetration constraint for each

of vertexedge contacts A constraint is necessary only if the vertex and the edge form a

vertexedge supporting pair Let A b e a vertex of p olygon P and and BC b e an edge of

p olygon Q Let the two edges incident to A b e FA and AE We say that A and BC form

an vertexedge supp orting pair if among the p oints in edge FA and AE A has the smallest

directed distance to L the line that contains BC see Figure In other words if

BC E

F

A C

B

Figure A vertexedge supp orting pair

6

E AF is moved suciently far way and moved back towards L then A is the rst p oint

BC

to hit L We say A supp orts BC if A and BC form a supp orting pair If we draw the

AB

outward normals of FA and AE and the inward normal of BC starting from A then the

inward normal of BC is included in the cone of angle degrees b ounded by the

outward normals of FA and AE

If A and BC do not form a vertexedge supp orting pair then force A stay outside BC

do es not guarantee nonoverlapping condition of FA and AE with BC Therefore it is not

necessary to build a nonp enetration constraint for A and BC

From the denition it immediately follows that a concave vertex cannot supp ort any

edge In a nonoverlapping layout there cannot b e concave vertex contact another concave

vertex

For a convexconcave vertex contact pair the convex vertex and the two edges of the

concave vertex form two vertexedge supp orting pairs and b oth of them need to b e included

when building nonp enetration constraints

For convexconvex vertex contact pair there can b e only two vertexedge supp orting

pairs among the four vertexedge contact pairs and we only need to chose one of these two

vertexedge supp orting pair to build a constraint This fact can b e seen more clearly from

the conguration space and Minkowski sum p oint of view see Chapter We omit the

explanation here

As we discussed in Section the choice b etween two of the vertexedge supp orting

pairs for a convexconvex vertex contact pairs is arbitrary Either one can b e chosen to

generate the nonoverlapping constraint for P and Q In making the choice we want achieve

two goals The rst goal to resolve the lo cked layout in which the p olygons interlock with

each The second goal is to make the choice that can leads to a global optimum However

we can show it is NPhard to achieve either one of the two goals

Performance

The simulation algorithm describ ed thus far has b een implemented on a mips Sun

Sparc workstation and tested on real apparel markers Comparing to the strict physically

based metho ds our simulation algorithm is simpler The linear programming formulation

which replaces the dierential equations or quadratic programming formulations in the

contactforce based physical simulation metho d should enable it to run much faster The

exp erimental results show that the algorithm is very ecient in converging an initially

lo osely packed layout to a relatively tight layout

However we discovered that our simulation algorithm has diculty compacting tightly

packed layouts When p olygons are tightly packed the chances of collision increase dra

matically The time interval is usually very small which causes numerical problems Very

frequently the simulation go es through many small time interval steps b efore it can make a

signicant progress through a large time interval Thus the algorithm has not b een success

ful in our application which involves compacting tightly packed human generated markers

For a medium sized marker that contains around pieces the algorithm to ok more than

minutes

The small time intervals have two causes First since there are many pieces it is likely

that there are two which are just ab out to come in contact When they do the simulation

must stop and recompute We could continue moving other pieces forward in time until

they come in contact and p ossibly make more progress this way However the resulting

simulation would have dierent time zones and thus would b e even less similar to physical

reality than our current algorithm The second and more fundamental reason why the time

interval is small is that even if there is only one piece it is p ossible to have many small

time intervals Supp ose piece P is in contact with the the piston piece on the right As

the piston moves leftward P b ounces back and forth b etween the left wall and the piston

piece Each b ounce requires a time interval In Chapter we will give a positionbased

mo del which will allow us to compute a nal p osition for P and the piston in one step

Although some steps of the simulation algorithm are carried out by straightforward

algorithms whose running time can b e improved we determined that the long running

time is mainly due to the small time intervals The running time of the other steps of the

simulation algorithm is insignicant compared to the large number of calls to the the linear

program solver due to the small time intervals

Chapter

The Theory of Minkowski Sum

and Dierence

The Minkowski sum and dierence are p owerful prepro cessing to ols for p olygon inter

section and containment problems Using the Minkowski sum and dierence resp ectively

we can convert a p olygonp olygon intersection overlap query and a p olygonp olygon con

tainment query into p ointinpolygon queries which allow us to achieve sublinear query

times Although the Minkowski sum and dierence has b een used extensively in rob ot

motion planning via the conguration space approach Can LPW SS we have

seen very few eorts in applying it to packing problems Throughout our marker making

pro ject we have demonstrated the greatly utility of the Minkowski sum and dierence in

packing problems For example the Minkowski sum plays a central role in the p osition

based optimization mo del to b e describ ed in the next chapter The Minkowski dierence is

essential in trim placement see DLM and Chapter

In this chapter we present the denition of the Minkowski sum and dierence and

discuss its prop erties and its applications in intersection and containment problems We

also examine algorithms for computing the Minkowski sums of dierent types of p olygons

In particular we prove a crucial prop erty ab out the Minkowski sum of starshap ed p olygons

which results in a signicantly simplied algorithm for computing the Minkowski sum of

starshap ed p olygons We also show that similar prop erties hold for monotone p olygons

Background

Polygon Intersection and Containment Problems

We consider the following problems for two simple p olygons P and Q

Polygon intersection Do es P intersect overlap Q

Polygon containment Is P b e totally contained in Q

These two problems arise frequently in marker making and in general twodimensional

packing problems Therefore optimal or ecient solutions to the problems are of great

interest

Without prepro cessing there exist trivial lineartime lower b ounds for b oth problems

These lower b ounds are actually tight according to the results of Van Wyk and Tarjan

TV and Chazelle Cha Van Wyk and Tarjan showed the p olygon intersection prob

lem is linear time reducible to p olygon simplicity testing that is testing whether a p olygon

is selfintersecting They further showed that testing the simplicity of a p olygon is in turn

linear time reducible to p olygon triangulation which is the problem of decomp osing a p oly

gon into nonoverlapping triangles whose vertices are also vertices of the p olygon The nal

linear time b ound for the p olygon intersection problem is achieved by Chazelles linear time

triangulation algorithm Cha Therefore we have

Theorem Polygon intersection can be solved in linear time

Using Theorem we show next that p olygon containment can also b e solved in linear

time

Theorem Polygon containment can be solved in linear time

Pro of Let P and Q b e two simple p olygons A necessary and sucient condition for Q

containing P is that at least one p oint of P is contained in Q and P and do es not intersect

the b oundary of Q Testing whether an arbitrary p oint of P is contained in Q takes linear

time

To test whether P intersects the b oundary of Q we identify a vertex u of P that has

the largest y co ordinate Extend a ray R vertically upwards from u It is easy to determine

in linear time the rst p oint v of Q hit by R if there is none then P is not inside Q

Cut Q at v if it is not already a vertex Add edges uv and v u to splice P and Q into one

lo op there are two copies of u and two copies of v Move uv by to the left and v u by

to the right that is separate the multiple copies of the vertices by Only six edges are

aected by changes in and if is suciently small then these edges do not intersect any

others unless P and Q have intersecting b oundaries This value of can b e computed in

linear time Furthermore for this value of the spliced p olygon will b e simple not self

intersecting if and only if P is interior to Q The linear time b ound follows from that

testing the spliced p olygon for simplicity takes linear time 2

Note that the linearity of b oth the intersection and containment problems dep end on

Chazelles linear time triangulation algorithm Chazelles algorithm is a theoretical break

through in computational geometry However the algorithm is extremely complicated and

it remains to b e seen whether it can b e made practical It is also not clear whether the al

gorithm can b e made numerically robust In practice Chazelles algorithm can b e replaced

by simpler O n log n algorithms in GJPj or HM

It follows from the ab ove discussion that without prepro cessing linear time is the b est

achievable for p olygon intersection and containment problems However in practice there

are situations which require sublinear query time for intersection and containment prob

lems as such queries will b e p erformed a great number of times Also there are o ccasions

when we want to examine all the lo cations where P can b e placed without overlapping

Q in order to select a lo cation according to some criterion These two requirements give

rise to the demand for a prepro cessing to ol that can characterize all the non overlapping

placements of P with resp ect to Q that also yield fast query time As shall b e seen in this

chapter such a demand is fullled by the Minkowski sum and dierence

Conguration Space Approach

The rob ot motion planning problem is the problem of nding a continuous motion to

transp ort an ob ject from a starting p osition to an ending p osition such that the ob ject is free

from collision with the surrounding obstacles There is a set of parameters that uniquely

determines the spatial state of the moving ob ject Such a set of parameters includes the

p osition and orientation of the ob ject It may also include the angles b etween the links if

the ob ject is an articulated one When the parameters take on a set of particular values it

gives a conguration of the ob ject The conguration space for the ob ject is the space of

1

This assumes that the ob ject in its starting and ending p ositions is free from collision with the obstacles

all the p ossible values for the parameters A conguration is represented as a p oint in the

conguration space

A conguration in which the ob ject is free from collision with the surrounding obstacles

is called a free conguration otherwise it is forbidden The collection of free congurations

is called free space And the complement of the free space in a conguration space is

called forbidden space It has b een shown that b oth free space and forbidden space can b e

partitioned into connected comp onents which are called free regions and forbidden regions

resp ectively Any path that connects two p oints in a free region and is totally contained

in the free region represents a continuous motion of the ob ject that is free from collision

Thus the motion planning problem can b e reduced to nding a path connecting the p oints

representing the initial and nal congurations This is the basic idea of the ingenious

conguration space approach LPW Can in rob ot motion planning In this approach

the moving ob ject shrinks to a p oint and the forbidden regions can b e viewed as enlarged

obstacles

If we restrict the general motion planning problem to the problem of planning the

motion of a simple p olygon translating in a environment consisting of one simple p olygonal

obstacle then the conguration space has a connected forbidden region However the

forbidden region may have holes and thus the free space may have multiple connected

comp onents The case of planning the motion of a translating a simple p olygon in a closed

environment whose b oundary can b e represented as a p olygon is similar the forbidden

region is connected but the free region may have multiple comp onents In b oth cases

the comp onents of the conguration space are closely related to the Minkowski sum We

will examine the relation in detail in the next section However for starshap ed p olygons

Theorem shows that the structure of their conguration space is particularly simple

the free space is a single connected comp onent and so is the forbidden space

Denitions and Prop erties

We present the denition of Minkowski sum and dierence in set theoretic terms The

lemmas and theorems in this section are valid for discrete or continuous p oint sets in the

Euclidean dspace (51, 48)

(56, 43)

(11, 29) (29, 27) (6, 24) (16, 24)

(34, 22) (40, 19) (11, 19)

(23, 3)

Figure The Minkowski sum for a circle and a square

Denition Let A and B b e two p oint sets in the The Minkowski Sum

of A and B denoted by A B is the p oint set dened as

b

A A B

b2B

b

where A is A translated by b

b

A fa b j a Ag

The Minkowski dierence of A and B denoted by A B is a p oint set dened as

b

A B A

b2B

Example Figure depicts the Minkowski sum of a circle A with a square B Let

C denote the Minkowski sum This gure also provides examples of Minkowski dierence

we have C A B and C B A We would like to p oint out that it is not always true

that A B B A

We rst show that A B can b e written equivalently as an algebraic sum of A and B

This algebraic sum is sometimes easier to apply than the original denition Hence it can

serve as an alternative denition of the Minkowski Sum

Lemma

A B fa b j a A b B g

b

Pro of By denition x A B implies that there exists b B such that x A It

follows that there exists a A such that x a b Therefore x is also an element of the

set on the right hand side

Similar 2

We immediately have

Corollary A B B A

Notice that in general A B B A

The next lemma establishes the relationship b etween Minkowski Sum and Minkowski

dierence

Lemma

A B A B

where A denotes the complement of A

A fa j a Ag

Pro of By denition we have

b

A B A

b2B

By De Morgans law we have

p b

A A

b2B b2B

b

b

A A 2 The lemma follows from the fact that

Symmetrically we have

Corollary A B A B

The next lemma shows that the shap e of the Minkowski sum and Minkowski dierence

are translation invariant

Lemma Let A and B be two point sets Let s and t be two points Then

s t st

A B A B

and

s t st

A B A B

Pro of The pro of is straightforward from the denitions of Minkowski Sum and dierence

2

As a consequence of Lemma if the p oint sets A and B can only change lo cation but not

orientation we need to compute their Minkowski sum or dierence only once After A and

B and are placed in new lo cations all we need to do is to translate the Minkowski sum or

dierence accordingly

Applications Intersection and Containment

Having studied the concept and the prop erties of the Minkowski Sum and dierence

we now turn to their applications in intersection and containment problems and present

two key theorems in this section The theorems show that using the Minkowski Sum and

dierence intersection and containment queries on two p oint sets A and B can b e converted

into membership queries on whether a p oint b elongs to A B or A B resp ectively

In the case where A and B are b oth p olygons the membership queries are actually p oint

inp olygon queries which can b e answered with prop er prepro cessing in time logarithmic

in the size of the p olygons

Intersection

T

x

Theorem Let A and B be two point sets and x be a point in the plane Then A B

if and only if x A B where B fb j b B g is the reective image of B

2

The prepro cessing involves constructing the Minkowski sum or dierence p olygons and building search

structures on the p olygons In general the prepro cessing step can b e exp ensive B

A

(−B) A (−B)

Figure The Minkowski sum and intersection detection

T

x x

Pro of Let y A B We have y A and y B That is there exists b B such

that y b x Therefore we have x y b Note that y b is a p oint in A B

Thus x A B

If x A B then we have x a b for a A and b B Rewrite x a b

T

x x

as a x b Therefore a b elongs to b oth A and B which implies A B 2

T

t s

B if and only if t s A B Corollary A

s t

Pro of A and B intersect if and only if they intersect after they are b oth translated by

T

ts

s ie if and only if A B 2

From Corollary we immediately obtain a useful fact which states that A and B

intersect if and only if A B contains the origin

Example Figure demonstrates intersection detection for two p oint sets A and B In

this case by checking the Minkowski sum of A and B we can verify that the intersection

of A and B is nonempty since the origin is contained in the Minkowski sum

Let A b e a stationary obstacle and let B b e a translating ob ject It is now clear

that A B is exactly the forbidden region in the conguration space approach The Q

P (−Q)

P

Figure Minkowski sum and nonoverlapping placement

complement of A B corresp onds to the free region In the case where A and B are

two p olygons the free region is the exterior of the p olygon A B The free region gives

all the vectors x by which B can b e translated without p enetrating A

Recall that for the p olygons in our marker making application there is a lo cal co ordinate

frame attached to each of the p olygons The co ordinates of the p oints in the p olygon are

given in the lo cal co ordinate system The lo cation of a p olygon in the global co ordinate

system is given by the global co ordinates of the p olygons lo cal origin Let P p denote the

fact that the lo cal origin of p olygon P is placed at p oint p in the global co ordinate system

When the lo cation of P is not sp ecied we will assume P is placed at the global origin

ie the lo cal origin of P is coincident with the global origin

Let P and Q b oth b e placed at the global origin The geometric interpretation of

Theorem for P and Q is Qx do es not intersect P if and only if x is outside the

Minkowski sum p olygon P Q

Example Figure shows that as long as the lo cal origin of p olygon Q is placed

outside the Minkowski sum P Q Q cannot overlap P

In addition to b eing a p oint set a p olygon has b oundary p oints and interior p oints We

say a p oint x is a boundary p oint of a p olygon P if for every the disc of radius

centered at x contains b oth p oints of P and p oints that do not b elong to P All the p oints

of P that are not b oundary p oints are called interior p oints If x is an interior p oint of P

then there exists a such that the disc of radius centered at x contains only p oints

of P

The two p olygon P and Q intersect ie P Q intersection can further b e classied

as overlapping if an interior p oint of one p olygon is contained in the other and vice versa

or in contact if P and Q are incident on their b oundary p oints

Now we extend Theorem to distinguish the case where two p olygons overlap

Theorem Polygon P and Qq overlap if and only if q is an interior point of P

Q

Pro of Since P and Qq overlap there exists a interior p oint x of P that is contained in

Qq That is x y q for y Q Hence q x y P Q Now let d x b e a disc

of radius centered at x and contained in P Then d x y the Minkowski sum of

d x with p oint y is a disc centered at q and is contained in P Q Hence q is an

interior p oint of P Q

The other direction is similar 2

Corollary P p overlap Qq if and only if q p is an interior point of P Q

Pro of The pro of is similar to the pro of of Corollary 2

The following corollary will b e used in Chapter

Corollary P p and Qq are in contact if and only if q p is on the boundary of

P Q

Pro of Follows immediately from Corollary and Corollary 2

Containment

x

Theorem gives the condition for all vectors x such that B do es not intersect A The

next theorem which can b e considered the dual of Theorem gives the condition for all

x

x such that B is completely contained in A Before we prove the theorem we rst give

A b e the complement of A If A is a p olygon then A is the exterior some intuition Let

x

of A For a vector x the condition that B is totally contained in A is equivalent to the

x

A is empty By Theorem this is the same condition that the intersection of B with

as x A B or equivalently x A B By Lemma A B is exactly the

Minkowski dierence A B B

A

A (−B)

Figure The Minkowski dierence and p olygon containment problem

x

Theorem Let A and B be two point sets Then B A if and only if x A B

Pro of The argument in the preceding paragraph can serve as an informal pro of Here

we present a set theoretic pro of

x b

B A implies for every b B we have x b A or equivalently x A for every

b B Hence

b

x A

b2B

Moreover

b b

A A

b2B

b2B

By denition the right hand side of the ab ove expression is exactly A B

Similar 2

Now it is clear that if we view A as a closed obstacle the free region for planning the

translation of B inside A is given by A B The set A B is also referred to as

an erosion of A by B in image analysis Ser Taking the erosion of two p oint sets is an

imp ortant op eration in image pro cessing for extracting the skeleton of an image

Example Figure shows the application of the Minkowski dierence in a contain

ment problem for two p olygons A and B The shaded area represents A B As long

as the lo cal origin of B is placed inside A B B is totally contained in A

Algorithms for Computing Minkowski Sums

Previously prop osed algorithms for computing Minkowski sums have b een limited to

convex p olygons and simple p olygons ie the p olygons that are nonselfintersecting and

without holes Although their Minkowski sums can b e computed eciently convex p olygons

are not suitable in our applications where the p olygons are mostly nonconvex On the other

hand the algorithms for computing the Minkowski sum of two simple p olygons take a long

time We have observed that starshap ed p olygons strike a balance b etween the eciency

of Minkowski sum computation and practicability We have also observed that in our

application the ma jority of p olygons are starshap ed The rest can b e decomp osed into two

or three starshap ed comp onents

Convex Polygons

Guibas et al GRS observed that the Minkowski sum of two convex p olygons can

b e computed in linear time by merging the edge segments of the two p olygons

Simple Polygons

In general it is easy to show that an edge segment on the b oundary of the Minkowski

sum p olygon of P and Q is part of an edge segment formed as the sum of a vertex in

P and an edge in Q or vice versa Let us call the edges formed by the sum of a vertex

in one p olygon and an edge of the other p olygon candidate edges If there are n vertices

in P and m vertices in Q then there are O mn candidate edges A natural idea for

generating the Minkowski sum is to calculate the arrangement Ede of the candidate

edges in O m n log nm time The algorithms in KOS and AST for calculating the

Minkowski sum of two simple p olygons followed this idea Kaul et al KOS introduced

the concept of vertexedge supp orting pairs which reduces the number of candidate edges

In the worst case the Minkowski sum of two simple p olygon can have O m n edges and

the same number of holes

Starshap ed Polygons

There is a class of p olygons called starshaped p olygons which are not as restricted as

convex p olygons but also easier to compute than simple p olygons A p olygon P is starshap ed

if there exists a p oint k in P such that for each other p oint p in P the entire segment k p u = v w

v

k0 k1

k0 P P Q

w k1

Q

Figure The Minkowski sum of two starshap ed p olygons

lies inside P Such a p oint k is called a kernel p oint of the p olygon Note that a convex

p olygon is a sp ecial case of a starshap ed p olygon in which the kernel equals the entire

p olygon Polygons P and Q in Figure are examples of starshap ed p olygons

We now show how to compute the Minkowski sum of starshap ed p olygons First we

prove a crucial prop erty for the Minkowski sum of two starshap ed p olygons that greatly

simplies the computation of the Minkowski sum

Theorem The Minkowski sum of two starshaped polygons is also a starshaped poly

gon

Pro of See Figure Let P and Q b e two starshap ed p olygons Let k b e a kernel

p oint of P and k b e a kernel p oint of Q It suces to show the k k k is a kernel

p oint of P Q To see this let u b e an arbitrary p oint in P Q and by denition u v w

for v P and w Q Since P and Q are starshap ed we have that k v is totally contained

in P and k w is totally contained in Q Therefore the Minkowski sum k v k w is totally

contained in P Q Notice that k v k w is a parallelogram with k at one end of a

diagonal and u v w at the other diagonal Hence k u is totally contained in P Q 2

Remark The theorem shows that starshap ed p olygons are closed under Minkowski sum

op erations The only previously known class of p olygons that is closed under Minkowski

sum is convex p olygons

It follows from Theorem that the Minkowski sum of two starshap ed p olygons can

not have holes Thus the computation of Minkowski sum is reduced to calculating the outer

envelope Ede of the arrangement of the O mn candidates by an angular sweepline al

gorithm The outer envelope of O mn segments can have O mnmn HS segments

where is the extremely slowly growing inverse of the Ackermanns function For prac

tical purp oses it can b e considered a constant The straightforward implementation of

the angular sweepline algorithm runs in O mnmn log mn time Hershberger Her

presented an algorithm for calculating the outer envelope of n line segments in O n log n

time Therefore we have

Theorem The Minkowski sum of two starshaped polygons can be computed in O mn log mn

time

Currently we are using a numerically robust implementation of angular sweepline algo

rithm for computing Minkowski sum of starshap ed p olygon The algorithm is based on the

observation that if we are unsure if a p oint q lies on the Minkowski sum we can always

pro ject from the kernel p oint p through q and take the farthest intersection with a candidate

edge We have encountered data containing a few nonstarshap ed p olygons but our studies

have shown that all these p olygons can b e expressed as a union of two and very rarely

three starshap ed p olygons For those nonstarshap ed p olygons we have a decomp osition

algorithm to decomp ose the p olygon into a small number of starshap ed ones During com

paction the starshap ed comp onents of a p olygon are glued together that is they have

the same translation and tilt

Monotone Polygons

A monotone p olygon is a simple p olygon that can b e decomp osed into two monotone

chains along a direction which we call the direction of mononicity A monotone chain

is a piecewise linear function with resp ect to the direction of monotonicity Assume the

direction of monotonicity is coincident with the y axis then the a monotone p olygon is

comp osed of a upp er chain and a lower chain

Like convexity and starshap edness the monotonicity of a p olygon is a p owerful to ol in

constraining the complexity of simple p olygons and facilitates the design of more ecient

and practical algorithms

We can consider monotonicity to b e a sp ecial case of starshap edness in the sense that a

monotone chain can b e thought of having a kernel p oint in the innity By using essentially

the same pro of as the one for Theorem we can show the following theorem

Theorem If two monotone polygons P and Q have the same direction of monotonicity

d then their Minkowski Sum P Q is also a monotone polygon with respect to direction d

The theorems shows that like the Minkowski sum of two starshap ed p olygons the

Minkowski sum of two monotone p olygons that share the same direction of monotonic

ity also has no holes Therefore computing such a Minkowski sum is again reduced to the

calculating the outer envelop Similar to Theorem we have

Theorem The Minkowski sum of two monotone polygons that have the same direction

of monotonicity can be computed in O mn log mn time

To apply Theorem we need to rst identify for two given p olygons whether there

exists a direction with resp ect to which the two p olygons are monotone The algorithm of

Preparata and Sup owit PS can decide whether a p olygon is monotone and further nd

all the directions of monotonicity for the p olygon in linear time Using their algorithm we

can rst calculate the ranges of the direction of monotonicity for the two p olygons and do a

merge in linear time to decide if the two p olygons share a common direction of monotonicity

In three dimensions there is no known algorithm for testing the monotonicity of a

p olyhedron The authors LZ susp ect that the problem is NPhard However for p olygonal

chains or p olyhedral surface patches in three or higher testing whether there is

a common direction of monotonicity can b e done in linear time using linear programming

We use three dimension as an example the other dimensions are similar We assume that

the outward normals of a p olyhedral surface have b een prop erly lab eled and are consistent

that is the surface can b e top ologically transformed into a plane parallel to the x y plane

and all the outward normals are upward Let the outward normal of a face in a p olyhedral

surface b e n n n n The direction of monotonicity d d d d must satisfy

x y z x y z

n d

or

n d n d n d

x x y y z z

which is a linear constraint in variables d d d

x y z

Given several p olyhedral surfaces we build a linear constraint for each of the faces

There exists a common direction of monotonicity if and only if the linear program with the

aforementioned constraints has a feasible solution This can b e tested in linear time using

Megiddos algorithm Meg

If two p olyhedral surfaces have a common direction of monotonicity we can form two

p olyhedral terrains by pro jecting the two surfaces to a plane b eneath and is parallel to

their common direction of monotonicity It is easy to show that the Minkowski sum of the

two terrains so formed is also a terrain with resp ect to the direction of monotonicity of the

two original terrains

Chapter

Compaction Using a

PositionBased Optimization

Mo del

In this chapter we describ e a compaction algorithm that directly solves for the p ositions

of the p olygons without the use of timeintervals or simulation Instead this algorithm uses

a positionbased optimization mo del The mo del contains articial constraints that restrict

the solution space to a convex feasible region These articial constraints are generated

using a locality heuristic The lo cality heuristic in turn relies on Minkowski sums of the

p olygons to create an explicit representation of the set of nonoverlapping p ositions of each

pair of p olygons this set is called the free region of the conguration space or more simply

the solution space see The ob jective in the mo del is a linear function of the p ositions

of the p olygons The algorithm solves this mo del using linear programming The solution

gives a set of new p ositions for the p olygons Since articial constraints were added the new

set of p ositions may not b e a lo cal minimum of the ob jective for the original compaction

problem The algorithm computes a new mo del and rep eats terminating when the ob jective

function cannot b e improved by the new mo del In practice very few iterations are required

to nd a lo cal minimum for the original compaction problem

This improved algorithm overcomes the diculties of the previous velocitybased algo

rithm in compacting tightly packed layouts It runs two orders of magnitude faster than

the previous algorithm

In this chapter we rst present the p ositionbased optimization mo del and then describ e

the applications of the mo del in implementing various compaction functions

The Theory of a PositionBased Optimization Mo del

NonOverlapping Conditions for Two Translating Polygons

Recall that in our representation of layout problems the p osition of p olygon P is given

by the global co ordinate of the origin of its lo cal co ordinate system As in the previous

chapter we use P c to denote that P s lo cal origin is p ositioned at c and when c is

P P P

omitted P s lo cal origin is placed at the origin of the global co ordinate system We assume

that the lo cal origin of each p olygon is a kernel p oint of that p olygon If any p olygon is

not starshap ed then we decomp ose it into starshap ed p olygons and add the constraint

that these p olygons must move as one unit Let p and q b e the new p ositions of P and Q

resp ectively From Theorem we have that for two p olygons P and Q and two arbitrary

p oints p and q P p intersects Qq if and only if q p is in P Q It follows that

planning the simultaneous motion of P and Q is reduced to planning the motion of a single

p oint q p which represents the relative motion of Q with resp ect to P in an environment

consisting of a static obstacle P Q Hence to guarantee that P and Q do not overlap

P Q the exterior of P Q we must force q p to stay in

A Lo cality Heuristic

In our applications the exteriors of the Minkowski sum p olygons are generally non

convex In order to use linear programming we need to nd a convex subset of the exterior

of a Minkowski sum p olygon that can b e used to formulate the nonoverlapping condition

as a set of linear constraints We use a locality heuristic to nd such a convex subset In

the rest of this section we explain the lo cality heuristic in detail

First of all our intention is to formalize the compaction problem as a linear programming

P Q problem Therefore we need to express the fact that the p oint q p must stay in

as a set of linear constraints on the p osition variable q p One way of building such a

linear constraint is to sp ecify a line segment and restrict q p to lie in the prop er halfplane

delimited by the line segment For instance let AB b e a line segment and let q p b e

denoted by R then from App endix A the following cross pro duct

RA BA

sp ecies that R is on the righthand side with resp ect to the direction from A to B of

AB In other words R lies in the halfplane H which is delimited by AB and contains

AB

righthand side of AB The cross pro duct expands to the following linear constraint

B A q B A q B A p B A p A B A B

y y x x x y y y x x x y x y y x

on variables p and q where A A B B are constants We call H the halfplane

x y x y AB

asso ciated with the linear constraint

Geometrically a set of linear constraints denes a convex region which is the intersection

of the halfplanes asso ciated with the constraints Conversely from a convex region in the

plane we can derive a unique set of linear constraints on q p Furthermore the set of

linear constraints asso ciated with a convex region is satised by q p if and only if q p is

contained in the convex region

P Q we can form a It is clear that by sp ecifying a nonempty convex region in

set of linear constraints which forces q p to stay in that convex region and thus ensures

the nonoverlapping condition for P and Q Ideally if P Q is convex we can use

P Q itself as the convex region to build constraints However P Q can never

b e convex b ecause it is the exterior of a simple p olygon Therefore any convex region we

choose can only b e a subset of P Q Hence by forcing q p to stay in a convex subset

P Q we actually restrict the freedom of the relative motion of P and Q To reduce of

this limitation we want the convex region to cover as large an area of P Q as p ossible

Additionally if c and c are the current p ositions of the origins of P and Q we want

P Q

the new relative p osition q p to b e reachable from the current relative p osition c c

Q P

via a continuous motion of P and Q Hence we also require that the convex region include

c c

Q P

The purp ose of the locality heuristic is to nd a region in P Q with the three

requirements we just identied convex large and contains the p oint c c The lo cality

Q P

heuristic nds such a convex region by rst determining a p oint on the b oundary of the

Minkowski sum that is nearest to b e dened b elow to c c Starting from that p oint

Q P

it walks clo ckwise and counterclockwise along the b oundary of the Minkowski sum When

walking clo ckwise with resp ect to the origin of the Minkowski sum it always makes left

turns It follows the next edge if it turns to the left at a concave vertex of the Minkowski

sum otherwise it extends the current edge nds its intersection with the Minkowski sum

and resumes the walk from that p oint This pro cedure continues until the current edge can

b e extended to innity It pro ceeds analogously in the counterclockwise direction making c − c Q P

(0, 0)

Figure The nearest convex region in the exterior of the Minkowski sum

right turns instead of left turns see

constraints consisting of the halfplanes to the outside of each Minkowski edge it

encounters The intersection of these halfplanes is a convex subset of the feasible solution

space

Under the lo cality heuristic the nearest p oint is not the b oundary p oint with the

closest Euclidean distance to c c Instead it is the intersection of the segment from the

Q P

origin to p oint c c with the b oundary of the Minkowski sum If c c is inside the

Q P Q P

Minkowski sum as it would b e when we are separating overlapping p olygons the nearest

p oint is obtained by extending the ray from the origin through the p oint c c until it

Q P

intersects the b oundary This choice of nearest p oint is imp ortant for the correct op eration

of the separation algorithm and is describ ed more fully in Section

Lemma Let P and Q be two starshaped polygons If the origin of the Minkowski sum

P Q is in its kernel then the locality heuristic terminates correctly

Pro of Consider the clo ckwise walk The angle ab out the origin always increases in a

clo ckwise direction Since the path taken must remain visible from the starting p oint and

indeed from every p oint in the convex region the total angle moved ab out the origin cannot

exceed degrees Therefore the walk must terminate and the only way it can terminate

is by extending an edge to innity 2

In the lo cality heuristic if the line segment connecting c c and the origin of the

Q P

Minkowski sum passes through a convex vertex of the Minkowski sum then either edge of

that vertex can b e chosen to generate the convex subset of the free space This arbitrary

1

If P and Q are b oth starshap ed then P  Q will b e starshap ed and thus have a nonempty kernel

choice is the same as the one made for a vertexvertex contact in the velocitybased mo del

see Section and Section

Linear Constraints with the Boundaries of the Container

The convex subset C obtained by the lo cality heuristic naturally yields a set of linear

constraints for a pair of p olygons In addition to the linear constraints for pairs of p olygon

we need to take into account the constraints b etween the p olygons and the b oundaries of

the container These constraints are quite straightforward to build

Let p olygon P b e adjacent to the upp er b oundary of the container and the let h b e the

y

largest y co ordinate of a vertex of P in its lo cal co ordinate system Let H b e the height of

the container Then P do es not overlap the upp er b oundary of the container in its new

p osition p if and only if

p h H

y y

which is a linear constraint in p Constraints with the left and lower b oundaries are built

y

similarly

The right b oundary sometimes is allowed to move We use a variable l to represent

the current length of the container Let w b e the largest lo cal xco ordinates of P The

x

nonoverlapping constraint b etween P and the right b oundary b ecomes

p w l

x x

The Positionbased Compaction Algorithm

We rst present a brief description of the algorithm and then give further explanation

A p ositionbased compaction algorithm

Input force f for piece i i N f s are constants

i i

Assign a variable p for p olygon i i N

i

do

L a list of adjacent pairs of p olygon returned from a sweepline algorithm

S S is the set of linear constraints generated so far

foreach adjacent pair P Q in L do

2

Here we assume the P is not rotated or ipp ed If this is not the case h should actually calculated

y

after taking the rotation and ipping into account Once calculated h remains constant as long as P can

y

only translate

Compute P Q

S a set of linear constraints generated for P and Q

using the lo cality heuristic

S S S

end

foreach p olygon P do

S the nonoverlapping constraints b etween P and

the b oundaries of the container

S S S

end

Set up a linear program

P

N

maximize f p

i i

i

subject to S

Get the set of new p ositions p i N by solving the linear program

i

Move p olygon i to p i N

i

P

n

until the ob jective function f p stops increasing

i i

i

As in the algorithm in Section we assign a set of desired directions f as the forces

i

applied to each p olygon these f s remains constant during the iterations However instead

i

of assigning velocities we use a set p of variables representing the p ositions of the p olygons

i

The nonoverlapping constraints of the p ositionbased mo del are built in the following

way We rst use a sweepline algorithm to nd all the adjacent pairs of p olygons For each

adjacent pair we nd the set of halfplane constraints generated by the lo cality heuristic in

the previous section

The optimization mo del is set up with all the constraints from each adjacent pair and

the ob jective function

n

X

maximize f p

i i

i

This mo del is a linear program and its solution is a set of p ositions which represent maximal

motion in the desired directions satisfying the current set of constraints

After the motions are applied the system reaches a minimum with resp ect to the set of

constraints generated by the lo cality heuristic The algorithm may need to iterate b ecause

when the p olygons are moved into their new p ositions some of the convex regions generated

by the lo cality heuristic might change Note that in each iteration the same linear function

is used as ob jective function The value of the ob jective function is either increased which

triggers the next iteration or stays the same at which p oint the lo cal minimum for the

compaction problem is reached The nal p osition is a lo cal minimum b ecause the convex

regions contain a feasible op en ball ab out the current set of p ositions

Furthermore each step of the algorithm moves the p olygons from one p oint to another

in the same convex subset of the nonconvex feasible nonoverlapping solution space

Therefore the straight line motion for each step stays within the solution space and the

total motion is a piecewise linear subset of the solution space

Remark Actually manufacturers would not mind if the p olygons leapfogged over

each other on the way to a more compact layout The mixed integer programming gener

alization of this optimization mo del see Chapter do es exactly that

Remark When applying the lo cality heuristic we assume that the two p olygons in

volved are b oth starshap ed or at least their Minkowski sum is starshap ed We have

encountered data containing nonstarshap ed p olygons Our studies have shown that all

these p olygons can b e expressed as a union of two and very rarely three starshap ed p oly

gons For those nonstarshap ed p olygons we use a decomp osition algorithm to decomp ose

the p olygon into a small number of starshap ed comp onents The lo cality heuristic is then

applied to each pair of comp onents of the two p olygons

Running Time and Robustness

Because the neighbor relation b etween pairs of p olygons can b e represented by a planar

graph a linear number of neighboring p olygon pairs is determined by a sweepline algorithm

The convex region found by the lo cality heuristic usually contains a small number of edges

Thus in practice the total number of constraints is linear in the input size The algorithm

typically runs in two to ve iterations b efore it stops Leftward compaction for a marker of

p olygons with the largest p olygons having nearly vertices runs in seconds on a

mips Sun SparcStation

The algorithm is also numerically very robust It handles degenerate cases slightly

overlapped inputs and slightly inaccurate Minkowski sums quite well In particular the

vertices of the Minkowski sums we use have b een rounded to the nearest integer lattice

p oint

3

The decomp osition algorithm was designed by Victor Milenkovic and implemented by Kirat Singh

4

Actually without a b ound on the distance a p olygon can move p otentially any pair can collide and thus

the graph is complete We place a b ound on the distance to ensure a planar graph

Compaction Functions

The p ositionbased optimization mo del eectively converts a co ordinated motion plan

ning problem of many translating p olygons into a linear program problem The mo del is

general and exible The nonoverlapping constraints among the p olygons are captured by

the set of the linear inequalities generated by the lo cality heuristic Several compaction

functions such as leftward compaction and op ening up gaps can b e derived from the mo del

by simply tailoring the ob jective functions By adding b ounds on the p ositional variables

to the linear program we can imp ose restrictions on the motion of each individual p olygon

For example disallowing the motion of some p olygons is the same as setting the upp er and

lower b ounds of the corresp onding p osition variables p and p to their current values

ix iy

In this section we extend the meaning of compaction to include the simultaneous motion

planning of all the p olygons in a layout We call the compaction in it original denition ie

shorten the length of a layout as leftward compaction We will describ e several compaction

functions derived from the p ositionbased mo del that are useful to manual or automated

marker making

Leftward Compaction

For leftward compaction the ob jective function is simply

minimize l

That is the ob jective is to generate a motion of the p olygons that maximizes the leftward

motion of the piston p olygon while allowing all the other p olygons to move freely It is

not necessary for all the p olygons to move to the left to minimize l Sometimes certain

pieces need to move to the right to give a b etter overall length of the marker Such motions

are captured by the linear program Figure shows the result of leftward compaction of

the marker in Figure Notice that during leftward compaction p olygon moves to the

right in order to give space for p olygon to move to the left

Leftward compaction is used primarily to increase the eciency of the nal layouts which

can either b e generated by human or by a computer Figure shows the result of leftward

compaction on pro duction marker shown in Figure 4 10 6

11 8 7 12

9 2 1

0 3 5

Figure An example of leftward compaction input

4 10 6

11

8 7 12

9 2 1

0 3 5

Figure An example of leftward compaction output Figure The human generated pants marker in Figure after leftward compaction

Name: 45725a−re Width: 59.75 in Length: 320.75 in Pieces: 126 Efficiency: 90.94%

Improvement in Cloth Utilizatio n

The algorithm has improved the cloth utilization of many pro duction quality human gen

erated markers markers that actually go to the cutting ro om The average improvement

for the markers from one of the worlds largest jeans manufacturers is the average

savings in material is inch p er marker As Section indicated a improvement

in eciency would save ab out two million dollars in material for the manufacturer In the

leftward compaction example shown in Figure the eciency of the marker has increased

by nearly and total length has b een shortened by inches

Vector Compaction

We use the term vector compaction to denote compaction in a xed b ounding b ox It

has the same ob jective function as in our general p osition based compaction mo del but

with the additional constraint that the right b oundary is xed

l

The forces f can b e assigned through the graphical user interface by drawing a vector

i

on the corresp onding pieces Hence the forces are referred to as vectors Only the nonzero

vectors need to b e assigned Usually only a few p olygons need to b e assigned vectors

Figure shows a example of vector compaction Polygon is given a force in the upp er

left direction The other p olygons are moved accordingly to allow the maximum motion of

p olygon in the sp ecied direction Polygon is squeezed out from the space b etween

p olygon and p olygon During the pro cess p olygon is pushed down while p olygon

is not aected by the motion This example shows in a certain sense that our compaction

algorithm is indeed simulating the frictionless motion of rigid b o dies in a viscous medium

The most imp ortant application of vector compaction is to enlarge a gap so that more

p olygons can b e put in it The p olygons surrounding the gap are pushed away from the gap

by the outward forces applied on them In manual marker making a gap can b e identied

on the user interface screen Then a human marker maker can assign the outward vectors

on the surrounding p olygons manually

Figure depicts the eect of op ening a gap The two trim pieces in the middle cannot

b e t into the gap b etween two large panels Forces are applied to the two large panels

to move one of them upward and the other downward The result is shown in the lower

part of the gure In this example only translation of the pieces used in compaction Figure after compaction Name: Human generated marker Width: 59.75 in Length: 543.16 in

Pieces: 192 Efficiency: 89.62% Left A human generated

Name: Compacted marker Width: 59.75 in pants Length: 537.52 in Pieces: 192

Efficiency: 90.56% marker RightThe human generated marker 3

4

2

1

0

(b)

3

4

2

1

0

(a)

Figure An example of vector compaction

Figure An example of op ening a gap

Op ening up gaps has b een an imp ortant technique used by humans to pro duce high

eciency markers esp ecially when placing the last few dicult pieces In making pants

marker for example human marker makers rst place the panel pieces and the panel

placement determines to nal length b ecause humans make the utmost eort to put all the

trim in the gaps amongst the panels Frequently the last few trim pieces can not b e tted

into any of the gaps left What human marker makers do is to choose a gap and try to

enlarge it This task is timeconsuming and awkward even for exp erienced human marker

makers when the rest of the markers has already b een tightly packed It is unlikely that

they are nding the maximal size gap since they can only move one piece at a time Hence

our compaction algorithms can greatly facilitate the manual marker making pro cess

In automated marker making the gaps in a marker are identied by a program DM

An automatic placement strategy chooses a set of trim p olygons and a particular gap in

which to place them If the trim p olygons can b e placed into the gap then vector compaction

is called to enlarge the gap An outward vector for a p olygon surrounding that gap can

b e drawn from the center of the gap to the center of the p olygon itself

Bumping

Bumping refers to the type of compaction in which only a presp ecied p olygon P is

b

allowed to move within a xed rectangle all other p olygons are xed The ob jective is to

maximize the motion of P in a direction f

b b

maximize f p

b b

Bumping has b een provided by some commercial software vendors as a pro ductivity aid

in manual marker making They use a dierent algorithm not based on linear programming

In traditional manual marker making in which the pattern pieces are laid manually on a

table a marker carefully places a pattern piece so that it do es not overlap any of the

surrounding pattern pieces that have already b een placed Bumping releases human marker

makers from the burden of calculating the nonoverlapping p osition when placing a pattern

piece With the help of the bumping function a human marker maker can rst put a

p olygon in a place which is close to its desired nal p osition then sp ecify a bumping vector

and bump it into its nal p osition According to the authors observation on the manual

marker making pro cess of several human marker makers bumping is involved in placing

almost all the pieces

Because commercial vendors use a naive bumping strategy they might stop prematurely

failing to move further in a direction that can decrease the ob jective function The bumping

metho d derived from our p ositionedbased mo del will always nd a lo cal minimum of the

bumping problem

Since all but one pieces are xed during bumping we can simplify our algorithm For

example we do not need to nd all the adjacent pairs only those adjacent to P Therefore

b

instead of a sweepline algorithm we can use a linear time algorithm to nd all the p olygons

adjacent to P The linear program generated is small since it contains constraints for only

b

a few pairs of p olygons P app ears in every pair and it has only two variables Therefore

b

the algorithm runs very fast

Bumping is an aid in several of our trim placement algorithms For example in a naive

trim placement strategy we had exp erimented a trim p olygon is placed in the leftmost

p osition in the gap that can hold it However in many o ccasions placing the trim p olygon

in the leftmost p osition can induce fragmentation of unplaced region in a gap Bumping is

applied to reduce the fragmentation After each trim p olygon is placed bumping is called

to bump the p olygon into upp erleft or lowerleft corner of the gap to help to keep the

remaining region of the gap useful for additional trim p olygons In most of the examples

we tried bumping has improved the nal results The total running only increase by a few

p ercent

Based on the bumping algorithm we have designed a strategy to demonstrate that one

pieceatatime metho ds can not improve the material utilization of tightly packed layouts

Our strategy is basically a simulation of a generic onepieceatatime metho d We use

a sweepline algorithm to sort the p olygons by increasing xco ordinate of their leftmost

vertices Leftward bumping is then p erformed on the p olygons according to the sorted

order Our exp eriments show that this strategy do es not improve material utilization most of

times This provides another evidence a co ordinated motion planning approach is essential

for solving compaction problem

Gravity Compaction

Gravity compaction is the action of applying the same force to all the p olygons as if

the p olygons are in a gravity eld For a sp ecied force f that is to b e applied to all the

p olygons gravity compaction has the ob jective function

n

X

f p maximize

i

We have observed that when applied prop erly the gravity compaction function can

group the otherwise fragmented unplaced regions into several large chunks An example is

depicted in Figure

A downward force has b een applied to all the p olygons in Figure and as a result

the unplaced regions move up to the upp er part of the marker region and combine into a

few larger chunks Larger chunks of unplaced region help increase the eciency of trim

placement since they p ermit more exible of nesting among the trim p olygons

Gravity compaction can also help to reshap e the unplaced regions inside a gap Some

times the trim p olygons in a gap are placed in such a way that makes it imp ossible to place

an additional trim p olygon in the gap even though the total area of unplaced region in

the gap is larger than the area of the unplaced trim p olygons The application of gravity

compaction changes the p ositions of the trim p olygons already placed in the gap and the

conguration of the unplaced region inside the gap It may b ecome p ossible to place an

additional trim p olygon in the recongured unplaced region Our exp eriments shows that

after the application of gravity more trim p olygons can b e tted into a gap This technique

was rst used by Karen Daniels to improve the eciency of some naive trim placement

strategies

Figure An example of gravity compaction

Chapter

Separation of Overlapping

Polygons and Database Driven

Marker Making

In the previous chapter we developed a p ositionbased optimization mo del and used it

to derive practically ecient algorithms for various compaction tasks In marker making

applications we sometimes encounter the need for solving a seemingly dierent problem

the separation problem The separation problem is the problem of eliminating the overlaps

in a layout by moving pieces away from each other If necessary we would even increase

the current length of the marker to give more space for resolving overlaps

One application of an ecient algorithm for the problem is to eliminate the overlaps

caused by rounding errors A more imp ortant application is in database driven automated

marker making systems Such systems aim at generating markers automatically by selecting

an existing marker stored in a database and then matching and substituting corresp onding

p olygons in the existing marker Since the substituted p olygons are usually not the same as

the original p olygons in the existing marker the substitution pro cess inevitably introduces

overlaps among the p olygons Whether or not the system can pro duce a valid marker

dep ends on the successful elimination of the overlaps

In this chapter we demonstrate that the capability of resolving overlaps is embedded

in the p ositionbased optimization mo del We rst dene and study the complexity of the

separation problem Then we show that the same p ositionbased optimization mo del also

yields an algorithm which gives a lo cally optimal solution to the separation problem To B+B2

B+B2

Figure Reduction of PARTITION to separation of overlapping p olygons

our knowledge this is the rst ecient algorithm for the separation problem Hence it

solves an industrially signicant problem

Based on this separation algorithm we give a new scheme for database driven marker

making We use the separation algorithm together with a database of humangenerated

layouts to automatically generate layouts approaching human p erformance

Denition and Complexity

Given a set of overlapping p olygons the separation problem is the problem of nding a

set of translations of the p olygons such that after the translations the p olygons are in non

overlapping p ositions and such that the total translation of all the p olygons is minimized

First we show that nding a global minimum for the total translation is NPcomplete

Theorem The separation of overlapping polygons is NPcomplete even for rectangles

Pro of Since rotation is not allowed we can use the same argument as in MDL to

show that the problem is in NP To show it is NPhard we again reduce PARTITION

to the problem Figure shows the construction of the reduction Let a a a

n

P

n

b e the integers in an instance of PARTITION Let B a Place n rectangular

i

i

pieces of height and length a i n inside a rectangular space of size B

i

in overlapping p ositions The rectangular space is then surrounded by many additional

rectangular blo cks to make sure its size is not easily enlarged For one piece to move from

one p osition to another p osition inside the rectangular space it needs to move no more

than unit vertically and B units horizontally The total motion of the pieces is therefore

less than B B The surrounding blo cks are built in such a way that to increase the

length or the width of the rectangular space they have to move a total of B B units

distance Therefore PARTITION has a solution if and only if the total displacement in the

separation is less than B B The construction can b e done in p olynomial time 2

In applications of the algorithm namely the database driven automated marker making

and correcting overlaps caused by rounding error the p olygons are not grossly overlapped

They tend to overlap slightly on their b oundaries since the p olygons b eing substituted

are matched for similar shap e and size or vertices and the p osition of a p olygon has b een

rounded to the nearest integer Next we show that even with the additional restriction

that the p olygons only slightly overlap each other the separation problem is no easier than

the general case that is it remains NPcomplete

We dene the degree of overlap r for two overlapping p olygons P and Q as the minimum

translation needed for P to b e in a nonoverlapping p osition with Q We say that two

p olygons are slightly overlapping if their degree of overlap

minfW H W H g r

P P Q Q

c

for a constant c where W H W H are the widths and heights of the b ounding

P P Q Q

b oxes of P and Q

Theorem The separation of overlapping polygons is NPcomplete even if the polygons

just slightly overlap each other

Pro of We reduce the NPhard PARTITION problem to this problem The PARTITION

problem is the same as PARTITION except that it requires that the two subsets each con

tain the same number of integers Each piece still has height but width B c a The

i

rectangular space in the middle now has size B nc B We divide the n pieces into

two rows each containing n pieces within the middle space The two rows do not overlap

vertically Within each row the pieces are spread out evenly The degree of overlap b etween

two adjacent pieces in each row is at most

B

c

B c a

i

b ecause B is the total overlap If there is a solution to PARTITION the moves needed

to make the pieces nonoverlapping are as follows exchange two vertically adjacent pieces

when necessary and do horizontal adjustment within each row The vertical exchanges have

a total displacement of at most n The total horizontal displacement within each row is at

most nB b ecause each piece has at most B horizontal displacement So with nB

total displacement we can solve the separation problem We put nB surrounding

blo cks on each side to restrict the movement of the pieces within the middle space 2

It is easy to see that the constant c can b e replaced by a p olynomial F B n and the pro of

still works

Remark In the pro ofs of Theorem and Theorem we assumed that the distance

used is the usual Euclidean distance We observe that the pro ofs are also valid using L

distance The L distance b etween the two p oints p x y and p x y is dened

as follows

p p jx x j jy y j d

L

1

Remark We mentioned in Section that we will prove the compaction problem to

b e PSPACEhard in Chapter The gap in complexity b etween the compaction problem

and the separation problem is accounted for by the fact that the compaction problem is

dened as a motion planning problem in which the p olygons cannot pass through or jump

over each other while in the separation problem there is no such restriction We would like

to p oint out that if we eliminate the ab ove mentioned restriction in the compaction problem

then compaction separation and packing all b ecome equivalent The NPcomplete layout

problem can b e reduced to separation through essentially the same reduction as the on in

the pro of of Theorem In Chapter we will develop a mixed integer programming

MIP formulation of compaction Under the MIP formulation the p olygons are p ermitted

to pass through each other The formulation gives a direct reduction of compaction to MIP

which shows compaction is in NP Thus we establish the NPcompleteness of compaction

when the p olygons can pass through each other The same MIP formulation also gives

a direct reduction of the strip packing problem to mixed integer programming In fact

compaction and strip packing b ecome equivalent under the formulation c − c Q P

(0, 0)

Figure Minkowski sum of two slightly overlapped p olygons

Algorithm for Separating Overlapping Polygons

In this section we describ e a separation algorithm that nds a lo cal minimum for the

separation problem from the p ositionbased optimization mo del On the surface it seems

that the separation problem may require some dierent techniques We observe that the

p ositionbased mo del is applicable to the separation problem since the nonoverlapping

conditions for adjacent p olygons are prerequisites to a feasible solution of the p osition

based optimization mo del Hence the p ositionbased optimization mo del oers a unied

approach to b oth problems

Let P and Q b e two overlapping p olygons and their current p ositions b e denoted by c

P

and c If we displace P by d and Q by d then the two p olygons will not overlap in their

Q P Q

new p ositions c d and c d resp ectively if and only if the p oint c c d d is

P P Q Q Q P Q P

outside P Q The vector from c c to the closest b oundary p oint on the Minkowski

Q P

sum yields the shortest vector d d that separates the two p olygons Supp ose we

Q P

constrain c c d d to remain within a convex subset of the exterior of P Q that

Q P Q P

touches the closest b oundary p oint If we so constrain every pair of overlapping p olygons

then if a feasible solution with resp ect to the constraints exists the solution will give a set

of displacements that separate the p olygons

We again use the lo cality heuristic to nd the desired convex subsets However we note

that the nearest p oint as dened by the lo cality heuristic is the intersection of l with

the b oundary of P Q where l is the line connecting c c to the global origin

Q P

Hence this choice of nearest p oint might not b e the same as the Euclidean closest p oint

The advantage of this choice is that it guarantees a feasible solution if the following three

conditions hold

the p olygons are not restricted to stay within a b ounding b ox container

all p olygons are starshap ed

no two p olygons have their lo cal origins at the same global p osition

To see that this is the case we rst x the p ositions of the p olygons in the global co ordinate

system and scale each of the p olygons in their lo cal co ordinate systems by a scaling factor

We choose to b e such that after the scaling none of the p olygons is overlapping another

Then scale up the whole layout by the same factor in the global co ordinate system That

is p erform the following pro jective transformation on the global co ordinate system

x y x y

The result is a nonoverlapping layout However this feasibility pro of dep ends on the

fact that each nearest p oint stays at the same sp ot on each shrinking p olygon This

holds for the given denition of nearest p oint It do es not hold for the Euclidean closest

p oint The rst condition app ears unrealistic b ecause there is always a b ounding strip for

a compaction in practice However often a wider strip of material is available from which

to cut the p olygons

As shown in Figure if two p olygons are slightly overlapping then the dierence

b etween the p olygon p ositions will b e slightly inside the Minkowski sum The convex region

found by the lo cality heuristic still gives a go o d indication of the direction of motions

to separate the two p olygons Thus we can use the lo cality heuristic from the previous

chapter to nd the convex regions Nonoverlapping constraints are built similarly as in the

p ositionbased optimization mo del of the previous chapter A feasible solution that satises

the constraints ensures the separation of overlapping p olygons

We now sp ecify the ob jective function to complete the description of the algorithm

Since the goal is to nd a nonoverlapping conguration with minimal amount of total

displacement the ob jective function is therefore

n

X

jd j minimize

i

i

where jd j is amount of displacement of p olygon P

i i

As discussed in Remark jd j is either measured in Euclidean distance in which

i

q

jd j d d

i

ix iy

or in the L metric in which

jd j jd j jd j

i ix iy

where d and d are x and y comp onents of d

ix iy i

In order to formulate the problem as a linear programing problem we must have a linear

ob jective function Therefore we use L distance in the ob jective function Hence the

ob jective function b ecomes

n

X

minimize jd j jd j

ix iy

i

We use a standard technique to eliminate the absolute values in the ob jective function

In this technique every variable whose absolute value app ears in the ob jective function is

replaced by two new variables For example the variable d which app ears in the ob jective

ix

function is replaced by d and d The new variables must have p ositive values That

ix ix

is the following b ounds are added into the linear program

d

ix

d

ix

represents the negative represents the p ositive part of d whereas d The variable d

ix

ix ix

part All the o ccurrences of d in the constraints are replaced by

ix

d d

ix ix

The o ccurrence of jd j in the ob jective function is replaced by

ix

d d

ix ix

This technique works when the absolute values only app ear in the ob jective function

The ob jective function together with condition enforce that only one of d and d

ix ix

has nonzero value If in the optimal solution of the linear program d is p ositive then we

ix

have d and d d Otherwise we have d and d d In b oth cases

ix ix

ix ix ix ix

d d correctly reects the absolute value of d

ix

ix ix

Now we have set up the complete linear program for the separation problem The

solution of the linear program gives a nonoverlapping conguration for the p olygons which

also minimizes the total displacement of the p olygons measured in L distance Notice that

unlike the compaction algorithms in which multiple iterations of linear program solving are

needed this separation algorithm needs only one iteration

Remark Preferably we would like to minimize the total amount of displacement mea

sured in Euclidean distance in our separation algorithm However we notice that in the

applications of our algorithm the primary requirement is to nd a nonoverlapping cong

uration The consideration to minimize the total amount of displacement comes secondary

Nevertheless the L distance serves as a go o d approximation of the Euclidean distance in

our application

Layout Made Easy

Database Driven Automated Marker Making

The separation algorithm of the previous section solves an op en problem in database

driven systems for automated marker making Such systems developed by several CADCAM

rms are based on a database of high quality human generated markers

Some human marker makers with to years of exp erience can generate extremely

high quality markers The markers generated by marker makers with only two or three years

of exp erience are often lower in eciency than the markers made by the most exp erienced

marker makers Commercially available systems automatically generate markers at least

b elow the eciency of the b est human generated markers It is thought that if these

systems could somehow start with the top quality human generated markers as an a initial

conguration then they could generate much more ecient markers This is the idea b ehind

a database marker making system

Given a set of p olygons to b e placed the typical database matching system applies a set

of shap e similarity criteria to nd the marker in the database that has the closest size and

shap e combinations Each p olygon to b e placed in the new marker is matched to a p olygon

in the human generated marker Once such a match is found it uses a one p olygon at a

time technique to place each p olygon in the new marker at the p osition of its matching

p olygon in the human marker If the p olygon overlaps previously placed p olygons in the

new marker its p osition must b e corrected so that it do es not overlap these p olygons

Once a p olygon is correctly placed its p osition is frozen Without a co ordinated overlap

correction metho d this form of one p olygon at a time correction can grossly alter the

layout of the marker and make it harder or even imp ossible to place the rest of the p olygons

anywhere near the p osition of their matching pieces In some cases the correction algorithm

fails to nd a nonoverlapping p osition for the p olygon

With our separation algorithm we can give a simpler and more reliable automatic layout

scheme To distinguish our scheme from the scheme describ ed ab ove we call our scheme

substitution based automated marker making In our scheme we rst lay out each p olygon

at the corresp onding p osition of its matching p olygon in the human generated layout This

layout is created regardless of whether the p olygons overlap each other Next we apply the

separation algorithm to nd a nearby feasible nonoverlapping placement if one exists If

no such placement exists we can increase the length of marker to allow such a placement

and apply the leftward compaction algorithm to shorten the length

If we have no limitation in b oth dimensions of the marker we can always nd a nearby

nonoverlapping placement see the scaling argument in the previous section However

if the width is xed our separation algorithm can fail to nd a feasible placement We can

not exp ect to do b etter b ecause the general problem is NPcomplete

Shap e Matching Criteria

Recent studies in computational geometry oer some general techniques on matching

p olygon shap es ABB AG However these techniques do not take advantage of

the prop erties of the p olygons in a sp ecic application area p ossess and thus runs slowly

One the other hand domain sp ecic knowledge sometimes can provide much more direct

and eective heuristics for matching and substituting p olygons Take pants markers as an

example there are certain characteristics ab out the shap e of a basic comp onent such as a

panel piece In addition the dimensions of the pieces are governed by the size sp ecication

ie the panel pieces for pants of size have basically the same dimension Therefore

ever though the exact shap e of the panel pieces dier from marker to marker the shap e

similarity measure for the samesized panel pieces is presumably very high Hence in

practice the size factor alone could decide underlying matching rule in a database driven

marker making system

Currently the separation algorithm works as the engine of our prop osed database driven

marker making system It do es not mandate any sp ecic shap e similarity matching rule

The user of our algorithm a CAD company in textile industry will b e instrumental in

designing eective matching rules for their customers

An Example

We have combined our algorithms into one separationcompaction algorithm with mul

tiple userselected options This section describ es an example of substitution based marker

making

Using a naive p olygon matching algorithm we match a new set of p olygons to the set

of p olygons in a human generated marker Figure shows the marker generated by sub

stituting matching p olygons Using our separationcompaction algorithm we eliminate the

overlaps in the marker and then compact leftward The resulting marker has an eciency

of which is comparable to human marker makers with two or three years of ex

p erience By moving three small p olygons manually to the gap on the lower right corner

of the marker and running leftward compaction again the eciency increases to

only lower than the marker generated by an exp ert human Figure for the same

set of p olygons This shows that starting from a go o d initial conguration can greatly re

duce the complexity of marker making and demonstrates the applicabili ty of our separation

algorithm for databasedriven marker making

Cut Planning

The database driven marker making could b e the only automatic marking scheme in

the next couple of years that can come very close to human p erformance Its impact can

b e well b eyond our original purp ose of increasing a few fractions of a p ercent in material

utilization A fully automatic marker scheme that is able to pro duce pro duction quality

marker in real time will change the whole apparel manufacturing pro cess We take the cut

planning in apparel manufacturing as an example to illustrate the inuence of the database

driven marker making

An order that comes to an apparel manufacturer consists of the demand for dierent

quantities of garments for several dierent sizes Let there b e n dierent sizes S S S

n

in the order For each size S j n let demand for this size in the order b e D The

j j

apparel manufacturer must rst calculate the materials needed to fulll the order and then

purchase the materials The cut planning problem refers to the calculation of the materials

needed

The current industrial practice uses a set of generic markers M M M to rep

m

resent the markers to b e made Each marker M contains a combination of sizes and has

i

an eciency e based on statistics on the past human p erformance on the particular size

i

combination in M Let a b e the number of size S garments that can b e cut from one M

i ij j i

marker

S S S

n

M a a a

n

M a a a

n

M a a a

m m m mn

Demand D D D

n

Assume that x number of markers M need to b e cut to fulll the order Then the cut

i i

planning problem can b e formulated as an integer programming problem

maximize x e

i i

st

m

X

a x D

ij i j

i

for j n

x are integers

i

The marker M is actually made by a human marker maker if x The integer program

i i

is usually solved by a greedy algorithm that limits the number of markers need to the made

The problem with the current approach is that the real eciency of marker M cannot

i

b e taken into account when solving the integer program b ecause the marker has not b een

generated yet The real eciency might dier signicantly from historical data Thus cut

planning pro cess may not nd the real optimal solution On the other hand it is often to o

exp ensive and takes to lone time to have humans generate all the markers b eforehand

With a database driven marker making system that is able to generate high quality

markers in real time we can aord to generate all the markers and obtain the real eciency

data b efore we solve the cut planning problem That will enable us to have a more accurate

prediction of the materials needed This capability should reduce the inventory problem

when ordering more than what is needed and avoid missed shipments b ecause of insucient

materials for manufacturing

Figure Marker generated by matching and substitution

Figure Marker after elimination of overlaps and leftward compaction Length

in eciency

Figure Marker after adjustment on small p olygons Length in eciency

Figure The corresp onding marker generated by a human Length eciency

Chapter

Compaction with Small Rotations

In this chapter we extend our p ositionbased mo del to allow p olygons to rotate by a

small amount during compaction As discussed in Chapter allowing the p olygons to

rotate several degrees ie tilting can result in increased eciency for a layout

We present two dierent metho ds for compaction with small rotations in this chapter

The rst metho d is based on relaxation of a p olygon nding the p osition and the tilt of

the p olygon that gives it the most freedom to move in various directions In the second

metho d we consider the nonlinear optimization mo del for the entire set of p olygons in

volving b oth translations and rotations Instead of solving this mo del directly we solve

a linearized version Translationonly separation then eliminates small overlaps resulting

from the linearization

Rotational Compaction by Relaxation

Translational Relaxation of a Single Polygon

In this section we fo cus on planning the translation of a single p olygon Q in an envi

ronment consisting of k static p olygonal obstacles P P P that surround Q The

k

 

purp ose of the motion planning is to nd a p oint q and a maximal value l such that the



center of Q can b e placed at any p oint within a square centered at q and has size l l

without colliding with the surrounding obstacles

 

In other words once Qs center is placed at q q it will b e free from collision when

x y

displaced by l l for parameters and whose values are in the range What



this means for a b oundary p oint u of Q when Q is placed at q is that if we place the center

of a l l square at u then the square can not contain any p oints from the obstacles If

we move the center of the l l square along the b oundary of Q the square generates a

band of obstaclefree region ab out the b oundary of Q We refer to this band as the slack

region of Q Hence another way to lo ok at the relaxation of Q is that if we place the center

 

of Q at q q then Q has the largest area slack region

x y

We call the ab ove mentioned motion planning problem the relaxation problem for Q We

show next that by applying the p ositionbased optimization mo del describ ed in Chapter

we can nd a lo cally optimal solution to the relaxation problem

Recall that using the conguration space approach we can convert the obstacles P

i

i k into enlarged obstacles P Q i k and reduce the problem of

i

planning the motion for Q to the problem of planning the motion for a single p oint q which

represents the center of Q in the presence of the enlarged obstacles The free space F for

Q

the motion planning of Q is the complement of the union of these enlarged obstacles

P Q P Q P Q F

k Q

Let us denote the square corresp onding to the range q l q l q l q l by R

x x y y

Clearly solving the relaxation problem for Q is equivalent to nding largest sized square R

contained in F Using De Morgens law we can express F alternatively as

Q Q

P Q P Q P Q F

k Q

Hence nding the largest R in F is equivalent to nding the largest R that b elongs to all

Q

of the enlarged obstacles P Q i k simultaneously

i

Let us represent R by its four corners q l q l q l q l q l q l and

x y x y x y

q l q l Since R has to b e contained in P Q for i k its four corners

x y i

P Q We use the same lo cality heuristic describ ed the last must also b e contained in

i

P Q that contains c the current chapter to construct a large convex subset C of

i Q i

p osition of the center of Q The lo cality heuristic is applicable here since in tightly packed

layouts such as in marker making applications the freedom of Q to move around is very



limited This implies that R is usually very small and that q must b e close c Hence for

Q

the purp ose of nding the largest R the convex subset C obtained by the lo cality heuristic

i

P Q gives a go o d approximation of

i

1

More precisely it is equivalent to nding the largest sized square in the connected comp onent of F

Q

which contains the current p osition of Q

It follows from the convexity of C that if C contains all four corners of a square then C

i i i

contains the entire rectangle Thus to ensure that C contains R it is sucient to constrain

i

the four corners of R to remain in C

i

We use the same metho d as describ ed in Section to derive a set of linear constraints

for each of the four corners of R Consider the upp er right corner q l q l as an

x y

example The linear constraint generated for this p oint with resp ect to an edge AB of C is

i

the following

B A q B A q B A B A l A B A B

y y x x x y y y x x x y y x

which is a linear constraint on q q and l The constraints for other three corners with

x y

resp ect to edge AB are built similarly

P Q Next for each obstacle P i k we calculate the convex set C from

i i

using the lo cality heuristic and built a set of linear constraints for the corners of R with C

i

Let S b e the collection of such linear constraints We set up the following linear program

of three variables q q and l

x y

maximize l

sub ject to S

  

The solution q q l of the linear program gives a lo cally optimal solution for the relax

x y

  

ation of Q That is if the center of Q is placed at q q then Q can move l in

x y

various directions where jj j j without colliding into the surrounding p olygons

Figure shows an example of the relaxation for piece

Rotational Compaction of a Single Polygon

From the previous section we see that the larger the size of R the larger the slack

region of Q Conceivably the size of R calculated for Q with dierent tilts can b e dierent

The idea b ehind rotational compaction using relaxation is the following By sequentially

placing each of the p olygons in a p osition and prop er tilt such that it has the largest slack

region we transform the layout into a lo oser conguration Hence we can subsequently

apply our translational compaction algorithm to tighten the lo osened layout

Our rst task is to nd the tilt of Q that yields the largest R That is when Q is

tilted by R as calculated by the algorithm in the previous section has the largest size

We will call this rotational relaxation of Q 4 10 6

11 8 7 12

9 2 1

0 3 5

4 10 6

11 8 7 12

9 2 1

0 3 5

Figure An example of translational relaxation for p olygon

Let the range of tilt allowed for Q b e Ideally we would like to calculate the size

of R for every angle within the tilt range and choose the largest one However that would

require a complicated nonlinear algorithm which would b e dicult to make numerically

stable Therefore we only take K equallyspaced discrete values within the range and

calculate R for Q tilted by the rotation corresp onding to a discrete value We then set to

the angle that yields the largest R

An example of rotational relaxation is depicted in Figure Piece has the p osition

and the tilt that allow it to have the largest slack region

Algorithm for Rotational Compaction Using Relaxation

The complete algorithm for rotational compaction using relaxation metho d is as follows

Step Do a rotational relaxation for each p olygon in the layout

Step Do a translational compaction

Step Iterate Step and until no progress can b e made

For Step we can sp ecify the same ob jective function used in the various compaction

functions describ ed in Chapter The relaxation of Step helps to lo osen the layout

and hence the translational compaction done in Step usually achieves b etter results than

without the relaxation

Figure through Figure present an example of rotational compaction using relax

ation on a human generated marker Figure shows the original marker and the result

of rotational compaction using relaxation Figure compares the results of applying left

ward translational compaction alone on the marker and applying rotational compaction

using relaxation

The b est result we have achieved is improvement in eciency on a human gener

ated pro duction marker versus improvement with translational compaction alone

Rotational Compaction Using Linearization

The second metho d we present here for devising a practically ecient rotational com

paction algorithm is linearization As we have mentioned the b oundary of the conguration

space of two p olygons that are allowed to simultaneously translate and rotate is a nonlin

ear algebraic surface To express the relation of a p oint to the nonlinear surface by linear 4 10 6

11 8 7 12

9 2 1

0 3 5

(a)

4 10 6

11 8 7 12

9 2 1

0 3 5

(b)

Figure An example of rotational relaxation for p olygon Name: 1311−5as Width: 61.00 in Length: 81.83 in Pieces: 23 Efficiency: 80.85%

1617 22 15 14 8 21

12 2 5

20 6 19 13

0 18 3

11 1

4 10 7 9

Name: 1311−5as−rl Width: 61.00 in Length: 80.25 in Pieces: 23 Efficiency: 82.44%

16 22 17 15 14 8 21 12 2

5

20 19 6 13 0 18

3

11

1

4 10 7

9

Figure An example of rotational compaction using relaxation a human generated

marker and the result rotational compaction using relaxation Name: 1311−5as−cl Width: 61.00 in Length: 81.62 in Pieces: 23 Efficiency: 81.06%

1617 15 14 22 8 21 12 2

5

20 19 13 6 0 18

3

11 1

4 10 7 9

Name: 1311−5as−rl Width: 61.00 in Length: 80.25 in Pieces: 23 Efficiency: 82.44%

16 22 17 15 14 8 21 12 2

5

20 19 6 13 0 18

3

11

1

4 10 7

9

Figure An example of rotational compaction using relaxation continued the com

parison with translational only compaction on the same marker

constraints we cut a thin slice from the surface and try to t it with a set of hyperplanes

by linearization

Let us consider an edge UV of the Minkowski sum P Q for p olygons P and Q

where Q is a copy of Q rotated by degrees Recall from Chapter that every edge

of a Minkowski sum is formed by a vertexedge supp orting pair Let UV b e formed by a

supp orting pair consisting of vertex A of P and edge BC of Q

Assume P is rotated around its lo cal origin by and Q by where and are

measured relative to the current tilts of the p olygons Let j j and j j for a constant

0

Assume that is small enough such that the corresp onding vertex A of the rotated P

0 0

together with the edge B C of the rotated Q are still an edgevertex supp orting pair

0 0

which forms the corresp onding edge U V of the Minkowski sum of the rotated p olygons

Let the co ordinates of A B and C in their resp ective lo cal co ordinate system b e A A

x y

B B and C C The new lo cal co ordinates of these three vertices after rotation are

x y x y

0

A A cos A sin

x y

x

0

A A sin A cos

x y

y

0

B cos B sin B

x y

x

0

B B sin B cos

x y

y

0

C C cos C sin

x y

x

0

C C sin C cos

x y

y

0 0

The edge U V on the Minkowski sum of the rotated p olygons has the following co ordi

0 0

nates U V is ordered counterclockwise

0 0 0

U A B

x x x

A cos A sin B cos B sin

x y x y

0 0 0

U A B

y y y

A sin A cos B sin B cos

x y x y

0 0 0

V A C

x x x

A cos A sin C cos C sin

x y x y

0 0 0

V A C

y y y

A sin A cos C sin C cos

x y x y

In this section we will use p and q to denote the relative displacements of P and Q with

resp ective to their current p osition c and c Note that we change the usual meaning of

P Q

p and q here for notational simplicity The new global p ositions for P and Q are therefore

p c and q c resp ectively We now derive the nonoverlapping constraint for p oint

P Q

0 0

F q c p c with resp ect to edge U V Let us denote c c by G Using the

Q P Q P

same metho d as in Section we start the derivation with

0 0 0

U F U V

This expands to

0 0 0

F U V U

and further to

0 0 0 0 0 0

F F V U R U V U

x x

y y y y x x

Substituting variables yields

G q p A cos A sin B cos B sin

x x x x y x y

C sin C cos B sin B cos

x y x y

G q p A sin A cos B sin B cos

y y y x y x y

C cos C sin B cos B sin

x y x y

This further expands to

B cos C cos B sin C sin q

y y x x x

B cos C cos B sin C sin p

y y x x x

B cos C cos B sin C sin q

x x y y y

B cos C cos B sin C sin p

x x y y y

B G cos C G cos B G cos C G cos

y x y x x y x y

A B cos cos A B cos cos A C cos cos

y x x y y x

A C cos cos B C cos B C cos

x y y x x y

A B cos sin A B cos sin A C cos sin

x x y y x x

A C cos sin B G sin C G sin B G sin

y y x x x x y y

C G sin A B cos sin A B cos sin

y y x x y y

A C cos sin A C cos sin A B sin sin

x x y y y x

A B sin sin A C sin sin A C sin sin

x y y x x y

B C sin B C sin

y x x y

which simplies to

B cos C cos B sin C sin q

y y x x x

B cos C cos B sin C sin p

y y x x x

B cos C cos B sin C sin q

x x y y y

B cos C cos B sin C sin p

x x y y y

B G C G B G C G cos

y x y x x y x y

B G C G B G C G sin

x x x x y y y y

A B A B A C A C cos

x y y x x y y x

A B A B A C A C sin

x x y y x x y y

B C B C

y x x y

Formulation for Translation Only Compaction

As a way of verifying our derivation of the nonp enetration constraint we show that

nonp enetration constraint for translational compaction is a sp ecial case Let us set the

relative rotation angles and all to zero We have

B C q

y y x

B C p

y y x

B C q

x x y

B C p

x x y

B G C G B G C G

y x y x x y x y

A B A B A C A C

x y y x x y y x

B C B C

y x x y

which is exactly the translationonly constraint we derived in Section

Other VertexEdge Supp orting Pair

If the vertexedge supp orting pair that forms UV came is comp osed of a vertex A from

p olygon Q and an edge BC from p olygon P then the formulation is slightly dierent

Let the tilts for p olygon P and P b e denoted as ab ove by and Rep eating the same

0 0

derivation ab ove we obtain the nonp enetration constraint for F against U V

B cos C cos B sin C sin q

y y x x x

B cos C cos B sin C sin p

y y x x x

B cos C cos B sin C sin q

x x y y y

B cos C cos B sin C sin p

x x y y y

B G C G B G C G cos

y x y x x y x y

B G C G B G C G sin

x x x x y y y y

A B A B A C A C cos

x y y x x y y x

A B A B A C A C sin

x x y y x x y y

B C B C

y x x y

Linearization

To linearize and we use the dominant terms in the Taylor expansion of sin x and

cos x for small x

sin x x O x

cos x x O x

We substitute these approximations of sin x and cos x into the inequalities Then we

eliminate the quadratic and higher degree terms and obtain the linearized form of the

inequalities The linearized form for is

B C q

y y x

B C p

y y x

B C q

x x y

B C p

x x y

B G C G B G C G

y x y x x y x y

B G C G B G C G

x x x x y y y y

A B A B A C A C

x y y x x y y x

A B A B A C A C

x x y y x x y y

B C B C

y x x y

and for

B C q

y y x

B C p

y y x

B C q

x x y

B C p

x x y

B G C G B G C G

y x y x x y x y

B G C G B G C G

x x x x y y y y

A B A B A C A C

x y y x x y y x

A B A B A C A C

x x y y x x y y

B C B C

y x x y

The Algorithm

The algorithm pro ceeds similar as the algorithm in Section We rst generate the

pairs of adjacent p olygons using a sweepline algorithm For each adjacent pair of p olygons

P and Q we compute the Minkowski P Q and identify a convex subset C in P Q

using the lo cality heuristic For each edge of P Q that is included in C we identify

the vertexedge supp orting pairs that formed this edge The nonoverlapping constraints

are generated using these vertexedge supp orting pairs according to the formulation in

Section The algorithm then solves the resulting linear program

What is left to sp ecify are the b ounds on the rotation angles For each p olygon we

allow its tilt to change continuously within a small range To limit the approximation error

we choose the range to b e degrees This range must b e contained in the

tilt limits Hence the nal range we use is

It is conceivable that due to the approximation of sin x and cos x overlap among the

pieces may o ccur after each linearized rotational compaction However the overlaps are

2

An edge in the Minkowski sum can b e formed by more than one vertexedge supp orting pairs

very small and we can eectively eliminate them using the algorithm in Chapter We

run a overlap resolution b etween every two linearized rotational compaction steps to avoid

accumulation of error The complete algorithm is therefore to iterate a linearized rotational

compaction step and an overlap resolution step until no further improvement to the eciency

can b e made

Examples

Figure illustrates one iteration of linearized rotational compaction on a simple layout

with only two p olygons The gure on the top shows the initial layout The gure in the

middle depicts the p osition of the p olygons immediately after linearization One overlap

which o ccurs b etween the two p olygons is magnied in the large circle The b ottom gure

shows the result after the elimination of the overlaps in the middle gure Figure shows

the nal result of rotational compaction on the layout in Figure after several iterations

which bring the tilts of p olygons to their limits

Figure shows the result of rotational compaction using linearization on a human gen

erated marker Figure compares the results of rotational compaction using linearization

with translational only compaction

Comparison of the Two Rotational Compaction Meth

o ds

One would exp ect the linearization metho d to p erform b etter than the relaxation metho d

ie reach a lower energy status for the same layout using the same ob jective function

based on the following two reasons First in the relaxation metho d the rotation angle of

a p olygon can only b e taken from several discrete values equally spaced within a range

In the linearization metho d however the rotation angle of the p olygon can change con

tinuously within the same range through successive linearized compaction steps Hence

the linearization metho d can reach the same set of p ositionrotation values that results in

a lo cal minimum for the relaxation metho d Second a layout can b e lo cked if only a

onepieceatatime motion is p ermitted as in the relaxation metho d However the same

layout may not b e lo cked if simultaneous motion of all the p olygons is p ermitted

In practice however the linearization metho d do es not outp erform the relaxation metho d

on every marker There exist markers that give b etter compaction result using the relax Width: 19.00 in Length: 20.00 in

Width: 19.00 in Length: 19.64 in

Width: 19.00 in

Length: 19.72 in

Figure A single iteration of rotational compaction using linearization Width: 19.00 in Length: 20.00 in Pieces: 2 Efficiency: 42.50%

Width: 19.00 in (a) Length: 18.12 in Pieces: 2 Efficiency: 46.91%

(b)

Figure The nal result of rotational compaction using linearization after successive

iterations Name: 24412−7 Width: 59.00 in Length: 101.74 in Pieces: 22 Efficiency: 74.22%

16 10 19 9 20

1 21

13 4 14

18 15 0 3 11

8 6 2 7

12 5 17

Name: 24412−7−rot Width: 59.00 in Length: 98.42 in Pieces: 22 Efficiency: 76.72%

16 10 19 9 20 1 21

4 13 14 18 15 11 0 3

8

7 2 6 12

5

17

Figure An example of rotational compaction using linearization a human generated

marker and the result of rotational compaction using linearization Name: 24412−7−cl Width: 59.00 in Length: 101.35 in Pieces: 22 Efficiency: 74.51%

16 10 19 9 20

1 21

13 4 14

18 15 0 11 3

8

7 2 6 12

5 17

Name: 24412−7−rot Width: 59.00 in Length: 98.42 in Pieces: 22 Efficiency: 76.72%

16 10 19 9 20 1 21

4 13 14 18 15 11 0 3

8

7 2 6 12

5

17

Figure An example of rotational compaction using linearization continued the com

parison with translational only compaction on the same marker

ation metho d This fact illustrates that lo cked markers for rotational compaction are very

rare so relaxation works most of the time It also illustrates that the relaxation metho d

can jump to more global optimum b ecause it considers the entire valid tilt interval whereas

the linearization metho d falls to the nearest optimum

On the unlo cked markers the linearization metho d runs much faster than the re

laxation metho d This is b ecause the relaxation metho d takes a relaxation step for every

p olygon and each relaxation step involves several iterations of setting up and solving a linear

program On the other hand the linearization metho d is much slower than translationonly

compaction since the small interval required by linearization makes many more iterations of

linearized rotational compaction in order to converge to a lo cal optimum Our exp eriments

shows that linearization metho d usually is ab out four times slower than translationonly

compaction

Chapter

Floating

In this chapter we present another extension to the p ositionbased optimization mo del

of Chapter The extended mo del solves the oating problem the problem of distributing

free space in a layout evenly among the p olygons Another way to describ e oating is that

it tries to increase distances b etween neighboring p olygons as a electric eld do es to a set of

mutually repulsive charged ob jects in a container Figure shows an example of oating

The motivation for oating is that in the cutting pro cess the cutting to ol needs a certain

amount of clearance in order to avoid cutting into adjacent p olygons One way of creating

the clearance is to add buering area along the b oundary of a p olygon However adding

buering area decreases the eciency of the layout In marker making the primary goal is

always to get maximal eciency Separating pieces that are touching is a secondary goal In

achieving this secondary goal it is never allowed to decrease the eciency Hence adding

buering is not viable alternative In this chapter we show that by using oating however

one is able to utilize the existing free spaces inside the layout to create the buering areas

In this chapter we will rst dene the distance b etween p olygons Then we will intro

duce a set of variables that represent the distance b etween p olygons to the p ositionbased

optimization mo del We then present several oating formulations each oers a dierent

way of distributing the free space Lastly we discuss the application of the extension to

overlap resolution in a overlapped layout We show that with the added capability of con

trolling the distance b etween p olygons we can partially eliminate overlaps when it is not

p ossible to completely resolve them

Figure An example of oating

Distance Between Polygons

We b egin by giving a formal denition of the distance b etween two p olygons This

notation is a generalization of the depth of overlap concept introduced in Chapter

We shall see that depth of overlap corresp onds to the negative distance b etween the two

p olygons We rst dene the distance b etween p olygons using the p olygons themselves

Then we illustrate how it is reected in the Minkowski sum of two p olygons

Before we give the denition we review briey the incidence relation b etween two p oly

gons We say that p olygon P overlaps p olygon Q if there exist some p oints of P that

are contained in the interior of Q recipro cally there must also exist some p oints of Q

that are in the interior of P Otherwise P and Q are nonoverlapping When P and Q

are nonoverlapping they can still b e in contact that is P and Q are incident on their

b oundaries

Again we use P c to denote a p olygon P whose center is placed at c

P P

Denition Given p olygons P c and Qc let v b e the minimum length vector such

P Q

that Qc v is in contact with P The distance b etween P c and Qc denoted by

Q P Q

D P c Qc is dened as follows

P Q

If P c and Qc do not overlap then

P Q

D P c Qc kv k

P Q

If P c and Qc overlap then

P Q

D P c Qc kv k

P Q

where kv k is the length of v

From the denition we immediately have the following facts

Fact D P c Qc D Qc P c

P Q Q P

Fact D P c Qc if and only if P c and Qc are in contact

P Q P Q

Next we try to obtain characterization of D P c Qc from the Minkowski sum

P Q

P Q For notational simplicity let us denote P Q by M Let c c M b e

Q P

the minimal distance b etween c c and M the b oundary p oints of M That is

Q P

c c M min fkc c r k j r M g

Q P Q P

Dene P c Qc as

P Q

P c Qc c c M

P Q Q P

if c c is not contained in M Otherwise

Q P

P c Qc c c M

P Q Q P

Claim D P c Qc P c Qc

P Q P Q

Pro of Without loss of generality we only prove for the case where P c and Qc

P Q

do not overlap The pro of for the case where they overlap is similar only the signs of

P c Qc and D P c Qc are changed

P Q P Q

Let b b e the b oundary p oint of M that is closest to c c Let w b e the vector

Q P

connecting c c to b Translating c c by w brings c c to b By Corollary

Q P Q P Q P

that means that Qc w is in contact with P c Since by denition D P c Qc

Q P P Q

is the minimum distance needed to bring Qc into contact with P c we must have

Q P

D P c Qc kw k P c Qc

P Q P Q

On the other hand supp ose Qc is translated by a distance of D P c Qc to a

Q P Q

0 0

p osition Qc to b e contact with P c Again by Corollary c must b e on the

P

Q Q

0

b oundary of M Thus the distance b etween c and c which is D P c Qc must

Q P Q

Q

b e less than or equal to P c Qc by denition Hence we must have

P Q

D P c Qc P c Qc

P Q P Q

2

In the rest of this chapter we use D P c Qc and P c Qc interchangeably

P Q P Q

to denote the distance b etween P c and Qc

P Q

Controlling the Distance Between Polygons

Let p and q denote the new p ositions of P and Q In Chapter we showed that by nding

P Q and constraining q p to lie in C we can guarantee a large convex subset C in

that there is no overlap b etween P p and Qq or equivalently D P p Qq In this

section we show that by transforming C into other convex sets and building similar linear

constraints on the transformed sets we are able to force the distance D P p Qq to b e

at least d where d can b e either a constant or a variable

Let C b e the convex subset identied by the lo cality heuristic of Chapter Let A A

i i

i k b e the list of edges of P Q output by the lo cality heuristic By our

convention A A is ordered counterclockwise That is when walking from A to A

i i i i

the interior of P Q is on the lefthand side of A A and the outward normal of

i i

A A p oints to the righthand side of A A

i i i i

Asso ciate each edge A A with a line LA A that contains A A Let halfplane

i i i i i i

H A A b e delimited by LA A and contain the outward normal of A A Then C

i i i i i i

is the intersection of H A A for i I and is b ounded by LA A

i i i i

Let LA A d b e obtained by translating the line LA A by a distance d along

i i i i

the outward normal of A A and H A A d b e the corresp onding halfplane obtained

i i i i

by translating H A A the same amount It is clear that LA A d is to the right of

i i i i

A A for d and to the left of A A for d

i i i i

We now construct a new convex set C d by taking the intersection of H A A d

i i

for i I It follows immediately that C d is delimited by the lines LA A d

i i

i I

Clearly if d then C d is completely contained in C see Figure In this case the

distance of a p oint in C d to the b oundary of C is at least d Since the p oints of P Q

are either on or outside C which means the distance of a p oint in C d to P Q is at

least d b ecause each p oint is at least d distant from each line containing an edge of the

convex p olygon Hence we have

Lemma Let d If q p C d then D P p Qq d

Linear Constraints for Floating

Let LA A d b e a b ounding line of C d with asso ciated halfplane H A A d

i i i i

We now consider the linear constraint for q p H A A d Again let us denote q p

i i

by R From App endix A we know that the cross pro duct A R A A equals twice the

i i i

signed area of the triangle RA A The signed area is p ositive when R A and A are

i i i i

ordered counterclockwise or equivalently when R H A A On the other hand the

i i

hkA A k where h is the signed distance from R to LA A area of RA A equals

i i i i i i

We have

A R A A

i i i

h

kA A k

i i

Hence R H A A d can b e expressed as

i i

A R A A

i i i

d

kA A k

i i

Since A R A A is a linear constraint on R the inequality is a linear constraint in

i i i

the variables p q and d It is imp ortant that d is a variable in the linear constraint It

enables us to have exible control over the distance b etween p olygons

Maximize the Minimum Distance Between Polygons

With the linear constraint built in the previous section we immediately have an

algorithm for maximizing the minimum distance b etween the p olygons We obtain this

algorithm by mo difying the p ositionbased optimization mo del see Chapter

In the mo died mo del we replace the original linear constraints with the linear con

straints of the form The ob jective function is simply to maximize d If we assume that

there is no overlap in the layout then the current p ositions of the p olygons and the value

d always form a feasible solution of the mo del If the mo del has an optimal solution



d then by Lemma the distance b etween a pair of neighboring p olygons is at least



d when the p olygons are placed at their new p ositions

Separating Polygons by a Sp ecic Distance

Here by separating p olygons by a distance d we mean to nd a set of new p osition

of the p olygons in a layout in which the distance b etween every pair of p olygons is at least

d If we are only interested in detecting whether the p olygons in a layout can b e separated

by a sp ecic distance d we can add a constraint d d to the mo del in the previous section

and use a constant ob jective function With the constant ob jective function the linear

program solver will return a set of feasible solutions immediately after it nds one That is

the linear program solver will stop once it reaches the b oundary or the interior the feasible

region without marching to the optimal p oint Hence it is faster to solve

Moreover we can combine the ab ove formulation with the one in Section to achieve

the result of separating the p olygons by a distance of d while minimizing the total transla

tions of the p olygons To do so we replace the constant ob jective function in the previous

paragraph with the following ob jective function

n

X

jq j minimize

i

i

We use the same technique as in Section to eliminate the absolute values

Maximizing the Overall Distance b etween Polygons

If the mo del in Section do es not have a nonzero optimal solution it is a go o d in

dication that there is a critical set in the layout We say a list of p olygons P P P

l

forms a critical set in a layout if P is in contact with P and P il and it

i i i

is imp ossible to make the distance b etween P and P i l greater than zero

i i

without increasing the length of the layout

For layouts with critical sets although the p olygons that are included in some critical

set can not b e moved there can still b e some free areas that can b e distributed among

the p olygon not in the critical sets Hence we need a formulation that achieves partial

results To do so we revise the mo del in Section by assigning a separate variable d for

j

the j th pair of neighboring p olygons for j J where J is the number of neighboring

p olygons found by the sweepline algorithm We call these variables distance variables and

they are sub ject to the b ounds d j J When building the constraints for the

j

j th pair we replace the d in inequality by d The ob jective function is to maximize

j

the overall distance b etween neighboring pairs of p olygons

J

X

d maximize

j

j

With the ab ove formulation the distance variables corresp onding to the pairs of neigh

b oring p olygons that are in some critical set will b e zero in the optimal solution However

other distance variables can now have nonzero values and hence those p olygons will b e

separated by various distances

Uniform Distribution of Free Areas

We see that the formulations in Section and Section each have their own ad

vantages and drawbacks For the formulation in Section free space in the layout are

distributed among p olygons uniformly in the sense that every pair of adjacent p olygon is

 

separate by at least a distance d for an optimal solution d But it may fail to increase

the distance among p olygons if there exist critical sets in the layout The formulation in

Section on the other hand is usually able to nd the optimal solution which has non

zero value for some of the distance variables However since the ob jective function is to

maximize the sum of all the distance variables it may increase the distance b etween some

pairs of p olygons at the exp ense of decreasing the distance b etween some other pairs of

p olygons or keep those distances very small This b ehavior may not b e desirable for certain

applications

In this section we nd a compromise b etween the two formulations We adopt the linear

constraints from Section and achieve our goal by mo difying the ob jective function

Let us create a new variable m to represent the mean of all the distance variables

J

X

d m

j

J

j

Our rst goal is the same as the one in the formulation of Section which is to maximize

the overall distances b etween the neighboring p olygons Hence we would include

maximize J m

or equivalently

minimize J m

in our new ob jective function

Our second goal is to distribute the free spaces as uniformly among the p olygons as

p ossible That is we want to minimize the deviation b etween a distance variable and m

We express this goal using the following ob jective

minimize jd mj jd mj jd mj

c

Combining the two goals together we obtain our new ob jective function

J

X

minimize J m jd mj

j

j

1

Note that our ability to express and combine our ob jectives is limited by the linear program mo del

which only allows a single linear ob jective function Hence we have to express each of our individ ual goal

as a linear function and combine them using a linear combination The single ob jective function we have

devised do es not necessarily accomplish the multiple ob jectives exactly the ways we intended it to However

we can inuence the b ehavior of the mo del by assigning prop er weights in the linear combination

We now use the same technique as in Section to eliminate the absolute value in the

ob jective function We rst introduce J new variables l and l for j J Next

i i

we replace the term jd mj in the ob jective function by l l and add the following

j

i i

constraints

l l d m

i

i i

and b ounds

l

i

l

i

into the linear program

Remark We can have an alternative technique to eliminate the absolute value in the

ob jective function In this technique we introduce J new variables l for j J and

j

replace jd mj in the ob jective function by l Then we add the following constraints

j j

d m l

j j

d m l

j j

and b ounds

l

j

to the linear program

The dierence with the previous technique is that we introduce J fewer variables but

J more constraints Empirical studies show that the simplex metho d for solving a linear

program runs approximately in time linear in max m n where m is the number of vari

ables and n the number of constraints Since we usually have many more constraints than

variables we do not exp ect signicant dierence in the p erformance of the two techniques

Maximize the Minimum Distance Between Polygons

An Alternative Metho d

The formulations in previous sections try to achieve their goals in a single step by de

signing a suitable ob jective function The linear ob jective function itself oers limited

exibility Sometime when the goal cannot b e achieved by sp ecifying a single ob jective

function we may try to set up linear program with dierent ob jective functions as subrou

tines and use an algorithm to control these subroutines For example when there exists

critical sets in a layout the formulation in Section fails to increase the distance b etween



any pairs of p olygons b ecause d is zero

We can actually solve the problem in two steps In the rst step we set up the ob jective

function to maximize the sum of d s Then we identify the p olygons in the critical sets by

i

checking whether the corresp onding distances in the solution are zeros In the second step

we can just maximize the minimum separation among the noncritical p olygons

Floating For Overlapped Layouts

Since the linear constraint we formulated in Section is an extension to the one in

Section all of the formulations presented in previous sections can b e applied to a

layout that contains overlaps In particular with d set to the formulation in Section

exactly the same as the original formulation for separation presented in Section

Moreover with the distance variables we have more exible control over elimination

of overlaps In contrast to the mo del in Section which fails to make any improvement

when it cannot eliminate all the overlaps in a layout we can now eliminate the overlaps

partially that is eliminate the overlaps for some of the overlapped pairs of p olygons but not

all of them We can also make improvements by reducing the negative distance b etween

two overlapped p olygons

However to make the formulations work well on layouts that contain overlaps we need

to make the following mo dication to the formulations The mo dication is to replace the

b ounds

d j J

j

in the previous linear program mo dels with

d d j J

j j

for some prop er constants d j J to b e sp ecied next

j

There are two conicting requirements for d j J First d should b e small

j j

in order to prevent d from having large negative value which means deep overlap b etween

j

the two p olygons in the j th pair However if d is to o small we might not b e able to nd

j

any feasible solutions Therefore we want d to b e big In particular for partial resolution

j

of overlaps it is imp ortant for the d to have big enough values such that the current

j

p ositions of the p olygons plus any value of d that satises d d for j J can

j j j

b e a feasible solution of the linear program mo del The reason is that we want to make

p ossible any innitesimal motion of p olygons that could result in an improvement in the

ob jective function If the current p ositions of the p olygons cannot form a feasible solution

those innitesimal movements may not b e p ossible

We now present a metho d for choosing the b ounds d j J that satisfy the

j

aforementioned requirements Let us assume that the j th pair of p olygons P c and Qc

P Q

P Q found by the lo cality are overlapping each other Let C b e the convex subset of

heuristic Since P c and Qc are overlapping the p oint c c is not contained in

P Q Q P

C Intuitively we want to expand C that is move the b ounding lines of C towards the

exterior of C in equal sp eed until one of the lines hits c c Let d b e the distance

Q P j

traveled by the b ounding lines see Figure More precisely we want to nd the convex

set C h for h such that c c is on the b oundary of C h and assign h to d Such

Q P j

an h can b e found by calculating the signed distance of c c to the b ounding lines of C

Q P

The distance of c c to a b ounding LA A of C is p ositive if c c is contained

Q P i i Q P

in the halfplane H A A otherwise it is negative Then h is chosen as the smallest

i i

negative value of the signed distances Clearly with h and d so chosen c and c

j P Q

satisfy the constraints built for P c and Qc Therefore if all d j J are chose

P Q j

this way the current p ositions of the p olygons form a feasible solution of the linear program

mo del

We next argue that the d j J chosen as describ ed ab ove is in some sense

j

the set of smallest p ossible values to guarantee that the current p ositions form a feasible

solution The reason is simply that if d is smaller than the h of the previous paragraph

j

then we need to move c c by a nonzero distance to satisfy the constraints built for

Q P

P c and Qc which corresp onds to C d But that motion may not b e p ossible Hence

P Q j

the current p ositions cannot form a feasible solution In this event the infeasibility imp osed

by a small d prevents p ossible improvements in the other part of the layout

j C(d) C

d

c − c Q P

O(0,0)

P (−Q)

Figure C d the convex set obtained by translating the b oundary lines of C by a

distance of d

C

C(d 0 )

d 0

c − c Q P

O(0,0)

P (−Q)

Figure The translated convex set for slightly overlapped p olygons

Chapter

Mixed Integer Programming

Mo del for Compaction and

TwoDimensional Packing

In this chapter we extend the linear programming formulation used in our p osition

based optimization mo del to a mixed integer programing MIP formulation The MIP

formulation oers a reduction of the twodimensional strip packing problem see Chapter

to the MIP problem Hence the optimal solution of a twodimensional strip packing

problem can b e found by solving a mixed integer program The reduction also serves as a

direct pro of that optimal D strip packing problem is in NP

The MIP formulation is then further extended to solve the multiple containment prob

lem the problem of nding a nonoverlapping placement of a set of nonconvex p olygons

in a nonconvex container In automated marker making applications this problem corre

sp onds to placing several trim pieces in a gap Using the MINTO optimization package we

have sometimes b een able to place up to nine p olygons in a gap in a few minutes

Limitation of the Lo cality Heuristic

In our p ositionbased compaction algorithm the lo cality heuristic is used to restrict the

P Q relative motion of p olygon Q with resp ect to p olygon P to a convex subset of

On the one hand such a restriction is essential in reducing the motion planning problem

1

Flips and discrete rotations can b e added to the MIP mo del but we have not attempted to implement

this

embo died in compaction to a more manageable linear programming problem On the other

hand it may exclude other solutions to a compaction problem that may result in a shorter

length A simple example is depicted in Figure Figure a shows the initial con

guration of a layout to b e compacted Figure b shows the result of applying our

p ositionbased compaction algorithm

Obviously for the layout in Figure a the b est result that can b e achieved by a

compaction algorithm is a layout of length l in which p olygon Q and p olygon P are stacked

vertically The actual result achieve by our p ositionbased compaction algorithm has length

l

In this example our p ositionbased compaction algorithm failed to nd the optimal

compaction result of length l b ecause the convex subset selected by the lo cality heuristic

prevents P and Q from moving to the relative p osition that yields the optimal solution The

starting edge selected by the lo cality heuristic is the edge b of P Q The convex subset

P Q built from b is actually the halfplane delimited by b and on the righthand C of

side of b The linear constraint built from C constrains Q to stay on the right of P Thus

the length l of the layout shown in Figure b is the b est length achievable given

the constraint

Clearly if the edge a of P Q see Figure c is selected as the starting edge for

P Q then C is the halfplane delimited by and ab ove building a convex subset C of

a The linear constraint built from C states that Q must lie on top of P Hence using

C instead of C to build the nonoverlapping constraints would enable our p ositionbased

compaction algorithm nd the optimal compaction of length l

An immediate idea to improve our p ositionbased compaction algorithm is therefore to

try several convex subsets of P Q for each pair of p olygons P and Q and choose the

ones that collectively yield the b est compaction result However the following theorem

shows that making such a choice is NPhard

Theorem Given a layout consisting of N polygons P P P Assume that for

N

each pair of polygons P and P i j N i j we can choose one from two dierent

i j

P P to build nonoverlapping constraints for P and P in our convex subsets of

i j i j

positionbased compaction algorithm Then nding a combination of the convex subsets

that achieves the optimal solution for compaction is NPhard

Pro of We again reduce the now familiar PARTITION problem to our problem The

reduction is shown in Figure For an instance fa a a g of PARTITION we

N c Q h Q 2h l c h P P

l (a)

c c P Q P Q

2 l − 1

(b)

c c Q P a Q

c P b P

P (−Q)

(c)

Figure a The initial layout b The compaction result using the p ositionbased

compaction algorithm c Illustration of the lo cality heuristic the dotted lines illustrates

the b oundary of the convex subset identied by the lo cality heuristic P PPP P P P 11 2 3 4 5 6 7

P

0

Figure Reduction of PARTITION to selecting the right combination of convex subsets

P P P P 11 3 6 7

PP P P

0 2 4 5

Figure Successful selection of the right combination of convex subsets solves PARTI

TION

build rectangles P of height and length a i N We then add two additional

i i

P

N

a Initially these p olygons rectangles P and P each of height and length B

i N

i

are placed in the conguration shown in Figure

For rectangles P and P i j the Minkowski sum P P is also a rectangle Let

i j i j

t b l and r represent the top b ottom left and right edges of P P resp ectively Let

i j

P P that are delimited by edge convex sets H H H and H b e the halfplanes in

i j t b l r

t b l and r resp ectively The nonoverlapping constraint built using H constrains P to

t j

stay ab ove P The other three cases can b e deduced similarly

i

The choices of convex sets for pairs of p olygons are as follows First for building non

overlapping constraints of P i n with P we oer two choices of convex subsets

i

the one that constrains P to stay on top of P and the one that constrains P to stay to

i i

the right of P Second for building nonoverlapping constraints b etween P i n

i

and P we oer the convex subset that constrains P to stay to the left P and the

n i n

one that constrains P to stay b elow P Third for building nonoverlapping constraints

i n

b etween P and P i j n i j we oer the convex subset that constrains P to

i j i

stay to the left P and the one that constrains P to stay b elow P

j i j

Figure shows the minimal length compaction of the layout in Figure It is clear

that PARTITION has a solution if and only if the layout in Figure has a length B

compaction 2

In the next section we will use a set of Bo olean variables each has value or to

represent each of the convex subsets to b e chosen The problem of choosing the combination

of convex subsets that yields the minimal length compaction is then reduced to a MIP

problem Theorem illustrates that using the full p ower of MIP is justied since the

problem is at least as hard as MIP that is NPhard in the worst case More imp ortantly

reducing the problem to MIP enables us to take the advantage of the p owerful techniques

developed recently for solving mixed integer programs esp ecially the techniques deployed

by the MINTO package Nem which we are currently using

Remark Note that in Figure a if the upp er right vertex of P and the lower left

vertex of Q are incident then the p oint c c is incident on the vertex at the upp er right

Q P

corner of P Q In this case we are forced to make an arbitrary choice b etween using

edge a or edge b to build a nonoverlapping constraint We can use the same idea as in the

pro of of Theorem to show that making a consistent choice that leads to minimal length

compaction for layouts that have vertexvertex incidences is NPhard

MIP Formulation for Optimal TwoDimensional Pack

ingCompaction

From the previous section we see that in the optimal solution of compaction the relative

P Q p osition of Q with resp ect to P do es not necessarily lie in the convex subset of

identied by the lo cality heuristic In that case our p ositionbased compaction algorithm

fails to nd the optimal solution since it restricts the relative motion of Q with resp ect to

P to stay in the convex subset found by the lo cality heuristic

Thus in order to nd the optimal solution of compaction we need to consider the whole

free space P Q for each pair of p olygons P and Q To this end we rst give the

following denitions

Denition Let S be a set and let c c c be subsets of S We call c c c a

k k

covering of S if

k

c S

i

i

We call c c c a convex covering of S if c c c is a covering of S and c

k k i

is a convex set for i k We call c c c a convex decomp osition of S if

k

c c c is a convex covering of S and c c for i k

k i j

We now extend our p ositionbased mo del to include multiple convex subsets that cover

the free space for the motion planning of a pair of p olygons Let C C C b e a convex

k

P Q for p olygons P and Q For each subset C we can induce a set of covering of

i

linear constraints on q p the new relative p osition of Q with resp ect to P based on the

b oundaries of C see Section Each of the linear constraint has the following form

i

q q p p

x y x y

where and are constants

Let us assign a Bo olean variable B to each of the convex subsets C i k These

i i

Bo olean variables satisfy

k

X

B

i

i

That is at any moment only one of the Bo olean variables can b e true If B is we say

i

that C is selected Otherwise C is not selected

i i

Assume is a linear constraint built from convex subset C We expand the linear

i

constraint to include the Bo olean variable B

i

q q p p B

x y x y i

where is a suciently large constant such that when B is constraint is satised

i

automatically

Thus among all the constraints built from the convex subsets only the constraints built

from the selected convex subset are eective in constraining q p All the other constraints

b ecome redundant By selecting a prop er convex subset we are able to place q p anywhere

P Q in the free space

We now p erform the ab ove steps for every pair of p olygons in a layout The result is an

extension of the p ositionbased compaction algorithm that is capable of nding the global

optimal of compaction The following is the mo died algorithm

A p ositionbased compaction algorithm using MIP formulation

Input force f for p olygon i i N f s are constants

i i

Assign a p ositional variable p for p olygon i i N

i

do

L the list of all pairs of p olygons

S S is the set of linear constraints generated so far

foreach pair of p olygons P Q in L do

Compute P Q

P Q Find a convex covering C C C of

k

Assign a Bo olean variable B for C i k

i i

S the MIP constraints generated from C i k according to

i

S S S

P

k

Add the constraint B

i

i

end

foreach p olygon P do

S the nonoverlapping constraints b etween P the b oundaries of the container

S S S

end

Set up a mixed integer program

P

N

maximize f p

i i

i

subject to S

Get the set of new p ositions p i N by solving the mixed integer program

i

Place p olygon i at p i N

i

P

N

f p stops increasing until the ob jective function

i i

i

It follows from the algorithm that the following theorem holds

Theorem A feasible solution to the MIP model built in the above algorithm gives a non

overlapping placement of the polygons in the container Conversely from a nonoverlapping

placement of the polygons we can obtain a feasible solution to the MIP model

The following theorem is the main result of this section

Theorem The positionbased compaction algorithm using MIP formulation solves the

twodimensional strip packing problem for nonconvex polygons

2

Assume the p olygons can not rotate or ip

Figure Length cannot b e shortened without exchanging the p ositions of the p olygons

Pro of As b efore we view the right b oundary of the container as the frontend of a

piston piece and assign a p ositional variable p to it The constraints of the p olygons

N

with the container ensure that every p olygon lies to the left of the piston piece The

ob jective function of the MIP mo del b ecomes

minimize p

N



Let l b e the length of the optimal solution of a twodimensional strip packing problem

Since the optimal solution of the twodimensional strip packing is also a nonoverlapping

placement of the p olygons from the previous theorem it has a corresp onding feasible so



lution of the MIP mo del Therefore p the optimal solution of the MIP mo del for a

N

 

layout is of equal or lesser length than l But p cannot b e smaller since it is already

N

 

optimal Therefore p equals l 2

N

We note here that in the solution of the MIP mo del two p olygons can exchange p ositions

attaining p ositions which might not b e p ossible given only continuous motion of the two

p olygons Therefore the optimal solution of the MIP mo del is foremost the optimal solution

of the twodimensional strip packing problem Whether it is also an optimal solution to

the compaction problem dep ends on whether there is continuous motion that translates

the p olygons from their initial p ositions to the p ositions given by the optimal solution of

the MIP If such a continuous motion do es not exist then the optimal solution to the

compaction may have longer length than the optimal solution to the strip packing As we

shall see in the next chapter nding the optimal solution to compaction is harder than

nding the optimal solution to strip packing

For example for the layout shown in Figure a the optimal solution for strip packing

is also a solution for compaction b ecause we can push p olygon Q all the way to the left

However for the layout shown in Figure exchanging the p osition of the two p olygons

Figure Example of nding optimal compaction using MIP formulation

which is the only way to improve the length of the layout can not b e achieve by continuous

co ordinated motion of the two p olygons

Figure shows an example of nding the optimal compaction using the p ositionbased

compaction with MIP formulation

Algorithms for Finding Convex Covering

We now sp ecify how to construct the convex subsets C i k which cover the free

i

space P Q The general problem of decomp osing of p olygon into minimal number of

convex p olygons has b een studied in computational geometry There exists a p olynomial

time algorithm to decomp ose a simple p olygon into minimal the number of convex p oly

gons Kei Note that a linear number of convex p olygons is sucient since triangulation

is a convex decomp osition

For simplicity we assume that P Q do es not have holes To apply the existing

algorithms we make a rectangle that contains P Q The rectangle is made suciently

large such that we will not encounter the need to place q p outside the rectangle during the

CompactionPacking algorithm We then take out P Q from the rectangle The result

P Q We can use a simple transformation is a p olygon with a hole that approximates

to convert the p olygon with a hole to a simple p olygon and then decomp ose the converted

simple p olygon If P Q has multiple holes the pro cess is similar

If P Q is starshap ed then we have a simple and more direct algorithm of nding

a convex covering of the whole free space P Q The algorithm pro ceeds as follows

Let us number the edges of P Q as e e e We start from edge e We use e

L

as a starting edge in the lo cality heuristic to nd a convex subset Once a convex subset is

found we output the subset and mark all the edges that app ear in subset Then we start

from the next unmarked edge and use it as the starting edge of the next convex subset We

stop when all the edges have b een marked In the worst case such an algorithm runs in

O n time as shown in Figure where n is the total number of edge in the p olygon

Theorem If P Q is starshaped then the above algorithm generates a covering

P Q for

Pro of Let U b e an arbitrary p oint in P Q Let O b e a kernel p oint of P Q

Since P Q is a simple Jordan curve and O is inside P Q and U is outside

P Q the edge segment UO either intersects the b oundary of P Q at one p oint

or contains an edge of the b oundary Let us only consider the rst case the second case is

similar Let I b e the single intersection p oint of UO with the b oundary of P Q see

Figure Then the edge segment UI is completely contained in the convex subset C

that contains I Assume otherwise that is C do es not totally contain UI Then there must

b e an b oundary edge of C that intersects UI at a p oint I Then I is not visible from the

kernel p oint since it is hidden by I This contradicts the fact that P Q is a starshap ed

p olygon 2

The p olynomial time decomp osition and covering algorithms establish that the reduction of

twodimensional strip packing to MIP via our p osition based algorithm can indeed b e done

in p olynomial time and the resulting MIP mo del has size p olynomial in the input size of the

strip packing problem Hence this provides another pro of that strip packing of nonconvex

p olygons is in NP Another pro of that strip packing of arbitrary shap ed p olygons is in NP

is given in MDL

MIP Formulation for Multiple Containment Problem

Given a p olygonal container Q and a set of p olygons P P P the multiple contain

k

ment problem asks for a nonoverlapping placement of P P P inside Q We again

k

try to nd a MIP formulation for this problem

To solve the multiple containment problem we must take into consideration two types

of nonoverlapping constraints The rst type is the nonoverlapping constraints b etween P

i U

I

O

Figure Correctness of the convex covering algorithm

O(n) edges O(n) edges

O(n) edges

Figure Quadratic running time of the convex covering algorithm

and P i j The constrains are built from the Minkowski sum P P The second

j i j

type is the nonoverlapping constraints b etween P and the p olygonal container Q These

i

constraints are built from the Minkowski dierences Q P The MIP formulation for

i

the rst type of nonoverlapping constraints has b een studied in the previous section In

this section we concentrate on the second type of nonoverlapping constraint

We apply the same basic idea as in the previous section That is since Q P is

i

generally nonconvex we decomp ose Q P into several convex subsets and use a set of

i

Bo olean variables to select one of them

k

Let C C C b e a convex decomp osition or covering of Q P We again assign

i

i

each of these convex subsets a Bo olean variable B The Bo olean variables are incorp orated

into the linear constraints built from the convex subsets using the same metho d as in the

i

linear constraint By selecting a prop er B i n p the new p osition of P can

i i

b e placed anywhere in Q P

i

The p ositionbased multiple containment algorithm is the same as the p ositionbased

compaction algorithm using MIP formulation in the previous section The mo dication we

need to make is to replace the simple linear constraints b etween P and the rectangular

i

container with the mixed integer constraints b etween P and a p olygonal container Q

i

Similar to Theorem we have

Theorem A feasible solution to the MIP model built in the positionbased multiple

containment algorithm gives a nonoverlapping placement of the polygons in the polygonal

container

Since in multiple containment problem all we interested in is a feasible solution we use

a dummy constant ob jective function to replace the energy function in our normal

formulation With the constant ob jective function the mixed integer program solver returns

immediately after it nds the rst feasible solution without evaluating further feasible

solutions We observed that the use of a constant ob jective function reduced the running

time signicantly

We have applied the multiple containment algorithm to trim placement Figure

shows an example of placing four p olygons in a gap In DLM the authors compared

the MIP based algorithm for multiple containment problem with the more purely geometric

algorithms

3

However since Q is a static ob ject here we have q and q

x y

Figure Example of trim placement using multiple containment algorithm

Chapter

The Complexity of the

Compaction Problem

Introduction

We dene the compaction problem as a co ordinated motion planning problem for a set

of ob jects such that the area of the b ounding convex hull or the b ounding rectangle is

minimized

Since we are only interested in establishing lower b ounds we concentrate on a sp ecial

case of compaction all the ob jects are conned to move within a b ounding rectangle whose

top left and b ottom sides are xed and whose right side can only move inward It is easy

to show that we can reduce this sp ecial case to the more general case of compaction by

introducing a prop erly shap ed sleeve piece and a piston piece Therefore the lower b ound

of the sp ecial case is also a lower b ound of the general case

The co ordinated motion planning problem for a collection of rectangles inside a xed

rectangular b ox the warehouseman problem has b een studied by Hop croft et al HSS

They obtained a wellknown PSPACEhardness result for the problem by a reduction from

the PSPACEhard symbol transp osition problem Spirakis and Yap SY studied the

co ordinated motion of a collection of discs in a p olygonal container and proved the strong

NPhardness of the problem Since the p ossibility of PSPACEP and NPP has not b een

ruled out the hardness results do not imply that it requires exp onential time to decide

the existence of a co ordinated motion plan even though the shortest plan might have an

exp onential number of moves Chazelle et al COSSW showed that a sp ecial case of 8k 2k

A 2x2 B 2x (4k − 1 ) 2x2k 2 CD 2x(2k+2) F 2x(2k−6) 3x2k 3x2 1x(2k +2) 8 E H G 3x(4k+4) 4x(2k−4) 3x2

k bricks 1 3x2 free space 3 rows of 1x fillers 2

each row contains 2k fillers.

Figure The reduction of warehouseman problem from the symbol transp osition prob

lem

motion planning requires exp onential number of moves But in their case only one ob ject

is allowed to move at a time There is no previously known explicit construction of a

co ordinated motion planning that requires an exp onential number of moves

This chapter is organized as follows In Section we establish the PSPACEhardness

of the compaction problem and we prove the existence of sets of rectangles which require an

exp onential number of moves to compact In Section we prove that if some simple non

rectangular ob jects are allowed one can explicitly construct warehouseman and compaction

problems which require a number of moves exp onential in the number of edges in the input

In the last section we show that if more complicated shap es are allowed even nding a

lo cally optimal solution to compaction might require an exp onential number of moves This

result establishes that the p ositionbased compaction algorithm presented in Chapter has

an exp onentialtime worst case

The PSPACEHardness of Compaction

Hop croft et al HSS proved the PSPACEhardness of the warehouseman problem by

an ingenious reduction from the PSPACEhard symbol transp osition problem to the ware

houseman problem Here we follow their approach and reduce the transp osition problem

to the compaction problem Our reduction is built on top of their construction with some

additional construction to force the warehouseman problem to reach the nal state when

compaction has a solution In the next section we review the reduction used in HSS

with emphasis on the facts that are related to our mo dication

Review of the Warehouseman Problem

The layout of rectangular ob jects in the reduction in HSS is shown in Figure

The b ounding rectangle has dimension k where k will b e sp ecied later we follow

the convention in HSS to represent dimension as height length The large blo cks A

through H are called sliders Their dimensions are shown in the gure The k space

b etween A and B is lled with blo cks called dominoes which play the role of symbols

in the symbol transp osition problem The blo cks in the lower left corner are called

blo cks b etween D E and F are called l lers There are some bricks The small

additional llers b etween B F and the right b oundary The free space to the left of

F is the only free space within the b ounding b ox

There are two meaningful motions allowed in this layout First C D E and the llers

to right of D E can move to the right to ll the empty space One brick b elow C can

move up and ll the space op ened by C G can subsequently move to the left and llers

can drop down to ll the space left by G Such a circular motion can continue until all the

bricks move up to the middle row or can b e reversed to move in the opp osite direction

Second during any step of the circular motion free space can b e op ened up b etween C and

D to allow a domino to drop down Then B can move to the left the llers to the right of

F can move up and F can move next to the right wall Eight llers to the right of D and

E can take the space to the left of F A new free space will b e op ened up to resume

the circular motion which can shift the domino b etween C and D to the left or right and

reinsert it back into the row of domino es This latter motion simulates the transp osition of

symbols

To simulate the transformation rules in the symbol transp osition problem each domino

is further partitioned into smaller rectangles as shown in Figure The partition of a

domino consists of a b ottom rectangle a thick vertical spine and a left and right set of

rectangles The spines all have the same dimension The rectangles in the left and right set

have decreasing heights when counted from b ottom to top The lengths of the rectangles

are varied slightly around a nominal length to form various dents and tabs which can

b e used to enforce symbol transformation rules that govern whether a pair of domino es can

b e neighbors

In addition there are ob jects called spacers b etween the domino es A spacer is much PLUG ε

SPINE

DOMINO

Figure The construction of a domino

longer than a domino so that it cannot b e dropp ed down into the free space op ened b etween

C and D during the sequence of motion A spacer can transmit the t b etween a pair of

domino es on its two sides The choices of the height of the rectangles in a domino together

with the existence of the spacers ensure that any pair of domino es cannot b e directly

adjacent to each other there must b e at least one spacer b etween them the rectangles of

a domino cannot b e rearranged within a domino and the rectangles cannot b e exchanged

b etween two domino es

The amount k unsp ecied at the b eginning can now b e determined as the total length

of all the symbols b etween blo ck A and B divided by

Based on this construction Hop croft et al proved that the symbol transp osition prob

lem has a solution if and only if the domino es in their initial conguration can reach a nal

conguration through a continuous co ordinated motion

PSPACEhardness Pro of

To reduce the symbol transp osition problem to the compaction problem we need to

mo dify the construction so that the domino es in their initial state which represents an

initial string in the transp osition problem can reach the nal state if and only if the sliding

wall in the compaction problem can move downward

Let b e the minimum height of the top rectangles in the left or right set of the domino es

and still make The height of the spine of a domino can b e shortened by as much as

the whole reduction work This follows from the fact that the top rectangles in the left or

right set of a domino have the smallest height among all the rectangles comprising a domino

Thus the tiny free space on top of a spine cannot aect the two signicant motions in the

warehouseman problem nor can it introduce new signicant motions 1 24 k small blocks of size 1 x 6k 3 1 6k 1 A’ 4x2k B’ 4x (4k −1 ) 4+ε 2

A 2x2k B 2x (4k − 1 ) 2 D 2x (2k+2) F C 3x2k 3x2 2x (2k−6) 1x (2k +2) 8 E H G 3x(4k+4) 4x (2k−4) 3x2

k bricks

Figure The reduction of compaction from the symbol transp osition problem through

the reduction of the warehouseman problem

Assume there are n dierent types of domino es We shorten the height of the spine of a

type i domino by in We introduce n types of plug blo cks whose length equals that of the

spine A type i plug blo ck has height in Thus when a type i plug is put immediately

on top of the spine of a domino the total height is units

Figure shows the additional constructions we need for the reduction Let R denote

the b ounding b ox of the original construction We will rst delete the top edge of R and

extend the two side edges upwards We arrange the plugs in such a way that a plug of type i

is put ab ove where a type i domino would b e in the nal conguration of the warehouseman

problem Between the plugs there are stuer blo cks of height and length equal to the

nominal length of the rectangles in a left or right set Once plugs and stuers are put into

place it is not p ossible for them to exchange p ositions Initially the top edges of the plugs

and stuers are aligned along a horizontal line which is ab ove the top edge of blo ck

A The maximum height of free space b etween the plug row and the domino row is at most

eg when a type plug is put on top of a type n domino which is less than half of

the smallest height among domino es rectangles Once again the existence of these tiny free

spaces will not change the two signicant motions inside R

In order to force the domino es to the desired nal state we must also take away the

free space inside rectangle R when the desired nal conguration is reached Otherwise we

can push D to the right by units and drop a type domino to the free space left b etween 1/n 2n - 2 n 1

4n+1 3n+1 n 2n

1/n

2n n 2n

Figure Construction and the initial state of a blo ck puzzle

C and D If that happ ens there can b e many p ossible arrangements for the rest of the

l lers to domino es such that the sliding wall can drop down by The additional

0

the right of B can serve the purp ose of lling up the free space We need an extra layer

of k small blo cks of size to ll the space left op en by the llers to the right of

k

0

ab ove the top edge of B If we put the sliding wall horizontally at the p osition

k

blo ck A then the sliding wall can drop down by if and only if the domino es are in

k

their nal conguration It is easy to see that this reduction like the reduction in HSS

takes p olynomial time Thus we have

Theorem Compaction is PSPACEhard even for a collection of rectangles

Compaction in an Exp onential Number of Moves

The PSPACEhardness of the symbol transp osition problem shows that it is p ossible to

simulate a binary counter by moving rectangular ob jects inside a rectangular container such

that reaching a goal state from an initial state requires an exp onential number of moves

But such a simulation may b e complicated to construct and to describ e Here we show that

if we relax the restriction that all the ob jects must b e rectangles we can have an example

which is small in size and easy to understand The example shows that even when the

compaction problem involves simple ob jects such as Ushap ed ob jects we still have to deal

with an exp onential number of moves

Our construction is shown in Figure We build a rectangular container of dimension

n n Two vertical bars of width and height n divide the space within

the container into three equal sized slots We call them slot and from left to right

The b ottom half of each slot is taken by some rectangular blo cks There is one n n

(a) (b)

Figure a The nal state b A deadend situation

blo ck in slot and two n n blo cks on each of slots and Due to the vertical bars

these rectangular blo cks cannot b e moved from one slot to another On the upp er half of

the third slot there are some Ushap ed ob jects U U U stacked together vertically

n

All of these ob jects have U is the smallest one The walls of these ob jects have width

n

n

ni

long height n The b ottom of wall of U is

i

n

The height of the vertical bars ensures that only one Ushap ed ob ject can pass through

the op enings on top of the bars Therefore at any particular move only the ob ject on top

of a stack can b e moved There is a n n blo ck initially at the b ottom of the left slot

This blo ck can slide b etween the b ottom of the slots and is called a slider

It is easy to see that the right wall of the container can b e moved to p osition n

if and only if all the Ushap ed ob jects are moved to the upp er half of the rst slot see

Figure a

It is easy to verify that to solve the compaction problem a problem harder than the

n disc problem has to b e solved Thus the total motion required is at

n

least which is exp onential in n

Theorem Coordinated motion planning requires a number of moves that is exponential

in the number of edges in the input

Pro of Omitted 2

1 n

Discs are restricted to move to neighboring p osts This is still solvable with O moves

Finding a Lo cal Minimum Requires an Exp onential Num

b er of Moves

In this section we rst give another construction that involves more complicated shap es

to show that compaction requires an exp onential sized motion Then based on the con

struction we show that even nding a lo cal optimum according to an algorithm presented

in Chapter requires an exp onential number of steps

Consider the device shown in Figure The device is comp osed of four movable pieces

and a static obstacle that also provides the top left and b ottom b oundaries The obstacle

is a single connected piece and has a row of k teeth on the top and a row of k teeth on

the b ottom A to oth is one unit wide and one unit high The teeth on the top are displaced

a half unit to the right with resp ect to the teeth on the b ottom The four movable pieces

are lab eled A B C and D as shown in Figure The goal is to move piece A to the

left by k units To this end we need to move piece B through the two rows of teeth

During the motion a total of k up and down motions will o ccur for piece B B moves one

unit vertically during each up or down motion One unit of vertical motion of B will b e

transferred through piece C to piece D The two slanted edges in piece D have slop e

k

Therefore each up down motion of one unit in B will force D to move to the right left

by k units

The construction is actually replicated n times and concatenated together as shown in

Figure The top part is connected to the b ottom part ultimately at the far left The

pieces are organized into n groups with each group containing four pieces There are overlaps

among comp onents in the groups since the piece D in one group also serves as piece A in

the next group From left to right the groups are ordered from to n By the analysis

in the previous paragraph the k units of horizontal motion of piece A of group force k

units of horizontal motion of piece D of group which is the piece A of group The k

units of horizontal motion of piece A of group in turn force k units of horizontal motion

of piece A of group When the motion propagates to group n piece A of group n has

n

to move a total of k units horizontally If we choose k as a small constant then the total

number of edges in the construction is linear in n

Hence we have the following theorem

Theorem The compaction problem shown in Figure requires an exponential number

of moves

The motivation for the construction in Figure is to show that the compaction algo

rithm presented in Chapter for nding a lo cal minimum of the compaction problem needs

an exp onential number of iterations in the worst case To make the construction applicable

to our problem we must show that the description of the motion takes only p olynomial

space To show this we observe that piece B of group n is the busiest piece We divide

the motion into basic steps according to the motion of the piece The motion b etween the

moment that piece B of group n moves from the highest vertical p osition to the lowest one

or vise versa is called a basic step At each basic step only piece B in group n can move

a full vertical and horizontal unit The distance that can b e moved by a piece in another

group declines exp onentially with group number For example the piece B in group can

n

only move O k horizontal or vertical units in each basic step This shows that at each

basic step a description of the state of the system requires only p olynomial space Hence

p olynomial space is sucient to describ e the complete motion which is comp osed of basic

steps

Recall that the compaction algorithm in Chapter uses a conguration space approach

for nding a lo cal optimum For each neighboring pair of ob jects represented as p olygons

the Minkowski sum of the two ob jects is generated A large convex subset of the exterior of

the Minkowski sum is determined according to a lo cality heuristic A set of linear inequalities

are built using the b oundary edges of the convex subset The relative motion of the pair

of p olygons is constrained to stay inside the convex subset by the set of linear inequalities

A linear program is set up using the set of linear inequalities for every neighboring pair as

constraints The ob jective function maximizes the motion of an imaginary piston piece

at the right b oundary The solution of the linear program will give the new p ositions for all

the ob jects A new set of inequalities is set up if the convex subsets outside the Minkowski

sum of a pair of ob jects changes The algorithm iterates until there is no improvement to

the ob jective function

If we apply the algorithm to the compaction problem shown in Figure it is easy to

show that each iteration of the algorithm nds exactly the conguration after each basic

step The ob jective function can b e improved until piece A of group is moved to the

n

left by k units Because there is a total of k basic steps and each iteration of the

n

algorithm corresp onds to exactly one basic step there will b e a total of k calls to the

linear program

To show that the algorithm can only nd a lo cal minimum we make two dents in piece

A of group The two dents have the same height h but dierent widths d and d

Assume that the lower dent has width d and d d We make a rectangular ob ject with

dimension d h The rectangular ob ject is originally placed at the lower dent According

to the heuristics used in the algorithm the algorithm will never move the rectangular ob ject

from the lower dent to the higher dent Hence the algorithm do es not nd a global optimum

when the algorithm terminates

Theorem The compaction algorithm described in Chapter requires an exponential

number of iterations to nd a local minimum

We note that the example shown in Figure demonstrates the worst case b ehavior

of the compaction algorithm presented in Chapter In practice the algorithm runs very

fast For the application of compacting garment layouts consisting of up to pieces the

algorithm always terminates in less than iterations

D C B A

Figure The construction of a motion propagation device

Figure The replication and concatenation of the motion propagation device

Chapter

Conclusion

The p ositionbased compaction algorithm presented in this thesis is the rst fast and

practical algorithm for compacting a layout of convex and nonconvex p olygons The algo

rithm has b een shown to b e very eective in a real world application marker making in

apparel manufacturing The CAD company who licensed our software has b een conducting

on site exp eriments on the markers of some of their client companies Preliminary results

indicate that the software could save each client b etween a quarter of a million to a million

dollars p er year Potential saving to the entire textile industry amount to tens of millions

of dollars p er year

The algorithm is general and versatile We can use the algorithm to p erform dierent

tasks in all stages of twodimensional packing pro cess such as compaction op ening up gaps

and database driven automatic marker making by simply tailoring the ob jective functions

We have also shown that the algorithm can b e extended to handle small degree rotations

reduce the total amount of overlaps in a layoutperform oating and nd optimal two

dimensional layout of p olygons

The key to the p ositionbased compaction algorithm is the idea of representing the

nonconvex free space of motion planning lo cally by a large convex subset identied by a

lo cality heuristic The convex subsets make it p ossible to directly calculate the p osition

of the p olygons by building and solving a linear program mo del Even though in the

worst case compaction takes exp onential number of moves of the p olygons in practice the

algorithm always converges and nd a lo cal optimum that improves the existing layout in

a few iterations

During its execution the algorithm always keeps the layout in a nonoverlapping con

guration This characteristic is imp ortant in compacting tightly packed layout b ecause

if not planned carefully an overlap in the layout once o ccurred can b e hard to eliminate

due to the tightness of the layout The requirement of avoiding introducing overlaps makes

techniques such as simulated annealing less applicable to generating or compacting tightly

packed layouts since the some basic steps of simulated annealing such as swapping two

p olygons or p erturb the current p osition or orientation ipping and rotation of a p olygon

are very likely to introduce overlaps

The work presented in this thesis lies b etween the b oundary of computational geometry

and op erations research The algorithms developed here combine the concepts and tech

niques from b oth elds One reason of the eectiveness of our algorithms is that they utilize

the p ower of the mature linear programming techniques implemented in a state of the art

linear programming package The linear program package p erforms the basic steps of our

algorithms fast and reliably As exemplied in the p ositionbased compaction algorithm

the linear programming formulation can greatly improve the running time over the previous

non linear programing formulations

The numerical instability of geometric computations is a ma jor problem in implement

ing geometric algorithms Mil An additional advantage of using a linear programming

package is to use its numerical stability to overcome the numerical diculties of geometric

computations Combined with robust computational geometry techniques such as the ro

bust computation of Minkowski sums our p ositionbased compaction algorithm proves to

b e quite numerically stable in practice

Perhaps the most imp ortant impact of our p ositionbased compaction algorithm on two

dimensional packingpolygon nesting problems arises from its ability to separate overlapping

p olygons This ability has great impact b ecause it leads to a database driven automated

marker making scheme This scheme provides a very viable approach for totally automating

layout generation pro cess which is our ultimate goal The limitation of automatically

generating layouts using geometric algorithms alone is that in order to achieve eciencies

comparable to that of human generated layouts one has to develop sp ecial techniques for

dierent application domains For example ecient techniques for making jacket markers

might b e quite dierent from those of making pants markers The database driven marker

making scheme on the other hand can b e thought as an implicit form of learning from

examples The human marker makers domain knowledge their many years of exp erience

and esp ecially their understanding of the relationship among various shap es are condensed

into a set of examples the collection of high quality markers in the database With sucient

examples in the database for the matching algorithm to nd a close match the database

drive marker making scheme can pro duce a layout that is close to human p erformance

We conclude this thesis with a list of future research directions First we list the

problems related to extending the p ositionbased compaction algorithm and improving its

p erformance

Improving the Rotational Compaction Algorithm It is b enecial to b etter under

stand the discrepancies in compaction results pro duced by the two rotational com

paction algorithm We hop e that our understanding can leads to improved rotational

compaction algorithms

Compaction of Large Layouts Right now the p ositionbased compaction algorithm can

compact a layout of one hundred p olygon in less than one minute mostly b etween

to seconds For several large examples we have observation long running

time This might b e caused by the large number of constraints We are interested in

improving the running time There are two reasons for study this First there exist

large layouts in practice Second we have observed that the material utilization can

further b e improved by concatenating several markers into a single large one

Second we list problems related to database driven marker making

Shap e Matching Algorithms The key to pro ducing a high quality layout in the database

driven marker making scheme is to nd a close match b etween the p olygons in the

layout to b e made and those in an layout in the database Therefore improving the

shap e matching algorithm directly improves the quality of a automatically generated

layout

Improved Overlap Elimination Algorithms From Chapter we see that if there are

no limitations on the width and the length of a layout then the p ositionbased al

gorithm can always nd a separation of the overlapped p olygons However in strip

packing applications the width of the layout is xed Therefore the separation al

gorithm can fail to eliminate all the overlaps To overcome this diculty we can use

techniques from linear programming to analyze the slack variables asso ciated with the

constraints From these slack variables we then nd the constraints that are most

tight and further identify the p olygons involved We can then p op out these

p olygons from the layout and eliminate the overlaps among the remaining p olygons

Next we can shrink the p olygons by certain amount and nd the gaps that can ac

commo date the shrunken p olygons To put the p olygons back into the layout we can

p erform the following steps place the shrunken p olygon restore it to its orig

inal size and eliminate the resulting overlaps using our algorithm If overlaps still

cannot b e eliminated it would b e necessary to rep eat with a dierent p olygon Based

on this idea we can design more sophisticated algorithms for separating p olygons

Organization of the Database In database driven marker making if the database con

tains tens of thousands of markers it b ecomes crucial to organize the database such

that a marker can b e compared with and retrieved quickly Despite some recent inter

ests Jag the area is wide op en and oers great challenges as well as opp ortunities

App endix A

Vectors and Cross Pro ducts

Let A B and C b e three p oints in the plane with co ordinates are A A B B

x y x y

and C C resp ectively in a co ordinate system whose origin is at p oint O We denote by

x y

A the vector originated from O and ended at A Vector A can b e expressed as a linear

combination of i and j the unit vectors in the x and y axis as

A A i A j

x y

We denote by AB the vector originated from A and ended at B This vector represents the

relative displacement of p oint A with resp ect to p oint B From Figure A we can easily

see

AB B A B A i B A j

x x y y

Let AB B A and AB B A AB can b e written as

x x x y y y

AB AB i AB j

x y

By standard denition the cross pro duct of vectors AB and BC is given by

i j k

AC BC

AC AC AC

x y z

BC BC BC

x y z

where AC and BC are the z comp onents of AC and BC which are b oth zero in our case

z z

Expanding the determinant we have

AC BC AC BC AC BC k

x y y x

C A C B C A C B k

x x y y y y x x Y B AB A

A B

O X

Figure A Denition of vectors

B

A θ

C

Figure A The geometric interpretation of cross pro duct

Therefore the cross pro duct of two planar vectors is a vector parallel to the z axis The

direction of the cross pro duct is the same as the p ositive z axis if and only if AC and BC

form a right hand system The geometric interpretation of the AC BC is that its value

is twice the signed area of the triangle A B C and the sign is p ositive if and only if A

B and C are in clo ckwise order see Figure A

Since in our applications we are only interested in the scalar part of the cross pro duct

we dene the cross pro duct of two planar vectors as a scalar directly

Denition A Given three points A B and C in the plane the cross product of vectors

AC and BC is dened as

AC BC C A C B C A C B

x x y y y y x x

The following fact follows immediately from the geometric interpretation of the standard

dention of cross pro duct

Fact A

AC BC jAC jjBC j sin

where is the angle traversed when we sweep AC counterclockwisely until it reaches BC

By rewriting the right hand side of our denition of cross pro duct into a determinant form

we obtain the following fact

Fact A

A A

x y

AC BC

B B

x y

C C

x y

It is shown in GS that the well known CCW C ounter C l ock W ise predicate for three

p oint A B and C can b e expressed by the condition

A A

x y

B B

x y

C C

x y

Fact A shows that the CCW predicate is equivalent to AC BC

Combining the ab ove two facts we obtain the following lemma which is extremely useful

in deriving nonp enetration constraints

Lemma A Let A B and C be three points in the plane

in counterclockwise order

A B and C are i AC BC

colinear

in clockwise order

For notational simplicity we sometimes also use AC BC to denote the cross pro duct

AC BC in this thesis

1

For three p oints AA A B B B and C C C in the plane the predicate CCW A B C is true

x y x y x y

if and only if A B and C are in counterclockwise order

Biblio graphy

ABB H Alt B Behrends and J Blomer Approximate matching of p olygonal

shap es In Proc th Annu ACM Sympos Comput Geom pages

AG H Alt and M Go dau Measuring the resemblance of p olygonal curves In

Proc th Annu ACM Sympos Comput Geom pages

AKS R Anderson S Kahan and M Schlag An on log n algorithm for d

tile compaction In M Nagl editor GraphTheoretic Concepts in Computer

Science volume of Lecture Notes in Computer Science pages

SpringerVerlag

AST P K Agarwal M Sharir and S Toledo Applications of parametric searching

in geometric optimization In Proc rd ACMSIAM Sympos Discrete Algo

rithms pages

Bar D Bara Analytical metho ds for dynamic simulation of nonp enetrating rigid

b o dies Computer Graphics Proc SIGGRAPH

BB R Barzel and A H Barr A mo deling system based on dynamics constraints

Computer Graphics Proc SIGGRAPH

BECR Brenda S Baker Jr EG Coman and Ronald L Rivest Orthogonal packings

in two dimensions SIAM Journal of Computing

Can J Canny The Complexity of Robot Motion Planning MIT Press Cambridge

MA

CE B Chazelle and H Edelsbrunner An optimal algorithm for intersecting line

segments in the plane In Proc th Annu IEEE Sympos Found Comput

Sci pages

Cha B Chazelle Triangulating a simple p olygon in linear time In Proc st Annu

IEEE Sympos Found Comput Sci pages

CKSS Seth Chaiken Daniel J Kleitman Michael Saks and James Shearer Covering

regions by rectangles Siam J Alg Disc Meth

CMD FRK Chung MRGarey and DSJohnson On packing twodimensional

bins SIAM Journal of Alg Disc Meth

COSSW B Chazelle T Ottmann E SoisalonSoininen and D Woo d The complexity

TM

and decidability of SEPARATION In Proc th Internat Col loq Au

tomata Lang Program volume of Lecture Notes in Computer Science

pages SpringerVerlag

DD Kathryn A Dowsland and William B Dowsland Packing problems European

Journal of Operational Research

DLM K Daniels Z Li and V Milenkovic Multiple containment metho ds and

applications in cloth manufacture In Joseph Mitchell editor Proceedings of

the Army Research Oce and MSI Stony Brook Workshop on Computational

Geometry SUNY Stony Bro ok Octob er

DLM K Daniels Z Li and V Milenkovic Multiple containment metho ds Tech

nical Rep ort TR Center of Research in Computing Technology Aiken

Computation Lab oratory Harvard University

DM K Daniels and V Milenkovic Limited Gaps In Mark Keil editor Submitted

to the Sixth Canadian Conference on Computational Geometry Saskatoon

Canada SN W keilcsusaskca August University of Saskatchewan

Dyc Haralk Dyckho A typology of cutting and packing problems European

Journal of Operations Research

ECL Jr EG Coman and George S Lueker Probabilistic Analysis of Packing and

Partitioning Algorithms Wiley and Sons Inc New York

ECS Jr EG Coman and PW Shor Averagecase analysis of cutting and packing

in two dimensions European Journal of Operations Research

Ede H Edelsbrunner Algorithms in Combinatorial Geometry SpringerVerlag

Heidelb erg West Germany

G F Gobel Geometrical packing and In A Schrijver editor

Packing and Covering in Combinatorics pages Mathematical Centre

Tracts

Gar Martin Gardner Mathmatical games some packing problems that cannot b e

solved by sitting on the suitcase Scientic American

GG P C Gilmore and R E Gomory A linear programming approach to the

cuttingsto ck problem Operations Research

GG P C Gilmore and R E Gomory A linear programming approach to the

cuttingsto ck problem Part I I Operations Research

GJ Mickael R Garey and Davis S Johnshon Computers and Intractability A

guide to the Theory of NPCompleteness W H Freeman and Company San

Francisco

GJPj M R Garey D S Johnson F P Preparata and R E Tar jan Triangulating

a simple p olygon Inform Process Lett

GRS L Guibas L Ramshaw and J Stol A Kinetic Framework for Computational

Geometry In IEEE th Annual Symposium on Foundations of Computer

Science

GS L J Guibas and J Stol Primitives for the manipulation of general sub

divisions and the computation of Voronoi diagrams ACM Trans Graph

Her J Hershberger Finding the upp er envelope of n line segments in on log n

time Inform Process Lett

HM S Hertel and K Mehlhorn Fast triangulation of simple p olygons In Proc

th Internat Conf Found Comput Theory volume of Lecture Notes in

Computer Science pages SpringerVerlag

HS S Hart and M Sharir Nonlinearity of DavenportSchinzel sequences and of

generalized path compression schemes Combinatorica

HSS J E Hop croft J T Schwartz and M Sharir On the complexity of motion

planning for multiple indep endent ob jects P S P AC E hardness of the Ware

housemans Problem Internat J Robot Res

Jag H V Jagadish A retrieval technique for similar shap es In Proc ACM SIG

MOD Conf on the Management of Data pages

Kei J M Keil Decomp osing a p olygon into simpler comp onents SIAM J Com

put

KOS A Kaul MA OConnor and V Srinivasan Computing Minkowski Sums

of Regular Polygons In Proceedings of the Third Canadian Conference on

Computational Geometry Vancouver British Columbia

Len T Lengauer On the solution of inequality systems relevant to iclayout Jour

nal of Algorithms

LM Z Li and V Milenkovic Constructing strongly convex hulls using exact or

rounded arithmetic In Proc th Annu ACM Sympos Comput Geom pages

LM Z Li and V Milenkovic Constructing strongly convex hulls using exact or

rounded arithmetic Algorithmica

LMa Z Li and V Milenkovic A compaction algorithm for nonconvex p olygons

and its application In Proc th Annu ACM Sympos Comput Geom pages

LMb Z Li and V Milenkovic Compaction of a D layout of nonconvex shap es and

applications In SIAM Conference on Geometric Design SIAM November

LMc Z Li and V Milenkovic On the complexity of the compaction problem In

Proc th Canadian Conference on Computational Geometry pages

LMar Z Li and V Milenkovic Compaction and sep eration algorithms for nonconvex

p olygons and their applications European Journal of Operations Research

Special Issue on Cutting and Packing To app ear

LPW T LozanoPerez and M A Wesley An algorithm for planning collisionfree

paths among p olyhedral obstacles Commun ACM

LZ Z Li and B Zhu On the monotonicity of p olygons and p olyhedra To b e

submitted

Mal F Miller Maley Singlelayer Wire routing and compaction The MIT Press

Map D Maple A hierarchy preserving hierarchical compaction In Proc th

Design Automation Conference pages

MDL V Milenkovic K Daniels and Z Li Automatic Marker Making In Proc rd

Canadian Conference on Computational Geometry

MDL V Milenkovic K Daniels and Z Li Placement and Compaction of Nonconvex

Polygons for Clothing Manufacture In Proc th Canadian Conference on

Computational Geometry

Meg N Megiddo Linear programming in linear time when the dimension is xed

JACM

MFS R C Mosteller A H Frey and R Suaya d compaction a monte carlo

metho d In P Lasleb er editor Advanced Research in VLSI pages

MIT Press

Mil V Milenkovic Veriable implementation of geometric algorithms using nite

Precision Arithmetic PhD thesis Carnegie Mellon University CMU

CS

Mur Frank D Murgolo An ecient approximation scheme for variablesized bin

packing SIAM Journal of Computing

MW M Mo ore and J Wilhelms Collision detection and resp onse for computer

animation Computer Graphics Proc SIGGRAPH

Nem G Nemhauser The age of optimization solving large scale real world prob

lems Philip McCord Morse Lecture ORSATIMS Annual Meeting Chicago

May

PB J C Platt and A H Barr Constraint metho ds for exible mo dels Computer

Graphics Proc SIGGRAPH

PS FP Preparata and K Sup owit Testing a simple p olygon for monotonicity

Inform Process Lett

PS F P Preparata and M I Shamos Computational Geometry an Introduction

SpringerVerlag New York NY

Rei J H Reif Complexity of the movers problem and generalizations In Proc

th Annu IEEE Sympos Found Comput Sci pages

Rei J H Reif Complexity of the generalized movers problem In J Hop croft

J Schwartz and M Sharir editors Planning Geometry and Complexity of

Robot Motion pages Ablex Pub Corp Norwoo d NJ

Ser J Serra Image Analysis and Mathematical Morphology volume Academic

Press New York

SPa P E Sweeney and E R Paternoster Cutting and packing problems A

categorized applicationorientated research bibliography J Opl Res Soc

SPb Paul E Sweeney and Elizab eth Ridenour Paternoster Cutting and packing

problems A categorized applicationoriented research bibliography Journal

of the Operational Research Society

SS J T Schwartz and M Sharir Algorithmic motion planning in rob otics In

J van Leeuwen editor Algorithms and Complexity volume A of Handbook of

Theoretical Computer Science pages Elsevier Amsterdam

SSVS H Shin A L SangiovanniVincentelli and C H Sequin Two dimensional

compaction by zone rening In Proc rd Design Automation Conference

pages

SY P Spirakis and C Yap Strong NPhardness of moving many discs Inform

Process Lett

TV R E Tarjan and C J Van Wyk An O n log log ntime algorithm for trian

gulating a simple p olygon SIAM J Comput Erratum in

Won C K Wong An optimal twodimensional compaction scheme In P Bertolazzi

and F Luccio editors VLSI Algorithms and Architectures pages

Elsevier NorthHolland