Научная статья на тему 'An Efficient Algorithm for the Ellipse Packing Problem'

An Efficient Algorithm for the Ellipse Packing Problem Текст научной статьи по специальности «Математика»

CC BY
425
123
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
packing / ellipses / continuous rotations / quasi-phi-functions / nonlinear optimization / solution algorithm

Аннотация научной статьи по математике, автор научной работы — A. Pankratov, T. Romanova, I. Subota

The paper considers the problem of packing a given collection of ellipses into a rectangular container of minimal area. Our ellipses can be continuous rotated and translated. A class of radical-free quasi-phi-functions is introduced for an analytical description of non-overlapping and containment constraints for ellipses. We formulate the packing problem in the form of a nonlinear programming problem and develop an efficient solution algorithm. The algorithm allows us to reduce computational cost of our problem. We present computational results that compare with those published elsewhere recently.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «An Efficient Algorithm for the Ellipse Packing Problem»

An Efficient Algorithm for the Ellipse Packing Problem

A. Pankratov, T. Romanova and I. Subota

Department of Mathematical Modeling and Optimal Design, Institute for Mechanical Engineering Problems,

the National Academy of Sciences of Ukraine, Ukraine

Abstract - The paper considers the problem of packing a given collection of ellipses into a rectangular container of minimal area. Our ellipses can be continuous rotated and translated. A class of radical-free quasi-phi-functions is introduced for an analytical description of non-overlapping and containment constraints for ellipses. We formulate the packing problem in the form of a nonlinear programming problem and develop an efficient solution algorithm. The algorithm allows us to reduce computational cost of our problem. We present computational results that compare with those published elsewhere recently.

Index Terms - packing, ellipses, continuous rotations, quasi-phi-functions, nonlinear optimization, solution algorithm.

I. INTRODUCTION

The literature on two dimensional packing problems is large and it is not possible to comprehensively review here. It is common for cutting and packing papers to indicate the problem type according to the typology presented in [1]. At present, the interest in finding effective solutions for packing problems is growing rapidly. This is due to a large and growing number of applications and an extreme complexity of methods used to handle many of them [2]. In this paper, we deal with the optimal ellipse packing problem, which is a part of operational research and computational geometry. It has multiple applications in modern biology, mineralogy, medicine, materials science, nanotechnology, as well as in the chemical industry, power engineering, logistics etc.

One way to tackle the packing problem for ellipses is to approximate the latter with line segments [3]. There is a short list of publications which deal with arc shapes without polygonal approximations. Packing problems with irregular objects of fixed orientation, whose frontier can be described by a sequence of line- and arc-segments, are tackled in [4] using the no-fit polygon.

Manuscript received December 12, 2013

A. V. Pankratov is a senior scientist associate at the Department of Mathematical Modeling and Optimal Design, A.M. Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine. T. E. Romanova is a leading scientist at the Department of Mathematical Modeling and Optimal Design, A.M. Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine. Corresponding author, e-mail: tarom27@yahoo.com

I. A. Subota is an aspirant of the Department of Mathematical Modeling and Optimal Design, A.M. Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine.

That paper extends the heuristic orbital sliding method of calculating no-fit polygons to enable it to handle arcs and then shows the resultant no-fit polygons being utilised successfully on the two-dimensional irregular packing problem.

The other way is to use the existing phi-functions for arc objects, described in [5, 6]. However, the complexity of such a solution would depend on the number of lines/arcs used to approximate the ellipses. In any case, this approach would only give an approximate solution.

Our approach, which is based on quasi-phi-functions, is capable of handling precise ellipses (without any approximations) and thus finding an exact local optimal solution. The only other method of that sort was developed very recently by Josef Kallrath and Steffen Rebennack; see [7]. The paper is entirely devoted to the problem of cutting ellipses from a rectangular plate of minimal area. Incidentally, it offers a good overview of related publications. For a small number of ellipses they are able to compute a globally optimal solution subject to the finite arithmetic of global solvers at hand. However, for more than 14 ellipses none of the nonlinear programming (NLP) solvers available in GAMS can even compute a locally optimal solution. Therefore, the authors of [7] develop polylithic approaches, in which the ellipses are added sequentially in a strip-packing fashion to the rectangle restricted in width but unrestricted in length. The rectangle’s area is minimized at each step in a greedy fashion. The sequence in which they add ellipses is random; this adds some GRASP flavor to the approach. The polylithic algorithms allow the authors to compute good solutions for up to 100 ellipses. A number of examples are presented in the paper.

In order to compare the performance of the two methods, we applied our algorithm to some instances of the ellipse packing problem as used in [7].

