Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You or Your Team.

Learn More →

Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs

Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs Hindawi Publishing Corporation Home Journals About Us About this Journal Submit a Manuscript Table of Contents Journal Menu Abstracting and Indexing Aims and Scope Article Processing Charges Articles in Press Author Guidelines Bibliographic Information Contact Information Editorial Board Editorial Workflow Free eTOC Alerts Reviewers Acknowledgment Subscription Information Open Special Issues Published Special Issues Special Issue Guidelines Abstract Full-Text PDF Full-Text HTML Full-Text ePUB Linked References How to Cite this Article Advances in Operations Research Volume 2012 (2012), Article ID 346358, 26 pages doi:10.1155/2012/346358 Research Article Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs N. Chernov , 1 Yu. Stoyan , 2 T. Romanova , 2 and A. Pankratov 2 1 Department of Mathematics, University of Alabama at Birmingham, Birmingham, AL 35294, USA 2 Department of Mathematical Modeling, Institute for Mechanical Engineering Problems of The National Academy of Sciences of Ukraine, Kharkov, Ukraine Received 21 October 2011; Revised 30 January 2012; Accepted 31 January 2012 Academic Editor: Ching-Jong Liao Copyright © 2012 N. Chernov et al. This is an open access article distributed under the Creative Commons Attribution License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Abstract We study the cutting and packing (C&P) problems in two dimensions by using phi-functions. Our phi-functions describe the layout of given objects; they allow us to construct a mathematical model in which C&P problems become constrained optimization problems. Here we define (for the first time) a complete class of basic phi-functions which allow us to derive phi-functions for all 2D objects that are formed by linear segments and circular arcs. Our phi-functions support translations and rotations of objects. In order to deal with restrictions on minimal or maximal distances between objects, we also propose adjusted phi-functions. Our phi-functions are expressed by simple linear and quadratic formulas without radicals. The use of radical-free phi-functions allows us to increase efficiency of optimization algorithms. We include several model examples. 1. Introduction We study the cutting and packing (C&P) problems. Its basic goal is to place given objects into a container in an optimal manner. For example, in garment industry one cuts figures of specified shapes from a strip of textile, and one naturally wants to minimize waste. Similar tasks arise in metal cutting, furniture making, glass industry, shoe manufacturing, and so forth. In shipping works one commonly needs to place given objects into a container of a smallest size or volume to reduce the space used or increase the number of objects transported. The C&P problem can be formally stated as follows: place a set of given objects 𝐴 1 , … , 𝐴 𝑛 into a container Ω so that a certain objective function (measuring the “quality” of placement) will reach its extreme value. In some applications (as in garment industry) objects must be specifically oriented respecting the structure of the textile, that is, they can only be translated without turnings (or only slightly rotated within given limits). In other applications objects can be freely rotated. Some applications involve additional restrictions on the minimal or maximal distances between certain objects or from objects to the walls of the container Ω (one example is packing of radioactive waste). While most researchers use heuristics for solving C&P problems, some develop systematic approaches based on mathematical modeling and general optimization procedures; see, for example, [ 1 – 3 ]. We refer the reader to recent tutorials [ 4 , 5 ] presenting the history of the C&P problem and basic techniques for its solution. Standard existing algorithms are restricted to 2D objects of polygonal shapes; other shapes are simply approximated by polygons (a notable exception is [ 6 ] which also treats circular objects). The most popular and most frequently cited tools in the modern literature on the C&P problem are Minkowski sum [ 7 ] and the so-called No-Fit Polygon [ 4 ], which works with polygons only and does not support rotations. Rotations of polygons were considered in [ 8 , 9 ], and in a very recent paper [ 10 ] the concept of No-Fit Polygon was extended to objects bounded by circular arcs. In this paper we develop tools that handle any 2D objects whose boundary is formed by linear segments and/or circular arcs (the latter may be convex or concave). All objects we had to deal with in real applications, without exception, belong to this category. Our tools support free translations and rotations of objects and can respect any restrictions on the distances between objects. We describe the layout of objects relative to each other by the so-called phi-functions . For any placement of two objects 𝐴 𝑖 and 𝐴 𝑗 on the plane ℝ 2 , the corresponding phi-function Φ 𝐴 𝑖 𝐴 𝑗 shows how far these objects are from each other, whether they touch each other, or whether they overlap (in the latter case it shows how large the overlap is). Phi-functions were introduced in [ 11 – 13 ] and fully described in our recent survey [ 14 ]. Phi-functions are also used for solving 3D packing problems [ 15 ] and covering problems [ 16 ]. The arguments of the phi-function Φ 𝐴 𝑖 𝐴 𝑗 are the translation and rotation parameters of the objects 𝐴 𝑖 and 𝐴 𝑗 ; those parameters specify the exact position and orientation of the objects in the 𝑥 𝑦 plane (or in the 𝑥 𝑦 𝑧 space). All these parameters together, for all the given objects, constitute the solution space . Solving the cutting and packing problem then consists of minimization of a certain objective function defined on the solution space. Thus the solution of the C&P problem reduces to minimization of an objective function on a certain (multidimensional) space, which can be done by mathematical programming. A detailed description of the solution strategy is given in [ 14 ]. We emphasize that the minimization is performed with respect to all of the underlying variables, that is, all the objects can move and rotate simultaneously. In this respect our approach differs from many others that optimize the position of one object at a time. Illustrations and animated demonstrations of the performance of our methods can be found on our web page [ 17 ]. The solution space consists of all admissible (nonoverlapping) positions of our objects, which correspond to inequalities Φ 𝐴 𝑖 𝐴 𝑗 ≥ 0 for all 𝑖 ≠ 𝑗 . Our phi-functions Φ 𝐴 𝑖 𝐴 𝑗 are defined by a combination of minima and maxima of various basic functions that represent mutual position of various elements of the underlying objects (their edges, their corner points, etc.) As a result, the solution space is described by a complicated tree in which each terminal node consists of a system of inequalities involving translation and rotation parameters of certain objects. This description is very complex, and one of our goals is to simplify it. The above-mentioned inequalities may be expressed via distances between various points, segments, and arcs on the boundaries of our objects. The resulting formulas often involve square roots, which may cause unpleasant complications—formulas describing the solution space develop singularities, and the minimization process becomes prohibitively slow. To remedy the situation, we redefine the phi-functions so that the solution space will be described by simpler formulas without radicals (thus avoiding related singularities), This speeds up the optimization process. By our rules, phi-functions only need to satisfy certain flexible requirements, they are not rigidly determined by the shapes of the given objects. In fact, one can often define phi-functions for fairly complicated objects by simple formulas that avoid square roots and other irrational functions. This strategy was employed in our previous works [ 14 ], but here we implement it to an utmost extent. We will show that for any objects bounded by linear segments and circular arcs phi-functions can be defined by algebraic formulas without radicals. This is the principal goal of our paper. It was announced in [ 14 ] without much details. Here we give explicit practical formulas for computing the phi-functions in all possible cases. Our radical-free phi-functions also incorporate additional constraints on the distances between objects (see Section 4 ). We demonstrate the efficiency of our new phi-functions by model examples. For the description of the solution space via phi-functions we refer the reader to [ 14 ]. For further details of local optimization algorithms used in our programs we refer the reader to [ 18 ]. 2. Phi-Functions and Decomposition of Objects Recall that a 2D object is a subset 𝐴 ⊂ ℝ 2 ; it is usually specified by some equations or inequalities in the canonical coordinates 𝑥 , 𝑦 . Placing the object in ℝ 2 means moving it without changing its shape or size. Rigid motions in ℝ 2 consist of rotations and translations. If we rotate 𝐴 by angle 𝜃 𝐴 (say, clockwise) and translate it by vector 𝜈 𝐴 = ( 𝜈 𝐴 𝑥 , 𝜈 𝐴 𝑦 ) , then the resulting set ( placed object ) can be described by equation 𝐴  𝜈 𝐴 , 𝜃 𝐴  = 𝑅 𝜃 𝐴 𝐴 + 𝜈 𝐴 , ( 2 . 1 ) where 𝑅 𝜃 = ⎡ ⎢ ⎢ ⎣ ⎤ ⎥ ⎥ ⎦ c o s 𝜃 s i n 𝜃 − s i n 𝜃 c o s 𝜃 ( 2 . 2 ) denotes the standard rotation matrix. We call 𝜈 𝐴 and 𝜃 𝐴 the placement parameters for the object 𝐴 . Now let 𝐴 , 𝐵 ⊂ ℝ 2 be two objects. We denote the corresponding placed objects by 𝐴 ′ = 𝐴 ( 𝜈 𝐴 , 𝜃 𝐴 ) and 𝐵 ′ = 𝐵 ( 𝜈 𝐵 , 𝜃 𝐵 ) . The phi-function Φ = Φ 𝐴 𝐵 = Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  , ( 2 . 3 ) describes the mutual position (interaction) of the pair of sets 𝐴 ′ and 𝐵 ′ . It must satisfy three basic requirements: Φ > 0 i f 𝐴  ∩ 𝐵   𝐴 = ∅ , Φ = 0 i f i n t    𝐵 ∩ i n t   = ∅ a n d 𝜕 𝐴  ∩ 𝜕 𝐵   𝐴 ≠ ∅ , Φ < 0 i f i n t    𝐵 ∩ i n t   ≠ ∅ . ( 2 . 4 ) Here int ( 𝐴  ) denotes the interior of 𝐴 ′ and 𝜕 𝐴 ′ the boundary (frontier) of 𝐴 ′ . We always assume that our objects are canonically closed sets, that is, each object is the closure of its interior. Also, the boundary 𝜕 𝐴 ′ should not have self-intersections [ 11 , 14 ]. Note that Φ 𝐴 𝐵 is a function of six real variables 𝜈 𝐴 𝑥 , 𝜈 𝐴 𝑦 , 𝜃 𝐴 , 𝜈 𝐵 𝑥 , 𝜈 𝐵 𝑦 , 𝜃 𝐵 . An important requirement is that Φ 𝐴 𝐵 is continuous in all these six variables [ 14 ]. We will also assume that Φ 𝐴 𝐵 is “symmetric” in the sense that Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  = Φ 𝐵 𝐴  𝜈 𝐵 , 𝜃 𝐵 , 𝜈 𝐴 , 𝜃 𝐴  ( 2 . 5 ) and translation invariant, that is, for any vector 𝜈 Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  = Φ 𝐴 𝐵  𝜈 𝐴 + 𝜈 , 𝜃 𝐴 , 𝜈 𝐵 + 𝜈 , 𝜃 𝐵  . ( 2 . 6 ) Our phi-functions are also rotation invariant in a natural sense. In our formulas, the superscripts of Φ will always refer to given objects, while the arguments of Φ (the placement parameters) will be often omitted for brevity. The general meaning of ( 2.4 ) is that when the placed objects are disjoint, that is, a positive distance apart, then Φ > 0 . When those objects just touch each other (on their boundaries), but do not overlap, then Φ = 0 . When they overlap, then Φ < 0 . We emphasize that the exact value of the phi-function is not subject to any rigid constraints. If two placed objects 𝐴 ′ and 𝐵 ′ are disjoint, then Φ should just roughly approximate the distance between them. If they overlap, then the absolute value | Φ | should just roughly measure the extent of overlap. This flexibility allows us to construct relatively simple phi-functions for rather complex objects, which is the main goal of our paper. For example, let 𝐶 1 and 𝐶 2 be two circles (disks) of radii 𝑟 1 and 𝑟 2 , respectively, defined by 𝐶 𝑖 =  ( 𝑥 , 𝑦 ) ∶ 𝑥 2 + 𝑦 2 ≤ 𝑟 2 𝑖  . ( 2 . 7 ) Now by translating 𝐶 1 and 𝐶 2 through some vectors 𝜈 1 and 𝜈 2 , we get two placed circles 𝐶  1 and 𝐶  2 with centers ( 𝜈 1 𝑥 , 𝜈 1 𝑦 ) and ( 𝜈 2 𝑥 , 𝜈 2 𝑦 ) , respectively, and the same radii 𝑟 1 and 𝑟 2 (rotations are redundant for circles). Now the distance between 𝐶  1 and 𝐶  2 is 𝑑 = m a x { 𝜙 , 0 } , where  𝜙 =  𝜈 1 𝑥 − 𝜈 2 𝑥  2 +  𝜈 1 𝑦 − 𝜈 2 𝑦  2 −  𝑟 1 + 𝑟 2  . ( 2 . 8 ) Note that 𝜙 > 0 if the circles are disjoint and 𝜙 < 0 if they overlap, thus we could set Φ 𝐶 1 𝐶 2 = 𝜙 . But we define Φ 𝐶 1 𝐶 2 differently: Φ 𝐶 1 𝐶 2 =  𝜈 1 𝑥 − 𝜈 2 𝑥  2 +  𝜈 1 𝑦 − 𝜈 2 𝑦  2 −  𝑟 1 + 𝑟 2  2 . ( 2 . 9 ) Note that the sign of Φ 𝐶 1 𝐶 2 coincides with that of 𝜙 (and Φ 𝐶 1 𝐶 2 = 0 whenever 𝜙 = 0 ). But the formula ( 2.9 ) allows us to avoid radicals, thus improving the performance of our optimization algorithms. Next suppose 𝐴 = 𝐴 1 ∪ ⋯ ∪ 𝐴 𝑝 , 𝐵 = 𝐵 1 ∪ ⋯ ∪ 𝐵 𝑞 ( 2 . 1 0 ) are two objects, each of which is a union of some smaller (and simpler) components 𝐴 𝑖 and 𝐵 𝑗 , respectively. Those do not have to be disjoint, that is, some 𝐴 𝑖 ’s may overlap, and so may some of the 𝐵 𝑗 ’s. When the object 𝐴 is rotated and translated, all its parts are rotated by the same angle and translated through the same vector, so the placement parameters for 𝐴 and for all its parts 𝐴 𝑖 are the same. This applies to 𝐵 and its parts, too. Now we can define Φ 𝐴 𝐵 = m i n 1 ≤ 𝑖 ≤ 𝑝 m i n 1 ≤ 𝑗 ≤ 𝑞 Φ 𝐴 𝑖 𝐵 𝑗 . ( 2 . 1 1 ) This simple fact can be verified by direct inspection, see also [ 11 , 14 ]. In this paper we consider objects whose boundary is formed by linear segments and/or circular arcs (the latter may be convex or concave); see an example in Figure 1 . Such objects can be partitioned into simpler components of four basic types: (a) convex polygons, (b) circular segments, (c) “hats”, and (d) “horns”; see Figure 2 . Figure 1: A partition of an object into 15 basic objects: 8 convex polygons, 3 circular segments (marked by 𝐷 ), 3 hats (marked by 𝐻 ), and one horn (marked by 𝑉 ). Figure 2: Basic objects: (a) convex polygon 𝐾 , (b) circular segment 𝐷 , (c) hat 𝐻 , and (d) horn 𝑉 . A convex polygon is an intersection of 𝑚 ≥ 3 half-planes. More generally, an intersection of 𝑚 ≥ 1 half-planes will be called a generalized convex polygon, or phi-polygon. It may be a regular (bounded) polygon, or an unbounded region, such as a region between two rays (half-lines) emanating from a common vertex (see illustrations in [ 11 ]). A circular segment is a region bounded by a circular arc (smaller than a semicircle) and the respective chord. One can also describe a circular segment as the convex hull of a circular arc. A hat is formed by a circular arc (smaller than a semicircle) and two tangent lines at its endpoints (Figure 2(c) ). A horn is made by two circular arcs (one convex and one concave) that are tangent to each other at the point of contact and a line crossing both arcs and tangent to the concave one (Figure 2(d) ). We will denote these four types by 𝐾 , 𝐷 , 𝐻 , and 𝑉 , as in Figure 2 . Figure 1 shows a division of an object into basic subobjects. It consists of 8 convex polygons, 3 circular segments, 3 hats, and one horn. Decomposition of a given object into basic subobjects can be done by a computer algorithm based on the following steps. (1) Locate “beaks,” that is, points on the boundary of 𝐴 where two arcs (one concave and one convex) terminate with a common tangent line. At each beak, cut off a small piece that is shaped as a horn (by a line tangent to the concave arc). After the detachment of horns, the resulting object will have no beaks. (2) Locate all concave arcs and carve out hats so that each concave arc will be replaced with a polygonal line. After the detachment of hats, the resulting object will have no concave arcs. (3) Locate all convex arcs and cut off circular segments so that each convex arc will be replaced with one or more chords. After the detachment of segments, the resulting object will have no convex arcs. (4) If the resulting phi-polygon is convex, keep it. If not, decompose it into two or more convex ones. We note that if the given object 𝐴 is simple enough, it may not be necessary to divide it into basic objects. For example, if 𝐴 is a circle (or a ring), there is no need to cut it artificially into some polygons and circular segments, as phi-functions for circles (and rings) are quite simple; see ( 2.9 ) and other formulas below, as well as [ 11 – 13 ]. Next, recall that our basic goal is to place given objects 𝐴 1 , … , 𝐴 𝑛 into a container Ω with respect to a given objective. To ensure that the placed objects 𝐴 𝑖 ( 𝜈 𝐴 𝑖 , 𝜃 𝐴 𝑖 ) do not overlap, we can just verify that Φ 𝐴 𝑖 𝐴 𝑗 ≥ 0 for all 𝑖 ≠ 𝑗 . To ensure that 𝐴 𝑖 ( 𝜈 𝐴 𝑖 , 𝜃 𝐴 𝑖 ) ⊂ Ω , we verify that Φ 𝐴 𝑖 Ω ∗ ≥ 0 , where Ω ∗ = c l ( ℝ 2 ⧵ Ω ) is the closure of the complement to the container Ω . This is a part of our optimization algorithm; see [ 14 ]. The necessity of treating Ω ∗ = c l ( ℝ 2 ⧵ Ω ) as a (rather special) object leads us to considering unbounded objects, too. Given a bounded object 𝐵 , we denote by 𝐵 ∗ = c l ( ℝ 2 ⧵ 𝐵 ) the unbounded complementary object. If 𝐵 ∗ is delimited by line segments and circular arcs, then it can be decomposed into basic objects of the same four types, except one or more basic objects are unbounded phi-polygons as described above. 3. Basic Phi-Functions Due to the decomposition principle ( 2.11 ) our problem reduces the construction of phi-functions for all pairs of basic objects. As there are four types of basic objects, there are a total of  4 + 4 2  = 1 0 possible pairs of types of basic objects to treat. These will form a complete class of basic phi-functions. 3.1. Two Convex Polygons A convex polygon is an intersection of several half-planes. A half-plane can be defined by 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 so it is completely specified by three parameters ( 𝛼 , 𝛽 , 𝛾 ) . Without loss of generality we assume in what follows that 𝛼 2 + 𝛽 2 = 1 . A convex polygon (phi-polygon) 𝐾 that is the intersection of 𝑚 half-planes can be specified by 𝛼 𝐾 =   1 , 𝛽 1 , 𝛾 1   𝛼 , … , 𝑚 , 𝛽 𝑚 , 𝛾 𝑚   . ( 3 . 1 ) Alternatively, 𝐾 can be specified by a sequence of vertices 𝑥 𝐾 =   1 , 𝑦 1   𝑥 , … , 𝑚 , 𝑦 𝑚   ( 3 . 2 ) listed in the counterclockwise direction. If the polygon 𝐾 is moved (rotated and translated), its parameters 𝛼 𝑖 , 𝛽 𝑖 , 𝛾 𝑖 and 𝑥 𝑖 , 𝑦 𝑖 can be recomputed in terms of the rotation angle 𝜃 𝐾 and translation vector 𝜈 𝐾 , according to ( 2.1 ). Thus the placement parameters of 𝐾 can be incorporated into 𝛼 𝑖 , 𝛽 𝑖 , 𝛾 𝑖 , and 𝑥 𝑖 , 𝑦 𝑖 . Now let 𝐾 be a convex 𝑚 -gon and 𝐾  another convex 𝑚  -gon whose parameters we denote by ( 𝛼  𝑖 , 𝛽  𝑖 , 𝛾  𝑖 ) and whose vertices are denoted by ( 𝑥  𝑖 , 𝑦  𝑖 ) for 1 ≤ 𝑖 ≤ 𝑚  . Denote 𝑢 𝑖 𝑗 = 𝛼 𝑖 𝑥  𝑗 + 𝛽 𝑖 𝑦  𝑗 + 𝛾 𝑖 , 𝑣 𝑗 𝑖 = 𝛼  𝑖 𝑥 𝑗 + 𝛽  𝑖 𝑦 𝑗 + 𝛾  𝑖 . ( 3 . 3 ) Now we define the “polygon-polygon” phi-function as Φ 𝐾 𝐾 ′  = m a x m a x 1 ≤ 𝑖 ≤ 𝑚 m i n 1 ≤ 𝑗 ≤ 𝑚 ′ 𝑢 𝑖 𝑗 , m a x 1 ≤ 𝑗 ≤ 𝑚 ′ m i n 1 ≤ 𝑖 ≤ 𝑚 𝑣 𝑗 𝑖  , ( 3 . 4 ) see [ 14 ] for a detailed analysis of this formula. We note that Φ 𝐾 𝐾 ′ does not involve quadratic functions. It is defined by linear expressions only if rotational angles are not used. In particular, if 𝑃 is a half-plane defined by 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 and 𝐾  a polygon with vertices ( 𝑥  𝑖 , 𝑦  𝑖 ) , then ( 3.4 ) takes a much simpler form Φ 𝑃 𝐾 ′ = m i n 1 ≤ 𝑗 ≤ 𝑚 ′ 𝛼 𝑥  𝑗 + 𝛽 𝑦  𝑗 + 𝛾 . ( 3 . 5 ) 3.1.1. Convex Polygon and Circle Let 𝐾 be a convex polygon with sides 𝐸 𝑖 and vertices ( 𝑥 𝑖 , 𝑦 𝑖 ) for 1 ≤ 𝑖 ≤ 𝑚 . Let 𝛼 𝑖 𝑥 + 𝛽 𝑖 𝑦 + 𝛾 𝑖 = 0 be the equation of the line containing the side 𝐸 𝑖 . We assume that 𝛼 2 𝑖 + 𝛽 2 𝑖 = 1 and the vertices and sides are numbered counterclockwise and the 𝑖 th side joins the 𝑖 th and ( 𝑖 + 1 ) st vertices (if 𝑖 = 𝑚 , then we set 𝑖 + 1 = 1 ). Let 𝐶 be a circle with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Then we define Φ 𝐾 𝐶 = m a x 1 ≤ 𝑖 ≤ 𝑚  𝜒 m a x 𝑖 , 𝜓 𝑖  , 𝜓 𝑖  𝜔 = m i n 𝑖 , 𝜇 𝑖  , ( 3 . 6 ) where 𝜒 𝑖 = 𝛼 𝑖 𝑥 𝐶 + 𝛽 𝑖 𝑦 𝐶 + 𝛾 𝑖 − 𝑟 𝐶 (see Figure 3(a) ), 𝜔 𝑖 = ( 𝑥 𝑖 − 𝑥 𝐶 ) 2 + ( 𝑦 𝑖 − 𝑦 𝐶 ) 2 − 𝑟 2 𝐶 (see Figure 3(b) ), and 𝜇 𝑖 = ( 𝛼 𝑖 − 1 − 𝛼 𝑖 ) ( 𝑦 𝑖 − 𝑦 𝐶 ) − ( 𝛽 𝑖 − 1 − 𝛽 𝑖 ) ( 𝑥 𝑖 − 𝑥 𝐶 ) + 𝑟 𝐶 ( 𝛼 𝑖 − 1 𝛽 𝑖 − 𝛼 𝑖 𝛽 𝑖 − 1 ) (see Figure 3(b) ). See [ 14 ] for more details. Figure 3: A convex polygon and a circle. In particular, if 𝑃 is a half-plane 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 and 𝐶 a circle with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 , then ( 3.6 ) takes a much simpler form Φ 𝑃 𝐶 = 𝛼 𝑥 𝐶 + 𝛽 𝑦 𝐶 + 𝛾 − 𝑟 𝐶 . ( 3 . 7 ) 3.2. Convex Polygon and Circular Segment Let 𝐾 be again a convex polygon. Let 𝐷 be a circular segment 𝐷 = 𝐶 ∩ 𝑇 , where 𝐶 is a circle and 𝑇 a triangle made by the chord (the base of the segment) and the two tangents drawn at its endpoints. Now we define Φ 𝐾 𝐷  Φ = m a x 𝐾 𝐶 , Φ 𝐾 𝑇  , ( 3 . 8 ) where Φ 𝐾 𝐶 was defined by ( 3.6 ) and Φ 𝐾 𝑇 by ( 3.4 ). 3.3. Two Circular Segments Let 𝐷 = 𝐶 ∩ 𝑇 and 𝐷  = 𝐶  ∩ 𝑇  be two circular segments. We define Φ 𝐷 𝐷 ′  Φ = m a x 𝐶 𝐶 ′ , Φ 𝑇 𝐶 ′ , Φ 𝑇 ′ 𝐶 , Φ 𝑇 𝑇 ′  , ( 3 . 9 ) where Φ 𝐶 𝐶 ′ was defined by ( 2.9 ), Φ 𝑇 𝐶 ′ and Φ 𝑇 ′ 𝐶 by ( 3.6 ), and Φ 𝑇 𝑇 ′ by ( 3.4 ). This takes care of all possible pairs of convex basic objects, that is, types (a) and (b). It remains to deal with concave objects, that is, “hats” and “horns.” We first consider a simple object with a concave arc—the complement to a circle. This case is practically important because in many applications one places objects into a circular container. 3.3.1. Convex Objects inside a Circular Container Let 𝐶 ∗ denote the (closure of the) complement to a circle 𝐶 with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Now let 𝐶  be a circular object with center ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and radius 𝑟 𝐶 ′ ≤ 𝑟 𝐶 that we want to place inside the circle 𝐶 . Then we define Φ 𝐶 ∗ 𝐶 =  𝑟 𝐶 − 𝑟 𝐶 ′  2 −  𝑥 𝐶 − 𝑥 𝐶 ′  2 −  𝑦 𝐶 − 𝑦 𝐶 ′  2 . ( 3 . 1 0 ) If 𝑟 𝐶  > 𝑟 𝐶 , then we set Φ 𝐶 ∗ 𝐶 = − ∞ . Next let 𝐾 be a polygon (not necessarily convex) with vertices ( 𝑥 1 , 𝑦 1 ) , … , ( 𝑥 𝑚 , 𝑦 𝑚 ) that we want to place in our circle 𝐶 . Then we set Φ 𝐶 ∗ 𝐾 = m i n 1 ≤ 𝑖 ≤ 𝑚  𝑟 2 𝐶 −  𝑥 𝑖 − 𝑥 𝐶  2 −  𝑦 𝑖 − 𝑦 𝐶  2  . ( 3 . 1 1 ) If 𝐻 = 𝑇 ∩ 𝐶 ∗ 1 is a “hat,” that is, the intersection of a triangle 𝑇 and the complement to a circle 𝐶 1 (see Figure 6 ), we simply put Φ 𝐶 ∗ 𝐻 = Φ 𝐶 ∗ 𝑇 , where Φ 𝐶 ∗ 𝑇 is given by ( 3.11 ). Now let 𝐷 = 𝐶  ∩ 𝑇 be a circular segment, where 𝐶 ′ is a circle with center ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and radius 𝑟 𝐶 ′ and 𝑇 a triangle as before, and 𝑞 𝑖 = ( 𝑥 𝑖 , 𝑦 𝑖 ) , 𝑖 = 1 , 2 , the endpoints of the chord bounding 𝐷 ; see Figure 4(a) . We put 𝜓 0 = m i n 𝑖 = 1 , 2  𝑟 2 𝐶 −  𝑥 𝑖 − 𝑥 𝐶  2 −  𝑦 𝑖 − 𝑦 𝐶  2  , ( 3 . 1 2 ) then Φ 𝐶 ∗ 𝐷 = 𝜓 0  f o r 𝑟 𝐶 ≤ 𝑟 𝐶 ′  . ( 3 . 1 3 ) Note that 𝜓 0 = Φ 𝐶 ∗ 𝐾 subject to 𝑚 = 2 , see Figure 4(a) . Now we define Φ 𝐶 ∗ 𝐷  𝜓 = m i n 0  Φ , m a x 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2    f o r 𝑟 𝐶 > 𝑟 𝐶 ′  , ( 3 . 1 4 ) where 𝜓 0 is given by ( 3.12 ) and 𝜑 1 =  𝑦 1 − 𝑦 𝐶 ′ 𝑥   𝐶 ′ − 𝑥 𝐶  −  𝑥 1 − 𝑥 𝐶 ′ 𝑦   𝐶 ′ − 𝑦 𝐶  , 𝜑 2  𝑦 = − 2 − 𝑦 𝐶 ′ 𝑥   𝐶 ′ − 𝑥 𝐶  +  𝑥 2 − 𝑥 𝐶 ′ 𝑦   𝐶 ′ − 𝑦 𝐶  . ( 3 . 1 5 ) Figure 4: Nonoverlapping 𝐶 ∗ and 𝐷 . Formula ( 3.14 ) results from the following observations: Φ 𝐶 ∗ 𝐷 ≥ 0 if 𝜓 0 ≥ 0 subject to Φ 𝐶 ∗ 𝐶  ≥ 0 (see Figure 4(b) ), or 𝜑 1 ≥ 0 (Figure 4(c) ), or 𝜑 2 ≥ 0 (Figure 4(d) ). To clarify the role of the functions 𝜑 1 and 𝜑 2 we introduce vectors 𝑒 = ( 𝑥 𝐶 − 𝑥 𝐶 ′ , 𝑦 𝐶 − 𝑦 𝐶 ′ ) , 𝑎 1 = ( 𝑥 1 − 𝑥 𝐶 ′ , 𝑦 1 − 𝑦 𝐶 ′ ) , 𝑎 2 = ( 𝑥 2 − 𝑥 𝐶 ′ , 𝑦 2 − 𝑦 𝐶 ′ ) , 𝑒 1 = ( − ( 𝑦 1 − 𝑦 𝐶 ′ ) , 𝑥 1 − 𝑥 𝐶 ′ ) , and 𝑒 2 = ( 𝑦 2 − 𝑦 𝐶 ′ , − ( 𝑥 2 − 𝑥 𝐶 ′ ) ) , as shown in Figure 5(a) . Note that 𝑎 1 ⟂ 𝑒 1 and 𝑎 2 ⟂ 𝑒 2 . In these notations, 𝜑 1 = ⟨ 𝑒 , 𝑒 1 ⟩ , 𝜑 2 = ⟨ 𝑒 , 𝑒 2 ⟩ . ( 3 . 1 6 ) We call 𝜑 1 and 𝜑 2 “switch” functions. Note that m a x { Φ 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2 } < 0 if Φ 𝐶 ∗ 𝐶 ′ < 0 and 𝜑 1 < 0 and 𝜑 2 < 0 , see Figure 5(a) . However, there exist tree cases, where Φ 𝐶 ∗ 𝐶 ′ < 0 but m a x { Φ 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2 } ≥ 0 . First, 𝜑 1 ≥ 0 and 𝜑 2 < 0 (see Figure 5(b) ). Second, 𝜑 2 ≥ 0 and 𝜑 1 < 0 (Figure 5(c) ). Lastly, 𝜑 1 ≥ 0 and 𝜑 2 ≥ 0 (Figure 5(d) ). Figure 5: Role of the functions 𝜑 1 , 𝜑 2 . Figure 6: The domain 𝐺 (grey) and three triangles 𝑇 , 𝑇 1 , and 𝑇 2 . 3.4. Polygon and Hat Let 𝐻 = 𝑇 ∩ 𝐶 ∗ be a hat, that is, the intersection of the complement to a circle 𝐶 and a triangle 𝑇 as shown in Figure 6 . Let 𝐺 denote the domain lying above the circle 𝐶 and above the line 𝐿 containing the chord forming the base of the triangle 𝑇 ; see the grey area in Figure 6 . Note that 𝐻 = 𝐺 ∩ 𝑇 . Now if 𝐵 is any convex object, then it overlaps with 𝐻 if and only if it overlaps with both 𝑇 and 𝐺 ; hence, we can define the phi-function as Φ 𝐻 𝐵  Φ = m a x 𝑇 𝐵 , Φ 𝐺 𝐵  ( 3 . 1 7 ) provided we have properly defined Φ 𝑇 𝐵 and Φ 𝐺 𝐵 . This formula applies when 𝐵 is either a convex polygon or a circular segment. In these two cases Φ 𝑇 𝐵 is given by either ( 3.4 ) or ( 3.8 ), respectively. Thus it remains to define function Φ 𝐺 𝐵 . Here we assume that 𝐵 is a convex polygon. Let 𝑇 1 and 𝑇 2 denote two triangles adjacent to 𝑇 ; one side of each is a tangent to the circle 𝐶 , and another side of each is a segment of the line 𝐿 adjacent to the chord; see Figure 6 (the choice of the third side is not important). Let the circle 𝐶 have center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Let the half-plane 𝑃 below the line 𝐿 be defined by inequality 𝛼 𝑃 𝑥 + 𝛽 𝑃 𝑦 + 𝛾 𝑃 ≥ 0 . Note that 𝐺 = ( 𝐶 ∪ 𝑃 ) ∗ = 𝐶 ∗ ∩ 𝑃 ∗ . Now let 𝐾 be any polygon (not necessarily convex) with vertices ( 𝑥 1 , 𝑦 1 ) , … , ( 𝑥 𝑚 , 𝑦 𝑚 ) . Note that 𝐾 does not overlap with 𝐺 if and only if two conditions are met: (i) every vertex ( 𝑥 𝑖 , 𝑦 𝑖 ) lies either in the circle 𝐶 or below the line 𝐿 ; (ii) the polygon 𝐾 does not overlap with 𝑇 1 and 𝑇 2 . Accordingly, we define Φ 𝐺 𝐾  Φ = m i n 𝑇 1 𝐾 , Φ 𝑇 2 𝐾  , Ψ , ( 3 . 1 8 ) where Ψ = m i n 1 ≤ 𝑖 ≤ 𝑚  𝑟 m a x 2 𝐶 −  𝑥 𝐶 − 𝑥 𝑖  2 −  𝑦 𝐶 − 𝑦 𝑖  2 , 𝛼 𝑃 𝑥 𝑖 + 𝛽 𝑃 𝑦 𝑖 + 𝛾 𝑃  . ( 3 . 1 9 ) Therefore, Φ 𝐻 𝐾  Φ = m a x 𝑇 𝐾 , Φ 𝐺 𝐾  , ( 3 . 2 0 ) which completes the analysis of the “polygon-hat” pair. 3.5. Circular Segment and Hat Let 𝐻 = 𝑇 ∩ 𝐶 ∗ = 𝑇 ∩ 𝐺 be a hat as before and 𝐷 a circular segment. The above analysis applies, up to the formula ( 3.17 ), because 𝐷 is a convex object. It remains to define Φ 𝐺 𝐷 . We again use the notations 𝑃 , 𝐶 , and so forth, for objects associated with the hat 𝐻 , as defined above. We denote by 𝑝 1 = ( 𝑥 1 , 𝑦 1 ) and 𝑝 2 = ( 𝑥 2 , 𝑦 2 ) the endpoints of the arc bounding 𝐻 , as shown in Figure 8 , that is, the points of intersection of 𝜕 𝐶 with 𝜕 𝑃 = 𝐿 . The point 𝑝 𝑖 = ( 𝑥 𝑖 , 𝑦 𝑖 ) is a vertex of the triangle 𝑇 𝑖 for 𝑖 = 1 , 2 . The circular segment 𝐷 = 𝐶  ∩ 𝑇  is the intersection of a circle 𝐶  and a triangle 𝑇  , as before. Let 𝑟 𝐶 ′ denote the radius of the circle 𝐶  and ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) its center. Let 𝑞 1 = ( 𝑥  1 , 𝑦  1 ) and 𝑞 2 = ( 𝑥  2 , 𝑦  2 ) denote the endpoints of the chord bounding 𝐷 (as shown in Figure 4 ) and 𝐿  the line passing through these points. Let the half-plane 𝑃  below the line 𝐿  (away from 𝐷 ) be defined by inequality 𝛼  𝑥 + 𝛽  𝑦 + 𝛾  ≥ 0 . Note that 𝐷 = 𝐶  ∩ ( 𝑃  ) ∗ . If 𝑟 𝐶 ′ > 𝑟 𝐶 , then we set Φ 𝐺 𝐷  Φ = m a x 𝑃 ∗ 𝑇  , Φ 𝐶 ∗ 𝐷 , Φ 𝐺 𝐶  , 𝜑 1 , 𝜑 2  , ( 3 . 2 1 ) where Φ 𝑃 ∗ 𝑇 ′ is defined by ( 3.5 ), Φ 𝐶 ∗ 𝐷 by ( 3.14 ), and for 𝑖 = 1 , 2 we set 𝜑 𝑖  Φ = m i n 𝑇 3 − 𝑖 𝐷 , 𝑟 2 𝐶 −  𝑥  𝑖 − 𝑥 𝐶  2 −  𝑦  𝑖 − 𝑦 𝐶  2 , 𝛼  𝑥 𝑖 + 𝛽  𝑦 𝑖 + 𝛾   𝛼 , −  𝑥 3 − 𝑖 + 𝛽  𝑦 3 − 𝑖 + 𝛾  .   ( 3 . 2 2 ) Thus, Φ 𝐺 𝐷 ≥ 0 if Φ 𝑃 ∗ 𝑇 ′ ≥ 0 (see Figure 7(a) ) or Φ 𝐶 ∗ 𝐷 ≥ 0 (see Figure 7(b) ) or Φ 𝐺 𝐶 ′ ≥ 0 (see Figure 7(c) ), 𝜑 1 ≥ 0 (see Figure 7(d) ) or 𝜑 2 ≥ 0 (see Figure 7(e) ). Figure 7: A circular segment 𝐷 versus the region 𝐺 . Figure 8: The lines 𝐿 1 and 𝐿 2 for a segment-hat pair. The function Φ 𝐺 𝐶 ′ in ( 3.21 ) is defined as follows: Φ 𝐺 𝐶 ′  Φ = m a x 𝐶 ∗ 𝐶 ′ , Φ 𝑃 ∗ 𝐶 ′  𝜔 , m i n 1 , 𝜓 1 , 𝜔 2 , 𝜓 2   , ( 3 . 2 3 ) where Φ 𝐶 ∗ 𝐶 ′ was defined by ( 3.10 ) and Φ 𝑃 ∗ 𝐶 ′ by ( 3.7 ). We also denote 𝜔 𝑖 =  𝑥 𝑖 − 𝑥 𝐶 ′  2 +  𝑦 𝑖 − 𝑦 𝐶 ′  2 − 𝑟 2 𝐶  ( 3 . 2 4 ) for 𝑖 = 1 , 2 , and the functions 𝜓 1 , 𝜓 2 are defined so that 𝜓 𝑖 = 0 is the equation of the line 𝐿 𝑖 (see Figure 8 ), and 𝜓 𝑖 ≥ 0 is the half-plane below that line in Figure 8 . The line 𝐿 𝑖 passes through points 𝑝 𝑖 1 and 𝑝 𝑖 2 . The line segment 𝑝 𝑖 𝑝 𝑖 1 , 𝑖 = 1 , 2 , is perpendicular to the line 𝑝 1 𝑝 2 , the line segment 𝑝 𝑖 𝑝 𝑖 2 is perpendicular to the line 𝑝 𝑖 𝑝 3 , and we have ‖ 𝑝 𝑖 𝑝 𝑖 𝑗 ‖ = 𝑟 𝐶 ′ for all 𝑖 , 𝑗 = 1 , 2 . The functions 𝜓 𝑖 , 𝑖 = 1 , 2 , come from the application of ( 3.6 ) to 𝑇 𝑖 and 𝐶  . If 𝑟 𝐶 ′ ≤ 𝑟 𝐶 , we need to replace 𝜑 𝑖 , 𝑖 = 1 , 2 , in ( 3.21 ) with 𝜑  𝑖 defined by 𝜑  𝑖  𝜑 = m i n 𝑖 , 𝛼   𝑥 𝐶 ′ − 𝑥 𝐶  + 𝛽   𝑦 𝐶 ′ − 𝑦 𝐶   . ( 3 . 2 5 ) Finally, combining ( 3.17 ) and ( 3.21 ) gives Φ 𝐻 𝐷  Φ = m a x 𝑇 𝐷 , Φ 𝐺 𝐷  . ( 3 . 2 6 ) Indeed, Φ 𝐻 𝐷 ≥ 0 if Φ 𝑇 𝐷 ≥ 0 (see Figure 9(a) ) or Φ 𝐺 𝐷 ≥ 0 (see Figure 9(b) ). Figure 9: A hat 𝐻 and a circular segment 𝐷 . 3.6. Two Hats Let 𝐻  = 𝐺  ⋂ 𝑇  be a hat and 𝐻   = 𝐺   ⋂ 𝑇   another hat. Equivalently, 𝐻  = ( 𝐶  ) ∗ ⋂ 𝑇  and 𝐻   = ( 𝐶   ) ∗ ⋂ 𝑇   . For the hat 𝐻 ′ we use notation 𝐺  , 𝐶  , 𝑇  , and so forth, as defined above, and for the hat 𝐻   the respective notation 𝐺   , 𝐶   , 𝑇   , and so forth. Now our phi-function is defined by Φ 𝐻 ′ 𝐻 ′ ′  Φ = m a x 𝑇 ′ 𝐻 ′ ′ , Φ 𝐺 ′ 𝑇 ′ ′  , 𝜔 , 𝜏 , ( 3 . 2 7 ) where Φ 𝑇 ′ 𝐻 ′ ′ , Φ 𝐺 ′ 𝑇 ′ ′ are given by ( 3.17 ), ( 3.18 ), respectively, and we denote  𝛼 𝜔 = m i n  2 𝑥 1   + 𝛽  2 𝑦 1   + 𝛾  2 , 𝛼 2   𝑥  1 + 𝛽 2   𝑦  1 + 𝛾 2   ,  𝑟 𝐶 ′  2 −  𝑥 𝐶 ′ − 𝑥 3    2 −  𝑦 𝐶 ′ − 𝑦 3    2 ,  𝑟 𝐶 ′ ′  2 −  𝑥 𝐶 ′ ′ − 𝑥  3  2 −  𝑦 𝐶 ′ ′ − 𝑦  3  2  ,  𝛼 𝜏 = m i n  1 𝑥 3   + 𝛽  1 𝑦 3   + 𝛾  1 , 𝛼 1   𝑥  3 + 𝛽 1   𝑦  3 + 𝛾 1   ,  𝑟 𝐶 ′  2 −  𝑥 𝐶 ′ − 𝑥 1    2 −  𝑦 𝐶 ′ − 𝑦 1    2 ,  𝑟 𝐶 ′ ′  2 −  𝑥 𝐶 ′ ′ − 𝑥  1  2 −  𝑦 𝐶 ′ ′ − 𝑦  1  2  , ( 3 . 2 8 ) where ( 𝑥  𝑖 , 𝑦  𝑖 ) are the coordinates of the vertices and 𝛼  𝑖 𝑥 + 𝛽  𝑖 𝑦 + 𝛾  𝑖 = 0 , 𝑖 = 1 , 2 , are the equations of lines containing the two straight sides of 𝐻  , respectively; ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and 𝑟 𝐶 ′ are the coordinates of the center and the radius of the arc bounding 𝐻  . Similar notation applies to the hat 𝐻   . The hats 𝐻  and 𝐻   do not overlap if Φ 𝑇 ′ 𝐻 ′ ′ ≥ 0 (see Figure 10(a) ), or Φ 𝐺 ′ 𝑇 ′ ′ ≥ 0 (Figure 10(b) ), or 𝜔 ≥ 0 (Figure 10(c) ), or 𝜏 ≥ 0 (Figure 10(d) ). Figure 10: Four cases of nonoverlapping hats 𝐻  and 𝐻   . 3.7. Horns A horn 𝑉 = 𝐻 ∩ ( 𝐷 ∪ 𝑇 ) is the intersection of a hat 𝐻 and the union of a circular segment 𝐷 and a triangle 𝑇 ; see Figure 11 , where the triangle 𝑇 has vertices 𝑝 1 , 𝑝 2 , 𝑝 3 , and the hat 𝐻 has vertices 𝑝 1 , 𝑝 2 , 𝑝 4 . Figure 11: A horn 𝑉 (grey) and the respective hat 𝐻 (with vertices 𝑝 1 , 𝑝 2 , 𝑝 4 ), circular segment 𝐷 , and triangle 𝑇 (with vertices 𝑝 1 , 𝑝 2 , 𝑝 3 ). Now for any convex polygon 𝐾 we define Φ 𝑉 𝐾  Φ = m a x 𝐻 𝐾  Φ , m i n 𝐾 𝐷 , Φ 𝐾 𝑇   . ( 3 . 2 9 ) Similarly, for any circular segment 𝐷 ′ , Φ 𝑉 𝐷 ′  Φ = m a x 𝐻 𝐷 ′  Φ , m i n 𝐷 𝐷 ′ , Φ 𝑇 𝐷 ′   ( 3 . 3 0 ) and for any hat 𝐻 ′ Φ 𝑉 𝐻 ′  Φ = m a x 𝐻 𝐻 ′  Φ , m i n 𝐻 ′ 𝐷 , Φ 𝐻 ′ 𝑇   . ( 3 . 3 1 ) Now let 𝑉  = 𝐻  ∩ ( 𝐷  ∪ 𝑇 ′ ) be another horn. Then we define Φ 𝑉 𝑉 ′  Φ = m a x 𝐻 𝐻 ′  Φ , m i n 𝐻 𝐷 ′ , Φ 𝐻 𝑇 ′   Φ , m i n 𝐻 ′ 𝐷 , Φ 𝐻 ′ 𝑇   Φ , m i n 𝐷 𝐷 ′ , Φ 𝑇 𝑇 ′ , Φ 𝑇 𝐷 ′ , Φ 𝑇 ′ 𝐷   . ( 3 . 3 2 ) Some formulas for the phi-functions may appear quite complex. Note, however, that they all can be programmed off-line and stored in a computer library. In practical applications, one can just call the respective functions, and their evaluation proves to be fast and efficient. 4. Adjusted Phi-Functions Some applications involve restrictions on the distances between certain pairs of objects, or between objects and the walls of the container. For example, when one is packing radioactive waste, discarded pieces cannot be placed too close together. On the other hand, when one designs a printed circuit board (PCB), then certain electronic components cannot be placed too far apart. Cutting mechanical parts out of a metal sheet is another example where minimal distances have to be maintained, because one has to take into account the physical size of the cutter. In other words, some upper and/or lower limits on the distances between certain placed objects may be set, that is, given two objects 𝐴 , 𝐵 , the corresponding placed objects 𝐴  = 𝐴 ( 𝜈 𝐴 , 𝜃 𝐴 ) and 𝐵  = 𝐵 ( 𝜈 𝐵 , 𝜃 𝐵 ) must satisfy  𝐴 d i s t  , 𝐵   ≥ 𝜌 − 𝐴 𝐵  𝐴 o r d i s t  , 𝐵   ≤ 𝜌 + 𝐴 𝐵 , ( 4 . 1 ) where  𝐴 d i s t  , 𝐵   = m i n 𝑋 ∈ 𝐴 ′ , 𝑌 ∈ 𝐵 ′ d i s t ( 𝑋 , 𝑌 ) . ( 4 . 2 ) Here 𝜌 − 𝐴 𝐵 denotes the minimal allowable distance and 𝜌 + 𝐴 𝐵 the maximal allowable distance between 𝐴  and 𝐵  . To fulfil ( 4.1 ), it has been a common practice to compute the actual distance between 𝐴  and 𝐵  at every step during the optimization process and check if ( 4.1 ) holds. But the computation of geometric distances (especially for complex objects) involves complicated formulas with radicals, see a variety of examples detailed in [ 11 ]. We avoid the computation of geometric distances by using so called adjusted phi-functions defined below. Suppose we have to maintain a minimal distance 𝜌 = 𝜌 − 𝐴 𝐵 for a pair of objects 𝐴 , 𝐵 . We will construct an adjusted phi-function  Φ 𝐴 𝐵 satisfying  Φ 𝐴 𝐵  𝐴 > 0 i f d i s t  , 𝐵    Φ > 𝜌 , 𝐴 𝐵  𝐴 = 0 i f d i s t  , 𝐵    Φ = 𝜌 , 𝐴 𝐵  𝐴 < 0 i f d i s t  , 𝐵   < 𝜌 . ( 4 . 3 ) Then we work with it a just like with the regular phi-function Φ 𝐴 𝐵 in the previous sections, where no restrictions on distances were imposed. Indeed, all allowable placements of the objects 𝐴 , 𝐵 now correspond to  Φ 𝐴 𝐵 ≥ 0 and prohibited placements correspond to  Φ 𝐴 𝐵 < 0 . Thus our optimization algorithms can proceed the usual routine, but with the new (adjusted) phi-function  Φ 𝐴 𝐵 instead of Φ 𝐴 𝐵 . Given an object 𝐴 and 𝜌 > 0 we define its 𝜌 - expansion (Figure 12 ) by   𝐴 𝐴 = 𝜌 = 𝐴 ⊕ 𝐶 𝜌 , ( 4 . 4 ) where ( 𝐶 , 𝜌 ) denotes a circle of radius 𝜌 centered on the origin and the symbol ⊕ stands for the so-called Minkowski sum [ 19 ], which is defined by 𝐴 1 ⊕ 𝐴 2 = 𝑥   1 + 𝑥 2 , 𝑦 1 + 𝑦 2  :  𝑥 1 , 𝑦 1  ∈ 𝐴 1 ,  𝑥 2 , 𝑦 2  ∈ 𝐴 2  ( 4 . 5 ) for any two sets 𝐴 1 , 𝐴 2 ⊂ ℝ 2 . In other words, the 𝜌 -expanded object  𝐴 in ( 4.4 ) consists of points that are either in 𝐴 or at distance ≤ 𝜌 from 𝐴 . We will not need to use Minkowski sum for computing our phi-functions. Figure 12: An object 𝐴 (a), its 𝜌 -expansion  𝐴 (b), and the 𝜌 -expansion 𝛿 𝐴 of its boundary 𝜕 𝐴 (c). Now we construct the adjusted phi-function by  Φ 𝐴 𝐵  𝐴 = Φ 𝐵 , and it will satisfy the requirements ( 4.3 ). Note that instead of expanding the object 𝐴 we can expand the other object 𝐵 and define  Φ 𝐴 𝐵 = Φ 𝐴  𝐵 . This extra flexibility can be used in practice to minimize the cost of computation. Suppose we have to maintain a maximal allowable distance 𝜌 = 𝜌 + for a pair of objects 𝐴 , 𝐵 . This means that the objects have to be positioned so that Φ 𝐴 𝐵 ≥ 0 (to avoid overlaps) and  Φ 𝐴 𝐵 ≤ 0 , where  Φ 𝐴 𝐵 is the adjusted function constructed above (the latter condition will keep the distance ≤ 𝜌 ). Thus we can define another adjusted phi-function as  Φ 𝐴 𝐵  Φ = m i n 𝐴 𝐵  Φ , − 𝐴 𝐵  . ( 4 . 6 ) Now we have  Φ 𝐴 𝐵  𝐴 > 0 i f 0 < d i s t  , 𝐵    Φ < 𝜌 , 𝐴 𝐵   𝐴 = 0 i f i n t    𝐵 ∩ i n t   = ∅ a n d 𝜕 𝐴  ∩ 𝜕 𝐵    𝐴 ≠ ∅ o r d i s t  , 𝐵    Φ = 𝜌 , 𝐴 𝐵  𝐴 < 0 i f i n t    𝐵 ∩ i n t    𝐴 ≠ ∅ o r d i s t  , 𝐵   > 𝜌 . ( 4 . 7 ) Thus all allowable positions of 𝐴 and 𝐵 correspond to  Φ 𝐴 𝐵 ≥ 0 . We see that the adjusted phi-functions can always be defined as (ordinary) phi-functions, but for expanded objects. It remains to define phi-functions for expanded objects. For any object 𝐴 we have  𝐴 = 𝐴 ∪ 𝛿 𝐴 , where 𝛿 𝐴 = 𝜕 𝐴 ⊕ 𝐶 𝜌 is the expansion of the boundary of 𝐴 ; see Figure 12(b) . One can think of 𝛿 𝐴 as a “fattened” boundary of 𝐴 (whose “thickness” is 2 𝜌 ). Then by the decomposition principle ( 2.11 ) we define  Φ 𝐴 𝐵  𝐴 = Φ 𝐵  Φ = m i n 𝐴 𝐵 , Φ 𝛿 𝐴 𝐵  . ( 4 . 8 ) Now recall that 𝜕 𝐴 consists of linear segments and circular arcs, that is, 𝜕 𝐴 = ∪ 𝑚 𝑖 = 1 𝛾 𝑖 , where each 𝛾 𝑖 is either a segment of a line or a circular arc. Therefore, 𝛿 𝐴 = ∪ 𝑚 𝑖 = 1 ̂ 𝛾 𝑖 , where ̂ 𝛾 𝑖 = 𝛾 𝑖 ⊕ 𝐶 𝜌 denotes the expansion of 𝛾 𝑖 (as described below). Now by the decomposition principle ( 2.11 ) we define Φ 𝛿 𝐴 𝐵 = m i n 1 ≤ 𝑖 ≤ 𝑚 Φ ̂ 𝛾 𝑖 𝐵 . ( 4 . 9 ) The domain ̂ 𝛾 𝑖 = 𝛾 𝑖 ⊕ 𝐶 𝜌 is shown in Figure 13 for three different cases: 𝛾 𝑖 is a line segment (a), 𝛾 𝑖 is an arc of radius > 𝜌 (b), and 𝛾 𝑖 is an arc of radius ≤ 𝜌 (c); see a detailed analysis below. Figure 13: Expansion of boundary components. In all these three cases we have ̂ 𝛾 𝑖 = 𝐶 1 ∪ 𝐶 2 ∪ 𝑅 , where 𝐶 1 and 𝐶 2 are disks of radius 𝜌 centered on the endpoints of 𝛾 𝑖 . If 𝛾 𝑖 is a line segment, then 𝑅 is a rectangle (Figure 14(a) ). If 𝛾 𝑖 is a circular arc of radius 𝑟 𝑖 > 𝜌 , then 𝑅 is a “bent rectangle” (Figure 14(b) ). If 𝛾 𝑖 is a circular arc of radius 𝑟 𝑖 ≤ 𝜌 , then 𝑅 degenerates to a circular segment (Figure 14(c) ). Thus we define Φ ̂ 𝛾 𝑖 𝐵  Φ = m i n 𝐶 1 𝐵 , Φ 𝐶 2 𝐵 , Φ 𝑅 𝐵  , ( 4 . 1 0 ) where 𝑅 denotes the corresponding rectangle, or bent rectangle, or circular segment. Figure 14: Various domains ̂ 𝛾 = 𝐶 1 ∪ 𝐶 2 ∪ 𝑅 . We note that 𝜕 𝐴 consists of 𝑚 components, so 𝛿 𝐴 will consist of 𝑚 disks of radius 𝜌 and 𝑚 rectangles or “bent rectangles” (some of the latter may degenerate to circular segments). Rectangles and circular segments are objects of basic types, for which phi-functions were defined in Section 3 . Bent rectangles are objects of a new type, so we need to handle them separately. We have two cases shown in Figure 15 . On (a), the “bent rectangle” is the union of two “wedges” 𝑊 1 , 𝑊 2 and a hat 𝐻 . Every wedge 𝑊 𝑖 is in turn the union of a triangle 𝑇 𝑖 and a circular segment 𝐷 𝑖 (see Figure 16 ), hence Φ 𝑅 𝐵  Φ = m i n 𝐻 𝐵 , Φ 𝑇 1 𝐵 , Φ 𝐷 1 𝐵 , Φ 𝑇 2 𝐵 , Φ 𝐷 2 𝐵  . ( 4 . 1 1 ) In the second case (Figure 15(b) ) the bent rectangle 𝑅 can be decomposed as 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ ( 𝐻 ∩ 𝐶 ) . Accordingly, we define Φ 𝑅 𝐵  Φ = m i n 𝑊 1 𝐵 , Φ 𝑊 2 𝐵  Φ , m a x 𝐻 𝐵 , Φ 𝐶 𝐵   . ( 4 . 1 2 ) Figure 15: A “bent rectangle” 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ 𝐻 (a) and 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ ( 𝐻 ∩ 𝐶 ) (b). Figure 16: A wedge 𝑊 𝑖 = 𝑇 𝑖 ∪ 𝐷 𝑖 . 5. Numerical Examples We illustrate our method by several model examples. In these examples we describe each object by listing elements of its boundary 𝜕 𝐴 = { 𝑙 1 , … , 𝑙 𝑛 } . Each boundary element 𝑙 𝑖 is completely described by its numerical code (which is 0 for straight line segments, + 1 for convex arcs, and −1 for concave arcs), the coordinates of the two endpoints ( 𝑥 1 , 𝑦 1 ) and ( 𝑥 2 , 𝑦 2 ) , and (for circular arcs only) the coordinates of the center ( 𝑥 𝐶 , 𝑦 𝐶 ) . Our goal is to place a given object or two given objects into a circle of minimal radius or into a rectangle of minimal area. The rectangle is always properly oriented, that is, its sides are parallel to the 𝑥 and 𝑦 axes. Accordingly, our objective function (to be minimized) is 𝐹 ( 𝑢 1 , 𝑢 2 , … ) = 𝑟 in case of a circular container of radius 𝑟 and 𝐹 ( 𝑢 1 , 𝑢 2 , … ) = 𝑎 𝑏 in case of a rectangular container with sides 𝑎 and 𝑏 . The arguments 𝑢 1 , 𝑢 2 , … of the objective function include the translation vectors 𝜈 = ( 𝜈 1 , 𝜈 2 ) for all the objects and rotation angles 𝜃 , where appropriate; compare ( 2.1 ). If we place a single object into a circle, no rotation is needed. If two objects are placed into a circle, it is enough to rotate one of them to achieve the optimal placement. When one or two objects are placed into a rectangle, each of them may have to be rotated in order to find the best placement. Example 5.1. The goal is to place a given object into a circle of minimal radius. The object is a dolphin-like domain 𝐴 shown in Figure 17(a) ; its boundary is described in Table 1 . The optimal placement is also shown in Figure 17(a) . The radius of the optimal circle is 𝑟 ∗ = 4 . 0 1 5 2 3 4 . This example took 3.61 sec of the computer running time (we processed our examples on a PC with an AMD Athlon 64X2 2.6 GHz CPU). Table 1: The boundary of the dolphin-like has 13 elements. Figure 17: A dolphin-like object placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.2. The goal is to place the given object (same as in Example 5.1 ) into a rectangle of minimal area. The optimal placement is shown in Figure 17(b) . The rectangle has sides 𝑎 ∗ = 7 . 1 3 2 0 9 0 and 𝑏 ∗ = 6 . 4 1 6 8 0 4 . We note that our algorithm supports rotation of objects. The optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = 1 . 3 1 2 4 5 . This example took 104 sec. Example 5.3. The goal is to place two given objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects are identical copies of the dolphin-like object in Example 5.1 . The optimal placement is shown in Figure 18(a) . The radius of the circle is 𝑟 ∗ = 5 . 2 5 1 2 5 3 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 1 4 1 5 9 3 . This example took 4298 sec. Figure 18: (a) Two dolphin-like objects placed into a circle of minimal radius and (b) two staple-like objects placed into a circle of minimal radius. Example 5.4. The goal is to place two given objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects have identical shape, they look like thick metal staples and their boundary is described in Table 2 . The optimal placement is shown in Figure 18(b) . The radius of the optimal circle is 𝑟 ∗ = 2 . 4 5 5 8 6 6 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 1 4 1 5 9 3 . This example took 31 sec. Table 2: The boundary of the “thick staple” object has 8 elements, all straight line segments. Example 5.5. The goal is to place two given objects, 𝐴 and 𝐵 , of different shape into a circle of minimal radius. The object 𝐴 is made by three arcs (two concave and one convex) described in Table 3 . The object 𝐵 = 𝐻 1 ∪ 𝐻 2 is the union of two overlapping hats specified in Table 4 . The optimal placement is shown in Figure 19(a) . The radius of the circle is 𝑟 ∗ = 5 . 3 2 2 8 2 4 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 2 . 3 0 9 9 0 1 . This example took 1147 sec. Table 3: The object 𝐴 (Figure 19 ) bounded by three arcs. Table 4: The object 𝐵 = 𝐻 1 ∪ 𝐻 2 (Figure 19 ) is the union of two overlapping hats. Each hat is specified by the coordinates of the two endpoints ( 𝑥 1 , 𝑦 1 ) and ( 𝑥 2 , 𝑦 2 ) and the center ( 𝑥 𝐶 , 𝑦 𝐶 ) of the circular arc bounding it and by the coordinates ( 𝑥 𝑣 , 𝑦 𝑣 ) of its third vertex. We note that both circular arcs bounding 𝐻 1 and 𝐻 2 have radius 𝑟 = 5 . 0 . Figure 19: (a) Two objects of different shape placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.6. The goal is to place the two given objects, 𝐴 and 𝐵 (same as in Example 5.5 ), into a rectangle of minimal area. The optimal placement is shown in Figure 19(b) . The rectangle has sides 𝑎 ∗ = 1 3 . 2 9 4 2 5 6 and 𝑏 ∗ = 5 . 6 0 3 8 2 8 . Again, the objects are subject to rotation, and the optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = − 0 . 1 1 8 3 7 6 and the object 𝐵 is rotated by angle 𝜃 𝐵 = 0 . 7 1 5 3 4 6 . This example took 443 sec. Example 5.7. The goal is to place two very irregular (star-shaped) objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects have identical shape, each is the union of four overlapping hats specified in Table 5 . The optimal placement is shown in Figure 20(a) . The radius of the circle is 𝑟 ∗ = 7 . 0 3 1 5 3 1 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 0 . 6 3 4 5 4 3 . This example took 996 sec. Table 5: The object 𝐴 = 𝐻 1 ∪ 𝐻 2 ∪ 𝐻 3 ∪ 𝐻 4 (Figure 20 ) is the union of four overlapping hats. Hats are specified as in Table 4 . We note that all the circular arcs bounding these four hats have radius 𝑟 = 5 . 0 . Figure 20: (a) Two objects of different shape placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.8. The goal is to place two very irregular (star-shaped) objects, 𝐴 and 𝐵 , into a rectangle of minimal area. The objects are the same as in Example 5.7 . The optimal placement is shown in Figure 20(b) . The rectangle has sides 𝑎 ∗ = 8 . 8 5 6 3 5 0 and 𝑏 ∗ = 1 4 . 2 9 2 6 2 3 . Again, the objects are subject to rotation, and the optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = 0 . 4 7 0 3 7 6 and the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 6 1 1 9 6 9 . This example took 154 sec. Example 5.9. This is a modification of Example 5.5 : we place two objects 𝐴 and 𝐵 into a circle 𝐶 of minimal radius, but now the object 𝐴 must be at least the distance of 0.7 away from the object 𝐵 and from the edge of the circle 𝐶 ; that is, we need dist ( 𝐴 , 𝐵 ) ≥ 0 . 7 and dist ( 𝐴 , 𝐶 ∗ ) ≥ 0 . 7 . In this example we use adjusted phi-functions (Section 4 ). The optimal placement is shown in Figure 21 . Note that the object 𝐴 does not touch the object 𝐵 or the boundary of 𝐶 ∗ , to maintain the required distance from both. The radius of the optimal circle is 𝑟 ∗ = 5 . 8 2 3 5 0 7 . The objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 2 . 3 2 2 3 8 8 . This example took 7725 sec. Figure 21: Two objects 𝐴 and 𝐵 placed into a circle 𝐶 of minimal radius, with additional restriction on distances from 𝐴 to 𝐵 and 𝐶 . Acknowledgments The authors would like to thank M. Zlotnick for programming the decomposition of objects into basic objects. N. Chernov acknowledges the support of National Science Foundation, Grant DMS-0969187. They thank the anonymous referee for many useful remarks. References E. G. Birgin, J. M. Martínez, F. H. Nishihara, and D. P. Ronconi, “Orthogonal packing of rectangular items within arbitrary convex regions by nonlinear optimization,” Computers & Operations Research , vol. 33, no. 12, pp. 3535–3548, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH A. M. Gomes and J. F. Oliveira, “Solving irregular strip packing problems by hybridising simulated annealing and linear programming,” European Journal of Operational Research , vol. 171, pp. 811–829, 2006. V. J. Milenkovic and K. Daniels, “Translational polygon containment and minimal enclosure using mathematical programming,” International Transactions in Operational Research , vol. 6, no. 5, pp. 525–554, 1999. View at Publisher · View at Google Scholar J. A. Bennell and J. F. Oliveira, “The geometry of nesting problems: a tutorial,” European Journal of Operational Research , vol. 184, no. 2, pp. 397–415, 2008. View at Publisher · View at Google Scholar · View at Zentralblatt MATH G. Wäscher, H. Haußner, and H. Schumann, “An improved typology of cutting and packing problems,” European Journal of Operational Research , vol. 183, pp. 1109–1130, 2007. E. Burke, R. Hellier, G. Kendall, and G. Whitwell, “A new bottom-left-fill heuristic algorithm for the two-dimensional irregular packing problem,” Operations Research , vol. 54, no. 3, pp. 587–601, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. Milenkovic and E. Sacks, “Two approximate Minkowski sum algorithms,” International Journal of Computational Geometry & Applications , vol. 20, no. 4, pp. 485–509, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. J. Milenkovic, “Rotational polygon overlap minimization and compaction,” Computational Geometry , vol. 10, no. 4, pp. 305–318, 1998. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. J. Milenkovic, “Rotational polygon containment and minimum enclosure using only robust 2D constructions,” Computational Geometry , vol. 13, no. 1, pp. 3–19, 1999. View at Publisher · View at Google Scholar · View at Zentralblatt MATH E. Burke, R. Hellier, G. Kendall, and G. Whitwell, “Irregular packing using the line and arc no-fit polygon,” Operations Research , vol. 58, pp. 948–970, 2010. J. Bennell, G. Scheithauer, Y. Stoyan, and T. Romanova, “Tools of mathematical modeling of arbitrary object packing problems,” Annals of Operations Research , vol. 179, pp. 343–368, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH Y. Stoyan, G. Scheithauer, N. Gil, and T. Romanova, “Φ-functions for complex 2D-objects,” 4OR. Quarterly Journal of the Belgian, French and Italian Operations Research Societies , vol. 2, no. 1, pp. 69–84, 2004. View at Zentralblatt MATH Yu. Stoyan, J. Terno, G. Scheithauer, N. Gil, and T. Romanova, “Phi-functions for primary 2D-objects,” Studia Informatica Universalis , vol. 2, pp. 1–32. N. Chernov, Yu. Stoyan, and T. Romanova, “Mathematical model and efficient algorithms for object packing problem,” Computational Geometry , vol. 43, no. 5, pp. 535–553, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH Y. G. Stoyan and A. Chugay, “Packing cylinders and rectangular parallelepipeds with distances between them,” European Journal of Operational Research , vol. 197, pp. 446–455, 2008. T. Romanova, G. Scheithauer, and A. Krivulya, “Covering a polygonal region by rectangles,” Computational Optimization and Applications , vol. 48, no. 3, pp. 675–695, 2011. View at Publisher · View at Google Scholar · View at Zentralblatt MATH http://www.math.uab.edu/~chernov/CP/ . A. Wächter and L. T. Biegler, “On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming,” Mathematical Programming , vol. 106, no. 1, pp. 25–57, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH H. Minkovski, “Dichteste gitterförmige Lagerung kongruenter Körper,” Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen , pp. 311–355, 1904. var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-8578054-2']); _gaq.push(['_setDomainName', 'hindawi.com']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Advances in Operations Research Hindawi Publishing Corporation

Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs

