UFDC Home  myUFDC Home  Help 



Full Text  
GEOMETRIC BIN PACKING ALGORITHM FOR ARBITRARY SHAPES By ARFATH PASHA A THESIS PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE UNIVERSITY OF FLORIDA 2003 Copyright 2003 by Arfath Pasha I dedicate this thesis to my sister Anberin. ACKNOWLEDGMENTS I would like to extend my thanks and appreciation to Dr. Meera Sitharam for her invaluable input into the intricacies of algorithms, for her scholarship in this field, her readiness and ability to impart it. I thank Dr. Carl Crane for his unstinting support throughout the research phase, for extending facilities, and his knowledge in robotics which inspired this research. I would also like to express my appreciation to Dr. Sartaj Sahni for his assistance and kindly agreeing to be a part of the supervisory committee. The Department of Energy for its support through the University Research Program in Robotics is also greatly appreciated. TABLE OF CONTENTS page A C K N O W L E D G M E N T S ................................................................................................. iv LIST OF TA BLE S ................ ................... ................. .......... .. ............ .. vii LIST OF FIGURES ......... ......................... ...... ........ ............ ix ABSTRACT .............. ......................................... xi CHAPTER 1 IN TR OD U CTION ............................................... .. ......................... .. M o tiv atio n ....................................................... ................. . D e fin itio n s ........................................................... ................ .. 2 H eu ristic s ............................................................... ................3 R an dom ized H eu ristics .....................................................................................4 Sim ulated A nnealing ......................... .......................... .. ......... ............ ..... G enetic A lgorithm s ................... ............................ .. ........ ................. Geometric Bin Packing Problem Versions .............. ............................................8 General Form al Problem Statem ent ..................................................... ............ 12 C o m p lex ity ........................................................................................................... 12 2 LITERA TURE SU RVEY ................................................. .............................. 15 Theoretical W ork ..................................................................... ......... 15 H euristic Search M ethods........................................................................... 16 Random ized H euristics ............................................. .. ........ .. ......... 18 3 RESEARCH OBJECTIVES ......................................................... .............. 21 Sim plified Form al Problem Statem ent ............................................ ............... 21 O ur P relim inary A ttem pts................................................................ .....................22 Attempt 1: A Simple Genetic Algorithm ................................... ............... 22 Attempt 2: Divide and Conquer Explored.........................................................23 Idea of Main Contribution: A Hybrid Genetic Algorithm ......................................24 4 MAIN CONTRIBUTIONS OF CURRENT WORK .............................................27 A ssu m p tio n s ...............................................................................................................2 8 Genetic Algorithm .................................. .............. .. ............28 Optim al Placem ent A lgorithm ........................................................ ............... 34 G general A approach ........... .......................................................... .. .... .... .. 34 Geom etric Conventions .......................................................... ............... 36 Proof: Optimal Placement for the 2D NonOriented Case..............................37 Our Approach 1: Optim al Placem ent ...................................... ............... 39 Our Approach 2: Optim al Placement ...................................... ............... 42 5 EXPERIMENTAL RESULTS ............................................................................49 C choice of G A P aram eters ........................................ ............................................49 Em pirical A nalysis................................................... 49 Irregular Shapes............................................ ................... 50 G eom etric Shapes ......... ........... .... ................. .. ........ ................ 50 Genetic Algorithm Drawbacks ...... ......... ........................... ... ............... 51 Placem ent H euristic D raw backs............................................... ....... ........ 57 C conclusion ............................................................... .... ..... ........ 58 6 FU TU RE W O RK ....................... ............................ .... ............. ........60 APPENDIX A D O C U M E N TA T IO N ........................................................................ ...................62 B U SE R IN T E R F A C E .................................................................... ...... ...................83 L IST O F R E FE R E N C E S ....................................................................... ... ...................85 B IO G R A PH IC A L SK E TCH ..................................................................... ..................87 LIST OF TABLES Table pge 1 Packages contained in the implementation of the packing algorithm...................62 2 Classes contained in package genAlgthm ..................................... .................62 3 Classes contained in the package gui ............................................ ............... 63 4 Classes contained in the package packingDataStruct................... ................64 5 Attributes and methods contained in genAlgthm.Chromosome .............................64 6 Attributes and methods contained in genAlgthm.Population..........................65 7 Attributes and methods contained in gui.DataPanel ..........................................66 8 Attributes and methods contained in gui.DrawPanel ............................................67 9 Attributes and methods contained in gui.FileHandler................... ..............68 10 Attributes and methods contained in gui.M ain ...................... ................. ........... 69 11 Attributes and methods contained in gui.MenuBar.................... ...............70 12 Attributes and methods contained in gui.FileFilter............... ....................... 71 13 Attributes and methods contained in gui.StatusPanel ............................................72 14 Attributes and methods contained in packingDataStruct.BasicTests....................73 15 Attributes and methods contained in packingDataStruct.Container ......................75 16 Attributes and methods contained in packingDataStruct.Container.Profile ............76 17 Attributes and methods contained in packingDataStruct.ConvexHull ...................77 18 Attributes and methods contained in packingDataStruct.ConvexHull. H u llE lem en t ....................................................... ................ 7 7 19 Attributes and methods contained in packingDataStruct.Heuristic .........................78 20 Attributes and methods contained in packingDataStruct.Part.......................79 21 Attributes and methods contained in packingDataStruct.PartList ...........................81 22 Attributes and methods contained in packingDataStruct.Pose...............8................81 23 Attributes and methods contained in packingDataStruct.Vertex .............................82 LIST OF FIGURES Figure pge 11 Packing configuration with unstable placement of objects................... ..........2.. 12 Packing configuration with interlocking placements..........................................2 13 Structure of a typical genetic algorithm ....................................... ............... 6 14 Factors that determine the version of the binpacking problem.............................9 15 Multibin packing where capacity constraint is met but shape constraint is violated 1 16 An infinite solution space with infinite feasible solutions may be possible in the threedim ensional binpacking problem ........................................ ............... 13 21 Albano and Sapuppo, A* heuristic output, 1980 ........................................... 17 22 Robert McGee, online heuristic output of six packed shapes, 1997 ........................18 23 Computing the displacement along the yaxis in the heuristic by Ono and W anatabe 1997. ........................................................................ 19 24 Results from a genetic algorithm, Ono and Watanabe 1997...............................20 31 The simple genetic algorithm. (a) input (b) output after 989 generations ...............23 32 Chromosome containing pattern IDs and representing a packing configuration obtained by a heuristic........ ........................................ ................ .. .... ...... 25 41 Flowchart of genetic algorithm ...................... .....................29 42 Placing objects on top of a profile V ...................................................... ............ 35 43 Geometric conventions used in the placement heuristic .......................................37 44 Illustration of the problem for proving the nonoriented case ..............................38 45 G eom tery of C casting ........................................................................ .................. 40 46 Placement heuristic based on the linear programming approach for mold m a k in g ...................................... ......... ....................... ................ 4 2 47 First rule in the placement heuristic for a convex vertex in the pattern .................46 48 First rule in the placement heuristic for a concave vertex in the pattern..................47 49 Second rule in the placement heuristic.. ................ ...... ...............48 51 Arrangement of 13 geometric patterns (a) 12th generation, (b) 39th generation, (c) 47th generation, (d) Output from Petridis et al ............................... ............... .52 52 Arrangement of 14 geometric patterns (a) 2nd generation, (b) 36th generation, (c) 84th generation, (d) output from Watanabe and Ono................................................53 53 Arrangement of 36 irregular patterns (a) 1st generation, (b) 16th generation, (c) 40th generation, (d) output from W atanabe and Ono.....................................................53 54 Arrangement of 24 irregular patterns (a) 1st generation, (b) 5th generation, (c) 26th generation, (d) output from Albano and Supoppo................................................54 55 Arrangement of 30 irregular patterns (a) 2nd generation, (b) 9th generation, (c) 22nd generation, (d) output from Albano and Supoppo............................................. 55 56 Arrangement of 14 irregular convex patterns (a) 2nd generation (b) 7th generation (c) 25th generation.......... .......................................................... ...... ..... 56 57 Arrangement of 10 irregular nonconvex patterns (a) 1st generation (b) 8th generation (c) 39th generation........................................................ ............... 56 58 A draw back in the place ent heuristic .......................... .........................................58 Bl Arbitrary and geometric shaped patterns drawn on the user interface with the grid sw itched on ...................................................................... .......... 83 Abstract of Thesis Presented to the Graduate School of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Master of Science GEOMETRIC BIN PACKING ALGORITHM FOR ARBITRARY SHAPES By Arfath Pasha August 2003 Chair: Meera Sitharam Major Department: Computer and Information Science and Engineering One waste remediation plan calls for repackaging hazardous waste into fiftyfive gallon drums, which would then be melted in a plasma arc furnace. The objective of this effort was to develop a geometric binpacking algorithm, which will fill a drum as completely as possible with arbitrary shaped objects while obeying certain physical constraints that make the final packing configuration realizable in practice. Some of these constraints are the effect of gravity on the objects being packed, minimization of center of gravity of the container, and allowable radiation dose levels for the container. The prevention of packing configurations that contain interlocking shapes may also be an important physical constraint as such configurations are difficult to achieve when the packing is performed with the help of a robotic arm. The proposed approach uses a genetic algorithm to optimize the packing order or sequence, and an online packing heuristic that is capable of finding near optimal placements for each object in the sequence. The problem is known to be strongly NPhard and has many engineering applications in areas such as container loading, stock cutting, layout optimization and rapid prototyping. CHAPTER 1 INTRODUCTION Motivation This research was sponsored by the University Research Program in Robotics and was aimed towards finding an effective solution for the hazardous waste disposal problem being dealt with at Department of Energy sites. The objective of this task was to autonomously pack the hazardous waste into fiftyfive gallon drums, which would then be melted in a plasma arc furnace. Central to the task was the development of a bin packing algorithm that was capable of finding near optimal packing configurations for a set of irregular shaped objects. In addition to the main objective of the algorithm, the autonomous nature of the packing process posed certain physical constraints such as the minimization of the center of gravity of the packed container, allowable radiation dose levels for the container, stability of the packed objects and the prevention of packing configurations that contain interlocking shapes, as such configurations are difficult to achieve when the packing is performed with the help of a robotic arm. Figure 11 shows a packing configuration that contains unstable placements. Figure 12 illustrates another packing configuration with interlocking shapes. A robotic arm cannot replicate these packing configurations. This paper describes a methodology that may be used to meet the stated objectives. Although the method described is specific to the hazardous waste disposal problem, it may also be applicable to other packing applications such as container loading, stock cutting and rapid prototyping. Figure 11. Packing configuration with unstable placement of objects. (Das97) Figure 12. Packing configuration with interlocking placements. Definitions Optimization of the packing of arbitrary shaped objects into containers may be termed as a geometric binpackingproblem. The problem is essentially a combinatorial optimization problem that involves the selection and arrangement of items within a finite or discrete space, such that the resulting solution is integral in nature. Such problems are usually solved exactly and deterministically using integerprogramming techniques. Deterministic algorithms give the same output for any particular input each and every time they are executed on that input. Polynomial time solvable problems usually employ deterministic algorithms to get the exact optimal solution. However, the geometric bin packing problem is known to be strongly NPhard and conventional integer programming methods such as branch and bound algorithms may take exponential time to solve the problem deterministically to optimality. In recent years, researchers have used approximation and randomized algorithms and heuristics with varying degrees of success in trying to find near optimal solutions to the geometric binpacking problem. For NP complete problems where optimal solutions cannot be achieved in polynomial time, approximation algorithms are often used. An approximation algorithm is deterministic but inexact and it aims at obtaining a nearoptimal solution in polynomial time. The level of approximation is given by an approximation ratio p(n), which is the ratio of the cost of the solution provided by the algorithm to the cost of an optimal solution. This ratio is provably guaranteed. A randomized algorithm is one that makes some random choices. The behavior of randomized algorithms, depend not only on the input but also on the values produced by a random number generator. Although unproven, randomized algorithms are efficient in practice in finding near optimal solutions for NPcomplete and NPhard problems. Deterministic heuristics and randomized heuristics such as simulated annealing and genetic algorithms have been used extensively for geometric bin packing problems. These approaches have been found to make a good tradeoff between efficiency and quality of the results they provide, but offer no guarantees unlike approximation and randomized algorithms. These approaches are discussed here more detail. Heuristics As stated earlier, heuristics are also used to obtain good feasible solutions for NP hard problems. Heuristics are usually deterministic algorithms that use a rule of thumb that is simple. The basic strategies for heuristics are divide and conquer and iterative improvement. Although heuristics work quickly and efficiently, the quality of their output may leave much to be desired. The performance of heuristics is usually tested by running them on a set of inputs called benchmarks. The outputs of the heuristic for these benchmark inputs is then compared to the outputs of other heuristics run on the same set of benchmarks. This form of performance testing has some obvious drawbacks. The benchmarks represent only a small portion of the input universe and fail to describe the general problem instance. The quality of the outputs measured by the benchmark set may not help in improving the heuristic for general cases. Throughout this paper, the word "pattern" is used for twodimensional shapes and the words "object" and "part" are used interchangeably to denote shapes in three dimensions. The container for twodimensional cases may be assumed to be rectangular in shape and that for a threedimensional case may be assumed to be cuboids unless stated otherwise. Randomized Heuristics Simulated Annealing Randomization has proved to be a very effective technique for finding near optimal solutions for highly combinatorial problems. The objective behind a randomization technique is to optimize a function using a random sampling of the solution space. Simulated annealing is one of the most popular randomized search methods being used in combinatorial optimization. It was first introduced by Kirkpatrick et al. (Kir83) when he combined statistical mechanics of multibody systems with combinatorial optimization. The main idea behind simulated annealing is to reduce the overall energy of the system, which is defined by a cost function, in a gradual manner from a highenergy state to its ground state, which represents an optimal solution. This technique closely resembles the annealing process of metals where metals are heated to temperatures above their melting point and then cooled gradually to form uniform crystalline structures. The important factors in the annealing process are the formulation of the cost function and the rate at which the energy of the system is reduced. If the energy of the system is reduced rapidly, the final solution is usually metastable. This is analogous to the quenching of metals which leads to a nonuniform crystalline structure with a higher than optimum energy state. The energy of the system is reduced by a random search that not only chooses solution points that reduce the objective function but also accepts solution points that increasefwith a probability p. A control parameter T, which is analogous to the temperature in the annealing of metals, is used to narrow the search down to a near optimal solution. p e (6f/T) p=e During the initial stage of the algorithm, the control parameter allows the algorithm to make large changes to its parameter values. This allows the algorithm to explore new regions in the parameter space. As the algorithm progresses, the control parameter is lowered slowly and this forces the algorithm to perform a neighborhood search that eventually yields to a near optimal solution. Genetic Algorithms Genetic algorithms, like simulated annealing, utilize a randomized search technique to find near optimal solutions for combinatorial problems. This method of optimization was first developed by John Holland in 1975 (Hol75) and was then made popular by one of his students David Goldberg in 1989 (Gol89). Over the last decade, genetic algorithms have received significant attention for their effectiveness and quality of solutions for problems that cannot be solved using conventional optimization techniques. Genetic algorithms or GAs are based on the natural evolution of living organisms. The process of adaptation in a changing environment is the key to survival. This adaptation process takes place over a number of generations and tends to yield a highly fit set of individuals that are capable to producing off springs that have a higher chance of survival. The level of fitness of an organism may be determined from its genetic makeup. The genetic makeup of an organism contains information about the various attributes of the organism. This attribute information is stored in the genes of its chromosomes. The fitness may depend on the type of value that each gene takes on and the nature of interaction between genes. The structure usually leads to a highly nonlinear and epistatic solution space and despite its complexity, increasingly fit organisms are Figure 13. Structure of a typical genetic algorithm. created as a result of the evolutionary process. Researchers have modeled various intractable problems such as the traveling sales person problem based on this technique and found that it can be used to find near optimal solutions. The typical structure of a genetic algorithm consists of a population of a set of coded strings called chromosomes. These chromosomes are built up of smaller elements called genes. Each gene represents a certain attribute of the problem that the chromosome is modeled after. A gene may take on several different values called alleles. For example, the layout of a machine shop floor may be modeled by a chromosome whose genes represent the locations of the machines on the shop floor. The values that a gene can take on are called alleles. In the machine shop example, the finite set of locations that each gene can take on are the alleles for the gene. Each chromosome is associated with a fitness value that is calculated with the help of an evaluation function. The average fitness value of all the chromosomes in the population gives an idea of the fitness of the entire population. At the start of the algorithm, the genes are assigned random allele values and the fitness of this initial state is computed. Just as in nature, the refinement of the population occurs over several generations. During the course of each generation, the algorithm applies genetic operators such as reproduction, crossover and mutation to the chromosomes. Reproduction is the process of selecting chromosomes whose genes will be passed on to the next generation. The selection is usually based on the fitness of the chromosomes. Chromosomes that have higher fitness values have a greater probability of being selected. The crossover and mutation operators are applied to the selected chromosomes to produce the off springs that form the next generation. Crossover is the process of selecting genes from two parent chromosomes to form a new offspring chromosome. The crossover operator must ensure that some of the characteristics of the parent chromosomes that pertain to the problem are retained in the off springs. These characteristics are maintained in substrings of short defining length called schemata that form the building blocks of chromosomes. The crossover operator helps in propagating highly fit schemata from generation to generation giving exponentially increasing samples to the observed best. The mutation operator randomly alters genes in the new population, usually with a very small probability. The purpose of the mutation operator is to get the algorithm to move out of local optimums by causing some random perturbation of the genes. A detailed view of the structure of genetic algorithms and their operators may be found in Goldberg (Gol89). Geometric Bin Packing Problem Versions Over the last three decades, the binpacking problem has been studied by researchers in various forms. Research in this area began with the classical one dimensional binpacking problem, which served as a foundation for the analysis of approximation algorithms. It was one of the first combinatorial optimization problems for which performance guarantees were investigated. Since then, the problem has been broken down into several different versions based on various factors such as geometry of the objects, number of bins, nature of the problem and its constraints. All of these versions are very different from each other except for one common property they all contain a capacity constraint. The bin or bins that need to be packed have a finite capacity that cannot be exceeded. Figurel4 shows how the binpacking problem can be broken up into different versions based on various factors. Different combinations of these factors yield different versions of the problem. With the exception of the single bin decision problem with no input shape information, which is trivial, none of the versions of the problem are polynomial time solvable. The single bin optimization problem with no shape information may be framed as a knapsack problem that uses the size of the objects as the profit. Such a problem may be framed as follows. Given a set of objects L = {al, a2, a3, ...., an}, ai e {0,1}, and each object having a certain size wi, a container with size W, Max i= 1..n aiwi subject to i= 1..n aiwi < W This version of the problem is known to be NPhard. Capacity Constraint I ,With Different Input Shap es/ Without Shapes i __  _   Decision Problem Nonoverlap Constraint Optimization Problem  I ;1D/2D /3D Constrained/  Unconstrained  Geometric Shapes / Arbitrary Shapes Single Bin / Multi Bin Figure 14. Factors that determine the version of the binpacking problem Single bin packing problems that consider the shape of the objects being packed are useful in applications like container loading and stock cutting. The decision version of the problem is NPcomplete while the optimization version is strongly NPhard even for simple geometric shapes. The decision version of the problem may be framed as follows. Given a set of n threedimensional (or twodimensional) objects and a container with dimensions WHD (or WH), find if it is possible for all n objects to be packed into the container without overlapping. In the optimization version of the problem, a finite set of n threedimensional (or twodimensional) objects must be packed into a container with dimensions WD (or W) and infinite H such that the packed height H' of the objects is minimized. The single bin packing problem may be further categorized into online or offline packing. In the online packing process, the items must be packed in a predefined order or sequence, and information about the items is made available in that order. An online packing algorithm needs only to optimize the position and orientation of each item based on its shape and the space available in the bin after the previous items in the sequence have been packed. Since this method of packing performs only a local optimization, greedy algorithms and heuristics are best suited for it. Offline bin packing on the other hand is a global optimization process where there is no restriction on the order in which the items are packed. Most researchers that attempt to optimize a single bin taking shape into consideration resort to heuristic methods or randomized algorithms. In addition to this, the algorithm may be further constrained or unconstrained. Additional constraints such as low center of gravity of the container, or order of removal of the objects may be used. Typically, heuristic search methods and randomized heuristics such as simulated annealing and genetic algorithms are used for this type of packing process. Bin packing problems that involve the packing of multiple bins are known as multibin packing problems. The aim in such problems is usually to partition the items into groups while ensuring that the net volume of each group is less than or equal to the capacity of each bin. Similar to the single bin packing problem, multibin packing problems may be framed as NPcomplete decision problems where the objective is to find if it is possible to pack a finite set of items into a finite set of bins. They may also be framed as optimization problems where the objective is to minimize the number of bins that are required to pack a finite set of items. Also, just as in the single bin packing case that does not consider the shape constraint, the multibin packing problem with no shape constraint does nothing to find if the partitions that it created are actually feasible. The shapes of the items in each partition may prevent the items from being packed into the bin in spite of the volume constraint being met. This is illustrated in Figure 15. Although the grouping shown in the figure satisfy the capacity constraint, containers (a) and (b) (a) (b) (c) Figure 15. Multibin packing where capacity constraint is met but shape constraint is violated cannot be packed without overlapping due to the violation of the nonoverlap constraint. When the shapes of the items are taken into consideration, the problem becomes even more intractable. As a result, research for the multibin packing problem with nonoverlap constraint has been limited mostly to rectangular shaped objects. Multi binpacking problems have almost always been treated as offline binpacking problems. General Formal Problem Statement Based on the categorization of the binpacking problem given earlier, the problem of packing contaminated waste may be framed as a constrained threedimensional multi bin packing problem with a nonoverlap constraint as follows. Given a finite set of three dimensional objects of arbitrary geometry, and an infinite number of containers with dimensions WHD (or RH if container is cylindrical), pack without overlapping or splitting, all the objects into the minimum number of containers subject to the following constraints. * The center of gravity of each packed container must be below a certain threshold value. * The cumulative dose of each packed container must be below a certain allowable value. * The packing configuration of each container must not contain interlocking shapes. * The final position and orientation of each object in the container must result in a stable placement when the objects are placed in the order determined by the algorithm. Complexity The factors that make the binpacking problem hard are the packing order (sequence in which the objects are packed) and the nature of the shape and size of the items. For a set of n items, there are n! different sequences in which the bin may be packed. For each such sequence, there may be several different ways of placing the items into the bin based on the nature of the shape and size of the items. Figure 16. shows an instance of a packing problem that may not only have infinite solutions, but also infinite optimal solutions. The packing configuration shown may be rotated by small amounts about the vertical axis of the container to yield infinite similar solutions. Thus, the solution space for such a binpacking problem is extremely large and multimodal. For problems such as this, it is sufficient if an algorithm is capable of finding a "good" feasible solution that can be computed efficiently. Randomized algorithms such as simulated annealing and genetic algorithms are known to do just this. Figure 16. An infinite solution space with infinite feasible solutions may be possible in the threedimensional binpacking problem In addition to the packing order, the size and shape of the items being packed play an important role in the design of a packing algorithm. Most often, all the items that need to be packed have specific geometric shapes such as rectangular, rectilinear or spherical shapes. Geometric shapes tend to reduce the solution space in terms of the number of optimal positions and orientations that each item may have. A sphere for example, may be placed at several positions in the bin but it has only one fixed orientation. An algorithm designed to pack 2D rectangular shapes may take advantage of the fact that the OA 14 optimal solutions for most input instances has the items oriented in one of two possible 90degree orientations. This automatically reduces the feasible set of orientations, and therefore the solution space. The strippacking algorithm developed by Lodi et al. (Lod99) makes use of size and shape information of the items to narrow down the search for a near optimal solution. Nongeometric or irregular shaped items may have extremely large or even infinite feasible positions and orientations. CHAPTER 2 LITERATURE SURVEY This section gives an overview of some of the approaches and optimization techniques that have been used in the past for the two and threedimensional binpacking problem. Theoretical Work Due to the nature of the complexity of the problem, relatively less work has been done in analyzing bounds when compared to the actual development of heuristics and algorithms for the problems in two and three dimensions. Among the theoreticians in this field, Silvano Martello and Daniel Vigo have been prominent researchers in the areas of numerical simulation and combinatorial optimization and have published several papers that describe exact and approximation algorithms for the binpacking problem in two and three dimensions. Their work focused on packing rectangular shapes into the least number of bins. They have presented a lower bound for twodimensional binpacking problems with rectangular shapes that may be rotated by 90 degrees (Mar98). They have proved that the worstcase performance ratio of the sum of the area of the packed rectangles to the area of the container is 1/4. A branch and bound algorithm was used to test the effectiveness of the lower bound. The lower bound was later extended to three dimensions and verified with a similar branch and bound method in Martello et al. (Mar00). Experimental results have shown that smaller instances of the problem can be solved to optimality using exact algorithms, but for larger instances, approximation algorithms are required. Martello et al. (Mar98) explored strip packing and tabu search methods for obtaining good approximations with larger instances. In the strip packing procedure, all the patterns are packed into a strip of infinite width and height equal to the bin height. The packed strip is then partitioned into slices of width equal to the bin width. The patterns that occupy each slice are packed into at most two bins. The tabu search method is a metaheuristic that is applied to an underlying heuristic and its goal is to prevent the underlying heuristic from cycling in a local optimum by forbidding or penalizing moves that tend to guide the heuristic into a local optimum. Heuristic Search Methods Albano and Sapuppo (Alb80) resorted to heuristic search methods used in artificial intelligence to optimize the layout of irregular shaped twodimensional patterns on large stock sheets. They developed a deterministic solution to the allocation problem using the A* heuristic search method in Nilsson (Nil71). A simple set of rules was used to place the patterns on the sheet metal. After a pattern was placed, a profile that separated the available space from the occupied and wasted space was generated. This profile aided in the placement of the next pattern. For the n remaining patterns, k orientations were sampled on the current profile and of the n x k possibilities, a fixed number of successors were chosen based on the least amount of wasted space. Information of the chosen successors was maintained in the form of a directed graph where the edges represented the amount of wasted space and the nodes represented the patterns in particular orientations. By decomposing the allocation problem into a graph problem, the author was able to apply the A* search heuristic and expand potentially good nodes based on current estimates of the total wasted space. The size of the graph was dynamically maintained in order to reduce the amount of time taken to find a good solution. This created a tradeoff between the quality of the solution and the time taken for the solution produced. Figure 21 shows an example output of the heuristic. Figure 21. Albano and Sapuppo, A* heuristic output, 1980 Another heuristic search method was explored by Robert Mcgee (McG97) for the online packing of threedimensional irregular shaped objects into a cylindrical drum. The parts and container were modeled with the help of a voxel data structure. There was no attempt made to optimize the packing order of the objects. The objective of the heuristic was only to minimize the void space and trapped space that was created from each placement of an object in the container. Void space was defined as the space directly below the object just placed, that was not already occupied by the previously placed objects. The space between the object just placed and the walls of the container was considered as trapped space if this space contained too few continuous voxels. In order to place the objects into the container with minimal computation, a data structure called a chain code matrix was used to keep track of the surface voxels of the parts in the container. The heuristic used a brute force method of checking for all possible placements of the object on the chain code matrix surface and with a one voxel translation resolution. For each position, an orientation resolution of 360/theta was used about all three axes of rotation. theta was a userpreset parameter. For each placement, a quick surface interference check was performed to check the feasibility of the placement. If a feasible placement was found, it was checked for stability. The void space and trapped space were then computed if the object was found to be stable. The best placement of all the feasible and stable placements was then chosen based on the least void space and trapped space that it created. The Figure 22 below shows the placement of six parts in the cylindrical container using this method. Figure 22. Robert McGee, online heuristic output of six packed shapes, 1997 Randomized Heuristics Cagan et al. (Cag96) used simulated annealing to optimize a threedimensional offline binpacking problem for irregular shapes. The packing problem was formulated as a multiobjective optimization problem. Each item possessed an attractive force based on its distance to the centroid of the container. Penalty forces were given to volumes lying outside the container and to intersecting volumes. These individual forces were then summed up and weighted. The objective of the simulated annealing algorithm was to minimize the weighted sum. An octree data structure was used to model the items and a multiresolution modeling technique was implemented to reduce the amount of time taken for interference checking. At higher temperatures, lowresolution models of the items were used, and as the temperature was lowered, the accuracy of the octree models was increased. This time saving method was justified by the fact that at higher temperatures, the algorithm does a random walk in the solution space and does not require an accurate estimate of the objective function. But, at lower temperatures, the system performs a neighborhood search, which implies that the overall state of the system does not change much. This makes a more accurate evaluation fast with the multi resolution modeling technique. Results of tests performed on benchmark problems containing four and sixtyfour cubes were presented. ,, Pallm B PattmA PanlHmA Figure 23. Computing the displacement along the yaxis in the heuristic by Ono and Wanatabe 1997 (cited in Das97). Ono and Watanabe (cited in Das97) used a genetic algorithm to optimize the usage of sheet metal when arbitrary twodimensional patterns had to be cut out of it. Their approach used the ordering of the patterns to model the chromosomes. This set the search space to n! where n is the number of patterns. The fitness of the chromosome was evaluated based on a heuristic called the Layout Determining Algorithm (LDA) that was used to find the placement of the patterns on the sheet metal with no mutual overlap. The fitness was a measure of the sheet length used for a particular ordering or chromosome. The LDA moves the pattern along the sheet metal's height and width until it finds a position for which the pattern does not overlap the previously placed patterns. This is as shown in Figure 23. The increments with which the pattern is moved is based on simple interference checks along the X and Y directions for each vertex in the patterns. The first feasible position found for a pattern is its final position on the sheet. No attempt is made to optimize the position of a pattern for a particular ordering. In addition to this, the Anitial 497 th gernatioe n I  81 8 Figure 24. Results from a genetic algorithm, Ono and Watanabe (cited in Das97) 1997. pattern are considered nonorientable by the LDA. Results show a convergence in the genetic algorithm as shown in Figure 24 below. The paper also shows the comparison of three popular crossover operators CX (cyclic crossover), PMX (partially mapped crossover) and OX (order crossover) that were used for this problem. CHAPTER 3 RESEARCH OBJECTIVES As stated earlier, the problem of packing contaminated waste calls for the development of a threedimensional binpacking algorithm that is capable of producing near optimal packing configurations while obeying certain physical constraints. Due to the complex nature of this problem, the author chose to simplify the problem into a two dimensional packing problem as a first step. The focus of this research was limited to finding a good feasible solution rather than a theoretical analysis. Insight gained from handling the simpler form of the problem and from the results obtained from it may then be used to effectively come up with a solution for the problem in three dimensions. The final threedimensional case was left for future work. In order not to loose the main properties of the original problem, some of the physical constraints that applied to the original three dimensional problem had to be incorporated into the two dimensional case. Also, the simplified twodimensional problem had to be modeled in a way that could be easily extended into three dimensions. In order to accommodate all these changes, the generalized formal problem statement was reformulated into the simplified formal problem statement given below. Simplified Formal Problem Statement Given a finite set of 2D polygonal patterns of arbitrary shape and a rectangular container with width W and infinite height, find a packing configuration that minimizes the packed height of the container such that none of the patterns violate the following physical constraints. * Patterns do not overlap. * Every pattern must be stable when placed in the order defined by the final packing configuration. * There should be no interlocking patterns in the final packing configuration. Other constraints such as allowable radiation dose levels of the container and the minimization of the center of gravity of the container were relaxed to further simplify the problem. Once the proposed solution has been described, it will be shown how these constraints may be added on at a later stage. Our Preliminary Attempts During the initial stages of the research, various approaches were analyzed and experimented with. The assessment of the advantages and drawbacks of these experiments aided in the formulation of the final solution to the 2D packing problem. Attempt 1: A Simple Genetic Algorithm Since the solution space was large, irregular and multimodal, the problem called for a randomized approach and genetic algorithms was chosen for this. At first, a simple genetic algorithm was implemented for rectangular patterns. The objective function was to minimize the intersecting area of the rectangles by moving them around within a container rectangle using random translations and 90degree rotations. The chromosome for this problem was coded as a series of (x, y, theta) values, denoting the position of the patterns' centroids and orientations. A single point crossover operator with a simple mutation operator was used to model the algorithm. Despite the weak objective function and the poor modeling of the chromosome with respect to the problem objective, the algorithm showed convergence and the final results showed that the algorithm retained chromosomes that represented patterns that were separated out. It gave preference to larger patterns since more was to gain from separating them out. This exercise helped in gaining insight into the working of genetic algorithms, their capabilities and pitfalls. The approach itself did not suit the problem at hand since it did not do anything to address the stability and interlocking shape issues. Besides, the task of interference checking can be very expensive when it is performed on arbitrary shapes. The Figure 31 below illustrates an output of this implementation. (a) (bi Figure 31. The simple genetic algorithm. (a) input (b) output after 989 generations Attempt 2: Divide and Conquer Explored The objective function of minimizing the intersecting areas of the patterns not only set the solution space as infinite (with mostly infeasible solutions), but also did not give the algorithm enough physical meaning. The result was a slow convergence. In an effort to find a stronger objective function, a divide and conquer approach was explored. The approach involved the partitioning of the container into two or more partitions and optimizing each partition separately while using the same random translation and rotation procedure as before for each partition. Although this method was more time efficient and gave the objective function more physical meaning, it was plagued with several problems. The partitions had to be at least as large as the largest pattern and this is hard to determine for arbitrary shaped patterns where the bounding box changes with the orientation of the pattern. The chromosomes could not be modeled without having duplicates after the crossover operator was applied. Falkenauer (Fal96) suggests a procedure that can be used to eliminate duplicates for the multibin packing problem. The procedure is found to work well for the classical binpacking problem, but it can be laborious and inefficient for the geometric single bin packing case that also takes placement of the patterns into account. Also, the space between partitions may not be utilized effectively and this would lead to poor final packing configurations. The issues with interlocking shapes and stable placement were still not addressed by the algorithm. The main disadvantage in the first two attempts came from mixing the packing order and the placement aspects of the algorithm. Idea of Main Contribution: A Hybrid Genetic Algorithm At this point, a decision was made to further simplify the problem by breaking it down into two parts, ordering and placement, and tackling them separately. This idea was independently discovered and was later found in Dasgupta et al. (Das97). The order in which the patterns were placed in the container was known to affect the quality of the packing configuration. Also, for a given ordering, a mechanism was required to find the best position and orientation for each pattern as it was placed in the container. This breakup was then fit into the genetic algorithm structure by using a chromosome built up of pattern IDs as shown in the Figure 32 below. Each chromosome represents a particular ordering and is associated with a fitness value. The fitness value gave an idea of how good (or bad) the packing was when the patterns were placed in the order specified by the chromosome. The placement of the irregular shaped patterns is a non trivial task that required a separate optimization procedure. Similar to the approach used in Dasgupta et al. (Das97), a heuristic was used for this task. Figure 32. Chromosome containing pattern IDs and representing a packing configuration obtained by a heuristic Packing problems in two dimensions can be modeled as either tiling problems or stacking problems. In the tiling approach, the patterns are packed in a horizontal plane similar to the laying of mosaic tiles on the floor. This method of packing may lead to packing configurations with interlocking patterns when arbitrary shapes are to be packed. Also, the effect of gravity and stability of the patterns cannot be incorporated into the tiling approach. The stacking problem is similar to the game of Tetris where patterns fall in a vertical plane and have to be positioned and oriented appropriately as they fall. This form of packing does not allow the formation of interlocking patterns even for arbitrary shaped objects. The notion of gravity and stability of the packed patterns may also be incorporated into this method. The stacking approach was thus found to resemble the contaminated waste disposal problem and was the basis for the placement heuristic. The 8 4 5 1 3 6 2 0 next section describes this new approach of breaking up ordering and placement in more detail. After having made the decision to simplify the problem to two dimensions and model it as a stacking problem, the problem was stated formally as follows. The choice of breaking the problem up into two parts gave rise to a hybrid algorithm that used randomization to optimize the order in which the patterns were packed and a deterministic placement heuristic to optimize the placement of the patterns in the container. Not only did this approach make the problem more tractable, it gave the genetic algorithm the physical meaning it needed to perform the optimization effectively. In addition to this, the physical constraints of stability and the prevention of interlocking packing configurations could be addressed with this new approach. The design and implementation of this approach is described in detail in the following section. Later sections show how this approach can be extended into three dimensions. CHAPTER 4 MAIN CONTRIBUTIONS OF CURRENT WORK This work is an extension of the work done by Robert McGee in 1997 (McG97). The shortcomings of his algorithm were analyzed and several new features have been designed into the current algorithm to better meet the requirements of the contaminated waste disposal problem. McGee's implementation utilized an online heuristic, that is, it assumed an input order of objects to be placed and following this order, it optimized the placement of each object in the container. The approach in this paper not only optimizes the placement of the patterns in the container but also the order in which the patterns are placed into the container. The voxel data structure used in the earlier implementation has the tradeoff between resolution and efficiency in terms of both space and time complexity. The algorithm in this paper uses a polygonal data structure, which can easily be replaced with one of the commonly used boundary representation data structures for the 3D case. This form of representation of the objects is more efficient and will provide better approximations to the real shapes. McGee's implementation used a brute force method to find a good placement for each object by translating the object over every voxel on the surface profile for a discrete set of orientations. The placement heuristic that has been developed in this paper also finds "good" placements and has a linear average case running time. To make the algorithm more efficient, no interference checking is performed in the current implementation. Finally, stability and interlocking shape constraints that were incorporated in McGee's implementation have also been considered in the current implementation. Assumptions To further simplify the problem, the following assumptions have been made, without loss of generality, about the nature of the patterns being packed. * The patterns do not have holes. This assumption was made since it is not possible to fill holes in the stacking method for the two dimensional case. When the stacking problem is extended to three dimensions though, holes may be filled with other objects using this method. * The patterns are assumed to be of unit thickness and are all made of the same material. Therefore, the center of mass of each pattern coincides with its centroid. This assumption also implies that the center of gravity of the packed container is automatically minimized by the minimization of the packed height of the container since all the patterns have the same density. * The container has a rectangular profile and is assumed to have unit depth too. Genetic Algorithm The model for the genetic algorithm chosen in this paper represents chromosomes as the packing order or sequence in which patterns are packed into the container. The number of patterns n that need to be packed therefore determine the length of each chromosome. Each chromosome consists of an array of integers in the range 0 to n1, such that every element in the array holds a unique integer in that range. Integers in the array represent pattern IDs. An array element i containing pattern IDj, implies that the pattern with IDj is the i 'th pattern to be packed into the container. The fitness values of chromosomes are computed with the help of the placement heuristic that actually performs the packing for each chromosome. Figure 41 illustrates the structure of the packing algorithm. The algorithm begins with the initialization of a population of randomly generated set of chromosomes that are decoded with the help of the placement heuristic. In order to Genetic Algorithm Initialize population reproduce Is termination No reproducecondition met? loop Yes crossover Yes stop mutate Placement Heuristic r decode offspring Figure 41. Flowchart of genetic algorithm initialize the chromosomes with random alleles, a function that generates uniform random permutations of an array must be used. The function RANDOMIZEINPLACE that is described in Corman et al. (CorOl) is used. The function runs in O(n) time and its pseudocode is given below. RANDOMIZEINPLACE(A) 1. n < length[A] 2. for i 1 ton 3. do swap A [i] > A [Random(i, n)] Once Initialization of the population has been performed, the algorithm is run for several generations until the termination condition is met. For each generation, loop in Figure 41 is runp/2 times (p being the population size is always an even number) and two off springs that are part of the next generation are created with each execution of loopl. Loop2 forms the outer loop and runs once for each generation. Reproduction is performed with a simple roulette wheel selection procedure where pairs of chromosomes are randomly selected with a probability proportional to their fitness values. The roulette wheel selection method gives chromosomes that are more fit, a better chance of propagating their genes to future generations while not completely ignoring the weaker chromosomes. The pseudocode for this function is presented below. REPRODUCTION(Pop, sumFitness) 1. jj O 2. partSum + 0 3. sRand < RANDOM(O,sumFitness) 4. while true 5. if sRand > partSum and sRand < partSum+Pop[++jj] fitness 6. then returnjj 7. partSum += pop[ij].fitness REPRODUCTION takes as input, the population and the sum of the individual fitness values of the chromosomes in the population and returns the index of the chromosome that is to be reproduced. At first, a random number sRand is chosen between 0 and sumFitness in line 3. The whileloop in lines 47 loops through all the fitness intervals from 0 to sumFitness until it finds an interval that sRand lies in. When an interval that bounds sRand is found, the index of the corresponding chromosome is returned. This operation needs to be performed twice to yield two parents that can be crossed and probably mutated to get two off springs. REPRODUCTION also runs in O(n) time. The main objective of the crossover operator is to create off springs from parents that have something in common with the parent chromosomes in terms of their context. That is, the decoded offspring must exhibit some similar characteristics from both decoded parent solutions. The crossover operator must also yield children that are not too similar to each other or to the parents. If this happens, all the chromosomes in the population will begin to look similar after a few generations and this would result in a degenerate or incest population that is incapable of searching the solution space. In addition to these general requirements for a good crossover operator, the order based encoding scheme chosen for the packing problem calls for an operator that does not produce chromosomes with duplicate genes. Each gene in the chromosome must contain a unique integer in the range 0 to n1. This added requirement cannot be fulfilled from the basic single point type crossover operators and calls for something more sophisticated. Michalewicz (Mic92) describes three operators CX (cyclic crossover), PMX (partially mapped crossover) and OX (order crossover) that are capable of meeting this requirement. The PMX and OX operators are somewhat similar except that the OX operator gives more importance to the relative ordering of the genes while the PMX operator gives importance to both ordering and position information. The CX operator, like the OX, retains the relative ordering information of the genes. Of the three operators, CX and OX were found to be the least disruptive from the point of view of relative ordering. OX was finally chosen because of its simplicity in terms of implementation. The OX operator is described with the help of the following example. Consider the two parents pi and p2 below. pl=7435216908 p2=3416820579 At first, two crossover points are chosen randomly. The crossover points are marked by 'I'. p1=7435 216 908 p2= 3416 820 579 The portions of the chromosomes that are between the crossover points are copied into the offspring. ol=xxxx x 216 xxx o2=xxxx 820 xxx Beginning from the second crossover point of the second parent, the genes are copied in the same order with the exception of the genes that lie between the two crossover points of the first parent. We get the sequence 5 7 9 3 4 1 6 8 2 0 which reduces to 5 7 9 3 4 8 0 when 2 1 6 is removed from it. The reduced sequence is then used to fill the remaining placeholders in the first chromosome starting at the second crossover point to yield the completed first child, ol = 3 4 8 0 216 579 Similarly, the second child is, o2= 3 5 1 6 820 974 As seen from the above example, both off springs contain substrings whose relative ordering can be found in the parent chromosomes. The relative ordering of substring 3480 in ol is found in p2, and the relative ordering of substring 820 in o2 is also found in p2. The off springs are also very different from their parents and contain no duplicates. ORDERCROSSOVER(P], P2) 1. for ii 1 to n // n is the length of the chromosome 2. do O[ii] Pl[ii] 3. if RANDOM(0,1) < 1PCROSS 4. then return O 5. cl < RANDOM(0,n) 6. c2 RANDOM(cl,n) 7. forii 0 ton 8. do rem[ii] < P2[ii] 9. for ii cl to c2 10. do forjj 0 to n 11. if Pl[ii] = rem[jj] 12. then rem[jj] 1 13.jj c2 14. for ii < 0 to n 15. do if rem[ii] 1 16. then O[/j%n] < rem[ii] 17. jj++ 18. return 0 The pseudocode for the ordercrossover is given above. The function takes two parents PI and P2 as input and outputs a single offspring. In order to get two off springs from the same parents, the function must be called a second time with the order of the parents inverted in the function call. The function returns at line 4 (100PCROSS)% of the time, where PCROSS is the probability of crossover. If the function returns at line 4, the returned offspring is similar to P1. Lines 56 choose random cutoff points cl and c2. Lines 912 filter out the alleles rem, that lie within the cutoff points of the offspring from the remaining alleles ofP2. These remaining alleles are inserted into the offspring in lines 1317. The crossed over offspring is returned in line 17. ORDERCROSSOVER also runs in linear time. Once the chromosomes have been subject to the reproduction and crossover operators, a simple mutation operator is applied to them. The operator is applied to about 1% of the genes processed. When applied, it randomly chooses two genes in a chromosome and swaps them. The pseudocode for the mutation operator is given below. MUTATION(O) 1. for ii 1 to n / n is the length of the chromosome 2. do if RANDOM(0,1) < PMUTATION 3. then swap(O[ii], O[RANDOM(0,n)]) 4. return 0 Other parameters such as the size of the population and number of generations required, or the termination condition are based on experimental results and are discussed in the next section. Optimal Placement Algorithm General Approach The placement algorithm formed the inner most loop in the main genetic algorithm. During every generation, it had to be executed once for each chromosome in the population. For inputs that contain patterns with identical shapes, the algorithm depended solely on the heuristic for good packing configurations. The placement algorithm therefore needed to be extremely efficient in terms of both quality of placements and time complexity. Also, the placement algorithm had to be deterministic so that the fitness value for each unique chromosome was always the same. The general structure for the placement algorithm comprised of placing patterns on top of profile that was maintained in the container. The profile was made up of a list of straightline edges that marked the upper most edges of the patterns that were already packed. At the start of the placement algorithm, the profile was initialized to the two walls and floor of the container. This is as shown by the red dashed line in Figure 42(a). After each pattern was placed, the profile was updated in such a way as to blanket the pattern that was just packed. This is illustrated in Figure 42 (b,c,d). The search for a good I I initial profile (a) (b) (c) (d) void space Figure 42. Placing objects on top of a profile V placement involved finding a position and orientation for the pattern that resulted in the least void space and for which the physical constraints were not violated. The void space was defined as the space directly below a pattern that lay between the lower edges of the pattern and the profile. This too is illustrated in the Figure 42(c). Geometric Conventions A set of geometric and graphics conventions had to be devised before the placement algorithm was formulated. Two coordinate systems and a vertex numbering system were put together for this. These conventions are illustrated in Figure 43. The graphics coordinate system had its origin positioned at the upper left corner of the screen and oriented such that its positive yaxis was directed downwards and its positive xaxis directed from left to right. The graphics coordinate system was considered as the global coordinate system and was mainly used for graphics operations. Vertices of the container, profile and pattern were represented in the graphics coordinate system. The container coordinate system had its origin positioned at the lower left corner of the container and oriented such that its positive yaxis was directed upwards and the positive xaxis from left to right. This coordinate system was useful from the real world application point of view. The position and orientation of the packed patterns could be referenced from this coordinate system. The profile vertices were numbered from the top left to the top right corner of the container. The pattern vertices were ordered in the clockwise direction in the screen (or graphics) coordinates. A Clockwise ordering of the vertices in the graphics coordinate system results in a counterclockwise ordering in the Cartesian coordinate system. This allows the use of basic polygon algorithms written for the conventional counterclockwise ordering of vertices in the Cartesian coordinate system. The position of a pattern was defined by the position of its first vertex in the graphics coordinate system. Its orientation was defined as the angle subtended by the positive xaxis of the graphics coordinate system and the vector along the first edge of the pattern directed from vertex0 to vertex 1. x "0 2 4 5 6 34 12 9 10 Figure 43. Geometric conventions used in the placement heuristic Proof: Optimal Placement for the 2D NonOriented Case Sitharam and Wu (Sit02), took the lower edges of the 2D pattern and the profile edges as two sets of piecewise linear functions that are monotonic along the xaxis and proved that it was possible to find an optimal placement in linear time when the pattern edges can be translated along the x and y axes but not rotated. The entire proof is presented below. Given two continuous piecewise linear functions: (0,t) >R and g: (0,s) >R; where s < t, s and t positive; fhas n linear pieces and g has m linear pieces. The goal is to design an efficient algorithm to find 0 < u < ts, and v in R such that the function h,,v(x) : (u, s+u) >R, defined as g(xu) + v satisfies two properties. 1. h,.v(x) is atleastf(x) on h's support 2. 1 hf 1 (taken on h's support is minimized). g(xu) + v(u) g(x) + v(u) f(x) g(x) g(xu) 0 s t' Figure 44. Illustration of the problem for proving the nonoriented case As stated,f: (0,t) >R is a piecewise linear function with n linear pieces, and g : (0,s) >R is another piecewise linear function with m linear pieces, where t > s > 0. Define v : (0, st) R as v(u) = maxxE(u,+)f(x) g(xu)}. It follows that g(xu) v(u) >f(x) for Vx e (u, u+s). It is also clear that if uo and vo satisfy the two properties in the problem, vo v(uo). Let h,(x) = g(xu) + v(u), now we need to look for u such that h,(x) f(x) = f", +sh,(x) f(x) dx, is minimized. Since bothf(x) and g(x) are piecewise linear, for any fixed u E (0, ts), the distance d,(x) =f(x) g(xu) is also piecewise linear. Therefore, the maximum of d,(x) can only be taken at the break points located in [u, u+s]. This is shown in Figure 44 as the vertical dotted lines representing the possible position where the maximum of d(x) is taken. That means to compute v(u), only finite number ( n+m) of values ofd,(x) is needed. In other words, for any u e (0, ts), there is some breakpoint x, off(x) : v(u) = f(x,) g(x, u) or there is some break pointy, of g(x) : v(u) f(y, + u) g(y). Now let vf(u) f(x g(x, u), u E (x, s, x), V break points x, off(x); v' i() =f(y, + u) g(y,), u e (O y,, t y,) i (0 s), V break points y, of g(x), then v(u) = maxJ, fv1(u)}. All v/(u) are piecewise linear functions and can be computed quickly, in fact, they are all translations off(x) or g(x). So, v(u) is also piecewise linear and can be quickly computed. Now it is clear that h,(x) f(x) = g(xu) + v(u) f(x) is piecewise linear on both u and x. Therefore 11 h,(x) f(x) 1 is a quadratic spline for u. To get its minimum, one would compute its local minimum on each polynomial piece and then compute the global minimum. To maximize the maxnorm, one can simply compute the maxnorm of h,,(x) f(x) for each break point u, and compute the minimum of the maxnorms. To minimize the 2norm of h,(x) f(x), the final step becomes to compute the local minimum for each cubic polynomial piece and then compute the global minimum. This method can also be generalized to solve similar problems of two piecewise linear functions defined in R2. But extending this proof to the oriented case will involve more computations to find local minimums. This is an open problem. Our Approach 1: Optimal Placement At first, a placement technique was built out of a linear programming approach used for the design of molds that is described in deBerg et al. (deBOO). The main idea behind the approach was to find the shape of a mold from which the object to be cast could be extracted. Since different orientations of the object give rise to different molds, the objective was to find a suitable orientation for the object that would facilitate the removal of the object from its mold by a single translation along a direction vector d. This is possible only if d makes an angle of at least 900 with the outward normal f of all the surfaces on the mold. This is as shown in Figure 45. d Figure 45 Geomtery of Casting (DebOO) By treating the lower edges lying between the extreme vertices of the pattern as the surface to be cast, and a segment of the profile as a potential mold, the molding making approach was used to find the direction vectors d and D for the pattern and profile segment respectively as shown in Figure 46(b). The segment of the profile that was chosen had to be at least as wide as the lower edges of the pattern. Once these direction vectors were found, the pattern and profile segment were oriented such that their direction vectors were directed along the positive yaxis of the container coordinate system. The oriented pattern was positioned above the profile segment such that it's lower set of vertices were between the extreme vertices of the profile segment. The pattern was then translated towards the profile segment until it made contact with it. If the pattern was unstable, it was rotated either clockwise or counter clockwise about the first point of contact until it made a second point of contact with the profile segment. The decision of whether to rotate it clockwise or counter clockwise was made based on the location of the centroid with respect to the first point of contact. If the centroid was to the left of the first point of contact, the pattern was rotated counter clockwise in an effort to get a second point of contact to the left of the centroid and vice versa. The pattern was then rotated back by an amount the profile segment was first rotated to get the final position and orientation as shown in Figure 46(f). To find a near optimal placement, this procedure had to be executed for n (n being the number of pattern vertices) orientations of the pattern. Each of these pattern orientations had to be sampled against atmost m3 (m being the number of profile vertices) profile segments making it an O(mn) time algorithm. The orientations obtained from the direction vectors helped minimize the area between the mating edges of the profile and pattern. This approach looked promising, but it could not be adapted for the packing problem because it had a few serious flaws. The profile segment had to be at least as wide as the lower edges of the pattern in order to cradle the pattern. A reasonable way to find a profile segment that was at least as wide as the pattern and not too wide could not be found as the profile in this case was not monotonic along the xaxis. Finally, the placement search required a considerable amount of computing and this slowed the packing algorithm tremendously. Although this approach resulted in good placements, it had to be abandoned for a simpler and more efficient one. */ /I r \ i I (a) (b) (c) / ../ / // /" ( (d) (e) (f) Figure 46. Placement heuristic based on the linear programming approach for mold making Our Approach 2: Optimal Placement To make the heuristic lightweight, a simple but effective rule had to be adopted. Since no one rule can fulfill all the possible cases that can be encountered for arbitrary shapes, two simple rules that were very different from each other, provided good placements and complemented each other were chosen. The heuristic used these two rules to actually place the patterns in the container and the best placement was then picked from several sample placements. For each pattern to be placed in the container, PLACEPATTERN was called once with the pattern Ptn and the current profile Pr as input. Before the function began sampling placements for the pattern, it ran a profile smoothing routine SMOOTH PROFILE that eliminated profile vertices that were coincident, collinear, or subtended a concave angle that was less than half the smallest convex angle on the pattern. This helped speed up the algorithm. SMOOTHPROFILE ran in linear time. Once the profile was smoothed, several placements were sampled in lines 512 using PLACEMENT RULE1 and PLACEMENTRULE2. Placements that are contained within the container and are PLACEPATTERN( Ptn Pr ) 1. pl < 0 //initialize placement 2. bestPl 0 // initialize best placement 3. PE oo / initialize potential energy 4. Pr < SMOOTHPROFILE( Ptn, Pr ) 5. for i < 0 to n1 / n = number of pattern vertices 6. do forj <0 to m1 / m = number of profile vertices 7. do pl PLACEMENTRULE1( Ptn.vertex(i), Pr.vertex) ) 8. if pl.stableO and pl.contained) and pl.energyO < PE 9. then bestPl pl 10. PE < pl.energy( 11. pl < PLACEMENTRULE2( Ptn, pr. vertexj ) 12. if pl.stable0 and pl.contained) and pl.energy() < PE 13. then bestPl pl 14. PE < pl.energy( 15. if bestPI # 0 16. then PLACEPATTERN(Ptn, Pr, bestPl) 17. Pr < GENERATENEWPROFILE(Ptn, Pr) 18. return Pr stable, are recorded if they are found to have a potential energy that is less than that of the best placement bestPl. This selection is done in lines 8 and 12. The quality of a placement is judged by virtue of the pattern's potential energy in that placement. The best placement is one that has the least potential energy among all the sampled placements. Potential energy PE of a placement is given by the following equation. PE = (pattern area + void area)* height of pattern centroid above container floor Since the potential energy of a placement increases with void area and the height of the placement, the chosen placement is one that has close to minimum void area and height above the container floor. The inclusion of the pattern area prevents PE from going to 0 in cases when there is no void area in the placement. Also, the impact of the void area in the equation is relative to the area of the pattern. When the height of the placement is constant, the growth of PE with the increase in void area is proportional to the pattern area. If a good placement is found, the pattern in placed using the function PLACE PATTERN and a new profile that encapsulated the placed pattern was computed using the function GENERATENEWPROFILE. The new profile was generated in linear time and used to place the next pattern. PLACEMENTRULE1 paired up convex vertices belonging to the pattern with concave vertices on the profile and vice versa. For each convex vertex on the pattern, the pattern was positioned and oriented above each concave vertex such that the convex pattern vertex was directly above the concave profile vertex and formed the bottom most vertex in the pattern. The pattern was then oriented such that the vector along the inner bisector of the convex angle was parallel to and pointed in the same direction as the vector along the inner bisector of the concave vertex of the profile. This is shown in Figure 47(a). The pattern was translated vertically downwards until it made contact with the profile. Just as in the linear programming approach, the pattern was rotated to make a second point of contact with the profile (Figure 47(b)(c)). Once the pattern was placed, the placement was checked for stability. The pattern was considered stable if the two extreme points of contact were on either side of the centroid. PLACEMENTRULE1 worked well only when the angle of the convex vertex was less than or equal to the angle of the mating concave vertex. Also, placements near the walls of the container tended to intersect the container walls. Figure 48 illustrates a case where a concave vertex of the pattern is aligned with a convex profile vertex. Although this placement looks stable, it will be considered unstable by the heuristic because the two points of contact are not on either side of the pattern's centroid. To over come these drawbacks, PLACEMENTRULE2 that aligned the patterns with vertical edges in the profile was used. The patterns were rotated such that each edge connecting two adjacent convex hull vertices was made parallel to a vertical edge on the profile and formed the leftmost or rightmost convex hull edge based on whether the vertical edge of the profile was right facing or left facing. This is illustrated in Figure 49. The two rules were found to complement each other well, and if a perfect fit was available for a pattern, the heuristic was capable of finding it. The time that the heuristic took for each placement, depended on the nature of the shape in terms of the number of convex, concave and hull vertices, and the nature of the profile in terms of the number of convex and concave vertices, and number of vertical edges. The worst case running time of the heuristic is O(mn) (m being the number of profile vertices and n being the number of pattern vertices). (a) align vertices (b) drop (c) two points of contact (a) update profile Figure 47. First rule in the placement heuristic for a convex vertex in the pattern (b) drop (c) two points of contact (a) update profile Figure 48. First rule in the placement heuristic for a concave vertex in the pattern 0k I I (a) (b) II (c) (d) Figure 49. Second rule in the placement heuristic CHAPTER 5 EXPERIMENTAL RESULTS Choice of GA Parameters The performance of the algorithm can be greatly enhanced by choosing the right values for the population size, probability of crossover pCross and the probability of mutation pMutation. But, setting these parameters is known to be a difficult task. Haupt (Hau98) suggests various methods for refining these parameters and also states that there is no best way to do it, and that the behavior of the genetic algorithm depends on the problem being solved. A simple iterative procedure was used by running the algorithm on three problem instances that contained shapes for which the order was important in achieving good packing configurations. The population size, was first varied as a function of the input size while keeping pCross and pMutation fixed. The best convergence was obtained when the population size was varied linearly with the input size. pCross and pMutation were then altered in turn and a pCross of 0.6 and pMutation of 0.05 were found to further improve the convergence of the algorithm. Empirical Analysis The algorithm was executed for a number of problem instances, some of which were taken from previous papers. Each problem instance was executed 4 times and for 200 generations in each run. The outputs of all four runs for each instance were found to be consistent with each other in terms for the rate of convergence and the quality of the output. Figures 51 to 55 illustrate the comparisons in the outputs of the algorithm with the outputs presented in previous papers. The shapes of the pattern were copied by hand and are only approximations of the shapes presented in previous papers. The time that the algorithm took was found to be proportional to the number of patterns being packed, the number of vertices in each pattern and the width of the container. For a set of 10 patterns of comparable size and with 6 vertices per pattern, a container width capable of holding three patterns in a row, the algorithm averaged about 1 second per generation on a Pentium4 1.8GHz machine. Irregular Shapes For input instances containing irregular shaped patterns, the algorithm gave tight packing configurations and this is seen in Figure 53 to 57. Figures 53 to 55 show comparisons with outputs of previous papers that contained irregular shapes. The algorithm gave packing configurations that were as optimal as previous algorithms while adhering to all the constraints. Figure 56 and 57 show the convergence of instances containing only convex patterns and only nonconvex patterns. The algorithm performed equally well for both cases. Geometric Shapes The algorithm was also run with inputs containing only geometric shapes and was compared to the outputs presented in petridis et al. (Pet98) and Dasgupta et al. (Das97). Figure 51 and 52 show comparisons for geometric shapes. The outputs of our algorithm did not fair well in comparison to the previous algorithms for two reasons. Firstly, the implementations in Petridis et al. (Pet98) and Dasgupta et al. (Das97) did not consider rotations and thus reduced the problem complexity significantly. Secondly, the heuristic is unable to make a global decision between two or more locally optimal placements. There is a possibility of two or more distinct chromosomes encoding the same solution when the difference between them is small and restricted to neighboring genes as shown below. 0123456 0132456 The two chromosomes are similar except for the third and fourth genes that are swapped. The placement heuristic may output the same packing configuration for both chromosomes. This form of redundancy can grow exponentially with the size of the input and reduce the effectiveness of the algorithm. But, the possibility of this happening for a irregular and unique set of shapes is rare. Genetic Algorithm Drawbacks When the input set contains patterns of identical shape, the problem of redundancy becomes more significant. As the percentage of identical or duplicate shapes increase in the input set, the genetic algorithm gets increasingly ineffective and is actually rendered completely ineffective when all the patterns in the input set have a similar shape. For such input cases, the algorithm depends solely on the power of the placement heuristic as the order of placement ceases to play a role in the optimization process. This is seen for problem instances shown in Figures 51, 52 and 53. These instances contain duplicate shapes and the algorithm takes relatively more time to converge. From the experimental runs that were performed, it was found that the algorithm does not give better results beyond a certain point. Therefore, a good termination condition for the algorithm would be to stop when there is no improvement for a user defined number of generations. Since the algorithm updates the graphics with each improvement, the user may also terminate it once a satisfactory result is obtained. 52 (a) 220 (b) 220 (c) 220 (d) 200 Figure 51. Arrangement of 13 geometric patterns (a) 12th generation, (b) 39th generation, (c) 47t generation, (d) Output from Petridis et al. (Pet98) (a) (b) Figure 52. Arrangement of 14 geometric patterns (a) 2nd generation, (b) 36th generation, (c) 84th generation, (d) output from Watanabe and Ono (cited in Das97) tilt_ (a) (b) (c) (d) Figure 53. Arrangement of 36 irregular patterns (a) 1st generation, (b) 16th generation, (c) 40th generation, (d) output from Watanabe and Ono (cited in Das97) (c) (d) 4= (a) (b) (c) (d) Figure 54. Arrangement of 24 irregular patterns (a) 1st generation, (b) 5th generation, (c) 26th generation, (d) output from Albano and Supoppo (Alb80) Ila I_ _ (a) (b) Arrangement of 30 irregular patterns (a) Supoppo (Alb80) 2nd generation, (b) 9th generation, (c) 22nd generation, (d) output from Albano and Figure 55. 24; (a) (b) (a) Figure 56. Arrangement of 14 irregular convex patterns (a) 2nd generation (b) 7th generation (c) 25th generation Figure 57. Arrangement of 10 irregular nonconvex patterns (a) generation (c) 39th generation 1st generation (b) 8th L NJ L Placement Heuristic Drawbacks The heuristic implemented in this paper runs in linear time and has some amount of redundancy built into it. This redundancy helps in finding near optimal local placements regardless of the shape of the patterns. Placements that are sampled by the heuristic are found to be at or near the break points present along the profile. But, it suffers from one drawback. As the patterns are packed, the profile begins to develop narrow valley like regions. The heuristic does not find the placements directly above these regions to be good placement even though they may be better in terms of reducing the container height. This is because the heuristic settles for a placement whose potential energy is the least among all the sampled placements, and the void area created by each placement is considered in the calculation of the potential energy. The area in the valley region becomes part of the void area and reduces the potential energy of any placement above the valley. Figure 58 shows an instance of this problem. The alternate placement in the figure is not considered as a good placement because its potential energy is reduced due to the void area created in the valley. The effect of this problem can also be seen in the results shown in Figure 54 and Figure 55 where the patterns seem to be stacked directly on top of each other with longitudinal gaps between them. Not considering the void area in the calculation of the potential energy of a placement is not the solution to the problem because it results in a lot of wasted space below the placements. The problem can be eliminated by improving the profile smoothing function. The algorithm only minimizes the effect of slippage by searching for placements that are stable. Slippage may occur when objects are placed into the container due to factors such as low coefficient of friction at contact points. Checking for slippage is computationally too expensive for the heuristic. These drawbacks may be fixed with the help of a vision system that can detect a change in the real profile when compared to its virtual counterpart after each part is packed. If a change occurs, the packing algorithm may be executed once again for the unpacked parts and the real profile. The flexibility provided in this manner makes the algorithm more adaptable to changes in the real environment. placement from heuristic alternate placement I void area preventing alternate placement Figure 58. A drawback in the placement heuristic Conclusion There is a lot of scope in further improving the heuristic to produce better local placements. The approach used in this paper is simple and may be mapped into three dimensions. The hybrid nature of the algorithm allows it to be optimized against multiple constraints such as minimization of the center of gravity of the container, order of 59 removal and pressure constraints of the objects. It also has the flexibility of being used for both online and offline packing. The algorithm, therefore is capable of finding near optimal packing configurations for a set of arbitrary shapes, capable of optimizing against multiple constraints, is flexible enough to adapt to real world changes, is general enough to be applied to other packing applications and integrates well with an autonomous packing system. CHAPTER 6 FUTURE WORK From the inference gained by implementing the packing algorithm in two dimensions, a three dimensional packing algorithm may be implemented more effectively. The algorithm presented in this paper may be extended to three dimensions with the help of an edge based boundary representation data structure for the objects and the profile. The two dimensional profile would map onto a surface. A container with a fixed width and depth but with an infinite height may be used with the same heuristic and genetic algorithm objective function to yield similar results. The methodology used in searching for near optimal placements may also be used in three dimensions. There is a lot of scope for improving the heuristic either to make it find local optimal placements, or placements that will lead to better global solutions. The genetic algorithm may also be improved by making it adaptive. Petridis et al. (Pet98) suggests a method that varies the fitness function dynamically and shows how it can improve the convergence time for the algorithm. Multibin packing may be achieved by making the heuristic pack multiple bins for each chromosome. The objective function of the genetic algorithm would then have to be changed from minimizing the packed height of the bin to minimizing the number of bins used. The algorithm finds tight packing configurations for the patterns without considering the center of gravity of the packed container. If the patterns (or objects in three dimensions) are made of different materials that vary in density, a tight packing 61 configuration may not mean that the center of gravity has been minimized. This is a result of the second assumption that was made about the nature of the patterns being packed. The algorithm though, may be changed to overcome this drawback by considering the density of the patterns when the potential energy of each placement is calculated by the placement heuristic. APPENDIX A DOCUMENTATION Java 1.3 was chosen for the implementation of the algorithm since it is well suited for creating rapid prototypes. The language also provides extensive support for 2D graphics, utilities such as random number generators and basic data structures. The code was split into three packages genAlgthm, gui and packingDataStruct described in Table 1 below. Each package and their contents are detailed in the tables that follow. Table 1. Packages contained in the implementation of the packing algorithm Package Descriptiom gui Contains classes that build the graphical user interface. packingDataStruct Contains the data structure used to describe the patterns and container. genAlgthm Contains code for the genetic algorithm. Table 2. Classes contained in package genAlgthm Class Description Chromosome Implements a chromosome as an array of integers that contains the packing order of the list of patterns. Each chromosome is associated with a fitness value and holds the pose information of the patterns in the part list when the patterns are packed in the order defined by the chromosome. Population Implements a population of chromosomes and the genetic algorithm. Table 3. Classes contained in the package gui Class Description DataPanel A panel to the east of the main window that contains global data of the packing algorithm. The data panel is updated frequently during the execution of the algorithm. If the mouse pointer is moved over a pattern, data associated with the pattern in displayed in the data panel. DrawPanel A panel in the center of the main window that can be used to draw twodimensional shapes for the patterns and the container. The panel is equipped all the available mouse handlers. Patterns are drawn by single clicking the mouse at the desired vertices of the pattern. Clicking near the first vertex closes the pattern. The container is drawn by single clicking the mouse either of the two diagonal ends of the container. A pattern that is being drawn may be canceled by clicking the right mouse button. FileHandler Main MenuBar FileFilter StatusPanel The draw panel is refreshed frequently during the execution of the algorithm to show the most recent optimal solution obtained by the algorithm. This class contains code that handles the file input/output operations for the implementation. Main contains the main method for running the packing program. Typing "java gui.Main" from outside the gui directory on a console or shell window starts the program. Main extends JApplet and can be run as a standalone program or as an applet. This class contains code for the menu bar situation to the north of the main window. A convenience implementation provided by Sun Microsystems, that filters out all files except for those type extensions that it knows about from the FileChooserDialog box. Extensions are of the type ".dpk" for the packing algorithm. Case is ignored. A panel to the south of the main window that gives the user status information, tool tips and error/warning messages while the user interacts with the program. Table 4. Classes contained in the package packingDataStruct Class Description BasicTests A set of class methods containing code for basic computational geometry operations. Container A top level data structure that describes the container. Container has an inner class Profile that describes the profile of the container and the operations associated with the profile. ConvexHull Contains the implementation of Graham's algorithm for finding the convex hull of a polygon. This class implements the comparable interface in Java. Heuristic Implementation of the Placement Heuristic. Part Data structure that describes the pattern, its attributes and the operations associated with it. Part extends Vertex. PartList Data structure used to hold a list of parts or patterns. Pose Defines the position (x,y) and orientation theta of a geometric entity in the graphic coordinate system. Vertex Describes a vertex, its attributes and all the operations performed on it. Table 5. Attributes and methods contained in genAlgthm.Chromosome Field Summary public doublefitness Fitness value of the chromosome. protected int [] gene Set of genes making up the chromosome. protected Pose [] pose Array containing pose information for the list of patterns packed in the order defined by the chromosome. Constructor Summary Chromosome (Chromosome chromo) Creates a new chromosome that is identical to the input chromosomes chromo. Chromosome (int size) Creates a new chromosome of size size and initializes it with a random set of genes. Method Summary public int [] getChromosomeo Returns the chromosome as an array of integers. public int getGene(int index) Returns the gene with the specified index. public void setGene(int index, int value) Sets the value of a gene with the specified index. public void setPose(int index, Pose pose) Sets the pose of the pattern with the specified index. public int size( Returns the size of the chromosome. public void swap (int index], int index2) Swaps two genes in the chromosome. public j ava.lang. String toStringo Returns the string representation of the chromosome. Table 6. Attributes and methods contained in genAlgthm.Population Field Summary protected double avgFitness Average fitness of the population. private Container cc Container. private java.util.Random cRand Random number generator for the crossover operator. Private DrawPanel drawPanel Reference to the drawing panel of the graphical user interface. protected Chromosome fittestChromo Deep copy of the fittest chromosome. private int genCtr Generation counter. private Heuristic ht Reference to an instance of the placement heuristic. protected double maxFitness Maximum fitness value in the entire population for all generations. private static final int MAXGEN Maximum number of generations that the genetic algorithm will run before terminating automatically. private intpopSize Maximum size of the population. protected double minFitness Minimum fitness value in the entire population for all generations. private java.util.Random mRand Random number generator for the mutation operator. private int numCross Holds the number of crossovers performed. private int numGenes Number of genes in a Chromosome. private int numMutatation Holds the number of mutations performed. private static final int PCROSS Probability of crossover. private static final int PMUTA TION Probability of mutation. protected Chromosome [] pop Population of chromosomes. private java.util.Random rand Random number generator for generating a Random sequence of genes in each Chromosome. protected double sumFitness Sum of the fitness values of all the chromosomes in the population. Constructor Summary Population (DrawPanel drawPanel) Creates a new population of chromosomes based in the input information obtained from the reference to the draw panel. Initializes each chromosome with a random set of genes. The size of the population is equal to the number of patterns that need to be packed into the container. Table 6. Continued Method Summary private void crossover(int [] pl, int [] p2) Performs a crossover operator on the two parents pl and p2 with a probability PCROSS. The function then replaces the parents with the off springs. private void decode(Chromosome chromo) Computes the fitness value of a public void draw( private void generation( private static int indexOf(int [] pp, int elem) private void mutation( Chromosome chromo) public void run() private void select( public java.lang. String toStringo chromosome by running the placement heuristic on the chromosome. Draws the packing configuration of the fittest chromosome. Executes one complete generation of the genetic algorithm. Returns the index of elem in the array pp or 1 ifelem is not found in the array. Performs a random mutation on the input chromosome with the probability PMUTATION. Begins the execution of the genetic algorithm. Selects two parents randomly from the population of chromosomes for mating. The selection is done on the roulette wheel method. Returns a string representation of the population. Table 7. Attributes and methods contained in gui.DataPanel Constructor Summary DataPanel( public static void writeGlobalData(DrawPanel drawPanel) public static void writePartData(Part part) Creates an instance of the data panel. d Summary Writes global data to the draw panel. The data written includes max fitness and average fitness of the population, a measure of time complexity of the heuristic, number of crossovers, number of mutations and the time taken by the algorithm. Writes part data of the given part. Data includes the area of the part, location of centroid and index of the part. Table 8. Attributes and methods contained in gui.DrawPanel Field Summary protected Container container Reference to the container to be packed. private Part copyPart Placeholder for a copied part when the edit I copy command in the menu bar is used. private int drawMode Drawing mode of the draw panel. The following modes are defined for drawMode, 0 draw container 1 draw pattern 2 delete selected pattern 3 move selected pattern 4 copy selected pattern 5 select a pattern private Vertex moveFrom Location from which the selected pattern must be moved. Used when the edit I move command is used from the menu bar. private booleanpauseGA Set to true is the used pauses the genetic algorithm. private java.util.Vector polygon A list of vertices that are temporarily stored as a pattern is drawn. private boolean showGrid A grid is displayed when showGridis set to true. showGridis set to true when the user selected the edit  show grid option from the menu bar. private boolean snap The mouse pointer snaps to the closest grid point when this option is switched on from the edit I snap option in the menu bar. private java.awt.Rectangle snapRect A square with dimensions 20x20 pixels that is used to close the polygon. private static final int SNAPSIZE Resolution of the snap grid. private boolean stopGA Set to true if the user chooses to stop the genetic algorithm from run  stop GA in the menu bar. Constructor Summary DrawPanel() Creates an instance of the draw panel. Method Summary private void inito Initializes the draw panel. public void paint(java.awt.Graphics g) Paints graphic entities such as container, patterns etc onto the draw panel. public void repaint( Repaints the draw panel. public void reset( Initializes the draw panel. protected void setDrawMode(int mode) Sets the draw mode of the draw panel. private void thismouseClicked Does nothing. (j ava.awt.event.MouseEvent e) Table 8. Continued Method Summary private void thismouseDragged Does nothing. (j ava.awt.event.MouseEvent e) private void thismouseEntered Records the coordinates of the mouse when (j ava.awt.event.MouseEvent e) the draw mode is 5. private void thismouseExited Does nothing. (j ava.awt.event.MouseEvent e) private void thismouseMoved Does nothing. (j ava.awt.event.MouseEvent e) private void thismouseReleased Registers the coordinates of the mouse (java.awt.event.MouseEvent e) click as either a selection coordinate or a vertex belonging to the pattern or container based on the drawing mode. private void update(java.awt.Graphics g) Updates the draw panel. Table 9. Attributes and methods contained in gui.FileHandler Field Summary private j ava.lang. Stringfilename File name. Constructor Summary FileHandlero Creates a file handler for an unspecified FileHandler(j ava.lang. String fileName) Metho protected java.lang. String open() protected boolean save(j ava.lang. String contents) protected boolean saveAs(j ava.lang. String contents, java.lang. String fileName) file. Creates a file handler for the file with name fileName. d Summary Opens the file associated with this file handler and returns the contents of the file. Returns null if the file is not found or the file is not of the right format. Saves the given contents to the file with namefileName. If file name is not specified, the file chooser dialog box is displayed. Returns true is the save operations was successful. Similar to the method save, but saves the given contents to the given file name. Table 10. Attributes and methods contained in gui.Main Field Summary private static boolean isStandAlone Set to true is the program in being run as a standalone program. Set to false is the program is being run as an applet. Constructor Summary Main() Creates an instance of the program when the program is being run as a standalone program. Method Summary public void destroy( Overrides the destroy method in the super class. public j ava.lang. String Gets applet information from the param getParameter(java.lang. String key, tags in the HTML file that contains the java.lang. String def) applet. public void initO Initializes the applet. public static boolean isStandaloneO Returns true is the program is being run as a stand alone program. public static void main(java.lang.String [] Main method of the packing program. args) public void start() Overrides the start method in the super class. public void stop() Overrides the stop method in the super class. Table 11. Attributes and methods contained in gui.MenuBar Field Summary private javax.swing.JRadioButtonMenultem Set to true if the program is being run as a container standalone program. Set to false if the program is being run as an applet. private javax.swing.JMenu display Pull down menu for display options. private javax.swing.JMenu draw Pull down menu for drawing options. private DrawPanel drawPanel A reference to the draw panel. private javax.swing.JMenu edit Pull down menu for editing options. private Population pop A reference to the population. private javax. swing.JMenufile Pull down menu for file handling options. private FileHandlerfileHandler A reference to the file handler. private javax.swing.JRadioButtonMenuItem A radio button option in the edit menu for grid displaying a grid on the draw panel. The grid has a resolution of 20x20 pixels. private javax.swing.JMenuBar menuBar Menu bar. private javax.swing.JMenuItem menultem A handle for a menu item. private javax.swing.JRadioButtonMenuItem A radio button option in the draw menu parts for toggling between drawing modes for drawing the container and parts. private javax.swing.JMenu run Pull down menu with various options for executing the packing program. private javax.swing.JRadioButtonMenultem A radio button option in the edit menu. snap When snap is switched on, the each mouse click is set to the nearest grid point. Constructor Summary MenuBar(DrawPanel drawPanel) Creates an instance of the program when the program is being run as a standalone program. Method Summary public void Event handler for the menu bar. actionPerformed(j ava. awt.event.ActionEvent e) public DrawPanel drawPanel( Returns the menu bar's handle to the draw panel. public javax.swing.JMenuBar getMenuBaro Returns a reference to the menu bar. public void Event handler for the radio button menu itemStateChanged(java.awt.event.ItemEvent items in the menu bar. e) Table 12. Attributes and methods contained in gui.FileFilter Field Summary private static java.lang. String TYPE UNKNOWN private static java.lang. String HIDDEN FILE private j ava.util.HashTable ilters private j ava.lang. String description private j ava.lang. String fullDescription private boolean useExtensionslnBoolean Constructor Summary FileFiltero Creates a file filter. If no filters are added, then all files are accepted. FileFilter(j ava.lang. String extension) Creates a file filter that accepts files with the given extension. Example: new FileFilter("dpk") FileFilter(j ava.lang. String extension, Creates a file filter that accepts the given java.lang. String description) file type. Example: new FileFilter("dpk", "bin packing files ") Note that the "." before the extension is not needed. If provided, it will be ignored. Method Summary public boolean accept(Filej) Return true if this file should be shown in the directory pane, false if it shouldn't. public void addExtension(java.lang.String Adds a filetype "dot" extension to filter extension) against. For example: the following code will create a filter that filters out all files except those that end in ".dpk" : FileFilter filter = new FleFilter(); filter.addExtension("dpk"); Note that the "." before the extension is not needed and will be ignored. public java.lang. String getDescriptiono Returns the human readable description of this filter. For example: "Bin Packing files (*.dpk)" public j ava.lang. String getExtension(Filej) Return the extension portion of the file's name. public boolean Returns whether the extension list (.jpg, isExtensionListInDescriptiono .gif, etc) should show up in the human readable description. Only relevent if a description was provided in the constructor or using setDescription). Table 12. Continued public void setExtensionListInDescription(boolean b) public void setExtensionListInDescription(boolean b) Id Summary Determines whether the extension list (.jpg, .gif, etc) should show up in the human readable description. Only relevent if a description was provided in the constructor or using setDescription(). Determines whether the extension list (.jpg, .gif, etc) should show up in the human readable description. Only relevent if a description was provided in the constructor or using setDescription(). Table 13. Attributes and methods contained in gui.StatusPanel Field Summary private DrawPanel drawPanel A reference to the draw panel. private static javax.swing.JtextArea tArea Text area where status messages are written. private static javax.swing.Jlabel xCood Label to display the xcoordinate of the mouse pointer on the draw panel. private static javax.swing.Jlabel yCood Label to display the ycoordinate of the mouse pointer on the draw panel. Constructor Summary StatusPanel(DrawPanel drawPanel) Creates an instance of the status panel. Method Summary protected static void setCoordinates(int x, int Sets the given coordinates on the status y) panel. protected static void write(j ava.lang. String Writes the given status message on the status) status panel. Table 14. Attributes and methods contained in packingDataStruct.BasicTests Field Summary private static double TOL public static double angle(Vertex vO, Vertex vl) public static double angle(Vertex vO, Vertex vl, Vertex v2) public static double area(java.util.Vector vertexList) private static int areaSign( Vertex vO, Vertex vl, Vertex v2) public static boolean between( Vertex vO, Vertex vl, Vertex v2 ) public static int circleLinelntersect(Vertex center, double radius, Vertex vO, Vertex vl, Vertex [] iluci e'lc t) public static boolean collinear( Vertex vO, Vertex vl, Vertex v2 ) public static Vertex computeCentroid(Part part) private static double crossProduct (Vertex vO, Vertex vl) public static boolean equalsTo(double a, double b) Tolerance used for floating point inequality checks. Method Summary returns the angle in radians subtended at vO by a line passing through the two points and the positive xaxis. Note: CCW angle returned if origin is in the top left corner of the screen. CW angle returned if origin is in the bottom left corner of the screen. Returns the acute angle (in radians) subtended by the three vertices at the middle vertex vl. Returns the area bounded by the list of vertices that define a closed polygon. Returns the signed area of the triangle defined by the three vertices in the order vO, v, and v2. Returns true if the vertex vl lies within or along the edges of the bounding box defined by vO and v2. Finds the intersection of a circle with the given center and radius, and a line segment defined by vOvl. The points) of intersection are returned through a 2 element array of vertices that is passed to the function through the parameter list. Returns, 0 if the line segment does not intersect the circle. 1 if the line segment is tangential to the circle. 2 if the line segment intersects the circle once. 3 if the line segment intersects the circle twice. Returns true if the vertex v2 is collinear to the straight line. Computes the centroid of a part. Returns the cross product of two vertices. Returns true if a == b within a tolerance of TOL. Else it returns false. Table 14. Continued Method Summary public static double getDistance(Vertex vO, Returns the absolute distance between the Vertex vl) given vertices. public static boolean isClockwiseOriented Returns true if the vertex list is oriented (java.util.Vector vertexList) clockwise. Else it returns false. public static char linesIntersect(Vertex vO, Checks to see if two line segments Vertex vl, Vertex v2, Vertex v3, Vertex defined by vOvl and v2v3 intersect. If they inici ,'c t) intersect, the function returns the point of intersection through intersect in the parameter list. Returns, 'e': The segments collinearly overlap, sharing a point 'v': An endpoint (vertex) of one segment is on the other segment, but 'e' doesn't hold '1': The segments intersect properly (i.e., they share a point and neither 'v' nor 'e' holds) '0': The segments do not intersect (i.e., they share no points) public static char pointInPoly(Part part, Checks to see if the given vertex lies Vertex vO) within or along the edges of the part. Returns, 'i' : vO is strictly interior to part 'o' : vO is strictly exterior to part 'v' : vO is a vertex of part 'e' : vO lies on the relative interior of an edge of part public static double Returns the perpendicular distance pointLineDistance(Vertex vO, Vertex vl, between the line defined by vertices vOvl Vertex v2, Vertex inc'i \Ic t) and the vertex v2. The point of contact of the perpendicular with the line is returned through intersect in the parameter list. public static void Reverses the order of the given list of reverseVector(java.util.Vector vertexList) vertices. public static double [] Sorts and array of doubles and returns the sortWithoutDup(double [] array, int begin, sorted array after removing duplicates int end) between the limits begin and end. public static int turns (Vertex vO, Vertex vl, Determines whether two consecutive line Vertex v2) segments vOvl and v1v2 form a left turn, a right turn or they are collinear. Returns, 1 if it is a left turn2 if it is a right turn 0 if the lines are collinear Table 15. Attributes and methods contained in packingDataStruct.Container Field Summary private double area private double available area private Vertex centroid private java.awt.geom.Rectangle container private DrawPanel drawPanel private Vertex origin private partList partList private Container.Profile profile Container(Vertex vO, Vertex vl) Container(DrawPanel drawPanel Container(j ava.lang. String contain public void addPart(Partpart) public Vertex origin( public double area) public double availableAreao public boolean contains(Rectangle2D.Double bb public boolean contains(Vertex vi public void draw(java.awt.Graphi public Rectangle2D.Double getC public PartList getPartListo public java.util.Vector getProfile( public double height( public synchronized Vertex origin 2D.Double Area of the container. Area enclosed by the profile and the top edge of the container. Centroid of the container. Container. A reference to the draw panel. Origin of the container. The lower left corner of the container in graphic coordinates. List of parts that need to be packed. Profile of the container. Constructor Summary Creates a container with the given diagonal coordinates vO and vl. ) Creates a container object with the information input by the user through the draw panel. ner) Creates a container object from a string representation of the container. Method Summary Adds a part to the container list of parts. Returns the origin of the container, i.e. the bottom left comer in graphic coordinates. Returns the area of the container. Returns the area enclosed by the container profile and the top edge of the container. Returns true if the given bounding box bb ) is fully contained within the container (or at least touching the walls). 0) Returns true if the given vertex is container within the container or is along the walls of the container. Else returns false. cs2D g2) Draws the container onto the given graphics context. ontainero Returns a reference to the container. Returns a reference to the part list. ) Returns a reference to the container profile. Returns the height of the container. (0 Returns the origin of the container. Table 15. Continued Method Summary public void reset( Resets the dimensions of the container to the dimensions specified through the constructor. public void reset(Vertex vO, Vertex vl) Resets the dimensions of the container to the given dimensions. Vertex vO and v2 define any one diagonal of the container. public void setProfile(java.util.Vector Sets the profile of the container to the new newPr) profile. public j ava.lang. String toStringo Returns the string representation of the container. public double width() Returns the width of the container. Table 16. Attributes and methods contained in packingDataStruct.Container.Profile Field Summary private java.util.Vector rawProfile Raw profile of the container. The raw profile contains the exact profile of the top edges of the packed parts. Constructor Summary Profile(Rectangle2D.Double container) Creates a profile for the given container and initializes it. Method Summary public java.util.Vector computeProfile(Part Computes a new raw profile after the part) given part has been placed in the container. public void draw(java.awt.Graphics2D g2) Draws the profile to the given graphics context. public Vertex get(int index) Returns a profile vertex by index. Returns null if the vertex does not exist. public void reset(Rectangle2D.Double Reinitializes the profile for the given container) container. public int size( Returns the number of vertices in the container. public java.util.Vector Smoothes the raw profile by removing smoothProfile(java.util.Vector nPr, double vertices that are coincident, collinear and minAng) edges that subtend a concave angle less than minAng. The function returns the smoothed profile. private void monotonize(java.util.Vector pr) Makes the given vertex list monotonic along the xaxis. Table 17. Attributes and methods contained in packingDataStruct.ConvexHull Field Summary private Vertex vO Reference to the bottommost rightmost vertex in the polygon. private HullElement [] hullArray Defines an element on the convex hull. Constructor Summary public ConvexHull(Part parts) Computes the convex hull of the given part and updates the part attribute with the hull information. Method Summary private void grahamScan(HullElement [] Performs the graham scan. hullArray) Table 18. Attributes and methods contained in packingDataStruct.ConvexHull.HullElement Field Summary private int index Index of the hull element. private Vertex vO Vertex represented by the hull element. private boolean isOnHull Set to true if vO is a hull vertex. private boolean ang Angle subtended at the bottom most left most vertex by vO and the horizontal axis. Constructor Summary HullElement(Vertex vO, int index) Creates a hull element for the give vertex with index index. Method Summary public int compareTo(Object o) Implements the compareTo method that is part of the comparable interface in Java. The method compares two hull elements from the point of view of the convex hull algorithm. Returns, 1 if vertex in object o is to the left of the line joining vO (bottom most right most vertex of the part) and this vertex 1 if the vertex in object 0 is to the left of the line joining vO to this vertex. 0 if the vertex in object o collinear with the line joining vO to this vertex. Table 19. Attributes and methods contained in packingDataStruct.Heuristic Field Summary private Container container Reference to the container. private boolean stability Set to true if stable placements are required. Else set to false. private int totallterations Used to compute the average complexity of the heuristic. private int totalVerts Used to compute the average complexity of the heuristic. Constructor Summary public Heuristic (DrawPanel drawPanel, Creates an instance of the heuristic with boolean stability) container input taken from the draw panel. stability is set to true if stable placements are required. Method Summary public double getComplexityO Returns the average case complexity of the placement heuristic. public void packByOrder(Chromosome Packs the contents of the container in the chromo) order specified by the given chromosome. public boolean packPart(Part part) Packs the given part into the container. protected static Vertex Drops the given part on to the give profile dropPart(java.util.Vector profile, Partpart) such that the part makes at least one point of contact with the profile. This point of contact is returned by the function. The method assumes that the part is initially positioned above the profile. protected boolean Rotates the given part that has been rotateToSecondContact(Part part, dropped onto the given profile such that java.util.Vector profile, Vertex ctl) the part makes at least two points of contact with the profile. ctl is the first point of contact about which the part is rotated to get a second point of contact. Returns true if the placement is admissible. Else, returns false. private static double Returns the angle by which the line getSecondContact(Vertex vO, Vertex vl, segment vOvl must be rotated about cen Vertex rad, Vertex cen, Vertex ct2, int turn) in order to make a point of contact ct2 with the edge joining the vertices rad and cen. The point of contact is returned though the reference ct2 in the parameter list. The direction of rotation is specified by turn. If turn is equal to 1, find angle for counter clockwise rotation in graphics coordinates. If turn equals 2, find angle for clockwise rotation. Table 20. Attributes and methods contained in packingDataStruct.Part Field Summary private double area private java.awt.geom.Rectangle2D.Double bbox private int bVert private Vertex centroid public boolean isPacked private int IVert private double minAng private int numHullVerts public Pose pose public Part() public Part (Part part) public Part(j ava.lang. String part) public Part(java.util.Vector vertex public double area) public int bVert( public Vertex centroidO public Object clone( private void computeVertexConv public void draw(java.awt.Graphi public Vertex get(int index) public Rectangle2D.Double getBl public java.util. Vector getLower' public java.awt.Polygon getPolyg public java.util.Vector getVertexI public int 1VertO Area of the part. Bounding box of the part. Index to bottommost leftmost vertex. Centroid of the part. Set to true if part is packed. Else set to false. Index to leftmost topmost vertex. Minimum angle subtended at a convex vertex of the part. Number of convex hull vertices in the part. Pose information of the part after it has been placed in the container. Null if part is not packed. Constructor Summary Creates an empty part. Duplicates a given part. Creates a part from its string representation. :List) Creates a part from the given list of vertices. Method Summary Returns the area of the part. Returns the index of the leftmost bottommost vertex. Returns the centroid of the part. Returns a shallow copy of the part. exity( Tags part vertices as convex or concave. cs2D g2) Draws the part onto the given graphics context. Returns the vertex with the specified index. Returns null if vertex does not exist. box() Returns the bounding box of the part. /ertices( Returns the lower vertices that lie between the leftmost and rightmost vertices inclusive. on() Returns the part as a polygon. List() Returns the vertex list of the part. Returns the leftmost topmost vertex of the part. Table 20. Continued public double minAngo public int numHullVertso public void rotate(Vertex rejVert, double angle) public void rotateCCWToNextHullVertexo public void rotateCWToNextHullVertexo public static void rotateVertexList(j ava.util.Vector vertexList,Vertex rejVert, double angle) public int rVerto public boolean selflntersects( public void set(Partpp) public int size( private void switchOrientationo public java.lang. String toStringo public void translate(VertexfromVert, Vertex toVert) public static void translateVertexList(java.util.Vector vList,Vertex fromVert, Vertex toVert) public int tVerto public void unpack( protected void updateBboxo public java.util.Vector vertexList() Summary Returns the minimum convex angle in the part. Returns the number of convex hull vertices in the part. Rotates the part about rejVert by the given angle. Rotates the part such that the convex hull vertex that lies on the lower side and nearest to the rightmost bottommost vertex is made the rightmost bottom most vertex. Rotates the part such that the convex hull vertex that lies on the lower side and nearest to the leftmost topmost vertex is made the leftmost top most vertex. Rotates the given vertex list about rejVert by the specified angle. Returns the index of the rightmost bottommost vertex. Returns true if the part geometry is found to be selfintersecting. Sets the part attributes to the given part. Returns the number of vertices in the part. Makes a clockwise oriented part counterclockwise and wise versa. Returns the string representation of the part. Translates the part relative tofromVert and toVert. Translates the given vertex list relative to from Vert and toVert. Returns the index of the topmost right most vertex. Unpacks the part if it is packed. Updates the bounding box of the part. Returns the vertex list of the part. Table 21. Attributes and methods contained in packingDataStruct.PartList Field Summary private java.util.Vector masterList Original part list. private java.util.Vector pList Part list on which the algorithm is executed. Constructor Summary public PartList( Creates an empty part list. public PartList(PartListpartList) Creates a part list from the list of parts given. public PartList(java.lang. String partList) Creates a part list from a string representation of that part list. Method Summary public boolean add(Partpart) Adds a part to the list. public synchronized void Draws all the parts in the list to the given draw(j ava.awt.Graphics2D g2) graphics context. public Part get(int index) Gets a part by index. Returns null if requested part is not found. public Part remove(int index) Removes a part with the given index from the part list. public void reset( Copies the contents of masterList into pList. public int size() Returns the number of parts in the list. public j ava.lang. String toStringo Returns the string representation of the part list. Table 22. Attributes and methods contained in packingDataStruct.Pose Field Summary private double x xcoordinate of the pose. private double y ycoordinate of the pose. private double ang Defines the orientation of the pose. Constructor Summary public Pose(double x, double y, double ang) Creates a pose with position x,y and orientation ang. public Pose(Pose pose) Create a pose from another pose. public Pose(Vertex vO, double ang) Creates a pose with position vO and orientation ang. Method Summary public Object clone() Returns a shallow copy of the pose. public double getOrientation( Returns the orientation of the pose. public double getX0 Returns the xcoordinate of the pose. public double getY0 Returns the ycoordinate of the pose. public Vertex position() Returns the position of the pose. Table 22. Continued public void set(Pose pose) public java.lang. String toString) Method Summary Sets the pose to a new pose. Returns the string representation of the pose. Table 23. Attributes and methods contained in packingDataStruct.Vertex Field Summary public double angle public boolean isConvex protected boolean isOnHull public Vertex( public Vertex(double x, double y) public Vertex(java.lang. String vet public Vertex (Vertex vertex) public static Vertex add (Vertex v vl) public Object clone( public boolean coincident(Vertex public synchronized void draw(G public void rotate(Vertex rejVert, angle) public void set(Vertex vert) public static Vertex sub (Vertex v vi) public java.lang. String toStringo public synchronized void translate fromVert, Vertex toVert) Angle made by the bisector of the two edges connected to this vertex and the positive xaxis. Set to true if the vertex is a convex vertex in a list of vertices. Else set to false. Set to true if the vertex belongs to a polygon and is a convex hull vertex. Else set to false. Constructor Summary Creates a vertex with default coordinates (0,0). Creates a vertex with coordinates (xy). rtex) Creates a vertex from the given string representation of the vertex. Creates a vertex from another vertex. Method Summary '0, Vertex Returns the sum of two vertices, i.e. the sum of the two vectors geometrically equivalent to that vertex. Returns a shallow copy of a vertex. vert) Returns true if the given vertex is coincident to this vertex. Else returns false. graphics g2) Draws this vertex on to the given graphics context. double Rotates this vertex about refVert by the specified angle. Sets this vertex data to the data of the given vertex. 0, Vertex Returns the difference between two vertices, i.e. the difference of the two vectors geometrically equivalent to these vertices. Returns the string representation of this vertex. e(Vertex Translates this vertex relative tofromVert and toVert. APPENDIX B USER INTERFACE Figure B.1 Shows the graphical user interface that was used to input data and for the visualization of the output. The Swing classes in Javal.3 were used to build the interface. The user interface was built in a way that allowed the program to be run as an applet or a standalone program. I M l MY Tip: D aw pM Reihtl tik ri buSi rtflRB ii can l unlnr drAMn r 0 Figure Bl Arbitrary and geometric shaped patterns drawn on the user interface with the grid switched on. The draw panel allowed the user to draw arbitrary shapes as well as geometric shapes with the help of the mouse. Geometric shapes could be drawn by switching on the snap mode from the "edit" menu. When in snap mode, the location of a mouse click was aii.,. set to the grid point that was nearest to the actual mouse click. Grid points had a resolution of 20x20 pixels. The edit menu also provided features that could be used to move, delete or make copies of patterns. A data panel was used to output global data such as the fitness of the best chromosome, the number of generations that the program has run, average time complexity of the heuristic etc. When the mouse was moved over a pattern, the data panel displayed data associated with the pattern. The data panel was updated in real time by using a separate thread for the execution of the genetic algorithm. The draw panel was updated each time a better solution was found. The pattern and container data on the draw panel could be read into and out of persistent memory in the form of a formatted ASCII file. The "run" menu gave the user the option to run either the genetic algorithm or just the online placement heuristic on the input in the draw panel. A status panel was used to display error messages and tool tips. It also showed the coordinates of the mouse pointer in the graphic coordinate system when the mouse pointer was on the draw panel. LIST OF REFERENCES Alb80 Albano A, Sapuppo G. Optimal Allocation of Two Dimensional Irregular Shapes Using Heuristic Search Methods. IEEE Transactions on systems, Man, and Cybernetics May 1980; SMC 10(5). Cag96 Cagan J, Kolli A, Rutenbar R. Packing of Generic Three Dimensional Components Based On MultiResolution Modeling. Proceedings of The 1996 ASME Design Engineering Technical Conference and Computers in Engineering Conference; 1996 August 1822; Irvine, CA. CorO1 Corman HC, Leiserson CE, Rivest RL, Stein C. Introduction to AlgSt i/thuu, Cambridge, Massachusetts, MIT Press, 2001. Das97 Dasgupta D, Michalewicz Z. Evolutionary Alglt i/thi in Engineering Applications, Berlin, Springer, 1997, pp. 515530. deBOO de Berg M, van Krevald M, Overmars M, Schwarzkopf O. Computational Geometry Algorithms and Applications, Berlin, Springer, 2000. Fal96 Falkenauer E, A Hybrid Grouping Genetic Algorithm for Bin Packing. In Journal of Heuristics, 2(1), Kluwer Academic Publishers 1996; pp. 530. Gol89 Goldberg DE. Genetic Algorithms in Search, Optimization and Machine Learning, New York, Adison Wesley, 1996. Hau98 Haupt RL, Haupt SE. Practical Genetic Algt ilthi/,, New York, John Wiley, 1998. Hoc95 Hochbaum DS. Approximation Algt ithin, for NPHard Problems, Boston, Massachusetts, PWS Publishing Company, 1995. Hol75 Holland JH. Adaptation in Natural and Artificial Systems, Ann Arbor, The University of Michigan Press, 1975. Kir83 Kirkpatrick S, Gelatt CD, Vecchi MP. Optimization by Simulated Annealing. Science, 1983; May 13; 220(4598). Lod99 Lodi A, Martello M, Vigo D. Approximation Algorithms for the Oriented Two Dimensional Bin Packing Problem. European Journal of Operations Research 1999; 112: 158166. Mar90 Martello S, Toth P. Lower Bounds and Reduction Procedures for the Bin Packing Problem. Discrete Applied Mathematics 1990; 22: 5970. Mar98 Martello S, Vigo D. Exact Solution of the TwoDimensional Finite Bin Packing Problem. Management Science 1998; March; 44(3). Mar00 Martello S, Pisinger D, Vigo D. The Three Dimensional Bin Packing Problem. Operations Research 2000; MarchApril; 48(2): 256267. McG97 McGee RJ. ThreeDimensional Packing Algorithm Using Voxel Modeling [thesis]. Gainesville (FL): University of Florida; 1997. Mic92 Michalewicz Z. Genetic Algol i/thi, + Data Structures = Evolution Programs, Berlin, SpringerVerlag, 1992. Nil71 Nilsson NJ. ProblemSolving Methods in Artificial Intelligence, New York, McGraw Hill, 1971. Pet98 Petridis V, Kazarlis S, Bakirtzis A. Varying Fitness Functions in Genetic Algorithm Constrained Optimization: The Cutting Stock and Unit Commitment Problems. IEEE Transactions on Systems, Man, and Cybernetics part b: Cybernetics 1998; October; 28(5). Rou98 O'Rourke J. Computational Geometry in C, Second Edition, Cambridge, Massachusetts, University Press, 1998. Sit02 Sitharam M, Wu X. Optimal Placement for 2D NonOriented Geometric Bin Packing [Manuscript]. Department of Computer and Information Science and Engineering, University of Florida, Gainesville (FL), 2002. Szy95 Szykman S, Cagan J. A Simulated Annealing Approach to ThreeDimensional Component Packing. ASME Journal of Mechanical Design 1995; 117(2(A)): 308314. BIOGRAPHICAL SKETCH Arfath Pasha was born in Bangalore, India, on October 28, 1973. Shortly after completing his bachelor's degree at the University of Mysore, India, in mechanical engineering he attended the University of Florida, Gainesville. Becoming interested in robotics, he pursued a concurrent master's degree in mechanical engineering and computer information science and engineering under the guidance of Dr. Carl D. Crane III and Dr. Meera Seetharam. During this time he also worked as a graduate research assistant at the Center for Intelligent Machines and Robotics. 