Você está na página 1de 5

A Multi-sphere Scheme for 2D and 3D Packing Problems

Takashi Imamichi and Hiroshi Nagamochi


Department of Applied Mathematics and Physics, Graduate School of Informatics, Kyoto University, Kyoto, Japan {ima,nag}@amp.i.kyoto-u.ac.jp

Abstract. In this paper, we deal with a packing problem that asks to place a given set of objects such as non-convex polytopes compactly in R2 and R3 , where we treat translation, rotation and deformation as possible motions of each object. We propose a multi-sphere scheme that approximates each object with a set of spheres to nd a compact layout of the original objects. We focus on the case that all objects are rigid, and develop an ecient local search algorithm based on a nonlinear program formulation. Keywords: packing problem, multi-sphere scheme, iterated local search, unconstrained nonlinear program.

Introduction

In this paper, we deal with a packing problem that asks to place a given set of objects such as non-convex polytopes or objects with curved surfaces compactly in a bounded space in R2 and R3 , where we treat translation, rotation and deformation as possible motions of each object. The problem includes various types of packing problems such as the circle/sphere packing problem, the nonconvex polygon packing problem and a problem of nding feasible layouts in protein docking. We propose a general approach, called multi-sphere scheme, for designing ecient algorithms that compute compact layouts in the packing problem. In the multi-sphere scheme, we rst approximate each object by a set of spheres, and we then search for the positions of all these spheres that minimize an appropriate penalty function. Geometric computations such as collision detection and penetration depth [1] become signicantly simpler if all objects are sets of spheres. In this paper, we focus on the penalized rigid sphere set packing problem that asks to pack a family of sphere sets in our multi-sphere scheme. The container is a rectangle or a circle for R2 and a cuboid or a sphere for R3 , and only translation and rotation by an arbitrary angle are allowed as motions of each object.
This research was supported by Research Fellowships of the Japan Society for the Promotion of Science for Young Scientists and a Scientic Grant in Aid from the Ministry of Education, Science, Sports and Culture of Japan.
T. St utzle, M. Birattari, and H.H. Hoos (Eds.): SLS 2007, LNCS 4638, pp. 207211, 2007. c Springer-Verlag Berlin Heidelberg 2007

208

T. Imamichi and H. Nagamochi

Numerous types of packing problems have been studied so far. The problem of packing circles/spheres, which can be regarded as a special case of the penalized rigid sphere set packing problem, has many variations, such as packing circles into a circle [2], packing circles into a rectangle [3], and sphere packing problem in R2 or a higher dimensional space [4]. Wang et al. [2] formulated an unconstrained nonlinear program of the problem, and designed an algorithm by combining a steepest descent method and a procedure for perturbing a layout. The irregular strip packing problem has been well studied recently. The problem asks to place polygons in R2 inside a rectangular container so that the length of the container is minimized, where translations and rotations by xed degrees such as 90 degrees and 180 degrees are usually allowed. Imamichi et al. [5] proposed a separation algorithm based on a nonlinear program and incorporated the separation algorithm and a swapping algorithm of two polygons in their iterated local search algorithm. Milenkovic [6] uses a linear program to compute how to translate and rotate polygons in a given layout in R2 so as to reduce the length of the container. Modeling an object by a sphere set is already used in several applications. Ferrez [7] proposed a framework of physical simulation of a set of spheres in R3 and a fast algorithm to detect the collisions of spheres. To design a local search algorithm for penalized rigid sphere set packing problem, we formulate the problem as an unconstrained nonlinear program such that the quasi-Newton method can be applied. We then construct an iterated local search algorithm based on the approach by Imamichi et al. [5].

Penalized Rigid Sphere Set Packing Problem

