2005 Crispin-Genetic Algorithm Coding Methods For Leather Nesting
2005 Crispin-Genetic Algorithm Coding Methods For Leather Nesting
c 2005 Springer Science + Business Media, Inc. Manufactured in The Netherlands.
TOM BAYES
SATRA Technology Centre, Rockingham Road, Kettering, Northamptonshire, N16 9JH, England
[email protected]
DAVID REEDMAN
R&T Mechatronics Ltd. The Cottage, Main Street, Wartnaby, Melton Mowbray,
Leicestershire, LE14 3HY, England
[email protected]
Abstract. The problem of placing a number of specific shapes in order to minimise waste is commonly encountered
in the sheet metal, clothing and shoe-making industries. The paper presents genetic algorithm coding methodologies
for the leather nesting problem which involves cutting shoe upper components from hides so as to maximise material
utilisation. Algorithmic methods for computer-aided nesting can be either packing or connectivity driven. The paper
discusses approaches to how both types of method can be realised using a local placement strategy whereby one
shape at a time is placed on the surface. In each case the underlying coding method is based on the use of the no-fit
polygon (NFP) that allows the genetic algorithm to evolve non-overlapping configurations. The packing approach
requires that a local space utilisation measure is developed. The connectivity approach is based on an adaptive graph
method. Coding techniques for dealing with some of the more intractable aspects of the leather nesting problem such
as directionality constraints and surface grading quality constraints are also discussed. The benefits and drawbacks
of the two approaches are presented.
Keywords: computer-aided nesting, genetic algorithms, encoding, leather, image processing, packing, connec-
tivity, optimisation
shaped surface which is also characterised by further fied as unsuitable because of the variation in hide qual-
constraint requirements (see Section 2). ity with position e.g. defects such as scar tissue and
Many packing-driven solutions to the cutting stock holes that may occur randomly. In order to make deci-
problem have been reported in the literature [1]. Anand sions about placement the skilled cutter (and any pro-
et al. [2] and Bounsaythip et al. [3] have explored ge- posed automation) requires implicit knowledge of the
netic algorithm approaches. One of the main difficulties subsequent processes. During the lasting or 3D shap-
reported was finding an appropriate encoding strategy ing of the shoe upper certain components undergo large
for mapping shapes evolved by the genetic algorithm elastic and visco-elastic distortions. The presence of
to non-overlapping configurations. Anand [2] used an singular defects in such components may lead to a me-
unconstrained approach whereby the genetic algorithm chanical failure during lasting and will certainly be un-
was allowed to evolve overlapping configurations and acceptable cosmetically in the finished product. There
post processing was subsequently used to check and is also a need to understand the anisotropy of the elas-
correct for shape intersection. Bounsaythip et al. [3] tic properties of leather and their effect on the shap-
have used an order based tree encoding method to pack ing process. This is known as identifying the lines of
components in strips. tightness, which are generally held to follow the skele-
Kahng [4] discusses the preoccupation with packing- tal structure. Conventionally shoe components are cut
driven as opposed to connectivity-driven problem for- “tight to toe” so that, when assembled, the stiffer elas-
mulations in the context of floor planning (i.e. auto- tic axis runs consistently along the shoe. Any proposed
mated cell placement for VLSI circuits) and suggests computer-aided nesting system must take into account
that approaches based on a connectivity centric should the constraint criteria outlined above. In addition any
be used. cosmetic defects present in the leather must either be
This paper explores genetic algorithm based coding discarded or must appear in areas of the shoe which are
methods for both a packing driven and connectivity hidden from casual view.
driven solution to the leather-nesting problem. Section The hide data files used for this research contain
2 describes the leather-nesting problem. Section 3 point co-ordinate information on the edge outline,
describes shape placement using the no-fit polygon. holes and grade regions (quality zones) from real hides
Section 4 develops a packing driven genetic algorithm scanned at a shoe factory. Region grading conforms
solution based on developing a local space utilisation to a grading system commonly used in shoemaking,
measure. In Section 5, a connectivity driven genetic al- which ranges from grade 1 regions where material
gorithm solution is presented based on creating a graph quality is rated between 95–100% down in steps of
at time of placement such that rules are used to prevent 5% to grade 5 regions where material quality is rated
invalid positioning. Section 6 discusses results and the between 75–80%. An image-point dual was used in
benefits and drawbacks of the two approaches. Finally the work allowing images of shapes to be created
conclusions are drawn. from part co-ordinates and vice versa [5]. Figure
1 shows a typical hide image with grade regions
marked.
2. Problem Description To constrain the placement of shapes that require
high quality leather a threshold can be applied to the
The shoe manufacturing process starts with the cutting grade image on a level determined by the lowest grade
of shoe upper components from a hide with parts nested that a shape may be placed within. Any lower grades
together as far as possible to maximise material usage. are removed from the hide. This approach completely
A significant proportion of the manufacturing cost of a restricts a shape from entering a poorer grade area than
pair of shoes is invested in the natural raw material and required.
so the efficient utilisation of this resource is of prime This work has used a tightness vector map, which
importance. Small improvements in yield can have a generically follows the skeletal structure (see Fig. 1).
dramatic effect on profitability. This allows an error difference angle to be calculated
In leather nesting constraints are placed on the se- between the tightness vector and shape direction vector.
lection process by external practicalities. In particu- A shape is placed so its direction is constrained to a
lar certain areas of the hide may be unsuitable for maximum deviation value either side of the tightness
a given class of components. Such areas may be identi- vector.
Genetic Algorithm Coding Methods for Leather Nesting 11
Figure 1. Hide image with directionality and grade constraints shown. Darker regions represent poorer quality grade material. Tightness vector
arrows indicate the required placement direction.
3. Shape Placement Using NFP edges of the individual shapes [8]. The basic algorithm
only works correctly for convex polygons and a number
Optimal nesting can only be achieved when shapes are of adjustments have been made to accommodate the
touching since any small gaps between two shapes are relationship between both simple non-convex [9] and
usually unusable and so are wasted. The no-fit polygon more complicated non-convex shapes [10].
(NFP) [6, 7] is the path traced by any selected refer- Our approach to calculating the NFP is based on im-
ence point on one shape as it circumnavigates around age processing techniques [5, 11]. The NFP is found
another shape. Selection of the reference point will from the Minkowski sum, which is the convolution
translate the NFP relative to the other shape. In Fig. between two shape images at a set orientation. The
2 the reference point has been taken as the shape cen- calculated Minkowski sum for two leather compo-
troid. The NFP can be used to ensure that each shape nents used in shoe making is shown in Fig. 2. The
placed touches the hide edge or another shape without NFP is the boundary between the area covered by
overlap. the Minkowski sum and those areas not covered by
A number of different methods have been devised the sum. Four-connected shape boundary images are
to calculate the NFP between two shapes involving the used to calculate the Minkowski sum with the NFP
addition of ordered vectors describing the polygonal extracted using morphological operators. As the angle
Figure 2. Minkowski sum found by convolution between two shape images at a set orientation. The NFP is the boundary and is dependent on
the angle between the two shapes as shown in the second diagram.
12 Crispin et al.
Figure 3. An example of a shape-hide no-fit polygon (NFP) and window region centred on point labelled A.
between shapes changes the NFP jumps from one the previously placed shape and the process of find-
state to another (i.e. there is a non-linear discontinuous ing the best local placement solution within the new
change). window region is repeated.
Our window placement strategy imitates the place-
ment strategies of a professional lay-planner and pro-
4. Packing Driven Solution motes clustering and runs of similar shapes. The NFP
calculations are only performed within the local win-
A packing driven solution requires that shapes are dow region, thereby reducing the number of compu-
placed such that space utilisation is maximised. The tational operations required as compared to those that
method developed for this work is based on a local would be required if the whole hide image is used.
placement strategy where shape parts are placed on the Figure 4 shows an example of shape placement
hide one at a time in sequence. Once a shape is placed it against a hide edge within a window area. The window
is not changed becoming part of a dead region in which is centred on a current point labelled A. The average
it is not possible to place further parts. The local place- directionality angle is calculated using the tightness
ment approach requires using a local measure for space vector map in a box positioned at the centre point of
utilisation such that the sum approximates to the final
space utilisation measure. The alternative approach is
to use a global placement method in which whole lays
are repeatedly created on a hide and tested directly
against a global space utilisation measure. Heistermann
and Lengauger [12] discuss the advantages of using a
local placement strategy over that of a global placement
strategy in terms of nesting time requirements.
The strategy of our packing algorithm is based on
placing a shape at a point on the shape/hide NFP (or a
shape/shape NFP) to maximise local space utilisation.
Calculations are performed within a window region.
The window is initially positioned around the point at
the rear of the spine of the hide nearest to the image
corner. In Fig. 3 this point is labelled A and the first
shape is placed in the window region shown such that
the shape which fits closest to the edge is chosen. The Figure 4. An example of shape placement within a window region
window is moved (i.e. stepped) so that it is centred on showing the relationship between shape angle θ and lay angle ϕ.
Genetic Algorithm Coding Methods for Leather Nesting 13
the line projected from A at lay angle ϕ to the window tionality) lined up along the length with either orienta-
edge. The box dimensions for determining the direc- tion acceptable. The number of shoes required is used
tion angle are made equal to the window step distance. to determine how many of each shape type should be
A shape angle θ measured from the horizontal axis is placed.
chosen such that it is constrained to ±5◦ of the aver-
age tightness angle found. The shape is placed at the
4.1. Genetic Algorithm Packing Optimisation
point on the shape-hide NFP which is closest to the
line projected from A at lay angle ϕ. By generating lay
The key features of a simple genetic algorithm are:
angle sample populations a number of placement solu-
tions are created which can each be assigned a fitness
value so that the best placement can be determined. The – They start with an initial random population of po-
specification requirement that the maximum deviation tential solutions.
for the shape angle should be ±5◦ round the tightness – The population is indexed in terms of fitness using
angle found in the region of placement is also used in an objective function.
the optimisation process (see Section 4.1). – High fitness members are randomly selected and re-
Efficient utilisation of space requires that shapes are combined to produce an offspring.
located close to one another. An indication of the prox- – A small proportion of the offspring mutates to extend
imity of a shape to the hide edge or another shape can the search.
be calculated for optimisation purposes. Our approach – Fitness values for the offspring are calculated.
to proximity measurement is based on filtering the bi- – The offspring and their corresponding fitness values
nary images of the shape and the hide using a mask replace poorly performing members of the original
of unity-values. A threshold is applied to generate an population.
outer border around both the hide edge and shape (see
Fig. 5). It is observed that shapes that fit closest to the Iteration is used to generate more and more offspring
edge have the largest overlap area. Consequently, a fit- solutions to yield better approximations to the final op-
ness value can be calculated as the overlap area between timal solution, see Goldberg [13]. For specific coding
the two borders as this provides a measure of proximity details see [14, 15].
to the edge or another shape. The genetic algorithm generates a real value popu-
The shapes are placed in order of size since it is lation consisting of lay angles and directionality ratios.
easier to find suitable positions for the smaller shapes As previously discussed the shape angle is calculated
once the available area becomes limited. It is noted from the local tightness vector map using a box region
that the largest shape, the vamp (toe piece), is also centred on the lay angle line. The directionality ratio
the shape that requires the highest-grade leather and value is used to allow a constrained variation of shape
is to be placed with the tightness of the material (direc- angle from the local tightness value calculated in the
box region.
To utilise the mechanics of evolution a selection of
the current set of solutions is chosen to become the
parents of the next set of offspring. The tournament
selection process is used to generate random pairs of
indices to the current solutions and their corresponding
fitness values compared, the greater of the two being
chosen as a parent. Pairs of these successful parents are
then combined using linear recombination to create a
new population. The offspring is 60% of the size of
the population. A mutation operator randomly alters
5% of the genes (lay angle, directionality ratio) in the
offspring to extend the search area and so reduce the
chances of becoming stuck at sub-optimal solutions.
An elitist reinsertion strategy is used. A typical lay-
Figure 5. Fitness value calculation. The fitness value is equal to the plan obtained using the packing coding approach is
free space overlap region shown as the darker region. shown in Fig. 6.
14 Crispin et al.
Figure 6. Lay plan of 14 shoes giving 61.6% coverage (with directionality and grading constraints applied).
Figure 10. Typical connectivity based lay-plan of 84 shoe parts giving approximately 58% coverage obtained using the adaptive graph
connectivity strategy.
the shape angle chromosome section rotates the shape ing shapes in the list to recombine. This requires the
indicated in the corresponding locus in the shape order angles to be reordered so that the corresponding shapes
chromosome section. from all chromosomes are in the same order and return-
Each of the angles in the shape angle chromosome ing their offspring to their parent’s individual orders
section is associated with the shape at the correspond- after creation. The result would be that the shape angle
ing locus in the shape order chromosome section. When properties of a shape would only recombine with a like
the shapes are reordered, the associated angles are also shape irrespective of shape order. The angles are then
reordered to the same positions as the corresponding reordered to follow their respective loci in the shape
shapes. Consequently, a shape angle is a property of a order chromosome section as described before.
shape since it is linked to the shape order. The angles for next placement describe a method of
The partially matched crossover (PMX) operator as positioning a shape relative to the last shape placed.
described in Goldberg [13] is used to reorganise the or- They remain independent of the shape properties. Ob-
der in which the shapes are placed. PMX combines the servation and analysis of the effect of these values sug-
sequences contained in the two parent solutions to cre- gest that the angles in the first two loci show the great-
ate two new offspring solutions consisting of elements est importance to the final lay, while the rest have more
of both parents while ensuring that no index within the subtle consequences.
order sequence is repeated. The PMX operator respects The fitness value is calculated as the hide area multi-
the absolute positions of individual indices in the order plied by the square of the ratio of the number of shapes
sequence promoting chromosome structures dependant placed to the number of shapes required. If all the re-
on positional attributes. quired shapes are placed the value is equivalent to the
The real valued line recombination operator is used absolute area of the hide, any less increases the fitness
for recombining shape angle vectors and placement an- value significantly. Figure 10 shows a typical result of
gle values. Real valued line recombination [18] is a nesting components using the connectivity coding ap-
mathematical approach to the combination of real val- proach. The graph spirals in from the edge of hide since
ued solutions. Offspring are created by finding a ran- the coding method attempts to place shapes so that they
domly weighted average of each individual position in connect to the previously placed shape and an anchor
the chromosome. The line recombination operator uses shape that is initially the hide edge.
a single weighting value for all positions in the chro-
mosome so that solutions are developed on a straight 6. Results
line between each pair of parents.
To associate the properties of shape types it was de- An empirical analysis to measure statistically the
cided to only allow the shape angles from correspond- quality of the final solution (coverage, time) for the
Genetic Algorithm Coding Methods for Leather Nesting 17
Figure 11. (a) Change in average percentage coverage for different window sizes (b) change in average time taken for typical lay of whole
hide verse window size (1.2 GHz Athlon running Windows 2000).
7. Conclusions
Acknowledgments
Tom Bayes is team leader of the Advanced Concepts section within David Reedman, recently deceased, was formally the research man-
the Shoe and Allied Trade Research Association (SATRA). He has ager of British United Shoe Machinery with particular expertise in
been working on the problem of leather cutting for several years automatic control and system engineering. He had been working in
having developed one of the first computer-aided nesting systems to the shoe industry for over 30 years.
meet industry requirements.