Loading next page...
 
/lp/hindawi-publishing-corporation/phi-functions-for-2d-objects-formed-by-line-segments-and-circular-arcs-WNT0qgpCOS

References

References for this paper are not available at this time. We will be adding them shortly, thank you for your patience.

Publisher
Hindawi Publishing Corporation
Copyright
Copyright © 2012 N. Chernov et al.
ISSN
1687-9147
eISSN
1687-9155
Publisher site
See Article on Publisher Site

Abstract

Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs Hindawi Publishing Corporation Home Journals About Us About this Journal Submit a Manuscript Table of Contents Journal Menu Abstracting and Indexing Aims and Scope Article Processing Charges Articles in Press Author Guidelines Bibliographic Information Contact Information Editorial Board Editorial Workflow Free eTOC Alerts Reviewers Acknowledgment Subscription Information Open Special Issues Published Special Issues Special Issue Guidelines Abstract Full-Text PDF Full-Text HTML Full-Text ePUB Linked References How to Cite this Article Advances in Operations Research Volume 2012 (2012), Article ID 346358, 26 pages doi:10.1155/2012/346358 Research Article Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs N. Chernov , 1 Yu. Stoyan , 2 T. Romanova , 2 and A. Pankratov 2 1 Department of Mathematics, University of Alabama at Birmingham, Birmingham, AL 35294, USA 2 Department of Mathematical Modeling, Institute for Mechanical Engineering Problems of The National Academy of Sciences of Ukraine, Kharkov, Ukraine Received 21 October 2011; Revised 30 January 2012; Accepted 31 January 2012 Academic Editor: Ching-Jong Liao Copyright © 2012 N. Chernov et al. This is an open access article distributed under the Creative Commons Attribution License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Abstract We study the cutting and packing (C&P) problems in two dimensions by using phi-functions. Our phi-functions describe the layout of given objects; they allow us to construct a mathematical model in which C&P problems become constrained optimization problems. Here we define (for the first time) a complete class of basic phi-functions which allow us to derive phi-functions for all 2D objects that are formed by linear segments and circular arcs. Our phi-functions support translations and rotations of objects. In order to deal with restrictions on minimal or maximal distances between objects, we also propose adjusted phi-functions. Our phi-functions are expressed by simple linear and quadratic formulas without radicals. The use of radical-free phi-functions allows us to increase efficiency of optimization algorithms. We include several model examples. 1. Introduction We study the cutting and packing (C&P) problems. Its basic goal is to place given objects into a container in an optimal manner. For example, in garment industry one cuts figures of specified shapes from a strip of textile, and one naturally wants to minimize waste. Similar tasks arise in metal cutting, furniture making, glass industry, shoe manufacturing, and so forth. In shipping works one commonly needs to place given objects into a container of a smallest size or volume to reduce the space used or increase the number of objects transported. The C&P problem can be formally stated as follows: place a set of given objects 𝐴 1 , … , 𝐴 𝑛 into a container Ω so that a certain objective function (measuring the “quality” of placement) will reach its extreme value. In some applications (as in garment industry) objects must be specifically oriented respecting the structure of the textile, that is, they can only be translated without turnings (or only slightly rotated within given limits). In other applications objects can be freely rotated. Some applications involve additional restrictions on the minimal or maximal distances between certain objects or from objects to the walls of the container Ω (one example is packing of radioactive waste). While most researchers use heuristics for solving C&P problems, some develop systematic approaches based on mathematical modeling and general optimization procedures; see, for example, [ 1 – 3 ]. We refer the reader to recent tutorials [ 4 , 5 ] presenting the history of the C&P problem and basic techniques for its solution. Standard existing algorithms are restricted to 2D objects of polygonal shapes; other shapes are simply approximated by polygons (a notable exception is [ 6 ] which also treats circular objects). The most popular and most frequently cited tools in the modern literature on the C&P problem are Minkowski sum [ 7 ] and the so-called No-Fit Polygon [ 4 ], which works with polygons only and does not support rotations. Rotations of polygons were considered in [ 8 , 9 ], and in a very recent paper [ 10 ] the concept of No-Fit Polygon was extended to objects bounded by circular arcs. In this paper we develop tools that handle any 2D objects whose boundary is formed by linear segments and/or circular arcs (the latter may be convex or concave). All objects we had to deal with in real applications, without exception, belong to this category. Our tools support free translations and rotations of objects and can respect any restrictions on the distances between objects. We describe the layout of objects relative to each other by the so-called phi-functions . For any placement of two objects 𝐴 𝑖 and 𝐴 𝑗 on the plane ℝ 2 , the corresponding phi-function Φ 𝐴 𝑖 𝐴 𝑗 shows how far these objects are from each other, whether they touch each other, or whether they overlap (in the latter case it shows how large the overlap is). Phi-functions were introduced in [ 11 – 13 ] and fully described in our recent survey [ 14 ]. Phi-functions are also used for solving 3D packing problems [ 15 ] and covering problems [ 16 ]. The arguments of the phi-function Φ 𝐴 𝑖 𝐴 𝑗 are the translation and rotation parameters of the objects 𝐴 𝑖 and 𝐴 𝑗 ; those parameters specify the exact position and orientation of the objects in the 𝑥 𝑦 plane (or in the 𝑥 𝑦 𝑧 space). All these parameters together, for all the given objects, constitute the solution space . Solving the cutting and packing problem then consists of minimization of a certain objective function defined on the solution space. Thus the solution of the C&P problem reduces to minimization of an objective function on a certain (multidimensional) space, which can be done by mathematical programming. A detailed description of the solution strategy is given in [ 14 ]. We emphasize that the minimization is performed with respect to all of the underlying variables, that is, all the objects can move and rotate simultaneously. In this respect our approach differs from many others that optimize the position of one object at a time. Illustrations and animated demonstrations of the performance of our methods can be found on our web page [ 17 ]. The solution space consists of all admissible (nonoverlapping) positions of our objects, which correspond to inequalities Φ 𝐴 𝑖 𝐴 𝑗 ≥ 0 for all 𝑖 ≠ 𝑗 . Our phi-functions Φ 𝐴 𝑖 𝐴 𝑗 are defined by a combination of minima and maxima of various basic functions that represent mutual position of various elements of the underlying objects (their edges, their corner points, etc.) As a result, the solution space is described by a complicated tree in which each terminal node consists of a system of inequalities involving translation and rotation parameters of certain objects. This description is very complex, and one of our goals is to simplify it. The above-mentioned inequalities may be expressed via distances between various points, segments, and arcs on the boundaries of our objects. The resulting formulas often involve square roots, which may cause unpleasant complications—formulas describing the solution space develop singularities, and the minimization process becomes prohibitively slow. To remedy the situation, we redefine the phi-functions so that the solution space will be described by simpler formulas without radicals (thus avoiding related singularities), This speeds up the optimization process. By our rules, phi-functions only need to satisfy certain flexible requirements, they are not rigidly determined by the shapes of the given objects. In fact, one can often define phi-functions for fairly complicated objects by simple formulas that avoid square roots and other irrational functions. This strategy was employed in our previous works [ 14 ], but here we implement it to an utmost extent. We will show that for any objects bounded by linear segments and circular arcs phi-functions can be defined by algebraic formulas without radicals. This is the principal goal of our paper. It was announced in [ 14 ] without much details. Here we give explicit practical formulas for computing the phi-functions in all possible cases. Our radical-free phi-functions also incorporate additional constraints on the distances between objects (see Section 4 ). We demonstrate the efficiency of our new phi-functions by model examples. For the description of the solution space via phi-functions we refer the reader to [ 14 ]. For further details of local optimization algorithms used in our programs we refer the reader to [ 18 ]. 2. Phi-Functions and Decomposition of Objects Recall that a 2D object is a subset 𝐴 ⊂ ℝ 2 ; it is usually specified by some equations or inequalities in the canonical coordinates 𝑥 , 𝑦 . Placing the object in ℝ 2 means moving it without changing its shape or size. Rigid motions in ℝ 2 consist of rotations and translations. If we rotate 𝐴 by angle 𝜃 𝐴 (say, clockwise) and translate it by vector 𝜈 𝐴 = ( 𝜈 𝐴 𝑥 , 𝜈 𝐴 𝑦 ) , then the resulting set ( placed object ) can be described by equation 𝐴  𝜈 𝐴 , 𝜃 𝐴  = 𝑅 𝜃 𝐴 𝐴 + 𝜈 𝐴 , ( 2 . 1 ) where 𝑅 𝜃 = ⎡ ⎢ ⎢ ⎣ ⎤ ⎥ ⎥ ⎦ c o s 𝜃 s i n 𝜃 − s i n 𝜃 c o s 𝜃 ( 2 . 2 ) denotes the standard rotation matrix. We call 𝜈 𝐴 and 𝜃 𝐴 the placement parameters for the object 𝐴 . Now let 𝐴 , 𝐵 ⊂ ℝ 2 be two objects. We denote the corresponding placed objects by 𝐴 ′ = 𝐴 ( 𝜈 𝐴 , 𝜃 𝐴 ) and 𝐵 ′ = 𝐵 ( 𝜈 𝐵 , 𝜃 𝐵 ) . The phi-function Φ = Φ 𝐴 𝐵 = Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  , ( 2 . 3 ) describes the mutual position (interaction) of the pair of sets 𝐴 ′ and 𝐵 ′ . It must satisfy three basic requirements: Φ > 0 i f 𝐴  ∩ 𝐵   𝐴 = ∅ , Φ = 0 i f i n t    𝐵 ∩ i n t   = ∅ a n d 𝜕 𝐴  ∩ 𝜕 𝐵   𝐴 ≠ ∅ , Φ < 0 i f i n t    𝐵 ∩ i n t   ≠ ∅ . ( 2 . 4 ) Here int ( 𝐴  ) denotes the interior of 𝐴 ′ and 𝜕 𝐴 ′ the boundary (frontier) of 𝐴 ′ . We always assume that our objects are canonically closed sets, that is, each object is the closure of its interior. Also, the boundary 𝜕 𝐴 ′ should not have self-intersections [ 11 , 14 ]. Note that Φ 𝐴 𝐵 is a function of six real variables 𝜈 𝐴 𝑥 , 𝜈 𝐴 𝑦 , 𝜃 𝐴 , 𝜈 𝐵 𝑥 , 𝜈 𝐵 𝑦 , 𝜃 𝐵 . An important requirement is that Φ 𝐴 𝐵 is continuous in all these six variables [ 14 ]. We will also assume that Φ 𝐴 𝐵 is “symmetric” in the sense that Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  = Φ 𝐵 𝐴  𝜈 𝐵 , 𝜃 𝐵 , 𝜈 𝐴 , 𝜃 𝐴  ( 2 . 5 ) and translation invariant, that is, for any vector 𝜈 Φ 𝐴 𝐵  𝜈 𝐴 , 𝜃 𝐴 , 𝜈 𝐵 , 𝜃 𝐵  = Φ 𝐴 𝐵  𝜈 𝐴 + 𝜈 , 𝜃 𝐴 , 𝜈 𝐵 + 𝜈 , 𝜃 𝐵  . ( 2 . 6 ) Our phi-functions are also rotation invariant in a natural sense. In our formulas, the superscripts of Φ will always refer to given objects, while the arguments of Φ (the placement parameters) will be often omitted for brevity. The general meaning of ( 2.4 ) is that when the placed objects are disjoint, that is, a positive distance apart, then Φ > 0 . When those objects just touch each other (on their boundaries), but do not overlap, then Φ = 0 . When they overlap, then Φ < 0 . We emphasize that the exact value of the phi-function is not subject to any rigid constraints. If two placed objects 𝐴 ′ and 𝐵 ′ are disjoint, then Φ should just roughly approximate the distance between them. If they overlap, then the absolute value | Φ | should just roughly measure the extent of overlap. This flexibility allows us to construct relatively simple phi-functions for rather complex objects, which is the main goal of our paper. For example, let 𝐶 1 and 𝐶 2 be two circles (disks) of radii 𝑟 1 and 𝑟 2 , respectively, defined by 𝐶 𝑖 =  ( 𝑥 , 𝑦 ) ∶ 𝑥 2 + 𝑦 2 ≤ 𝑟 2 𝑖  . ( 2 . 7 ) Now by translating 𝐶 1 and 𝐶 2 through some vectors 𝜈 1 and 𝜈 2 , we get two placed circles 𝐶  1 and 𝐶  2 with centers ( 𝜈 1 𝑥 , 𝜈 1 𝑦 ) and ( 𝜈 2 𝑥 , 𝜈 2 𝑦 ) , respectively, and the same radii 𝑟 1 and 𝑟 2 (rotations are redundant for circles). Now the distance between 𝐶  1 and 𝐶  2 is 𝑑 = m a x { 𝜙 , 0 } , where  𝜙 =  𝜈 1 𝑥 − 𝜈 2 𝑥  2 +  𝜈 1 𝑦 − 𝜈 2 𝑦  2 −  𝑟 1 + 𝑟 2  . ( 2 . 8 ) Note that 𝜙 > 0 if the circles are disjoint and 𝜙 < 0 if they overlap, thus we could set Φ 𝐶 1 𝐶 2 = 𝜙 . But we define Φ 𝐶 1 𝐶 2 differently: Φ 𝐶 1 𝐶 2 =  𝜈 1 𝑥 − 𝜈 2 𝑥  2 +  𝜈 1 𝑦 − 𝜈 2 𝑦  2 −  𝑟 1 + 𝑟 2  2 . ( 2 . 9 ) Note that the sign of Φ 𝐶 1 𝐶 2 coincides with that of 𝜙 (and Φ 𝐶 1 𝐶 2 = 0 whenever 𝜙 = 0 ). But the formula ( 2.9 ) allows us to avoid radicals, thus improving the performance of our optimization algorithms. Next suppose 𝐴 = 𝐴 1 ∪ ⋯ ∪ 𝐴 𝑝 , 𝐵 = 𝐵 1 ∪ ⋯ ∪ 𝐵 𝑞 ( 2 . 1 0 ) are two objects, each of which is a union of some smaller (and simpler) components 𝐴 𝑖 and 𝐵 𝑗 , respectively. Those do not have to be disjoint, that is, some 𝐴 𝑖 ’s may overlap, and so may some of the 𝐵 𝑗 ’s. When the object 𝐴 is rotated and translated, all its parts are rotated by the same angle and translated through the same vector, so the placement parameters for 𝐴 and for all its parts 𝐴 𝑖 are the same. This applies to 𝐵 and its parts, too. Now we can define Φ 𝐴 𝐵 = m i n 1 ≤ 𝑖 ≤ 𝑝 m i n 1 ≤ 𝑗 ≤ 𝑞 Φ 𝐴 𝑖 𝐵 𝑗 . ( 2 . 1 1 ) This simple fact can be verified by direct inspection, see also [ 11 , 14 ]. In this paper we consider objects whose boundary is formed by linear segments and/or circular arcs (the latter may be convex or concave); see an example in Figure 1 . Such objects can be partitioned into simpler components of four basic types: (a) convex polygons, (b) circular segments, (c) “hats”, and (d) “horns”; see Figure 2 . Figure 1: A partition of an object into 15 basic objects: 8 convex polygons, 3 circular segments (marked by 𝐷 ), 3 hats (marked by 𝐻 ), and one horn (marked by 𝑉 ). Figure 2: Basic objects: (a) convex polygon 𝐾 , (b) circular segment 𝐷 , (c) hat 𝐻 , and (d) horn 𝑉 . A convex polygon is an intersection of 𝑚 ≥ 3 half-planes. More generally, an intersection of 𝑚 ≥ 1 half-planes will be called a generalized convex polygon, or phi-polygon. It may be a regular (bounded) polygon, or an unbounded region, such as a region between two rays (half-lines) emanating from a common vertex (see illustrations in [ 11 ]). A circular segment is a region bounded by a circular arc (smaller than a semicircle) and the respective chord. One can also describe a circular segment as the convex hull of a circular arc. A hat is formed by a circular arc (smaller than a semicircle) and two tangent lines at its endpoints (Figure 2(c) ). A horn is made by two circular arcs (one convex and one concave) that are tangent to each other at the point of contact and a line crossing both arcs and tangent to the concave one (Figure 2(d) ). We will denote these four types by 𝐾 , 𝐷 , 𝐻 , and 𝑉 , as in Figure 2 . Figure 1 shows a division of an object into basic subobjects. It consists of 8 convex polygons, 3 circular segments, 3 hats, and one horn. Decomposition of a given object into basic subobjects can be done by a computer algorithm based on the following steps. (1) Locate “beaks,” that is, points on the boundary of 𝐴 where two arcs (one concave and one convex) terminate with a common tangent line. At each beak, cut off a small piece that is shaped as a horn (by a line tangent to the concave arc). After the detachment of horns, the resulting object will have no beaks. (2) Locate all concave arcs and carve out hats so that each concave arc will be replaced with a polygonal line. After the detachment of hats, the resulting object will have no concave arcs. (3) Locate all convex arcs and cut off circular segments so that each convex arc will be replaced with one or more chords. After the detachment of segments, the resulting object will have no convex arcs. (4) If the resulting phi-polygon is convex, keep it. If not, decompose it into two or more convex ones. We note that if the given object 𝐴 is simple enough, it may not be necessary to divide it into basic objects. For example, if 𝐴 is a circle (or a ring), there is no need to cut it artificially into some polygons and circular segments, as phi-functions for circles (and rings) are quite simple; see ( 2.9 ) and other formulas below, as well as [ 11 – 13 ]. Next, recall that our basic goal is to place given objects 𝐴 1 , … , 𝐴 𝑛 into a container Ω with respect to a given objective. To ensure that the placed objects 𝐴 𝑖 ( 𝜈 𝐴 𝑖 , 𝜃 𝐴 𝑖 ) do not overlap, we can just verify that Φ 𝐴 𝑖 𝐴 𝑗 ≥ 0 for all 𝑖 ≠ 𝑗 . To ensure that 𝐴 𝑖 ( 𝜈 𝐴 𝑖 , 𝜃 𝐴 𝑖 ) ⊂ Ω , we verify that Φ 𝐴 𝑖 Ω ∗ ≥ 0 , where Ω ∗ = c l ( ℝ 2 ⧵ Ω ) is the closure of the complement to the container Ω . This is a part of our optimization algorithm; see [ 14 ]. The necessity of treating Ω ∗ = c l ( ℝ 2 ⧵ Ω ) as a (rather special) object leads us to considering unbounded objects, too. Given a bounded object 𝐵 , we denote by 𝐵 ∗ = c l ( ℝ 2 ⧵ 𝐵 ) the unbounded complementary object. If 𝐵 ∗ is delimited by line segments and circular arcs, then it can be decomposed into basic objects of the same four types, except one or more basic objects are unbounded phi-polygons as described above. 3. Basic Phi-Functions Due to the decomposition principle ( 2.11 ) our problem reduces the construction of phi-functions for all pairs of basic objects. As there are four types of basic objects, there are a total of  4 + 4 2  = 1 0 possible pairs of types of basic objects to treat. These will form a complete class of basic phi-functions. 3.1. Two Convex Polygons A convex polygon is an intersection of several half-planes. A half-plane can be defined by 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 so it is completely specified by three parameters ( 𝛼 , 𝛽 , 𝛾 ) . Without loss of generality we assume in what follows that 𝛼 2 + 𝛽 2 = 1 . A convex polygon (phi-polygon) 𝐾 that is the intersection of 𝑚 half-planes can be specified by 𝛼 𝐾 =   1 , 𝛽 1 , 𝛾 1   𝛼 , … , 𝑚 , 𝛽 𝑚 , 𝛾 𝑚   . ( 3 . 1 ) Alternatively, 𝐾 can be specified by a sequence of vertices 𝑥 𝐾 =   1 , 𝑦 1   𝑥 , … , 𝑚 , 𝑦 𝑚   ( 3 . 2 ) listed in the counterclockwise direction. If the polygon 𝐾 is moved (rotated and translated), its parameters 𝛼 𝑖 , 𝛽 𝑖 , 𝛾 𝑖 and 𝑥 𝑖 , 𝑦 𝑖 can be recomputed in terms of the rotation angle 𝜃 𝐾 and translation vector 𝜈 𝐾 , according to ( 2.1 ). Thus the placement parameters of 𝐾 can be incorporated into 𝛼 𝑖 , 𝛽 𝑖 , 𝛾 𝑖 , and 𝑥 𝑖 , 𝑦 𝑖 . Now let 𝐾 be a convex 𝑚 -gon and 𝐾  another convex 𝑚  -gon whose parameters we denote by ( 𝛼  𝑖 , 𝛽  𝑖 , 𝛾  𝑖 ) and whose vertices are denoted by ( 𝑥  𝑖 , 𝑦  𝑖 ) for 1 ≤ 𝑖 ≤ 𝑚  . Denote 𝑢 𝑖 𝑗 = 𝛼 𝑖 𝑥  𝑗 + 𝛽 𝑖 𝑦  𝑗 + 𝛾 𝑖 , 𝑣 𝑗 𝑖 = 𝛼  𝑖 𝑥 𝑗 + 𝛽  𝑖 𝑦 𝑗 + 𝛾  𝑖 . ( 3 . 3 ) Now we define the “polygon-polygon” phi-function as Φ 𝐾 𝐾 ′  = m a x m a x 1 ≤ 𝑖 ≤ 𝑚 m i n 1 ≤ 𝑗 ≤ 𝑚 ′ 𝑢 𝑖 𝑗 , m a x 1 ≤ 𝑗 ≤ 𝑚 ′ m i n 1 ≤ 𝑖 ≤ 𝑚 𝑣 𝑗 𝑖  , ( 3 . 4 ) see [ 14 ] for a detailed analysis of this formula. We note that Φ 𝐾 𝐾 ′ does not involve quadratic functions. It is defined by linear expressions only if rotational angles are not used. In particular, if 𝑃 is a half-plane defined by 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 and 𝐾  a polygon with vertices ( 𝑥  𝑖 , 𝑦  𝑖 ) , then ( 3.4 ) takes a much simpler form Φ 𝑃 𝐾 ′ = m i n 1 ≤ 𝑗 ≤ 𝑚 ′ 𝛼 𝑥  𝑗 + 𝛽 𝑦  𝑗 + 𝛾 . ( 3 . 5 ) 3.1.1. Convex Polygon and Circle Let 𝐾 be a convex polygon with sides 𝐸 𝑖 and vertices ( 𝑥 𝑖 , 𝑦 𝑖 ) for 1 ≤ 𝑖 ≤ 𝑚 . Let 𝛼 𝑖 𝑥 + 𝛽 𝑖 𝑦 + 𝛾 𝑖 = 0 be the equation of the line containing the side 𝐸 𝑖 . We assume that 𝛼 2 𝑖 + 𝛽 2 𝑖 = 1 and the vertices and sides are numbered counterclockwise and the 𝑖 th side joins the 𝑖 th and ( 𝑖 + 1 ) st vertices (if 𝑖 = 𝑚 , then we set 𝑖 + 1 = 1 ). Let 𝐶 be a circle with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Then we define Φ 𝐾 𝐶 = m a x 1 ≤ 𝑖 ≤ 𝑚  𝜒 m a x 𝑖 , 𝜓 𝑖  , 𝜓 𝑖  𝜔 = m i n 𝑖 , 𝜇 𝑖  , ( 3 . 6 ) where 𝜒 𝑖 = 𝛼 𝑖 𝑥 𝐶 + 𝛽 𝑖 𝑦 𝐶 + 𝛾 𝑖 − 𝑟 𝐶 (see Figure 3(a) ), 𝜔 𝑖 = ( 𝑥 𝑖 − 𝑥 𝐶 ) 2 + ( 𝑦 𝑖 − 𝑦 𝐶 ) 2 − 𝑟 2 𝐶 (see Figure 3(b) ), and 𝜇 𝑖 = ( 𝛼 𝑖 − 1 − 𝛼 𝑖 ) ( 𝑦 𝑖 − 𝑦 𝐶 ) − ( 𝛽 𝑖 − 1 − 𝛽 𝑖 ) ( 𝑥 𝑖 − 𝑥 𝐶 ) + 𝑟 𝐶 ( 𝛼 𝑖 − 1 𝛽 𝑖 − 𝛼 𝑖 𝛽 𝑖 − 1 ) (see Figure 3(b) ). See [ 14 ] for more details. Figure 3: A convex polygon and a circle. In particular, if 𝑃 is a half-plane 𝛼 𝑥 + 𝛽 𝑦 + 𝛾 ≤ 0 and 𝐶 a circle with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 , then ( 3.6 ) takes a much simpler form Φ 𝑃 𝐶 = 𝛼 𝑥 𝐶 + 𝛽 𝑦 𝐶 + 𝛾 − 𝑟 𝐶 . ( 3 . 7 ) 3.2. Convex Polygon and Circular Segment Let 𝐾 be again a convex polygon. Let 𝐷 be a circular segment 𝐷 = 𝐶 ∩ 𝑇 , where 𝐶 is a circle and 𝑇 a triangle made by the chord (the base of the segment) and the two tangents drawn at its endpoints. Now we define Φ 𝐾 𝐷  Φ = m a x 𝐾 𝐶 , Φ 𝐾 𝑇  , ( 3 . 8 ) where Φ 𝐾 𝐶 was defined by ( 3.6 ) and Φ 𝐾 𝑇 by ( 3.4 ). 3.3. Two Circular Segments Let 𝐷 = 𝐶 ∩ 𝑇 and 𝐷  = 𝐶  ∩ 𝑇  be two circular segments. We define Φ 𝐷 𝐷 ′  Φ = m a x 𝐶 𝐶 ′ , Φ 𝑇 𝐶 ′ , Φ 𝑇 ′ 𝐶 , Φ 𝑇 𝑇 ′  , ( 3 . 9 ) where Φ 𝐶 𝐶 ′ was defined by ( 2.9 ), Φ 𝑇 𝐶 ′ and Φ 𝑇 ′ 𝐶 by ( 3.6 ), and Φ 𝑇 𝑇 ′ by ( 3.4 ). This takes care of all possible pairs of convex basic objects, that is, types (a) and (b). It remains to deal with concave objects, that is, “hats” and “horns.” We first consider a simple object with a concave arc—the complement to a circle. This case is practically important because in many applications one places objects into a circular container. 3.3.1. Convex Objects inside a Circular Container Let 𝐶 ∗ denote the (closure of the) complement to a circle 𝐶 with center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Now let 𝐶  be a circular object with center ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and radius 𝑟 𝐶 ′ ≤ 𝑟 𝐶 that we want to place inside the circle 𝐶 . Then we define Φ 𝐶 ∗ 𝐶 =  𝑟 𝐶 − 𝑟 𝐶 ′  2 −  𝑥 𝐶 − 𝑥 𝐶 ′  2 −  𝑦 𝐶 − 𝑦 𝐶 ′  2 . ( 3 . 1 0 ) If 𝑟 𝐶  > 𝑟 𝐶 , then we set Φ 𝐶 ∗ 𝐶 = − ∞ . Next let 𝐾 be a polygon (not necessarily convex) with vertices ( 𝑥 1 , 𝑦 1 ) , … , ( 𝑥 𝑚 , 𝑦 𝑚 ) that we want to place in our circle 𝐶 . Then we set Φ 𝐶 ∗ 𝐾 = m i n 1 ≤ 𝑖 ≤ 𝑚  𝑟 2 𝐶 −  𝑥 𝑖 − 𝑥 𝐶  2 −  𝑦 𝑖 − 𝑦 𝐶  2  . ( 3 . 1 1 ) If 𝐻 = 𝑇 ∩ 𝐶 ∗ 1 is a “hat,” that is, the intersection of a triangle 𝑇 and the complement to a circle 𝐶 1 (see Figure 6 ), we simply put Φ 𝐶 ∗ 𝐻 = Φ 𝐶 ∗ 𝑇 , where Φ 𝐶 ∗ 𝑇 is given by ( 3.11 ). Now let 𝐷 = 𝐶  ∩ 𝑇 be a circular segment, where 𝐶 ′ is a circle with center ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and radius 𝑟 𝐶 ′ and 𝑇 a triangle as before, and 𝑞 𝑖 = ( 𝑥 𝑖 , 𝑦 𝑖 ) , 𝑖 = 1 , 2 , the endpoints of the chord bounding 𝐷 ; see Figure 4(a) . We put 𝜓 0 = m i n 𝑖 = 1 , 2  𝑟 2 𝐶 −  𝑥 𝑖 − 𝑥 𝐶  2 −  𝑦 𝑖 − 𝑦 𝐶  2  , ( 3 . 1 2 ) then Φ 𝐶 ∗ 𝐷 = 𝜓 0  f o r 𝑟 𝐶 ≤ 𝑟 𝐶 ′  . ( 3 . 1 3 ) Note that 𝜓 0 = Φ 𝐶 ∗ 𝐾 subject to 𝑚 = 2 , see Figure 4(a) . Now we define Φ 𝐶 ∗ 𝐷  𝜓 = m i n 0  Φ , m a x 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2    f o r 𝑟 𝐶 > 𝑟 𝐶 ′  , ( 3 . 1 4 ) where 𝜓 0 is given by ( 3.12 ) and 𝜑 1 =  𝑦 1 − 𝑦 𝐶 ′ 𝑥   𝐶 ′ − 𝑥 𝐶  −  𝑥 1 − 𝑥 𝐶 ′ 𝑦   𝐶 ′ − 𝑦 𝐶  , 𝜑 2  𝑦 = − 2 − 𝑦 𝐶 ′ 𝑥   𝐶 ′ − 𝑥 𝐶  +  𝑥 2 − 𝑥 𝐶 ′ 𝑦   𝐶 ′ − 𝑦 𝐶  . ( 3 . 1 5 ) Figure 4: Nonoverlapping 𝐶 ∗ and 𝐷 . Formula ( 3.14 ) results from the following observations: Φ 𝐶 ∗ 𝐷 ≥ 0 if 𝜓 0 ≥ 0 subject to Φ 𝐶 ∗ 𝐶  ≥ 0 (see Figure 4(b) ), or 𝜑 1 ≥ 0 (Figure 4(c) ), or 𝜑 2 ≥ 0 (Figure 4(d) ). To clarify the role of the functions 𝜑 1 and 𝜑 2 we introduce vectors 𝑒 = ( 𝑥 𝐶 − 𝑥 𝐶 ′ , 𝑦 𝐶 − 𝑦 𝐶 ′ ) , 𝑎 1 = ( 𝑥 1 − 𝑥 𝐶 ′ , 𝑦 1 − 𝑦 𝐶 ′ ) , 𝑎 2 = ( 𝑥 2 − 𝑥 𝐶 ′ , 𝑦 2 − 𝑦 𝐶 ′ ) , 𝑒 1 = ( − ( 𝑦 1 − 𝑦 𝐶 ′ ) , 𝑥 1 − 𝑥 𝐶 ′ ) , and 𝑒 2 = ( 𝑦 2 − 𝑦 𝐶 ′ , − ( 𝑥 2 − 𝑥 𝐶 ′ ) ) , as shown in Figure 5(a) . Note that 𝑎 1 ⟂ 𝑒 1 and 𝑎 2 ⟂ 𝑒 2 . In these notations, 𝜑 1 = ⟨ 𝑒 , 𝑒 1 ⟩ , 𝜑 2 = ⟨ 𝑒 , 𝑒 2 ⟩ . ( 3 . 1 6 ) We call 𝜑 1 and 𝜑 2 “switch” functions. Note that m a x { Φ 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2 } < 0 if Φ 𝐶 ∗ 𝐶 ′ < 0 and 𝜑 1 < 0 and 𝜑 2 < 0 , see Figure 5(a) . However, there exist tree cases, where Φ 𝐶 ∗ 𝐶 ′ < 0 but m a x { Φ 𝐶 ∗ 𝐶 ′ , 𝜑 1 , 𝜑 2 } ≥ 0 . First, 𝜑 1 ≥ 0 and 𝜑 2 < 0 (see Figure 5(b) ). Second, 𝜑 2 ≥ 0 and 𝜑 1 < 0 (Figure 5(c) ). Lastly, 𝜑 1 ≥ 0 and 𝜑 2 ≥ 0 (Figure 5(d) ). Figure 5: Role of the functions 𝜑 1 , 𝜑 2 . Figure 6: The domain 𝐺 (grey) and three triangles 𝑇 , 𝑇 1 , and 𝑇 2 . 3.4. Polygon and Hat Let 𝐻 = 𝑇 ∩ 𝐶 ∗ be a hat, that is, the intersection of the complement to a circle 𝐶 and a triangle 𝑇 as shown in Figure 6 . Let 𝐺 denote the domain lying above the circle 𝐶 and above the line 𝐿 containing the chord forming the base of the triangle 𝑇 ; see the grey area in Figure 6 . Note that 𝐻 = 𝐺 ∩ 𝑇 . Now if 𝐵 is any convex object, then it overlaps with 𝐻 if and only if it overlaps with both 𝑇 and 𝐺 ; hence, we can define the phi-function as Φ 𝐻 𝐵  Φ = m a x 𝑇 𝐵 , Φ 𝐺 𝐵  ( 3 . 1 7 ) provided we have properly defined Φ 𝑇 𝐵 and Φ 𝐺 𝐵 . This formula applies when 𝐵 is either a convex polygon or a circular segment. In these two cases Φ 𝑇 𝐵 is given by either ( 3.4 ) or ( 3.8 ), respectively. Thus it remains to define function Φ 𝐺 𝐵 . Here we assume that 𝐵 is a convex polygon. Let 𝑇 1 and 𝑇 2 denote two triangles adjacent to 𝑇 ; one side of each is a tangent to the circle 𝐶 , and another side of each is a segment of the line 𝐿 adjacent to the chord; see Figure 6 (the choice of the third side is not important). Let the circle 𝐶 have center ( 𝑥 𝐶 , 𝑦 𝐶 ) and radius 𝑟 𝐶 . Let the half-plane 𝑃 below the line 𝐿 be defined by inequality 𝛼 𝑃 𝑥 + 𝛽 𝑃 𝑦 + 𝛾 𝑃 ≥ 0 . Note that 𝐺 = ( 𝐶 ∪ 𝑃 ) ∗ = 𝐶 ∗ ∩ 𝑃 ∗ . Now let 𝐾 be any polygon (not necessarily convex) with vertices ( 𝑥 1 , 𝑦 1 ) , … , ( 𝑥 𝑚 , 𝑦 𝑚 ) . Note that 𝐾 does not overlap with 𝐺 if and only if two conditions are met: (i) every vertex ( 𝑥 𝑖 , 𝑦 𝑖 ) lies either in the circle 𝐶 or below the line 𝐿 ; (ii) the polygon 𝐾 does not overlap with 𝑇 1 and 𝑇 2 . Accordingly, we define Φ 𝐺 𝐾  Φ = m i n 𝑇 1 𝐾 , Φ 𝑇 2 𝐾  , Ψ , ( 3 . 1 8 ) where Ψ = m i n 1 ≤ 𝑖 ≤ 𝑚  𝑟 m a x 2 𝐶 −  𝑥 𝐶 − 𝑥 𝑖  2 −  𝑦 𝐶 − 𝑦 𝑖  2 , 𝛼 𝑃 𝑥 𝑖 + 𝛽 𝑃 𝑦 𝑖 + 𝛾 𝑃  . ( 3 . 1 9 ) Therefore, Φ 𝐻 𝐾  Φ = m a x 𝑇 𝐾 , Φ 𝐺 𝐾  , ( 3 . 2 0 ) which completes the analysis of the “polygon-hat” pair. 3.5. Circular Segment and Hat Let 𝐻 = 𝑇 ∩ 𝐶 ∗ = 𝑇 ∩ 𝐺 be a hat as before and 𝐷 a circular segment. The above analysis applies, up to the formula ( 3.17 ), because 𝐷 is a convex object. It remains to define Φ 𝐺 𝐷 . We again use the notations 𝑃 , 𝐶 , and so forth, for objects associated with the hat 𝐻 , as defined above. We denote by 𝑝 1 = ( 𝑥 1 , 𝑦 1 ) and 𝑝 2 = ( 𝑥 2 , 𝑦 2 ) the endpoints of the arc bounding 𝐻 , as shown in Figure 8 , that is, the points of intersection of 𝜕 𝐶 with 𝜕 𝑃 = 𝐿 . The point 𝑝 𝑖 = ( 𝑥 𝑖 , 𝑦 𝑖 ) is a vertex of the triangle 𝑇 𝑖 for 𝑖 = 1 , 2 . The circular segment 𝐷 = 𝐶  ∩ 𝑇  is the intersection of a circle 𝐶  and a triangle 𝑇  , as before. Let 𝑟 𝐶 ′ denote the radius of the circle 𝐶  and ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) its center. Let 𝑞 1 = ( 𝑥  1 , 𝑦  1 ) and 𝑞 2 = ( 𝑥  2 , 𝑦  2 ) denote the endpoints of the chord bounding 𝐷 (as shown in Figure 4 ) and 𝐿  the line passing through these points. Let the half-plane 𝑃  below the line 𝐿  (away from 𝐷 ) be defined by inequality 𝛼  𝑥 + 𝛽  𝑦 + 𝛾  ≥ 0 . Note that 𝐷 = 𝐶  ∩ ( 𝑃  ) ∗ . If 𝑟 𝐶 ′ > 𝑟 𝐶 , then we set Φ 𝐺 𝐷  Φ = m a x 𝑃 ∗ 𝑇  , Φ 𝐶 ∗ 𝐷 , Φ 𝐺 𝐶  , 𝜑 1 , 𝜑 2  , ( 3 . 2 1 ) where Φ 𝑃 ∗ 𝑇 ′ is defined by ( 3.5 ), Φ 𝐶 ∗ 𝐷 by ( 3.14 ), and for 𝑖 = 1 , 2 we set 𝜑 𝑖  Φ = m i n 𝑇 3 − 𝑖 𝐷 , 𝑟 2 𝐶 −  𝑥  𝑖 − 𝑥 𝐶  2 −  𝑦  𝑖 − 𝑦 𝐶  2 , 𝛼  𝑥 𝑖 + 𝛽  𝑦 𝑖 + 𝛾   𝛼 , −  𝑥 3 − 𝑖 + 𝛽  𝑦 3 − 𝑖 + 𝛾  .   ( 3 . 2 2 ) Thus, Φ 𝐺 𝐷 ≥ 0 if Φ 𝑃 ∗ 𝑇 ′ ≥ 0 (see Figure 7(a) ) or Φ 𝐶 ∗ 𝐷 ≥ 0 (see Figure 7(b) ) or Φ 𝐺 𝐶 ′ ≥ 0 (see Figure 7(c) ), 𝜑 1 ≥ 0 (see Figure 7(d) ) or 𝜑 2 ≥ 0 (see Figure 7(e) ). Figure 7: A circular segment 𝐷 versus the region 𝐺 . Figure 8: The lines 𝐿 1 and 𝐿 2 for a segment-hat pair. The function Φ 𝐺 𝐶 ′ in ( 3.21 ) is defined as follows: Φ 𝐺 𝐶 ′  Φ = m a x 𝐶 ∗ 𝐶 ′ , Φ 𝑃 ∗ 𝐶 ′  𝜔 , m i n 1 , 𝜓 1 , 𝜔 2 , 𝜓 2   , ( 3 . 2 3 ) where Φ 𝐶 ∗ 𝐶 ′ was defined by ( 3.10 ) and Φ 𝑃 ∗ 𝐶 ′ by ( 3.7 ). We also denote 𝜔 𝑖 =  𝑥 𝑖 − 𝑥 𝐶 ′  2 +  𝑦 𝑖 − 𝑦 𝐶 ′  2 − 𝑟 2 𝐶  ( 3 . 2 4 ) for 𝑖 = 1 , 2 , and the functions 𝜓 1 , 𝜓 2 are defined so that 𝜓 𝑖 = 0 is the equation of the line 𝐿 𝑖 (see Figure 8 ), and 𝜓 𝑖 ≥ 0 is the half-plane below that line in Figure 8 . The line 𝐿 𝑖 passes through points 𝑝 𝑖 1 and 𝑝 𝑖 2 . The line segment 𝑝 𝑖 𝑝 𝑖 1 , 𝑖 = 1 , 2 , is perpendicular to the line 𝑝 1 𝑝 2 , the line segment 𝑝 𝑖 𝑝 𝑖 2 is perpendicular to the line 𝑝 𝑖 𝑝 3 , and we have ‖ 𝑝 𝑖 𝑝 𝑖 𝑗 ‖ = 𝑟 𝐶 ′ for all 𝑖 , 𝑗 = 1 , 2 . The functions 𝜓 𝑖 , 𝑖 = 1 , 2 , come from the application of ( 3.6 ) to 𝑇 𝑖 and 𝐶  . If 𝑟 𝐶 ′ ≤ 𝑟 𝐶 , we need to replace 𝜑 𝑖 , 𝑖 = 1 , 2 , in ( 3.21 ) with 𝜑  𝑖 defined by 𝜑  𝑖  𝜑 = m i n 𝑖 , 𝛼   𝑥 𝐶 ′ − 𝑥 𝐶  + 𝛽   𝑦 𝐶 ′ − 𝑦 𝐶   . ( 3 . 2 5 ) Finally, combining ( 3.17 ) and ( 3.21 ) gives Φ 𝐻 𝐷  Φ = m a x 𝑇 𝐷 , Φ 𝐺 𝐷  . ( 3 . 2 6 ) Indeed, Φ 𝐻 𝐷 ≥ 0 if Φ 𝑇 𝐷 ≥ 0 (see Figure 9(a) ) or Φ 𝐺 𝐷 ≥ 0 (see Figure 9(b) ). Figure 9: A hat 𝐻 and a circular segment 𝐷 . 3.6. Two Hats Let 𝐻  = 𝐺  ⋂ 𝑇  be a hat and 𝐻   = 𝐺   ⋂ 𝑇   another hat. Equivalently, 𝐻  = ( 𝐶  ) ∗ ⋂ 𝑇  and 𝐻   = ( 𝐶   ) ∗ ⋂ 𝑇   . For the hat 𝐻 ′ we use notation 𝐺  , 𝐶  , 𝑇  , and so forth, as defined above, and for the hat 𝐻   the respective notation 𝐺   , 𝐶   , 𝑇   , and so forth. Now our phi-function is defined by Φ 𝐻 ′ 𝐻 ′ ′  Φ = m a x 𝑇 ′ 𝐻 ′ ′ , Φ 𝐺 ′ 𝑇 ′ ′  , 𝜔 , 𝜏 , ( 3 . 2 7 ) where Φ 𝑇 ′ 𝐻 ′ ′ , Φ 𝐺 ′ 𝑇 ′ ′ are given by ( 3.17 ), ( 3.18 ), respectively, and we denote  𝛼 𝜔 = m i n  2 𝑥 1   + 𝛽  2 𝑦 1   + 𝛾  2 , 𝛼 2   𝑥  1 + 𝛽 2   𝑦  1 + 𝛾 2   ,  𝑟 𝐶 ′  2 −  𝑥 𝐶 ′ − 𝑥 3    2 −  𝑦 𝐶 ′ − 𝑦 3    2 ,  𝑟 𝐶 ′ ′  2 −  𝑥 𝐶 ′ ′ − 𝑥  3  2 −  𝑦 𝐶 ′ ′ − 𝑦  3  2  ,  𝛼 𝜏 = m i n  1 𝑥 3   + 𝛽  1 𝑦 3   + 𝛾  1 , 𝛼 1   𝑥  3 + 𝛽 1   𝑦  3 + 𝛾 1   ,  𝑟 𝐶 ′  2 −  𝑥 𝐶 ′ − 𝑥 1    2 −  𝑦 𝐶 ′ − 𝑦 1    2 ,  𝑟 𝐶 ′ ′  2 −  𝑥 𝐶 ′ ′ − 𝑥  1  2 −  𝑦 𝐶 ′ ′ − 𝑦  1  2  , ( 3 . 2 8 ) where ( 𝑥  𝑖 , 𝑦  𝑖 ) are the coordinates of the vertices and 𝛼  𝑖 𝑥 + 𝛽  𝑖 𝑦 + 𝛾  𝑖 = 0 , 𝑖 = 1 , 2 , are the equations of lines containing the two straight sides of 𝐻  , respectively; ( 𝑥 𝐶 ′ , 𝑦 𝐶 ′ ) and 𝑟 𝐶 ′ are the coordinates of the center and the radius of the arc bounding 𝐻  . Similar notation applies to the hat 𝐻   . The hats 𝐻  and 𝐻   do not overlap if Φ 𝑇 ′ 𝐻 ′ ′ ≥ 0 (see Figure 10(a) ), or Φ 𝐺 ′ 𝑇 ′ ′ ≥ 0 (Figure 10(b) ), or 𝜔 ≥ 0 (Figure 10(c) ), or 𝜏 ≥ 0 (Figure 10(d) ). Figure 10: Four cases of nonoverlapping hats 𝐻  and 𝐻   . 3.7. Horns A horn 𝑉 = 𝐻 ∩ ( 𝐷 ∪ 𝑇 ) is the intersection of a hat 𝐻 and the union of a circular segment 𝐷 and a triangle 𝑇 ; see Figure 11 , where the triangle 𝑇 has vertices 𝑝 1 , 𝑝 2 , 𝑝 3 , and the hat 𝐻 has vertices 𝑝 1 , 𝑝 2 , 𝑝 4 . Figure 11: A horn 𝑉 (grey) and the respective hat 𝐻 (with vertices 𝑝 1 , 𝑝 2 , 𝑝 4 ), circular segment 𝐷 , and triangle 𝑇 (with vertices 𝑝 1 , 𝑝 2 , 𝑝 3 ). Now for any convex polygon 𝐾 we define Φ 𝑉 𝐾  Φ = m a x 𝐻 𝐾  Φ , m i n 𝐾 𝐷 , Φ 𝐾 𝑇   . ( 3 . 2 9 ) Similarly, for any circular segment 𝐷 ′ , Φ 𝑉 𝐷 ′  Φ = m a x 𝐻 𝐷 ′  Φ , m i n 𝐷 𝐷 ′ , Φ 𝑇 𝐷 ′   ( 3 . 3 0 ) and for any hat 𝐻 ′ Φ 𝑉 𝐻 ′  Φ = m a x 𝐻 𝐻 ′  Φ , m i n 𝐻 ′ 𝐷 , Φ 𝐻 ′ 𝑇   . ( 3 . 3 1 ) Now let 𝑉  = 𝐻  ∩ ( 𝐷  ∪ 𝑇 ′ ) be another horn. Then we define Φ 𝑉 𝑉 ′  Φ = m a x 𝐻 𝐻 ′  Φ , m i n 𝐻 𝐷 ′ , Φ 𝐻 𝑇 ′   Φ , m i n 𝐻 ′ 𝐷 , Φ 𝐻 ′ 𝑇   Φ , m i n 𝐷 𝐷 ′ , Φ 𝑇 𝑇 ′ , Φ 𝑇 𝐷 ′ , Φ 𝑇 ′ 𝐷   . ( 3 . 3 2 ) Some formulas for the phi-functions may appear quite complex. Note, however, that they all can be programmed off-line and stored in a computer library. In practical applications, one can just call the respective functions, and their evaluation proves to be fast and efficient. 4. Adjusted Phi-Functions Some applications involve restrictions on the distances between certain pairs of objects, or between objects and the walls of the container. For example, when one is packing radioactive waste, discarded pieces cannot be placed too close together. On the other hand, when one designs a printed circuit board (PCB), then certain electronic components cannot be placed too far apart. Cutting mechanical parts out of a metal sheet is another example where minimal distances have to be maintained, because one has to take into account the physical size of the cutter. In other words, some upper and/or lower limits on the distances between certain placed objects may be set, that is, given two objects 𝐴 , 𝐵 , the corresponding placed objects 𝐴  = 𝐴 ( 𝜈 𝐴 , 𝜃 𝐴 ) and 𝐵  = 𝐵 ( 𝜈 𝐵 , 𝜃 𝐵 ) must satisfy  𝐴 d i s t  , 𝐵   ≥ 𝜌 − 𝐴 𝐵  𝐴 o r d i s t  , 𝐵   ≤ 𝜌 + 𝐴 𝐵 , ( 4 . 1 ) where  𝐴 d i s t  , 𝐵   = m i n 𝑋 ∈ 𝐴 ′ , 𝑌 ∈ 𝐵 ′ d i s t ( 𝑋 , 𝑌 ) . ( 4 . 2 ) Here 𝜌 − 𝐴 𝐵 denotes the minimal allowable distance and 𝜌 + 𝐴 𝐵 the maximal allowable distance between 𝐴  and 𝐵  . To fulfil ( 4.1 ), it has been a common practice to compute the actual distance between 𝐴  and 𝐵  at every step during the optimization process and check if ( 4.1 ) holds. But the computation of geometric distances (especially for complex objects) involves complicated formulas with radicals, see a variety of examples detailed in [ 11 ]. We avoid the computation of geometric distances by using so called adjusted phi-functions defined below. Suppose we have to maintain a minimal distance 𝜌 = 𝜌 − 𝐴 𝐵 for a pair of objects 𝐴 , 𝐵 . We will construct an adjusted phi-function  Φ 𝐴 𝐵 satisfying  Φ 𝐴 𝐵  𝐴 > 0 i f d i s t  , 𝐵    Φ > 𝜌 , 𝐴 𝐵  𝐴 = 0 i f d i s t  , 𝐵    Φ = 𝜌 , 𝐴 𝐵  𝐴 < 0 i f d i s t  , 𝐵   < 𝜌 . ( 4 . 3 ) Then we work with it a just like with the regular phi-function Φ 𝐴 𝐵 in the previous sections, where no restrictions on distances were imposed. Indeed, all allowable placements of the objects 𝐴 , 𝐵 now correspond to  Φ 𝐴 𝐵 ≥ 0 and prohibited placements correspond to  Φ 𝐴 𝐵 < 0 . Thus our optimization algorithms can proceed the usual routine, but with the new (adjusted) phi-function  Φ 𝐴 𝐵 instead of Φ 𝐴 𝐵 . Given an object 𝐴 and 𝜌 > 0 we define its 𝜌 - expansion (Figure 12 ) by   𝐴 𝐴 = 𝜌 = 𝐴 ⊕ 𝐶 𝜌 , ( 4 . 4 ) where ( 𝐶 , 𝜌 ) denotes a circle of radius 𝜌 centered on the origin and the symbol ⊕ stands for the so-called Minkowski sum [ 19 ], which is defined by 𝐴 1 ⊕ 𝐴 2 = 𝑥   1 + 𝑥 2 , 𝑦 1 + 𝑦 2  :  𝑥 1 , 𝑦 1  ∈ 𝐴 1 ,  𝑥 2 , 𝑦 2  ∈ 𝐴 2  ( 4 . 5 ) for any two sets 𝐴 1 , 𝐴 2 ⊂ ℝ 2 . In other words, the 𝜌 -expanded object  𝐴 in ( 4.4 ) consists of points that are either in 𝐴 or at distance ≤ 𝜌 from 𝐴 . We will not need to use Minkowski sum for computing our phi-functions. Figure 12: An object 𝐴 (a), its 𝜌 -expansion  𝐴 (b), and the 𝜌 -expansion 𝛿 𝐴 of its boundary 𝜕 𝐴 (c). Now we construct the adjusted phi-function by  Φ 𝐴 𝐵  𝐴 = Φ 𝐵 , and it will satisfy the requirements ( 4.3 ). Note that instead of expanding the object 𝐴 we can expand the other object 𝐵 and define  Φ 𝐴 𝐵 = Φ 𝐴  𝐵 . This extra flexibility can be used in practice to minimize the cost of computation. Suppose we have to maintain a maximal allowable distance 𝜌 = 𝜌 + for a pair of objects 𝐴 , 𝐵 . This means that the objects have to be positioned so that Φ 𝐴 𝐵 ≥ 0 (to avoid overlaps) and  Φ 𝐴 𝐵 ≤ 0 , where  Φ 𝐴 𝐵 is the adjusted function constructed above (the latter condition will keep the distance ≤ 𝜌 ). Thus we can define another adjusted phi-function as  Φ 𝐴 𝐵  Φ = m i n 𝐴 𝐵  Φ , − 𝐴 𝐵  . ( 4 . 6 ) Now we have  Φ 𝐴 𝐵  𝐴 > 0 i f 0 < d i s t  , 𝐵    Φ < 𝜌 , 𝐴 𝐵   𝐴 = 0 i f i n t    𝐵 ∩ i n t   = ∅ a n d 𝜕 𝐴  ∩ 𝜕 𝐵    𝐴 ≠ ∅ o r d i s t  , 𝐵    Φ = 𝜌 , 𝐴 𝐵  𝐴 < 0 i f i n t    𝐵 ∩ i n t    𝐴 ≠ ∅ o r d i s t  , 𝐵   > 𝜌 . ( 4 . 7 ) Thus all allowable positions of 𝐴 and 𝐵 correspond to  Φ 𝐴 𝐵 ≥ 0 . We see that the adjusted phi-functions can always be defined as (ordinary) phi-functions, but for expanded objects. It remains to define phi-functions for expanded objects. For any object 𝐴 we have  𝐴 = 𝐴 ∪ 𝛿 𝐴 , where 𝛿 𝐴 = 𝜕 𝐴 ⊕ 𝐶 𝜌 is the expansion of the boundary of 𝐴 ; see Figure 12(b) . One can think of 𝛿 𝐴 as a “fattened” boundary of 𝐴 (whose “thickness” is 2 𝜌 ). Then by the decomposition principle ( 2.11 ) we define  Φ 𝐴 𝐵  𝐴 = Φ 𝐵  Φ = m i n 𝐴 𝐵 , Φ 𝛿 𝐴 𝐵  . ( 4 . 8 ) Now recall that 𝜕 𝐴 consists of linear segments and circular arcs, that is, 𝜕 𝐴 = ∪ 𝑚 𝑖 = 1 𝛾 𝑖 , where each 𝛾 𝑖 is either a segment of a line or a circular arc. Therefore, 𝛿 𝐴 = ∪ 𝑚 𝑖 = 1 ̂ 𝛾 𝑖 , where ̂ 𝛾 𝑖 = 𝛾 𝑖 ⊕ 𝐶 𝜌 denotes the expansion of 𝛾 𝑖 (as described below). Now by the decomposition principle ( 2.11 ) we define Φ 𝛿 𝐴 𝐵 = m i n 1 ≤ 𝑖 ≤ 𝑚 Φ ̂ 𝛾 𝑖 𝐵 . ( 4 . 9 ) The domain ̂ 𝛾 𝑖 = 𝛾 𝑖 ⊕ 𝐶 𝜌 is shown in Figure 13 for three different cases: 𝛾 𝑖 is a line segment (a), 𝛾 𝑖 is an arc of radius > 𝜌 (b), and 𝛾 𝑖 is an arc of radius ≤ 𝜌 (c); see a detailed analysis below. Figure 13: Expansion of boundary components. In all these three cases we have ̂ 𝛾 𝑖 = 𝐶 1 ∪ 𝐶 2 ∪ 𝑅 , where 𝐶 1 and 𝐶 2 are disks of radius 𝜌 centered on the endpoints of 𝛾 𝑖 . If 𝛾 𝑖 is a line segment, then 𝑅 is a rectangle (Figure 14(a) ). If 𝛾 𝑖 is a circular arc of radius 𝑟 𝑖 > 𝜌 , then 𝑅 is a “bent rectangle” (Figure 14(b) ). If 𝛾 𝑖 is a circular arc of radius 𝑟 𝑖 ≤ 𝜌 , then 𝑅 degenerates to a circular segment (Figure 14(c) ). Thus we define Φ ̂ 𝛾 𝑖 𝐵  Φ = m i n 𝐶 1 𝐵 , Φ 𝐶 2 𝐵 , Φ 𝑅 𝐵  , ( 4 . 1 0 ) where 𝑅 denotes the corresponding rectangle, or bent rectangle, or circular segment. Figure 14: Various domains ̂ 𝛾 = 𝐶 1 ∪ 𝐶 2 ∪ 𝑅 . We note that 𝜕 𝐴 consists of 𝑚 components, so 𝛿 𝐴 will consist of 𝑚 disks of radius 𝜌 and 𝑚 rectangles or “bent rectangles” (some of the latter may degenerate to circular segments). Rectangles and circular segments are objects of basic types, for which phi-functions were defined in Section 3 . Bent rectangles are objects of a new type, so we need to handle them separately. We have two cases shown in Figure 15 . On (a), the “bent rectangle” is the union of two “wedges” 𝑊 1 , 𝑊 2 and a hat 𝐻 . Every wedge 𝑊 𝑖 is in turn the union of a triangle 𝑇 𝑖 and a circular segment 𝐷 𝑖 (see Figure 16 ), hence Φ 𝑅 𝐵  Φ = m i n 𝐻 𝐵 , Φ 𝑇 1 𝐵 , Φ 𝐷 1 𝐵 , Φ 𝑇 2 𝐵 , Φ 𝐷 2 𝐵  . ( 4 . 1 1 ) In the second case (Figure 15(b) ) the bent rectangle 𝑅 can be decomposed as 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ ( 𝐻 ∩ 𝐶 ) . Accordingly, we define Φ 𝑅 𝐵  Φ = m i n 𝑊 1 𝐵 , Φ 𝑊 2 𝐵  Φ , m a x 𝐻 𝐵 , Φ 𝐶 𝐵   . ( 4 . 1 2 ) Figure 15: A “bent rectangle” 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ 𝐻 (a) and 𝑅 = 𝑊 1 ∪ 𝑊 2 ∪ ( 𝐻 ∩ 𝐶 ) (b). Figure 16: A wedge 𝑊 𝑖 = 𝑇 𝑖 ∪ 𝐷 𝑖 . 5. Numerical Examples We illustrate our method by several model examples. In these examples we describe each object by listing elements of its boundary 𝜕 𝐴 = { 𝑙 1 , … , 𝑙 𝑛 } . Each boundary element 𝑙 𝑖 is completely described by its numerical code (which is 0 for straight line segments, + 1 for convex arcs, and −1 for concave arcs), the coordinates of the two endpoints ( 𝑥 1 , 𝑦 1 ) and ( 𝑥 2 , 𝑦 2 ) , and (for circular arcs only) the coordinates of the center ( 𝑥 𝐶 , 𝑦 𝐶 ) . Our goal is to place a given object or two given objects into a circle of minimal radius or into a rectangle of minimal area. The rectangle is always properly oriented, that is, its sides are parallel to the 𝑥 and 𝑦 axes. Accordingly, our objective function (to be minimized) is 𝐹 ( 𝑢 1 , 𝑢 2 , … ) = 𝑟 in case of a circular container of radius 𝑟 and 𝐹 ( 𝑢 1 , 𝑢 2 , … ) = 𝑎 𝑏 in case of a rectangular container with sides 𝑎 and 𝑏 . The arguments 𝑢 1 , 𝑢 2 , … of the objective function include the translation vectors 𝜈 = ( 𝜈 1 , 𝜈 2 ) for all the objects and rotation angles 𝜃 , where appropriate; compare ( 2.1 ). If we place a single object into a circle, no rotation is needed. If two objects are placed into a circle, it is enough to rotate one of them to achieve the optimal placement. When one or two objects are placed into a rectangle, each of them may have to be rotated in order to find the best placement. Example 5.1. The goal is to place a given object into a circle of minimal radius. The object is a dolphin-like domain 𝐴 shown in Figure 17(a) ; its boundary is described in Table 1 . The optimal placement is also shown in Figure 17(a) . The radius of the optimal circle is 𝑟 ∗ = 4 . 0 1 5 2 3 4 . This example took 3.61 sec of the computer running time (we processed our examples on a PC with an AMD Athlon 64X2 2.6 GHz CPU). Table 1: The boundary of the dolphin-like has 13 elements. Figure 17: A dolphin-like object placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.2. The goal is to place the given object (same as in Example 5.1 ) into a rectangle of minimal area. The optimal placement is shown in Figure 17(b) . The rectangle has sides 𝑎 ∗ = 7 . 1 3 2 0 9 0 and 𝑏 ∗ = 6 . 4 1 6 8 0 4 . We note that our algorithm supports rotation of objects. The optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = 1 . 3 1 2 4 5 . This example took 104 sec. Example 5.3. The goal is to place two given objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects are identical copies of the dolphin-like object in Example 5.1 . The optimal placement is shown in Figure 18(a) . The radius of the circle is 𝑟 ∗ = 5 . 2 5 1 2 5 3 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 1 4 1 5 9 3 . This example took 4298 sec. Figure 18: (a) Two dolphin-like objects placed into a circle of minimal radius and (b) two staple-like objects placed into a circle of minimal radius. Example 5.4. The goal is to place two given objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects have identical shape, they look like thick metal staples and their boundary is described in Table 2 . The optimal placement is shown in Figure 18(b) . The radius of the optimal circle is 𝑟 ∗ = 2 . 4 5 5 8 6 6 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 1 4 1 5 9 3 . This example took 31 sec. Table 2: The boundary of the “thick staple” object has 8 elements, all straight line segments. Example 5.5. The goal is to place two given objects, 𝐴 and 𝐵 , of different shape into a circle of minimal radius. The object 𝐴 is made by three arcs (two concave and one convex) described in Table 3 . The object 𝐵 = 𝐻 1 ∪ 𝐻 2 is the union of two overlapping hats specified in Table 4 . The optimal placement is shown in Figure 19(a) . The radius of the circle is 𝑟 ∗ = 5 . 3 2 2 8 2 4 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 2 . 3 0 9 9 0 1 . This example took 1147 sec. Table 3: The object 𝐴 (Figure 19 ) bounded by three arcs. Table 4: The object 𝐵 = 𝐻 1 ∪ 𝐻 2 (Figure 19 ) is the union of two overlapping hats. Each hat is specified by the coordinates of the two endpoints ( 𝑥 1 , 𝑦 1 ) and ( 𝑥 2 , 𝑦 2 ) and the center ( 𝑥 𝐶 , 𝑦 𝐶 ) of the circular arc bounding it and by the coordinates ( 𝑥 𝑣 , 𝑦 𝑣 ) of its third vertex. We note that both circular arcs bounding 𝐻 1 and 𝐻 2 have radius 𝑟 = 5 . 0 . Figure 19: (a) Two objects of different shape placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.6. The goal is to place the two given objects, 𝐴 and 𝐵 (same as in Example 5.5 ), into a rectangle of minimal area. The optimal placement is shown in Figure 19(b) . The rectangle has sides 𝑎 ∗ = 1 3 . 2 9 4 2 5 6 and 𝑏 ∗ = 5 . 6 0 3 8 2 8 . Again, the objects are subject to rotation, and the optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = − 0 . 1 1 8 3 7 6 and the object 𝐵 is rotated by angle 𝜃 𝐵 = 0 . 7 1 5 3 4 6 . This example took 443 sec. Example 5.7. The goal is to place two very irregular (star-shaped) objects, 𝐴 and 𝐵 , into a circle of minimal radius. The objects have identical shape, each is the union of four overlapping hats specified in Table 5 . The optimal placement is shown in Figure 20(a) . The radius of the circle is 𝑟 ∗ = 7 . 0 3 1 5 3 1 . Again, the objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 0 . 6 3 4 5 4 3 . This example took 996 sec. Table 5: The object 𝐴 = 𝐻 1 ∪ 𝐻 2 ∪ 𝐻 3 ∪ 𝐻 4 (Figure 20 ) is the union of four overlapping hats. Hats are specified as in Table 4 . We note that all the circular arcs bounding these four hats have radius 𝑟 = 5 . 0 . Figure 20: (a) Two objects of different shape placed into (a) a circle of minimal radius and (b) a rectangle of minimal area. Example 5.8. The goal is to place two very irregular (star-shaped) objects, 𝐴 and 𝐵 , into a rectangle of minimal area. The objects are the same as in Example 5.7 . The optimal placement is shown in Figure 20(b) . The rectangle has sides 𝑎 ∗ = 8 . 8 5 6 3 5 0 and 𝑏 ∗ = 1 4 . 2 9 2 6 2 3 . Again, the objects are subject to rotation, and the optimal rectangle is found when the object 𝐴 is rotated by angle 𝜃 𝐴 = 0 . 4 7 0 3 7 6 and the object 𝐵 is rotated by angle 𝜃 𝐵 = 3 . 6 1 1 9 6 9 . This example took 154 sec. Example 5.9. This is a modification of Example 5.5 : we place two objects 𝐴 and 𝐵 into a circle 𝐶 of minimal radius, but now the object 𝐴 must be at least the distance of 0.7 away from the object 𝐵 and from the edge of the circle 𝐶 ; that is, we need dist ( 𝐴 , 𝐵 ) ≥ 0 . 7 and dist ( 𝐴 , 𝐶 ∗ ) ≥ 0 . 7 . In this example we use adjusted phi-functions (Section 4 ). The optimal placement is shown in Figure 21 . Note that the object 𝐴 does not touch the object 𝐵 or the boundary of 𝐶 ∗ , to maintain the required distance from both. The radius of the optimal circle is 𝑟 ∗ = 5 . 8 2 3 5 0 7 . The objects are subject to rotation, and the optimal circle is found when the object 𝐵 is rotated by angle 𝜃 𝐵 = 2 . 3 2 2 3 8 8 . This example took 7725 sec. Figure 21: Two objects 𝐴 and 𝐵 placed into a circle 𝐶 of minimal radius, with additional restriction on distances from 𝐴 to 𝐵 and 𝐶 . Acknowledgments The authors would like to thank M. Zlotnick for programming the decomposition of objects into basic objects. N. Chernov acknowledges the support of National Science Foundation, Grant DMS-0969187. They thank the anonymous referee for many useful remarks. References E. G. Birgin, J. M. Martínez, F. H. Nishihara, and D. P. Ronconi, “Orthogonal packing of rectangular items within arbitrary convex regions by nonlinear optimization,” Computers & Operations Research , vol. 33, no. 12, pp. 3535–3548, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH A. M. Gomes and J. F. Oliveira, “Solving irregular strip packing problems by hybridising simulated annealing and linear programming,” European Journal of Operational Research , vol. 171, pp. 811–829, 2006. V. J. Milenkovic and K. Daniels, “Translational polygon containment and minimal enclosure using mathematical programming,” International Transactions in Operational Research , vol. 6, no. 5, pp. 525–554, 1999. View at Publisher · View at Google Scholar J. A. Bennell and J. F. Oliveira, “The geometry of nesting problems: a tutorial,” European Journal of Operational Research , vol. 184, no. 2, pp. 397–415, 2008. View at Publisher · View at Google Scholar · View at Zentralblatt MATH G. Wäscher, H. Haußner, and H. Schumann, “An improved typology of cutting and packing problems,” European Journal of Operational Research , vol. 183, pp. 1109–1130, 2007. E. Burke, R. Hellier, G. Kendall, and G. Whitwell, “A new bottom-left-fill heuristic algorithm for the two-dimensional irregular packing problem,” Operations Research , vol. 54, no. 3, pp. 587–601, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. Milenkovic and E. Sacks, “Two approximate Minkowski sum algorithms,” International Journal of Computational Geometry & Applications , vol. 20, no. 4, pp. 485–509, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. J. Milenkovic, “Rotational polygon overlap minimization and compaction,” Computational Geometry , vol. 10, no. 4, pp. 305–318, 1998. View at Publisher · View at Google Scholar · View at Zentralblatt MATH V. J. Milenkovic, “Rotational polygon containment and minimum enclosure using only robust 2D constructions,” Computational Geometry , vol. 13, no. 1, pp. 3–19, 1999. View at Publisher · View at Google Scholar · View at Zentralblatt MATH E. Burke, R. Hellier, G. Kendall, and G. Whitwell, “Irregular packing using the line and arc no-fit polygon,” Operations Research , vol. 58, pp. 948–970, 2010. J. Bennell, G. Scheithauer, Y. Stoyan, and T. Romanova, “Tools of mathematical modeling of arbitrary object packing problems,” Annals of Operations Research , vol. 179, pp. 343–368, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH Y. Stoyan, G. Scheithauer, N. Gil, and T. Romanova, “Φ-functions for complex 2D-objects,” 4OR. Quarterly Journal of the Belgian, French and Italian Operations Research Societies , vol. 2, no. 1, pp. 69–84, 2004. View at Zentralblatt MATH Yu. Stoyan, J. Terno, G. Scheithauer, N. Gil, and T. Romanova, “Phi-functions for primary 2D-objects,” Studia Informatica Universalis , vol. 2, pp. 1–32. N. Chernov, Yu. Stoyan, and T. Romanova, “Mathematical model and efficient algorithms for object packing problem,” Computational Geometry , vol. 43, no. 5, pp. 535–553, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH Y. G. Stoyan and A. Chugay, “Packing cylinders and rectangular parallelepipeds with distances between them,” European Journal of Operational Research , vol. 197, pp. 446–455, 2008. T. Romanova, G. Scheithauer, and A. Krivulya, “Covering a polygonal region by rectangles,” Computational Optimization and Applications , vol. 48, no. 3, pp. 675–695, 2011. View at Publisher · View at Google Scholar · View at Zentralblatt MATH http://www.math.uab.edu/~chernov/CP/ . A. Wächter and L. T. Biegler, “On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming,” Mathematical Programming , vol. 106, no. 1, pp. 25–57, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH H. Minkovski, “Dichteste gitterförmige Lagerung kongruenter Körper,” Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen , pp. 311–355, 1904. var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-8578054-2']); _gaq.push(['_setDomainName', 'hindawi.com']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

Journal

Advances in Operations ResearchHindawi Publishing Corporation

Published: May 6, 2012

There are no references for this article.