This section formulates the penalized rigid sphere set packing problem for R3 , which asks to place a collection O = {O1 , . . . , Om } of m objects into a container C , which is a sphere or a cuboid. Each object Oi consists of ni spheres {Si1 , . . . , Sini }, and has a reference point ri . Let cij be the vector that represents the center of sphere Sij , rij be the radius of Sij (i = 1, . . . , m; j = 1, . . . , ni ), ni and N = m j =1 cij /ni , which represents the center of Oi . i=1 ni . We let r i = For a set of points S , let S be the complement of S , cl(S ) be the closure of S , S be the boundary of S , and int(S ) = S \ S be the interior of S . After translating object O by translation vector (x, y, z )T , the resulting object is described as O (x, y, z )T = {x +(x, y, z )T | x O }, where T denote the transpose of a vector/matrix. After rotating object O by z -x-z Euler angles (, , ), the resulting object is described as R3 (, , ) O, where R3 (, , ) represents a rotation matrix. We dene a function rot that gives the placement of object Oi by rot (Oi , v i ) = (R3 (rot i , rot i , rot i ) (Oi (r i ))) ((xi , yi , zi )T + r i ), where rot is a positive parameter that represents sensitivity of rotations. Let Sij (v i ) = rot (Sij , v i ) and cij (v i ) be the center of Sij (v i ). The penetration depth [1] of two objects O and O is dened by (O, O ) = min{ x | int(O ) (O x ) = , x R3 }, where denotes the Euclidean norm.

A Multi-sphere Scheme for 2D and 3D Packing Problems

209

We dene penalties of the penetration and protrusion by using the penetration depth: The penalized rigid sphere set packing problem for R3 is dened by minimize subject to Frigid (v ) = wpen Fpen (v ) + wpro Fpro (v ), v = (v 1 , . . . , v m ) R6m ,
n n m n

(1)

pen pro i i k where Fpen (v ) = 1i<km j =1 l=1 fijkl (v ), Fpro (v ) = j =1 fij (v ), i=1 pen pro pen fijkl (v ) = ( (Sij (v i ), Skl (v k )))2 , fij (v ) = ( (Sij (v i ), cl(C )))2 . fijkl denotes pro the penetration penalty of two spheres Sij and Skl , fij denotes the protrusion penalty of sphere Sij , and wpen and wpro are positive parameters. The penalized rigid sphere set packing problem for R2 can be formulated analogously. The computation of (1) takes O(N 2 ) by a naive algorithm; the computation of Fpen is the bottleneck.

2.1

Computation of the Gradient of the Objective Function

pen (v )/ va = 0 This subsection shows how to compute Fpen (v ). First, fijkl (a {1, . . . , m} \ {i, k }). Assume that a pair of spheres Sij (v i ) and Skl (v k ) intersect each other. Let (xij , yij , zij )T = cij (v i ). If cij (v i ) = ckl (v k ), pen fijkl (v )

xi pen (v ) fijkl i

= 2pen (xij xkl ), = 2pen (cij (v i ) ckl (v k ))T R3 (rot i , rot i , rot i ) (cij r i ). i

where pen = (Sij (v i ), Skl (v k ))/ cij (v i )ckl (v k ) . The other dierentials are calculated in the same way. In the case of cij (v i ) = ckl (v k ), we use subgradients. We can handle Fpro (v ) analogously. Thus we can compute Frigid (v ).

Algorithm

This section describes our iterated local search algorithm ILS Rigid. Given a layout (O, C ) as an initial solution to the penalized rigid sphere set packing problem (1), our local search algorithm RigidQN(O , C ) returns a locally optimal solution computed by applying the quasi-Newton method. RigidQN has three parameters wpen , wpro , and rot : wpen (wpro ) denotes the weights of the penetration penalty (resp. the protrusion penalty), and rot denotes the sensitivity of rotations. We let wpen = wpro = 1 and rot = 102 in our experiments. ILS Rigid(O , C ) generates an initial solution by placing objects O randomly so that the reference points are in the container C , rotates the objects randomly and applies RigidQN to the initial layout. ILS Rigid maintains the incumbent solution Oopt that minimizes the objective function Frigid of (1), which will be used for generating the next initial solution. ILS Rigid rst perturbs the incumbent solution by swapping two randomly chosen objects O1 and O2 and rotates them randomly. Then, ILS Rigid translates and rotates objects by invoking RigidQN. ILS Rigid repeats these operations until a time limit.

210

T. Imamichi and H. Nagamochi

Computational Results

This section reports the results on computational experiments. We implemented our algorithm ILS Rigid in C++, compiled it by GCC 4.0.2 and conducted computational experiments on a PC with an Intel Xeon 2.8GHz processor (NetBurst) and 1GB memory. We adopt a quasi-Newton method package L-BFGS [8] for algorithm RigidQN.
Table 1. Information of instances 2D Instance TNO TNS ANS Width Height dighe1 16 1415 88.43 100 110 shapes0 43 3176 73.86 40 60 swim 48 5598 116.62 5752 6500 TNO: The total number of objects TNS: The total number of spheres 3D Instance TNO TNS ANS EL mol1 2 2575 1287.5 54 mol2 3 1948 649.3 46 mol3 3 2679 893.0 51 ANS: The average number of spheres EL: The edge length