The paper is organized as follows: In Section 2 we formulate the optimal ellipse packing problem and give a short review of related works. In Section 3 we propose a mathematical model as a continuous nonlinear programming problem by means of quasi-phi-functions. In Section 4 we develop a new efficient solution algorithm to search for local optimal solutions. In Section 5 we provide our computational results for several instances studied in [7], and finish with some concluding remarks in Section 6.

II. PROBLEM FORMULATION

We consider here a packing problem in the following setting. Let Q denote a rectangular domain of length l and width w. Both of these dimensions may be variable, or one may be fixed and the other variable. Suppose a set of ellipses Et, і є {1,2,...,n} = In, is given to be placed in Q without overlaps. Each ellipse Et is defined by its semiaxes ai and bt, whose values are fixed. With each ellipse Et we associate its eigen coordinate system whose origin coincides with the center of the ellipse and the coordinate axes are aligned with the ellipse’s axes. In that system the ellipse is described by parametric equations x = a cos t, y = b sin t, 0 < t < 2n . We also use a fixed coordinate system attached to the container Q. The position of ellipse Et in the fixed coordinates is specified by the coordinates (xt, y) of its center and the rotation angle j. Ellipse packing problem. Place the set of ellipses Et, і є In, within a rectangular container

Q = {(x,y) є R2 : 0 < x < l,0 < y < w} of minimal area.

III. MATHEMATICAL MODEL

ujj = (4, t2), X = -( Щ,, j

a1 =aij cos^t +e Sim#, e

1 cos

a =—

a,.

в

sintj

b ’

-alaj-P'jjP] ,

- -at1 sin j + в cosp,

= aj cosj + p2 sinj, p

-a2 sin#; + pp cosj,

cos t2

a =■

P2

a

sintj

b ’

x+ = a'j(xip- xt)+pj1(yj+- yt) -1,

X~ =ai(x^-xi) + pl(yt -У)-1,

(x2+, y2+) = (xj, yt2) + n(-p2,a2),

(x2, yip) =(xi2 y;;,)-v(-pPap), n = (a)2,

(xii, yii) = V, + M j) • (x2, y2),

(x2, y2) = (a,, cost2,bsint2), Mj) denotes the standard

t t t t

rotation matrix, v, = (x,, y ,) is a translation vector of ellipse E,; Фі is a quasi-phi-function defined for the ellipse Et and the object Q* = R2\int Q (to hold the

contatnment constraint),

First we assemble a complete set of variables for our optimization problem. The vector u є Ra of all our variables can be described as follows: u = (l, w, u1, u2,..., un ,t), where (l, w) denote the variable length and width of the container Q and u t = (xt, y j) is the vector of placement parameters for the ellipse Ei , і є In. Lastly, t denotes the vector of additional variables, defined as follows: t = (P, t2, j > і є In, t , t ,і є I ), where t1, t2 are additional variables for the pair of ellipses Et and E,, and t , t are additional variables for each ellipse Et.

Here Ra denotes the ст-dimensional Euclidean space, where a = 2 + 3n + n(n -1) + 2n = n2 + 4n + 2 is the number of the problem variables.

A mathematical model of the ellipse packing problem may now be stated in the form:

Фі (u) = mІn{^П(Pl),^П(P2),^12(Pз),^12(P4),

V21 (P2 X V21 (РзX V22 (PiX V22 (Р4Ж u = (xt,Уі,#,tn,tt2) є R5 , Pi = (0,0) , P2 = (l,0) ,

Рз =(l, w), P4 = (0, w), Vki = A,kx + BкУ + C ik - ^

Va 2 = - Akx - B >кУ - C ік-1, Ak = ak •cos # + рл •sin #,

B ік = -ak •sin # + h •cos #, ak = ■costk, рл = -pp1-,

a bi

C>k =-A>kx> - Bikyі, k = U.

Our constrained optimization problem (1)-(2) is NP-hard nonlinear programming problem [8]. The solution space W has a complicated structure: it is, in general, a disconnected set, each connected component of W is multiconnected, the frontier of W is made of nonlinear surfaces containing valleys, ravines. A matrix of the inequality system which specifies W is strongly sparse and has a block structure.

min F (u), (1)

uєW c Ra

W = {u є Ra : Ф, > 0, Фі > 0, j > і є In}, (2)

where F(u) = l • w , Ф, is a quasi-phi-function defined for the pair of ellipses E,, and E, (to hold the non-overlaPPing constraint),

Ф j (u і, uj, u ij) = min{x(e, вj, u ij),

X+ (u і, uj, u 'tj), X-(u і, uj, u 'j

IV. SOLUTION STRATEGY

Our solution strategy consists of three major stages:

1) First we generate a number of starting points from the feasible region of the problem (1)-(2). We employ the special starting point algorithm based on homothetic transformation of ellipses using a modification of the optimization procedure developed in [9] for a circular packing problem.

2) Then starting from each point obtained at Step 1 we search for a local minimum of the objective function

F(u) of problem (l)-(2). We employ special the Local Optimization Procedure (LOP) for ellipse packing problem (1)-(2).

3) Lastly, we choose the best local minimum from those found at Step 2. This is our best approximation to the global solution of the problem (l)-(2).

An essential part of our local optimization scheme (Step 2) is the LOP procedure that reduces the dimension of the problem and runtime. It is due to this reduction that our strategy can process large sets of non-identical ellipses. The reduction scheme used by our LOP algorithm is described below. The actual search for a local minimum is performed by a standard IPOPT algorithm [10], which is available at an open access noncommercial software depository (https://proiects.coin-or.org/Ipopt) .

Let u(0) eW be one of feasible starting points. The main idea of the subsequent LOP algorithm is as follows.

First we circumscribe a circle Ci of radius at around each ellipse Ei, i = 1,2,...,n . Then for each circle с. we construct an "individual" rectangular container Ц з Ct з E with equal half-sides of length ai + є ,

i = 1,2,...,n, so that Ci, Et and о,. have the same center (x°, y0) subject to the sides of о,. being parallel to those of Q . Here є is a fixed constant. Further we fix the position of each individual container о,, and let the local optimization algorithm move the corresponding ellipse Ei only within the container о,. . It is clear that if two individual containers о,, and Qj do not have common

interior points (i.e. ФцQj > 0), then we do not need to check the non-overlapping constraint for the corresponding pair of ellipses Ei and Ej . The idea allows us to extract subregions of our feasible region W of the problem (1)-(2) at each step of our optimization procedure as follows.

We create an inequality system of additional constraints on the translation vector vt of each ellipse Et in the form:

ФC‘Ql‘ > 0, i e In, where

Фс,Пі‘ = min{-xt + x° + є, - у + у» + є,

xi - x“ +єу -yi + є},

is the phi-function for the circle Ct and Q*. = R2\intQh..

Then we form a new region defined by

Then our algorithm searches for a point of local minimum u of the subproblem min F(u ). When

1 U„1 eWi cR"-"1 1

the point uw* is found, it is used to construct a starting point u(1) for the second iteration of our optimization procedure (note that the ст1 previously deleted additional variables т1 have to be redefined by a special procedure, assuming Л0 = 1). At that iteration we again identify all the pairs of ellipses with non-overlapping individual containers, form the corresponding subregion W2 (analogously to W1 ) and let our algorithm search for a local minimum u* e W2 . The resulting local minimum u* is used to construct a starting point u (2) for the third iteration, etc.

We stop our iterative procedure when F(u* ) = F(u ),

where u* is a point of local minimum of the problem

Wk

l_lk

min F (u ):

,eWk cRa-at k

{u eR°-°k : Ф„ > 0, (i, j) e;

k

ФІ > 0, ФCQ > 0, i e In },

{(i, j): ФПьП" < 0, i > j e In}.

We claim that the point u* = u(k)* = (u* ,rk) e Ra is a point of local minimum of the problem (1)-(2), where u* e R^-^ is the last point of our iterative procedure and

тк e Rak is a vector of the previously deleted additional variables (the variables can be redefined by the special procedure). The assertion comes from the fact that any arrangement of each pair of ellipses Ei and Ej subject to (i, j) eS\Ek guarantees that there always exists a vector

тк of additional variables such that Ф^ > 0, (i, j) eS \ Sk at the point u(k)*. Here S = {(i, j), i > j = 1,2,..., n}. Therefore the values of additional variables of the vector у have no effect on the value of our objective function, i.e F(u* ) = F(u(kr). That is why, indeed, we do not need to

redefine the deleted additional variables of the vector у at the last step of our algorithm.

W1 = {u eRCT-CT1 : Ф\> 0, (i, j) es1, Фi > 0, Фс-п;- > 0, i e In}, where у = {(i, j): фП1-Q1 j < 0, i > j e In} .

V. COMPUTATIONAL RESULTS

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Here we present a number of examples to demonstrate the high efficiency of our algorithm. We have run our experiments on an AMD Athlon 64 X2 5200+ computer, and for local optimisation we used the IPOPT code (https://proiects.coin-or.org/Ipopt). We present instances taken from the recent paper [7]. We set a runtime limit for

each example to search for at least 10 local minima. We

n

also use є = ^ bt / n in our computational experiments.

i=1

We applied our method to some instances used in paper [7] and compare our optimal solutions to theirs.

We set runtime for the group of instances: up to 20 objects - time limit 2 hours, up to 50 - time limit 5 hours, 100 objects - time limit 12 hours.

Table 1 lists some examples presented in [7]. For each the example the minimal area of the container found by our method is smaller than the best solution reported in [7]. The improvement is not so big (1% to 2%) for smaller sets of ellipses, but it becomes significant (8% to 9%) for larger sets of ellipses. It should be noted that for examples TC02a, TC02b, TC03a, TC03b, TC04a and TC04b presented in the paper our method found the same results.

TABLE 1

COMPARISON OF OUR RESULTS TO THOSE IN [7]

Name our result the best result from [7] Improvement (%)

TC05a 25.0206 25.29557 1.0990

TC05b 30.84870 31.28873 1.4264

TC06 25.47173 25.51043 0.1520

TC11 57.1783 57.24034 0.1085

TC14 24.25099 24.84634 2.4550

TC20 66.13647 67.83459 2.5676

TC30 95.36535 103.45212 8.4798

TC50 154.470487 166.91505 8.0563

TC100 297.73798 322.64663 8.3660

The local-optimal packing of 100 ellipses (for instance TC100 from [7]) into a rectangular container of area F (u) = 297.738 is shown in Figure 1.

Fig. 1 The local-optimal packing of 100 ellipses

VI. CONCLUSIONS

The algorithm allows us to reduce computational cost of our problem. While there are O( n2 ) pairs of ellipses in the container, our algorithm may in most cases only actively controls O(n) pairs of ellipses (this depends on the sizes of ellipses and the value of є), because for each ellipse only its nearest neighbors have to be monitored. Thus our LOP algorithm allows us to reduce the problem (1)-(2) with

O( n2 ) inequalities and a O( n2 )-dimensional solution space W to a sequence of sub-problems, each with O( n) inequalities and a O( n )-dimensional solution subspace Wk .

This reduction is of a paramount importance, since we deal with non-linear optimization problems.

REFERENCE

[1] Wascher, G., Hauner, H. and Schumann, H., (2007) An improved typology of cutting and packing problems, European Journal of Operational Research, Volume 183, Issue 3, 16, pp. 1109-1130.

[2] Bennell, J.A., Oliveira J.F, (2009) A tutorial in irregular shape packing problem, Journal of the Operational Research Society, 60:s93-s105 .

[3] Feng, Y., Han, K., and Owen, D. An Advancing Front Packing of Polygons, Ellipses and Spheres// Discrete Element Methods - 2002 -pp. 93-98.

[4] Burke, E.K., Hellier, R., Kendall, G., Whitwell, G., (2010) Irregular packing using the line and arc no-fit polygon. Operations Research. 58(4), 948-970

[5] Chernov N, Stoyan Y, Romanova T., (2010) Mathematical model and efficient algorithms for object packing problem. Computational Geometry: Theory and Applications 43(5): 535-553.

[6] Chernov, N., Stoyan, Y., Romanova, T., Pankratov, A., (2012) Phi-Functions for 2D Objects Formed by Line Segments and Circular Arcs. Advances in Operations Research, 26. doi:10.1155/2012/346358.

[7] Josef Kallrath and Steffen Rebennack, (2013) Cutting Ellipses from Area-Minimizing Rectangles" Journal of Global Optimization, DOI10.1007/s10898-013-0125-3

[8] Chazelle, B., Edelsbrunner, H., Guibas, L.J., (1989) The complexity of cutting complexes. Discrete & Computational Geometry. 4(2), 139-81

[9] Yu. Stoyan, G. Yaskov, (2013) Packing unequal circles into a strip of minimal length with a jump algorithm, Optimization Letters, DOI: 10.1007/s11590-013-0646-1.

[10] Wachter, A., Biegler, L. T., (2006) On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Mathematical Programming.106, 1, 25-57

Alexander V. Pankratov received Doctor of Technical Sciences degree in Mathematical Modeling and Computational Methods (2013) from A.M. Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine (Kharkov). From 2012 he is a senior scientist associate at the Department of Mathematical Modeling and Optimal Design, A.M. Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine. His current research interests include mathematical modeling, operational research, computational geometry, optimization, packing and cutting.

Tatiana E. Romanova received Doctor of Technical Sciences degree in Mathematical Modeling and Computational Methods (2003) from V.M. Glushkov Institute of Cybernetics of the National Academy of Sciences of Ukraine (Kiev). She received the Professor title (2005) from the Department of Applied Mathematic of Kharkov National University of Radioelectronics (Kharkov). From 2013 she is a leading scientist at the Department of Mathematical Modeling and Optimal Design, A.M.

Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine. Her current research interests include mathematical modeling, operational research, computational geometry, optimization, packing and cutting.

Iryna A. Subota received the M.Sc. (2011) from Kharkov National University of Radioelectronics. From 2011 she is an aspirant of the Department of Mathematical Modeling and Optimal Design, A.M.

Podgorny Institute of Mechanical Engineering of the National Academy of Sciences of Ukraine. Her current research interests include mathematical modeling, operational research, computational geometry, optimization, packing and cutting.

i Надоели баннеры? Вы всегда можете отключить рекламу.