Table 2. Results Instance Avg. EL #runs Time limit Avg. Frigid dighe1 105 10 600 2.72e+01 shapes0 50 10 600 8.60e01 swim 6126 10 600 2.92e+02 mol1 54 10 600 3.66e+00 mol2 46 10 600 1.08e+01 mol3 51 10 600 9.64e+00 Best Frigid Avg. NL 2.29e+00 4.97e02 4.48e02 1.86e02 0.00e+00 2.79e03 1.14e+00 3.54e02 1.50e+00 7.16e02 3.66e+00 6.09e02 Best NL 1.44e02 4.23e05 0.00e+00 1.97e02 2.67e02 3.75e02

We use instances for R2 and R3 . For R2 we consider the irregular strip packing problem with free rotations. We use instances available at the EURO Special Interest Group on Cutting and Packing (ESICUP) website1 after converting each polygon in the instances into a set of circles that approximates the polygon. For R3 , we consider the problem that asks to place some protein molecules into a cubic container. We use molecule data of a proteinprotein docking benchmark set2 [9]. To generate instances, we place spheres with van der Waals radii. We generate three instances: mol1 consists of 1GRN l u and 1F34 l b, mol2 consists of 1AY7 l b, 1EWY l b and 1FC2 r u, and mol3 consists of 1MLC l u, 1KAC l b and 1AY7 l b. Table 1 shows the information of the instances. We conducted 10 runs under the time limit of 600 seconds per run. Since the size of containers varies, we normalize the values of Frigid by Frigid /(the average edge length of the container). Table 2 shows the results. The column Avg. EL denotes the average edge length of the container, the column Avg. NL denotes the average normalized value of Frigid over the 10 runs, and the column Best NL denotes the best normalized value of Frigid over the 10 runs.
1 2

http://www.fe.up.pt/esicup/ http://zlab.bu.edu/julianm/benchmark/

A Multi-sphere Scheme for 2D and 3D Packing Problems

211

Conclusions

We proposed a multi-sphere scheme for a packing problem in 2D and 3D. It approximates objects by sphere sets and nd a feasible layout of the objects by the iterated local search algorithm ILS Rigid. Our computational experiments indicate that ILS Rigid can compute a nearby feasible layout eciently. It is left as future work to accelerate ILS Rigid by adopting other sophisticated data structures such as those for the collision detection and to develop an algorithm for the packing problem with deformable objects.

References
1. Agarwal, P.K., Guibas, L.J., Har-Peled, S., Rabinovitch, A., Sharir, M.: Penetration depth of two convex polytopes in 3D. Nordic Journal of Computing 7(3), 227240 (2000) 2. Wang, H., Huang, W., Zhang, Q., Xu, D.: An improved algorithm for the packing of unequal circles within a larger containing circle. European Journal of Operational Research 141(2), 440453 (2002) 3. Birgin, E.G., Mart nez, J.M., Ronconi, D.P.: Optimizing the packing of cylinders into a rectangular container: A nonlinear approach. European Journal of Operational Research 160(1), 1933 (2005) 4. Sloane, N.J.A.: The sphere packing problem. Documenta Mathematica ICM III, 387396 (1998) 5. Imamichi, T., Yagiura, M., Nagamochi, H.: An iterated local search algorithm based on nonlinear programming for the irregular strip packing problem. Technical report 2007-009, Department of Applied Mathematics and Physics, Graduate School of Informatics, Kyoto University (2007) 6. Milenkovic, V.J.: Rotational polygon overlap minimization and compaction. Computational Geometry 10(4), 305318 (1998) 7. Ferrez, J.A.: Dynamic triangulations for ecient 3D simulation of granular materi als. PhD thesis, Ecole Polytechnique F ed erale de Lausanne (2001) 8. Liu, D.C., Nocedal, J.: On the limited memory BFGS method for large scale optimization. Mathematical Programming 45(3), 503528 (1989) 9. Mintseris, J., Wiehe, K., Pierce, B., Anderson, R., Chen, R., Janin, J., Weng, Z.: Protein-protein docking benchmark 2.0: an update. Proteins 60(2), 214216 (2005)

Você também pode gostar