12
Innovative Applications of O.R. Heuristics for container loading of furniture Jens Egeblad a, * , Claudio Garavelli b , Stefano Lisi b , David Pisinger a a Department of Computer Science, University of Copenhagen, Copenhagen, Denmark b Department of Management Engineering, Polytechnic of Bari, Italy article info Article history: Received 30 August 2007 Accepted 28 January 2009 Available online 12 February 2009 Keywords: Packing Combinatorial optimization Logistics Transportation Heuristics abstract We consider a container loading problem that occurs at a typical furniture manufacturer. Each furniture item has an associated profit. Given container dimensions and a set of furniture items, the problem is to determine a subset of items with maximal profit sum that is loadable in the container. In the studied company, the problem arises hundreds of times daily during transport planning. Instances may contain more than one hundred different items with irregular shapes. To solve this complex problem we apply a set of heuristics successively that each solve one part of the problem. Large items are combined in specific structures to ensure proper protection of the items during transportation and to simplify the problem. The solutions generated by the heuristic has an average loading utilization of 91.3% for the most general instances with average running times around 100 seconds. Ó 2009 Elsevier B.V. All rights reserved. 1. Introduction The container loading optimization problem is a central indus- trial problem and deals with the optimal utilization of container space for distribution of goods. A survey on packing problems in general was presented by Dyckhoff et al. (1997) and a recent typol- ogy was presented by Wäscher et al. (2007). In this paper we consider container loading of pieces of furni- ture. The problem occurs at a typical furniture producer which re- quires solutions to be generated within minutes on commodity hardware. Items may have non-rectangular (irregular) shapes and each item i has an associated profit value p i that describes how desirable it is to load. Formally, the problem we address is a three-dimensional knapsack packing problem with irregular shaped items; Given a consignment I of items and container dimensions W; H and D, the objective is to determine a loadable set I 0 # I such that P i2I 0 p i is maximal. A set of items is loadable if all of its items can be placed stably within the knapsack and such that no two items overlap. It is easy to see that, since the one-dimensional knapsack prob- lem is NP-hard (see e.g. Kellerer et al., 2004), the three-dimensional variant is also NP-hard. In the typology by Wäscher et al. (2007) the problem belongs to the category strongly heterogeneous three-dimensional single knapsack problem (SKP) with irregular shapes. Items are divided into three different categories: Large: Irregularly shaped items such as armchairs, 2- and 3-seat sofas, chaise lounges and corner modules which are used to combine two segments of a sofa to a corner-sofa. See Fig. 1. To minimize the risk of damages during transportation, items must be placed in a stable location and only a specific set of rotations are allowed. Medium-sized: Box-shaped robust items for which all six possi- ble axis-aligned rotations are allowed. Small: Smaller accessory box-shaped items or items loaded in cardboard boxes, e.g. vases, lamps and glass-plates for tables. These items have different levels of fragility and acceptable ori- entations are taken from individual subsets of the six possible axis-aligned rotations. Additionally, small items may only be placed on top of heavier items and must be properly supported when loaded. Although all types of items have an associated profit that desig- nates its desirability, it is assumed that large items are always more desirable than medium-sized items, which in turn are more desirable than small items. An example solution with more than 300 items from all three categories is illustrated on Fig. 2. Instances are generally heteroge- neous and we generally consider item-types rather than items. In the following, let L; M; S, and I be the different types of large, medium, small, and all items, respectively in an instance and let p i for i 2 I be the profit value of item-type i. Generating accurate representations of items is a challenging problem and although laser-scanning methods were investigated, 0377-2217/$ - see front matter Ó 2009 Elsevier B.V. All rights reserved. doi:10.1016/j.ejor.2009.01.048 * Corresponding author. Tel.: +45 35 32 14 00. E-mail addresses: [email protected] (J. Egeblad), [email protected] (C. Garavelli), [email protected] (D. Pisinger). European Journal of Operational Research 200 (2010) 881–892 Contents lists available at ScienceDirect European Journal of Operational Research journal homepage: www.elsevier.com/locate/ejor

Heuristics for container loading of furniture

  • Upload
    dtu

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

European Journal of Operational Research 200 (2010) 881–892

Contents lists available at ScienceDirect

European Journal of Operational Research

journal homepage: www.elsevier .com/locate /e jor

Innovative Applications of O.R.

Heuristics for container loading of furniture

Jens Egeblad a,*, Claudio Garavelli b, Stefano Lisi b, David Pisinger a

a Department of Computer Science, University of Copenhagen, Copenhagen, Denmarkb Department of Management Engineering, Polytechnic of Bari, Italy

a r t i c l e i n f o

Article history:Received 30 August 2007Accepted 28 January 2009Available online 12 February 2009

Keywords:PackingCombinatorial optimizationLogisticsTransportationHeuristics

0377-2217/$ - see front matter � 2009 Elsevier B.V. Adoi:10.1016/j.ejor.2009.01.048

* Corresponding author. Tel.: +45 35 32 14 00.E-mail addresses: [email protected] (J. Egeblad), c.ga

[email protected] (D. Pisinger).

a b s t r a c t

We consider a container loading problem that occurs at a typical furniture manufacturer. Each furnitureitem has an associated profit. Given container dimensions and a set of furniture items, the problem is todetermine a subset of items with maximal profit sum that is loadable in the container. In the studiedcompany, the problem arises hundreds of times daily during transport planning. Instances may containmore than one hundred different items with irregular shapes. To solve this complex problem we apply aset of heuristics successively that each solve one part of the problem. Large items are combined in specificstructures to ensure proper protection of the items during transportation and to simplify the problem.The solutions generated by the heuristic has an average loading utilization of 91.3% for the most generalinstances with average running times around 100 seconds.

� 2009 Elsevier B.V. All rights reserved.

1. Introduction

The container loading optimization problem is a central indus-trial problem and deals with the optimal utilization of containerspace for distribution of goods. A survey on packing problems ingeneral was presented by Dyckhoff et al. (1997) and a recent typol-ogy was presented by Wäscher et al. (2007).

In this paper we consider container loading of pieces of furni-ture. The problem occurs at a typical furniture producer which re-quires solutions to be generated within minutes on commodityhardware. Items may have non-rectangular (irregular) shapesand each item i has an associated profit value pi that describeshow desirable it is to load.

Formally, the problem we address is a three-dimensionalknapsack packing problem with irregular shaped items; Given aconsignment I of items and container dimensions W;H and D,the objective is to determine a loadable set I0 # I such that

Pi2I0pi

is maximal. A set of items is loadable if all of its items can beplaced stably within the knapsack and such that no two itemsoverlap.

It is easy to see that, since the one-dimensional knapsack prob-lem is NP-hard (see e.g. Kellerer et al., 2004), the three-dimensionalvariant is also NP-hard. In the typology by Wäscher et al. (2007)the problem belongs to the category strongly heterogeneousthree-dimensional single knapsack problem (SKP) with irregularshapes.

ll rights reserved.

[email protected] (C. Garavelli),

Items are divided into three different categories:

� Large: Irregularly shaped items such as armchairs, 2- and 3-seatsofas, chaise lounges and corner modules which are used tocombine two segments of a sofa to a corner-sofa. See Fig. 1. Tominimize the risk of damages during transportation, items mustbe placed in a stable location and only a specific set of rotationsare allowed.

� Medium-sized: Box-shaped robust items for which all six possi-ble axis-aligned rotations are allowed.

� Small: Smaller accessory box-shaped items or items loaded incardboard boxes, e.g. vases, lamps and glass-plates for tables.These items have different levels of fragility and acceptable ori-entations are taken from individual subsets of the six possibleaxis-aligned rotations. Additionally, small items may only beplaced on top of heavier items and must be properly supportedwhen loaded.

Although all types of items have an associated profit that desig-nates its desirability, it is assumed that large items are alwaysmore desirable than medium-sized items, which in turn are moredesirable than small items.

An example solution with more than 300 items from all threecategories is illustrated on Fig. 2. Instances are generally heteroge-neous and we generally consider item-types rather than items. Inthe following, let L;M;S, and I be the different types of large,medium, small, and all items, respectively in an instance and letpi for i 2 I be the profit value of item-type i.

Generating accurate representations of items is a challengingproblem and although laser-scanning methods were investigated,

Fig. 1. Example of irregular items to be loaded.

Fig. 2. Example solution with more than 300 items and the coordinate system used.

882 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

we settled on simpler parametric models; Each item is describedusing approximately 50 parameters (measures), based on thephysical model. The parameters are used to generate a triangle-mesh structure (mesh), which is a simple list of triangles in spacethat describes the surface of the item. The generated meshes typi-cally consist of a few hundred triangles. Fig. 3 demonstrates therepresentation.

The solution method consists of the stages illustrated on Fig. 4which are completed one at a time from left to right and are asfollows:

1. Preprocessing. First, the geometry of large items is analyzedand a large set of sub-placements (templates) of few items aregenerated. The sub-placements are used to simplify subsequentstages of the overall heuristic. See Section 3 and 4.

2. Quad-wall building. A tree-search heuristic is used to find anintermediate solution consisting of only large items. Themethod constructs placements by iteratively selecting fourtemplates which fit next to each other in the width and heightof the container (quad-wall). See Section 5.

3. Local search. The quad-wall placement is refined via a localsearch heuristic for large items as described in Section 6.

4. Stability. A special local search heuristic which is described inSection 7 reduces situations where items are placed unstably.

5. Greedy algorithm. Once the large items have been placed weproceed to place medium-sized items between and above largeitems with a greedy algorithm described in Section 8. This algo-rithm is also used to determine a placement of large items

z

x

y

Fig. 3. The triangle-mesh structure of an item shown in the item-coordinatesystem.

which is suitable for medium-sized items. This is indicated onFig. 4 by the area below the three first heuristic steps, whichprotrudes into the ‘‘Greedy algo” step.

6. Wall-building. The small items are then placed in the availablespace at the end of the container with a traditional wall-build-ing heuristic to be described in Section 9. Remaining smallitems are placed using the greedy algorithm of step 5.

The main novelties introduced in this paper include the con-struction and use of the templates, the tree-search heuristic whichplaces quad-walls, and a strategy for ensuring stability of individ-ual items.

This paper is organized as follows: First, we present an overviewof previous relevant work in Section 2. In Sections 3–9 we presentthe solution method. Finally, in Section 10 we present the experi-mental results followed by a conclusion in Section 11.

2. Related work

Since the problem we consider in this paper is a knapsack con-tainer loading problem with irregular shapes and stability consid-erations, we will briefly discuss some of the recent advances in thetopics knapsack packing, container loading, dealing with stability,and three-dimensional packing of irregular shapes.

Recent exact methods for rectangular knapsack packing prob-lems based on enumeration schemes and strong lower-boundswere suggested by Caprara and Monaci (2004) and Fekete et al.(2007). Exact methods based on constraint programming tech-niques were suggested by Clautiaux et al. (2008). Heuristics in-clude the tabu-search based heuristic for the two-dimensionalknapsack packing problem by Alvarez-Valdes et al. (2005) and asimulated annealing and sequence-based heuristic for two- andthree-dimensional knapsack packing problems by Egeblad andPisinger (2009). To our knowledge irregular knapsack packingproblems have not been studied previously in the literature.

The term container loading problem is commonly used for thevariant of the three-dimensional knapsack packing problems thatconsists of more than a hundred homogeneous items and wherethe profit of each item is directly related to its volume.

Some of the most successful heuristics for the container loadingproblem utilize a technique referred to as wall-building which wasoriginally introduced by George and Robinson (1980). Here itemsare packed by constructing ‘‘walls” of items that fill the width

Fig. 4. The stages of the solution process.

J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892 883

and height of the container. Commonly, the depth of each wall isdetermined from the depth of a single item and items may not ex-tend beyond the depth of the wall that it belongs to. The mainadvantage of this paradigm is that the three-dimensional packingproblem is broken into a set of simpler two-dimensional problems.The main disadvantage is that space is lost when items do not fullyutilize the depth of the wall they belong to. A variety of wall-gen-eration techniques were studied by Bischoff and Marriott (1990)and more recent wall-building methods were introduced by Geh-ring and Bortfeld (2002) and Pisinger (2002).

To remedy some of the problems of wall-building, severalauthors have suggested alternative ways to represent free spacein the container. Notable recent methods were introduced by Bisc-hoff (2006), who used a non-trivial matrix to represent availablespace for every location of the container, and Eley (2002), whoused a list of available space which is updated each time a newblock of items is placed.

At the time of writing, the overall highest utilization levels forcontainer loading problems have been achieved by Mack et al.(2004) with a parallelized hybrid of tabu-search and simulatedannealing running on 64 processors based on the advanced wall-building procedure of Gehring and Bortfeld (2002). The heuristicreaches overall utilization of more than 90%. Some of the best re-sults with a non-parallel method were achieved by Moura andOliveira (2005) with overall utilization slightly below 90%.

A number of authors have also considered stability of the items.Gehring and Bortfeldt (1997) consider a set of constraints for thecontainer loading problem: Items may be placed only on top of astack with sufficient bearing-strength to accommodate it, itemsmay only be stacked a limited number of times on top of eachother, some items may only be at the top of a stack, since strengthof an item depends on its orientation only a limited number ofitem-depending orientations may be used, and items must beloaded such that they do no fall to the floor during transportation.The approach by Gehring and Bortfeldt (1997) was based on build-ing stacks which makes it relatively simple to accommodate mostof these constraints. Ratcliff and Bischoff (1998) and later Bischoff(2006) considered a similar list of constraints. Here a matrix repre-sentation is used to describe not only the available space but alsothe bearing-strength of each region of the floor. As the heuristicis constructive it is simple to ensure that items are positionedwithout violating load constraints.

Both two- and three-dimensional packing problems involvingirregular shapes have been studied in the literature. Irregular pack-ing is commonly considered in conjunction with the strip-packingproblem where a container width and a set of items are given, andone is to find the smallest height such that the items can be placedwithout overlap within the container. Currently the best results inthe literature for the strip-packing problem of irregular shapeshave been presented by Gomes and Oliveira (2006), Imamichiet al. (2006) and Egeblad et al. (2007).

Three-dimensional problems involving irregular shapes are lessstudied. Methods for three-dimensional packing of irregularshapes generally represent surfaces of shapes by triangle-mesh

structures. Thus far, the most promising results for the three-dimensional variant of the nesting problem comes from the meth-ods by Stoyan et al. (2005), which is based on three-dimensional/-functions, and Egeblad et al. (2009), which is a generalizationof the method by Egeblad et al. (2007) to three- and higher-dimen-sional problems. Both papers consider a three-dimensional variantof the strip-packing problem and the method by Egeblad et al.(2009) reaches utilization between 40% and 50% on instances withbetween 7 and 75 items.

3. Preprocessing

The first part of our method consists of geometric analysis andtemplate construction. The geometric analysis is used to determinewhere item-types must be positioned relatively to each other toavoid overlap. Once the feasible relative positions have been deter-mined, they are used to construct suitable sub-placements of a fewlarge items which we refer to as templates. Templates are used tosimplify the problem.

3.1. Geometric analysis

The geometric analysis is used to determine non-overlappingcompact positions of items relative to each other. Several combina-tions could be considered, but here we limit our discussion to pairsof items.

If rotation angles are fixed, the boundary of the three-dimen-sional Minkowski-sum of A and the inverse of B, describes all sur-face-contacting translations of B relative to A (see e.g. de Berg et al.,2000). For non-convex polyhedra, with respectively m and n fea-tures, the size of the Minkowski-sum is Oðm3n3Þ (see e.g. Skiena,1997) and thus this can be an expensive operation.

To simplify the problem, we take advantage of the fact that theshapes we consider describe mainly sofas. When a sofa is loaded inthe bottom of a container, it is first rotated 90� around the x-axis(see Fig. 3) and placed with its armrest on the container floor. Thisgives rise to a two-dimensional set of positions of one sofa relativeto another since the third dimension is fixed. Furthermore, a pair ofsofas is commonly loaded such that their fragile parts point to-wards each other for protection during transportation. Finally,the items are generally semi-convex sofa-shapes which further al-lows us to limit the number of possible relative positions to a one-dimensional set; For every relative x-position we assume that thereis one and only one acceptable y-position.

Consider meshes A and B (e.g. sofas or chairs) which are definedas in the coordinate system on Fig. 3 and are to be loaded on thecontainer floor. To simplify the discussion we omit the step herewhere the meshes are rotated around the x-axis and for theremainder of this section the xy-plane is the container floor. Welet Bp be B rotated 180� around the z-axis, so that the fragile parts(the seats) of A and Bp can point towards each other. The only fea-sible relative positions of Bp are those where Bp touches A and hasits seat pointing towards A’s.

y

x

Relative Pair Positions

Fig. 5. Example output of the pairing algorithm described in Section 3.1. Two copiesof the mesh from Fig. 3 are paired together and the output is a piecewise linearfunction describing relative y-position for every relative x-position.

884 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

Since both sofas must rest on the container floor (the xy-planeof the coordinate system here) A and Bp are initially translated inthe z-direction such that the minimal z-coordinate is 0. Fig. 5shows a function that gives the minimal y-translation of Bp forevery x-translation such that Bp does not overlap with A. This func-tion represents all possible feasible relative placements of the pairof sofas that we are allowed to consider. Five of these pairs areillustrated on Fig. 6.

To calculate this function proceed as follows. First, let A0 be thetriangles from A with upwards pointing normal ðy > 0Þ and B0 bethe triangles from Bp with downwards pointing normal ðy < 0Þ.All other triangles represent parts of the surfaces which point awayfrom the opposite mesh. For every pair of triangles a 2 A0; b 2 B0

determine the following:

� For each corner point p ¼ ðpx; py; pzÞ of b determine the intersec-tion of the plane z ¼ pz with a. This is either the empty set, a sin-gle point, or a line-segment which can be described by a linear

function �f p;aðxÞ on a closed interval Jp;a ¼ J1p;a; J

2p;a

h i, that gives

the line’s y-coordinate for every x-coordinate.� Assume the intersection is a line-segment and define fp;aðxÞ ¼

�f p;aðxþ pxÞ � py and Jp;a ¼ J1p;a � px; J

2p;a � px

h i, then for every

x 2 Jp;a; pþ ðx; fp;aðxÞ;0Þ 2 a. i.e., ðx; fp;aðxÞ;0Þ is the required trans-lation of p, such that p touches a. If the intersection is not a line-segment set Jp;a ¼ ;. Set fp;aðxÞ ¼ �1 for x R ½J1

p;a; J2p;a�.

� Similarly, determine fp;bðxÞ in x for every corner point p of a and b.� Now consider all pairs of edges e 2 a and g 2 b, where both

edges have a positive x extent. For each pair determine a func-tion fe;g and half-open interval Je;g such that g translated x 2 Je;g

along the x-axis and fe;gðxÞ along the y-axis intersects with e.Set fe;gðxÞ ¼ �1 for x R Je;g .

Let F be the set of all linear functions fp;a; fp;b, fe;g as defined abovefrom all triangles a 2 A0 and b 2 B0 and edges e 2 a; g 2 b. Define thepiecewise linear function fallðxÞ ¼maxf2F f ðxÞ, as the maximum y-coordinate of any f 2 F and for any value x. The function fallðxÞcan be generated in time OðjFj2Þ since every f 2 F is a line-segment.

Fig. 6. Five different pairs arising from the

In total the number of line segments generated is OðjA0jjB0jÞ and thetotal running time required to construct fallðxÞ is OðjA0 j2jB0 j2Þ.

Let Bðx; yÞ be Bp translated ðx; y;0Þ units, then for x 2 ð�1;1Þone or more edges or points from Bðx; fallðxÞÞ is coincident with atriangle from A, but no triangle of Bðx; fallðxÞÞ intersects A. i.e.,fallðxÞ describes the set of feasible positions of B relative to A.

3.2. Template construction

The second part of the preprocessing stage is to determine alarge set of feasible and stable sub-placements of items whichwe call templates. A template t represents a placement of jtj itemsof different types. The purpose of templates is to simplify the in-ner-portions of our heuristics by reducing the number of geometriccomputations and making it easier to ensure overall stability.

For a template t, let ðt1; . . . ; tjtjÞ be its item-types with ti 2L fori ¼ 1; . . . ; jtj. A template contains the relative position and rotationof ti for each item ti; i ¼ 1; . . . ; jtj. Let T be the set of templates gen-erated, then for each t 2 T let pðtÞ be the total profit of its constit-uents. Let wðtÞ;hðtÞ, and dðtÞ be the width, height, and depth of theminimal axis-aligned box which encompasses the sub-placementdescribed by t (bounding-box).

To use a template at a position p 2 R3 in the container, itemsmatching each of the item-types ti are placed according to the rel-ative position and orientation described in t at p. We refer to thepositioned sub-placement of items as a batch. Let the bounding-box of a batch b be ½bx1; bx2� � ½by1; by2� � ½bz1; bz2�.

Templates which contain the same set of item-types but placeddifferently are grouped; For t 2 T we let RðtÞ# T be the set of tem-plates containing the exact same set of item-types as t, and we saythat s; t 2 T are related if and only if s 2 RðtÞ.

3.2.1. Template typesThe templates that are generated fall in the following catego-

ries: Singletons, stacks, pairs based on the geometric analysis ofSection 3.1, pairs of stacks, user-defined templates, and fusedtemplates.

For every item-type i 2L a singleton template containing only iis generated for each allowed rotation of i (see Fig. 7a).

Stacks (see Fig. 7b) are generated by recursively adding item-types on top of each other until the container height is reached.All such possible templates are constructed.

To limit the number of templates an item is not allowed on topof a shorter item. Because the items used for templates are large,stacks commonly contain less than four items.

The geometric analysis (see Section 3.1) returns all possible fea-sible pairs of any two sofa item-types as illustrated in Fig. 7d. Tolimit the solution space, only a low number of these pairs are usedas templates. The pairs chosen are: P1: Pair with minimal bound-ing-box volume. P2: Pair which fills the container in the width nextto P1 (maximal sliding). P3: Pair which occupies half the containerwidth. Although more pairs theoretically allow for better solutions,experiments showed that in practice they tend to have the oppo-site effect – Presumably because the size of the solution space isincreased.

piecewise linear pair-function in Fig. 5.

Fig. 8. Contours cuðt; xÞ (b) and clðt; xÞ (c) of a template t (a).

Fig. 7. Examples of templates. (a) Single item. (b) Stack of two items. (c) User-defined templates consisting of 5 copies of the item from (a). (d) Pair of two items. (e) Stack-pairof four items. (f) Two pair-templates fused together.

J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892 885

Pairs of stacks (see Fig. 7e) are built by adding items one-by-onein order of non-increasing height to the smallest of the stacks. Oncethe composition of the two stacks has been determined, possiblepairs of the stacks are determined using the principle describedabove for pairs.

Because items in our context have a soft surface, geometricanalysis falls short of physical measurements. Therefore, we haveimplemented approximately 40 different kinds of user-definedtemplates for which the user can specify the constituent types,width, height, and depth of the template (see Fig. 7c).

Finally, for reasons which will be clarified in Section 4, the tem-plates of the previous categories are also fused heuristically to-gether along the x-axis to form new templates (see Fig. 7f). Morespecifically, any pair of constructed templates is fused if there isroom for a third template in the container width. This process isdone recursively over all templates and may generate new largertemplates which are fusions of many narrow templates. To ensurethat not too many combinations are generated, this preprocessingstep begins by repeating similar templates and continues to com-bine distinct templates where the resulting utilization of thebounding-box will be high. This process stops once f fused tem-plates have been created, with f ¼ 2000 empirically determinedas an adequate number.

3.2.2. RotationIn general a template is generated for each allowed orientation

of the templates described in the prior sections. This implies a dis-crete rotational model – not all rotations are possible. The limita-tion actually works well in practical situations where only alimited number of rotations may be allowed for some templatesor items in order to avoid damaging the items during transporta-tion. For every template at least a y-axis rotated variant will alsobe generated.

4. Sequence representation

Due to the size of the large items there is often only space for upto two templates in the width and height of the container. There-fore we limit the possible ways a template can be placed in thein xy-plane to four alignments numbered 1–4 matching the fourcorners lower-left, lower-right, upper-left, and upper-right. A solu-tion of n large items may be represented as a sequence of templateand alignment pairs of the form hðt1; a1Þ; . . . ; ðtn; anÞi for ti 2 T andai 2 f1; . . . ;4g; i ¼ 1; . . . ;n.

To convert a sequence into a placement, templates are used toplace batches one-by-one in the order of the sequence as follows.To use a template t to place a batch b we first determine x and y-ex-tents of t such that ðbx1; by1Þ; ðbx2; by1Þ; ðbx1; by2Þ and ðbx2; by2Þ coincidewith ð0;0Þ; ð0;WÞ; ðH;0Þ and ðH;WÞ for a ¼ 1; . . . ;4, respectively.The z-position of b is determined by considering the set B0 of batchesfor which ½bx1; bx2� � ½by1; by2� overlaps in the xy-plane and b is placedsuch that bz1 ¼maxb02B0bz2.

Realizing an entire sequence of n templates takes Oðn2Þ timesince it takes OðnÞ time for each template to determine and analyzeB0. However, the practical running time may be reduced by main-taining the batches sorted by z and stopping the search once allremaining templates have lower z-coordinate than the currentmaximum.

As an alternative to alignments, templates could be placedaccording to some greedy principle (e.g. bottom-left-back). How-ever, if two templates are exchanged one risks affecting the entiresolution, whereas alignments help maintain locally optimalplacements.

4.1. Contours

It is easy to determine a lower z-coordinate than the one arisingfrom the use of bounding-boxes. Since the x- and y-coordinate ofeach item within the template are fixed once the template isaligned one can search for a collision along the z-axis, using themeshes of each template. This operation is computationally expen-sive so we reduce the collision detection to a two-dimensionalproblem where only the xz-plane or yz-plane are considered. Thetwo techniques are similar and we will only describe the approachfor the xz-plane here.

For each template t we generate two contours of its extremepoints in the xz-plane (see Fig. 8). Let DðtÞ be the set of trianglesof the positioned and oriented meshes of items in t andcuðt; xÞ ¼maxfz j 9y; s 2 DðtÞ : ðx; y; zÞ 2 sg be the value of the max-imal z-coordinate for each x of any point on a triangle in DðtÞ(Fig. 8b), and clðt; xÞ ¼minfz j 9y; s 2 DðtÞ : ðx; y; zÞ 2 sg (Fig. 8c).clðt; xÞ and cuðt; xÞ are piecewise linear functions in x which canbe constructed from the edges of each triangle.

For a batch b formed from a template t, define the translatedcontours cuðb; xÞ ¼ cuðt; x� bx1Þ þ bz1 and clðb; xÞ ¼ clðt; x� bx1Þþbz1. When placing a batch b0 after a batch b 2 B0 – where onlyx- and y-coordinates have been determined according to its align-ment – such that b0z1 ¼maxxcuðb; xÞ � clðb0; xÞ will ensure that themeshes of the batches b0 and b do not overlap.

Since the items we consider generally consist of surfaces whichare not completely parallel to the coordinate system planes, a con-siderable amount of space in the container can be saved by thissimple strategy, as seen in Fig. 9. On the other hand the nature of

Fig. 9. A substantial amount of space can be recovered by using the contours oftemplates to determine required distance between batches (b) rather than thebounding-box (a).

Fig. 11. The four points of each wall used for domination check.

Fig. 10. A quad-wall consists of up to 4 templates that may be placed in the fouralignment corners.

886 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

the items are such that little, if anything, would be gained by con-sidering a full three-dimensional collision detection.

The piecewise linear functions cuðt; xÞ and clðt; xÞ are calculatedfor all templates during preprocessing. Since templates can only bealigned to the left and right side of the container a template canonly be placed with two different x-coordinates. Therefore thereare only four possible ways two templates can be positioned rela-tive to each other in the x-direction. Whenever the distance be-tween two templates is calculated, it is stored in a binary searchtree taking one of the four relative x-positions into account. If thetwo templates are placed with the same relative x-position later,the value from the search tree can be reused. Additionally, if accu-rate physical measures for two templates are known, these can beinserted into the search tree during preprocessing.

5. Quad-walls

To solve the loading problem our method starts with a tree-search algorithm for large items. The tree-search algorithm fillsthe container in the depth by iteratively selecting four templatesthat fill the container width and height (quad-wall). At each stepthe different quad-walls are ranked and the highest rankingquad-wall is used to fill a portion of the container. Once no morequad-walls can be used to fill the container, the heuristic back-tracks and tries with walls that have less rank.

Unlike traditional wall-building schemes, quad-walls do nothave boundaries in the z-direction and, when placed, their constit-uents are pushed as far back in the container as possible as de-scribed in Section 4. Another important element is that theconstituents of a quad-wall are repeated a number of times inthe depth, but not necessarily an equal number of times. The de-tails of this procedure are described in the following sections.

5.1. Quad-wall selection

A quad-wall consists of 4 templates, but since the number oftemplates in some instances can reach 30,000 the full set of possi-ble quad-walls could be as high as 30;0004, which is intractable toconsider in reasonable time. Therefore a large set of good candidatequad-walls are constructed using an inner tree-search heuristic. Afundamental part of this search is to rank individual templates. Fora template t 2 T we define uðtÞ ¼ pðtÞ

hðtÞdðtÞ, which indicates how prof-itable t is per height and depth unit.

An i-wall, ht1; . . . ; tii for i ¼ 1; . . . ;4, is an assignment of the tem-plate tj 2 T [ fnilg to each corner j; j ¼ 1; . . . ; i. A corner j may beempty if tj ¼ nil. The templates that may be assigned to a corneri depend on the assignment of templates to the first i� 1 corners.Let Tiðht1; . . . ; ti�1iÞ# T be the set of templates allowed at corner i iftemplates t1; . . . ; ti�1 have been assigned to the first i� 1 corners.

First all 1-walls containing t1 2 T at corner 1 are ranked:

r1ðht1iÞ ¼ uðt1Þ þ maxt22T2ðht1iÞ

uðt2Þ þ maxt32T3ðht1iÞ

uðt3Þ: ð1Þ

The set T2ðht1iÞ depends only on the width of t1. Therefore all tem-plates allowed in the lower-right corner can be sorted by width and

for each of the widths it can be specified which template has high-est value u. This way maxt22T2ðht1iÞuðt2Þ can be found in timeOðlog jTjÞ using binary search. A similar argument holds formaxt32T3ðht1iÞuðt3Þ since T3ðht1iÞ only depends on the height of t1,and therefore r1 can be found for each 1-wall in Oðlog jTjÞ time.Let W1 be the at most q1 1-walls with highest r1 where q1 is aparameter for the heuristic.

The heuristic proceeds recursively to rank 2-, 3-, and 4-walls.Define riðht1; . . . ; tiiÞ of an i-wall as:

riðht1; . . . ; tiiÞ ¼uðtiÞ þ max

t2T4ðht1 ;...;tiiÞuðtÞ for i ¼ 2;3;

uðtiÞ for i ¼ 4

(ð2Þ

and let Wiðht1; . . . ; tiiÞ be the set of at most qi highest ranked i-wallswith respect to riðht1; . . . ; ti�1; tiiÞ for ti 2 Tiðht1; . . . ; ti�1iÞ, where qi isa parameter for the heuristic. Let Wi be defined recursively as

Wi ¼ [ht1 ;...;ti�1i2Wi�1Wiðht1; . . . ; tiiÞ: ð3Þ

This means that each Wi consists of the highest ranked ði� 1Þ-wallsWi�1 from the previous corner appended with templates at corner i.The parameters qi determines the number of branches at each levelof the tree-search and are used to describe the width of the searchtree. The set W4 are walls with template assignments to all four cor-ners and the quad-walls we consider in the following. The size ofthe set of walls we consider is jW4j 6 qtot ¼ P4

j¼1qj.

5.2. Domination

If two walls w 2W4 and v 2W4 consists of the same item-types, v may dominate w by utilizing the space strictly better,and w can be discarded. Dominated walls are removed by examin-ing all walls w;v 2W4 with equal elements and comparing fourpoints based on the bounding-boxes of templates from each wall.Assume a wall w consists of templates hw1;w2;w3;w4i, and eachtemplate wi would be placed as batch bi, (see Fig. 10) if it wereto be used at this time, then we define

J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892 887

q1ðwÞ ¼ b1x2; b

1y2; b

1z2

� �; q2ðwÞ ¼ b2

x1; b2y2; b

2z2

� �;

q3ðwÞ ¼ b3x2; b

3y1; b

3z2

� �; q4ðwÞ ¼ b4

x1; b4y1; b

4z2

� �:

The points qiðwÞ; i ¼ 1; . . . ; 4 are illustrated on Fig. 11. Now, todetermine if wall w is dominated by v, we require thatqiðvÞz 6 qiðwÞz for all i ¼ 1; . . . ; 4 and:

q1ðvÞx6 q1ðwÞx; q1ðvÞy6 q1ðwÞy; q2ðvÞx P q2ðwÞx; q2ðvÞy6 q2ðwÞy;q3ðvÞx6 q3ðwÞx; q3ðvÞy P q3ðwÞy; q4ðvÞx P q4ðwÞx; q4ðvÞy P q4ðwÞy:

If w is dominated we simply remove it from W4. Note that caseswhere walls have no assigned template in one or more corners i(i.e. wi ¼ nil), can be dealt with by assigning appropriate values to qi.

5.3. Quad-wall appending

The m walls with highest �rðwÞ ¼P4

i¼1pðtiÞ=dðtiÞ forw ¼ ht1; t2; t3; t4i 2W4 are selected and the best of these is ap-pended to the current solution.

In traditional wall-building a wall is constructed once and inde-pendently of the previously placed elements. Here, however, weuse the templates ht1; . . . ; t4i of a quad-wall by a set of rules. Letdi be the maximum z-coordinate of any bounding-box of currentbatches at corner i of the container for i ¼ 1; . . . ;4. Let dþi be theresulting maximum z coordinate if template ti is used at corner i.The templates are then used to place batches one-by-one usingthe following rules:

1. If dþ4 6 d2 and dþ4 6 d3 we use t4, i.e., place a batch at alignment4 if alignment 2 and 3 are deeper after the placement,

2. otherwise if dþ3 6 d1 we use t3, i.e., place a batch at alignment 3if alignment 1 is filled after deeper the placement,

3. otherwise if dþ2 6 d1 we use t2, i.e., place a batch at alignment 2if alignment 1 is filled after deeper the placement,

4. otherwise we use t1.

These rules ensure that d1 P d2; d1 P d3 and d2; d3 P d4, at anygiven time and help distribute items evenly among the four align-ments. We repeat this until there are insufficient items or space touse one of the four templates.

Fig. 13. The best solution from the quad-wall heuristic (a) is appended with remainin

Fig. 12. Example placement using quad-walls. (a) Placement after use of first quad-

Note that by these rules a wall is not simply repeated, rathertemplates are distributed depending on depth. Example, a verydeep template will not be used as often as a thin template. It is alsoimportant to note that as the templates are placed, they are pushedas far back in the container as possible, so while a quad-wall is acollection of items in the width and height of the container it doesnot fill ‘‘slices” of the container. Example of placements after thefirst and second wall have been used are shown in Fig. 12.

5.4. Back-tracking

The quad-wall placement is embedded in a tree-search heuris-tic. Each stage where a wall is appended to the container is a nodein a search tree and each candidate wall corresponds to an edgefrom a parent to a child node in the search tree. Once the containeris full and there is insufficient space for further templates at theend of the container, the heuristic back-tracks in the search treeand continues with the second-best ranked wall etc. When allwalls of a node have been investigated the heuristic back-tracksto the node’s parent and continues with the next wall of the parent.

At most 150,000 forward and backward steps in the search treeare allowed due to time-constraints. To ensure that the heuristicdoes not search only in the end of the container the values of qi

are reduced at the lower levels of the tree and generally we setqi ¼ 1

2 qi�1, to balance the inner tree-search. At every q steps (e.g.q ¼ 10;000) we back-track to the root node of the tree. This strat-egy works adequately to ensure that search is done both within thebeginning and the end of the container.

6. Local search

The best solution found during tree-search is used as start-solu-tion for a local-search heuristic. During local search, solutions arerepresented as the type of sequences described in Section 4 andone side of the container is ‘open’ to allow batches to extend be-yond the container boundary. Only the profit of those batcheswhich are completely inside the container contribute to the objec-tive function. Items which are not part of the initial solution areadded to the end of the loading as additional batches, and will ingeneral protrude the container as shown in Fig. 13. The idea is thatthe local search will be able to move some of these items inside the

g items that may protrude out of the container (b) before local search is applied.

wall (3 templates). (b) Placement after use of second quad-wall (4 templates).

888 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

container boundaries and thereby increase the solution value. Thisstrategy is similar to the one used by Egeblad and Pisinger (2009)for two- and three-dimensional knapsack problems with boxes.

Let the current solution be defined as the sequencer ¼ hðt1; a1Þ; . . . ; ðtn; anÞi and let rðiÞ ¼ ðti; aiÞ be the ith element ofthe sequence, then the local search neighborhoods consists of thefollowing:

Exchange: For every i; j, with 1 6 i; j 6 n; i–j, every alignmentai; aj ¼ 1; . . . ;4 and every related template t0i 2 RðtiÞ; t0j 2 RðtjÞ wetry the sequence r0 where r0ðiÞ ¼ ðtj; ajÞ;r0ðjÞ ¼ ðti; aiÞ, andr0ðkÞ ¼ rðkÞ for k–i; j. I.e., trial of all exchanges of two templatesin the sequence and their relatives at all alignments.

Subset side-exchange: For every i; j with 1 6 i < j 6 n we trythe sequences r0 where r0ðkÞ ¼ ðtk;aðakÞÞ for i 6 k < j, andr0ðkÞ ¼ rðkÞ for k < i or k P j, where að1Þ ¼ 2;að2Þ ¼ 1;að3Þ ¼ 4and að4Þ ¼ 3. That is, trial of exchanges of left and right sidebatches in all consecutive sub-sequences.

Insert: For every i; j with 1 6 i; j 6 n; i–j and every alignmentai ¼ 1; . . . ;4 we try the sequences where ti has been removedand inserted before tj.

Combine: For templates t and s let Rðt [ sÞ be the set of tem-plates with all elements from t and s. Then for every i; j with1 6 i; j 6 n; i–j, every alignment ai ¼ 1; . . . ;4 and every templatetk 2 Rðti [ tjÞ we try the sequences where ti and tj have been re-moved and ðtk; aiÞ is inserted at the ith position. That is, replacingti and tj with batches that contain all the items from bothtemplates.

Split: For every i; j with 1 6 i; j 6 n; i–j, every alignmentak ¼ 1; . . . ;4, every k ¼ 1; . . . ; jtij, every template t0i 2 R t1

i ; . . . ; tk�1;�

tkþ1; . . . ; tjti ji Þ and tk 2 RðtkÞ we try the sequences where the ith ele-

ment has been replaced by t0i; ai� �

and ðtk; akÞ is inserted before thejth element. That is, ti is split into two templates with jtij � 1 ele-ments and one element, and the singleton template is tried every-where in the sequence with every alignment.

Cross-over: For every i; j with 1 6 i; j 6 n; i–j, every k ¼ 1; . . . ;

jtij, every l ¼ 1; . . . ; jtjj, every related template t0i 2 R t1i ; . . . ; tk�1

i ;�

tkþ1i ; . . . ; tjti j

i ; tljÞ, every related template t0j 2 R

�t1

j ; . . . ; tl�1j ; tlþ1

j ; . . . ;

tjtj jj ; tk

j

�, every alignment ai ¼ 1; . . . ;4 and every alignment aj ¼

1; . . . ;4 we try the sequence r0 ¼ r where the ith element is re-placed with ðt0i; aiÞ and the jth element with t0j; aj

� �. That is, all ex-

changes of one of the item-types from ti with any one item-typefrom tj.

Every time a sequence is tried its templates are applied to theirrespective alignment to evaluate the objective value of the solu-tion. Although the neighborhoods are quite large, we are generallyable to place more than a 100,000 sequences per second, so inpractice many changes may be examined within reasonable times.Experiments showed that not all neighborhoods need to be exam-ined in every iteration. Thus the neighborhoods are examined inthe order in which they are described above. Once an improvingchange is found in a neighborhood subsequent neighborhoodsare not searched, and the best improving change is used.

6.1. Objective functions

The primary objective function is to maximize the total profit ofbatches loaded within the container boundaries. However, with thisobjective function, changes are only accepted if they result in in-creased profit which may be hard to achieve in one single move.

To allow changes that occur over more than one iteration, a setof secondary objective functions is used. At any given time one sec-ondary objective function is active. Changes where the total profitremains the same but increases the active secondary objective arenow also accepted. Additionally, changes that give the largestimprovement in the primary objective value are always preferred,and ties are settled by considering the secondary objective value.

We refer to the situation where no improvement with respect toneither the primary nor the active secondary objective value canbe found, as a local minimum.

Define zðBÞ ¼ maxb2Bbz2 as the maximal occupied z-coordinateof any of the batches from the set B, and Bi as the placed batchesthat are aligned at corner i. Our secondary objective functions areas follows:

1. Minimize zðB1 [ B2 [ B3 [ B4Þ.2–5. Minimize maximal zðBiÞ for corner i ¼ 1;2;3;4. This gives

rise to four secondary objective functions.6. Minimize zðB1Þ þ zðB2Þ þ zðB3Þ þ ZðB4Þ.7. Minimize maximal zðB0Þ where B0 consists only of batches com-

pletely inside the container.

At any given moment only one secondary objective function isactive. Initially objective 1 is active. Whenever the heuristic reachesa local minimum with respect to the current active secondaryobjective function, the next secondary objective function from thelist is made active in a round robin manner. After a specified num-ber of non-profit-improving iterations the heuristic terminates.

6.2. Meta-heuristics

The large local search neighborhood is geared towards minoralterations that only shift items slightly around and can be thoughtof as a way to ‘‘clean-up” and ‘‘tighten” the quad-wall solution.

Unfortunately, none of the standard meta-heuristics such assimulated annealing (Kirkpatrick et al., 1983), tabu-search (e.g.Glover, 1989, 1990) and Guided Local Search (e.g. Voudouris andTsang, 1999) showed improvements over the simple local searchscheme within acceptable computational time. An explanationcould be that, while the quad-wall heuristic of the previous sectiondetermines a good local structure by generating quad-walls, it isharder to locate structured solutions with the mentioned meta-heuristics and more computational time is needed for them toreach good solutions.

7. Stability

It is important that items are loaded in a stable way duringtransportation. In this section we present a strategy for ensuringthat large items are placed stably.

Once the local search of Section 6 is complete a second localsearch heuristic which starts from the best solution found duringthe previous step is initiated. This heuristic is equivalent to the lo-cal search described in Section 6 except that the objective is tominimize the total profit of unstable batches. When no improvingchange can be found, the search terminates and batches which vio-late their stability requirement are removed from the solution sothat the resulting solution is stable.

An alternative strategy where the tree-search and local searchheuristics consider only stable solutions was tested, but the chosenapproach was favorable for two reasons: First, checking stability isan expensive operation and solutions are commonly almost stableafter the local search step, and resolving the few problems thatarise is computationally faster. Secondly, the overall solution qual-ity decreased when only stable solutions were searched, presum-ably, because the search benefits from passing through unstableplacements.

7.1. Center of mass

As we will explain in Section 7.2, we use the position of the cen-ter of mass of each item to evaluate if it is loaded stably. The cen-

Fig. 14. Stability evaluation. (a) Item to be evaluated is shown as dashed box. (b)Height levels below the item (xz-projection). The circle roughly in the middle is thexz-projection of the centroid of the item. The difference between the maximumheight-values of each of the four zones of the centroid must be less than somepreset value. Here it is 140 � 115 = 25 cm.

J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892 889

troid is the center of mass of an object if it has uniform density. Thecentroid, R, and signed volume, V, of a tetrahedron with o ¼ ð0;0;0Þt

and a; b; c 2 R3 as corner points may be calculated as:R ¼ ðaþ bþ cÞ=4 and V ¼ ða� b� cÞ=6. To calculate the centroidR of a set of n tetrahedra one can use the cumulative expression:

R ¼Pn

i¼1ViRiPni¼1Vi

; ð4Þ

where Ri is the centroid and Vi is the volume of each tetrahedron i.The centroid of a mesh with n triangles each with corner points

ai; bi; ci 2 R3, can be determined by decomposing it into n tetrahe-dra consisting of points o; ai; bi; ci and using the addition formula(4). In principle any point can be chosen as o, since the volumeand centroid calculation of each tetrahedron is signed and negativetetrahedra cancels surplus contribution of positive tetrahedra.

7.2. Stability evaluation

While existing methods in the literature demand that each itemis placed on an even surface, this constraint can often be circum-vented in practice by use of e.g. polystyrene plates. Hence we havechosen a less strict requirement.

To evaluate if an item is positioned in a stable fashion, the xz-projection of its bounding-box is divided into four regions aroundthe xz-projection of the centroid (which must be within its bound-ing-box). In each of the four regions the maximal height of itemsbelow the item considered is determined, and the height differencebetween the maximal and minimal height of the four regions is re-quired to be less than some value h (e.g. 15 cm).

This requirement ensures that the item is properly supportedaround its centroid and that there is no more than h difference be-tween the height of the supporting items below it. By this strategyitems that form ‘‘bridges” over two different items will even beacceptable.

Fig. 16. Maximizing space at the end of the container for to provide space for thewall-building heuristic.

Fig. 15. Wall-building. Layers or walls that fill the width and height of the containerare added one-by-one until the container is filled or all items have been placed.

8. Medium-sized items

The medium-sized items is the second group we consider. Themedium-sized items are boxes which may be rotated 90� aroundany of the coordinate axis resulting in up to six different orien-tations.

Medium-sized items are placed using a polynomial time greedyheuristic. A greedy heuristic is adequate for this part of the problem,because items are relatively small and homogeneous. Secondly, anefficient simple placement method allows us to integrate the greedyheuristic in the heuristics for large items.

The greedy heuristic proceeds as follows. Items are placedaccording to decreasing size with the largest items first. For eachitem the position further-most back in the container is determinedas a starting position. Ties are settled by selecting the lowest andleft-most position. Once the starting position has been found thewidest box-volume with bottom-left-back corner at the startingposition is found. This volume is then divided into up to eightsub box-volumes that are each filled homogeneously with one ori-entation of the item.

Since a good solution of medium-sized items may depend onthe placement of large items, this greedy approach is also inte-grated with the tree-search and local search heuristics for largeitems. At any time while running the two heuristics let z0l be totalprofit value of the large items and z0m for the medium-sized itemsof the currently best known solution. When the heuristics encoun-ter a solution with solution value zl equal to z0l for large items, thesolution value zm for medium-sized items is calculated. If zm > z0mthe current best known solution is replaced with the one with alarger number of medium-sized items.

9. Small items

The last set of items to be placed is the small items. These have alower precedence-value than large and medium-sized items.

For small items we consider three different types of constraints;Rotations, robustness, and weight. For each item a specified subsetof the six possible 90� rotations around the coordinate system axesis allowed. Also, for an item m we let sðmÞ 2 N define its robustnessand for any two items mi and mj, we require sðmjÞP sðmiÞ for mi tobe placed on mj. This ensures that an item is only put on top of amore robust item, so that fragile items are not placed on the bot-tom of a stack. Finally, let gðmÞ be the weight of item m (e.g. inkg). Then, for any two items mi and mj with sðmiÞ ¼ sðmjÞ, we re-quire that gðmiÞ < gðmjÞ if mi is to be placed on top of mj (seeFig. 14).

To place the small items we use a slightly modified version ofthe wall-building approach by Pisinger (2002), which is an

890 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

improvement over the heuristic by George and Robinson. The wall-building concept is depicted on Fig. 15. Rather than consideringjust one wall-depth for each wall, Pisinger used a tree-search heu-ristic which branches on a number of different wall-depths. Theoriginal heuristic by Pisinger fills walls by either horizontal or ver-

Table 1Characteristics and computational results for the 61 test instances.

Inst. Items Profit

jLj=jMj=jSj jIj jLj jMj jSj Loaded I

1 3/0/0 85 85 0 0 54 16002 82 82 0 0 62 16003 82 82 0 0 74 16004 76 76 0 0 73 16005 86 86 0 0 60 16106 6/0/0 78 78 0 0 67 16007 61 61 0 0 53 16108 70 70 0 0 55 16109 80 80 0 0 65 161010 12/0/0 82 82 0 0 65 161011 71 71 0 0 64 160012 75 75 0 0 63 160013 62 62 0 0 51 161014 24/0/0 77 77 0 0 63 161015 83 83 0 0 69 160016 78 78 0 0 62 160017 84 84 0 0 68 161018 40/0/0 84 84 0 0 65 160019 80 80 0 0 65 162020 79 79 0 0 63 160021 82 82 0 0 67 16101–21 78 63.2 1605.24

22 3/1/0 80 63 17 0 73 181523 106 79 27 0 73 181524 90 74 16 0 79 181025 92 63 29 0 79 180526 6/2/0 117 88 29 0 81 180527 130 97 33 0 83 182528 100 78 22 0 88 180029 99 70 29 0 76 180530 12/4/0 118 83 35 0 100 182531 101 71 30 0 89 182032 107 78 29 0 80 180533 92 70 22 0 72 182034 24/8/0 108 82 26 0 84 180035 110 81 29 0 90 181536 100 79 21 0 84 180537 109 83 26 0 89 180038 40/10/0 104 84 20 0 84 180039 103 85 18 0 81 180040 113 83 30 0 88 180041 101 85 16 0 82 180022–41 104 78.8 75.2 82.8 1808.5

42 3/1/3 114 82 32 104 66 200843 221 108 24 89 100 201844 194 90 19 85 120 202545 238 103 32 103 77 201646 6/2/6 167 75 26 66 106 201247 205 92 26 87 99 201448 211 87 31 93 96 202149 200 78 36 86 127 202250 12/4/12 181 78 24 79 103 200851 152 72 20 60 101 202052 165 75 27 63 119 200153 172 75 23 74 113 201354 24/8/24 219 83 33 103 108 200155 196 90 27 79 101 201356 219 92 31 96 130 201757 183 84 22 77 109 201458 40/10/40 191 88 12 91 112 200259 200 88 24 88 120 200660 194 84 22 88 123 201661 204 90 17 97 114 201942–61 191.3 85.7 25.4 85.4 107.2 2013.3

1–61 123.7 84

tical strips and branches on different strip-widths. Here we useonly vertical strips so that the constraint for small items can easilybe accommodated. As in the original heuristic, each strip is packedoptimally by solving a knapsack problem. Once the optimal set ofboxes for a strip has been determined, the boxes are sorted accord-

Loaded profit Utilization Time

L I L M S BB Mesh (seconds)

1600 1270 1270 89.9 59.8 58.61600 1360 1360 84.2 60.7 46.81600 1520 1520 88 53.2 61.51600 1550 1550 81.2 50.6 50.81610 1350 1350 85 64.3 67.91600 1470 1470 91.6 60.5 761610 1490 1490 82.3 53.4 55.71610 1400 1400 87.8 62 68.51610 1360 1360 89.2 61.4 90.31610 1400 1400 86.6 57.6 57.51600 1430 1430 87.9 58 75.71600 1430 1430 89.1 61.5 89.51610 1370 1370 84.6 56.8 46.91610 1370 1370 84.6 53.5 120.41600 1410 1410 85.1 51.2 168.71600 1370 1370 85.6 53.2 82.31610 1380 1380 85.3 54.4 104.21600 1360 1360 86.8 52.6 71.81620 1400 1400 85.9 53.1 81.51600 1360 1360 88.9 53.2 145.91610 1410 1410 87.7 53.6 1291605.24 1402.9 1402.9 86.5 56.4 83.3

1730 1675 1590 85 89.8 62.6 44.81680 1395 1260 135 89.2 63.2 86.41730 1530 1450 80 89.6 61.7 49.21660 1575 1430 145 91.2 62.5 63.11660 1445 1300 145 86.4 56.1 114.91660 1525 1360 165 93.5 67.6 176.61690 1570 1460 110 86.7 56.9 77.21660 1645 1500 145 90.6 61.6 132.71650 1585 1410 175 90.4 59.6 78.21670 1560 1410 150 87.1 58.6 52.31660 1665 1520 145 91.9 63 1401710 1520 1410 110 91.2 63.8 67.31670 1580 1450 130 89.9 58.7 95.41670 1585 1440 145 90.8 59.8 109.21700 1525 1420 105 91.7 59.3 129.81670 1570 1440 130 91.7 59.8 165.51700 1530 1430 100 89.4 56.4 96.41710 1430 1340 90 87.4 52 123.81650 1540 1390 150 89.7 56.7 168.61720 1530 1450 80 89.5 55.6 781682.5 1549 1423 126 89.9 59.8 102.5

1640 1600 1440 160 0 91.3 58.8 88.21720 1316 1170 120 26 88.2 61.5 521760 1593 1420 95 78 90 64.7 55.81650 1490 1330 160 0 93.8 60.7 109.91750 1654 1480 130 44 92.3 64.2 78.61710 1716 1550 130 36 89.9 57.5 124.81680 1665 1470 155 40 90 62.1 1231670 1706 1480 180 46 93.4 64.3 105.71730 1606 1440 120 46 92.5 64.2 106.51800 1566 1410 100 56 89.9 62 57.71740 1587 1380 135 72 90.9 64.8 71.11750 1587 1390 115 82 91.8 64.4 78.31630 1581 1390 165 26 92.7 58.6 73.61720 1559 1380 135 44 92.1 60.4 70.61670 1487 1260 155 72 88.1 56.9 64.91750 1600 1450 110 40 91.8 58.9 134.61760 1596 1460 60 76 91.2 56.2 142.71710 1590 1410 120 60 92.5 59 177.61730 1606 1430 110 66 92 59.5 236.31740 1595 1450 85 60 91.7 60.2 1341715.5 1585 1409.5 127 48.5 91. 3 60.9 104.3

1510.5 1411.6 83 15.9 89.2 59 96.5

J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892 891

ing to robustness value and weight to ensure that the constraintsare not violated. Rotational constraints are handled by only allow-ing legal rotations to be considered during determination of thedepth of the layers, width of each strip, and packing the strips.As in the original heuristic, the modified version used here alsoback-tracks once there is insufficient space for additional walls.

The heuristic is used to pack items in a box-volume at the end ofthe container with dimensions W � H � ðD� ZÞ where Z is themaximal occupied z-value of any of the batches or medium-sizeditems which were placed during the previous steps.

Once the local search and greedy heuristic for large items com-pletes, the local search procedure is used an additional time butthis time the objective is to maximize the value Z so that the in-put-space for the wall-building heuristic is maximized. Fig. 16aillustrates a placement of large items that is compacted into theplacement on Fig. 16b. The space at the end of the container (grayarea of 16b) is then filled by the wall-building heuristic.

Although wall-building fills the volume of the container quitewell, it is also desirable to fill the volume above the large items.To handle this we simply use the greedy heuristic from Section 8with the set of small items that remain after wall-building. Robust-ness constraints are handled by performing the additional check inthe greedy heuristic that an item is only placed above a more ro-bust item, and by placing most robust items first.

10. Experiments

The heuristic has been implemented in C++ (gcc 3.4.2) runningunder Linux on an AMD 64 3800+ 2.4 GHz. Since the problem hasnot been studied in the prior literature no test instances wereavailable. Therefore, to demonstrate the capabilities of the heuris-tic we have constructed a small dataset and report results in thissection.

10.1. Dataset

The dataset consists of 40 large, 10 medium-sized, and 40 smallitems types.

The large items are shapes of chairs, sofas, chaise lounges, andcorners. Items are paired together and used in complex templatesgenerated automatically as explained in Section 3. To further mi-mic the behavior at a furniture producer a set of user-defined tem-plates were determined by a geometric tool. For each item-typeless than 6 user-defined templates were created. These templatesare comprised of up to 5 items, but only one type of item. Profitvalues for large items were selected from the set {10, 20, 30},and is correlated to the dimensions of the item. Both the user-de-fined templates and the profit values mimic the practical use of theheuristic.

Medium-sized box-shaped items were generated with randomdimensions taken from the interval 20–80. The profit of all med-ium-sized items was set to 5.

Fig. 17. Solution of instance 61 with 114 it

Small box-shaped items were generated with random dimen-sions from the interval 10–80. The set of allowed rotations, robust-ness values and weight were determined randomly. Weight wasset randomly between 1 and 10 kg. The profit of all small itemswas set to 2.

A total of 61 instances divided among three groups were cre-ated: (A) 21 instances containing only large items, (B) 20 instanceswith large and medium-sized items, and (C) 20 instances with large,medium and small items. The most homogeneous instances consistof three large item-types, while the largest and most heterogeneousinstances consists of a total of 90 distinct item-types (40 large, 10medium, 40 small). All instances used container dimensions equalto a 40 feet high-cube container ð234� 269� 1185 cm3Þ. Thehigh-cube container allows us to better demonstrate the heuristic’sability to place items in multiple layers. Instances were generatedso that the total profit was slightly more than 1600, 1800 and2000 for (A), (B), and (C), respectively. Characteristics of individualinstances are described in the following section.

10.2. Results

Results of the computational experiments for all 61 instancesare reported in Table 1. For each instance we report the numberof item-types in each of the three groups in the column markedjLj=jMj=jSj and the number of items in the columns markedjIj; jLj; jMj; jSj. The column labeled ‘‘Loaded” under ‘‘Items” indicatesthe total number of items loaded. The columns labeled ‘‘Profit”gives the total profit of items ðIÞ and profit of large items ðLÞ. Thecolumns labeled ‘‘Loaded profit” is the best solution value for allitems ðIÞ and for each of the three item groups L;M and S.

Since no real performance measure exists, we have reported theutilization of each of the instances as two different values. Thebounding-box utilization in the column labeled ‘‘BB” is the per-centage of the container volume occupied by the bounding-boxesof the items. Since bounding-boxes can overlap, only non-overlap-ping volume is accounted for. The mesh-utilization is the percent-age of the container occupied by meshes (for large items) andboxes (for medium-sized and small items) and is reported in col-umn ‘‘Mesh”.

The average results for the three instance groups and all in-stances are reported in the rows labeled 1–21, 22–41, 42–61 and1–61.

On average the bounding-box utilization is 89.2% and the mesh-utilization is 59%. The utilization generally increases as more smallitems are available. When only large-sized items are considered,the average utilization in percent is 86.5 resp. 56.4 increasing to89.9 resp. 59.8 when the cargo also contains medium-sized items.However, for the hardest series of instances containing all threetypes of items and up to 200 items, volume utilization is 91.3%and 60.9%, respectively. This compares well with traditional con-tainer loading heuristics where the state-of-the-art is around 90–91% for box-shaped items. It also compares will with heuristics

ems (running time was 134 seconds).

892 J. Egeblad et al. / European Journal of Operational Research 200 (2010) 881–892

for packing of irregular shapes where typical utilization values arearound 45–50%.

Since the space between pairs of large items cannot be used forquality assurance reasons, the bounding-box utilization is probablythe most correct performance measure, as it accounts for this lostspace between the items.

The running time in seconds is reported in column ‘‘Time”. Theaverage running time is only around 100 seconds, which is highlyacceptable for real-life applications. A solution to a typical instance(instance 61) is shown on Fig. 17.

11. Conclusion

We have developed a new heuristic for the three-dimensionalknapsack container loading problem with irregular shapes. Theheuristic consists of several sub-heuristics, which each solves aspecific part of the overall problem.

Items are divided into three different groups reflecting theirimportance, size and complexity. Large items are irregular, repre-sented by three-dimensional triangle-meshes and initially a setof template sub-placements of large items is generated for lateruse by tree-search and local-search heuristics. Medium-sized itemare rectangular and placed using a simple greedy heuristic. Smallitems are rectangular and loaded primarily in the end of the con-tainer with a modified wall-building approach. To fill out theremaining parts of the container small items are also placed usinga greedy heuristic.

The solution method is able to find good solutions for prob-lems with hundreds of heterogeneous items within minutes oncurrent commodity hardware. The bounding-boxes of items occu-py more than 89% of the container on average and in instanceswith items in all three groups the average utilization is 91%.These results compares well with state-of-the-art container load-ing heuristics that consider only smaller boxes and reach around90% utilization.

Finally, the algorithm was implemented at a major Europeanfurniture producer and improved their utilization by 3–5%.

Acknowledgement

The authors thank the anonymous reviewers for many helpfuland constructive comments.

References

Alvarez-Valdes, R., Parreno, F., Tamarit, J., 2005. A GRASP algorithm for constrainedtwo-dimensional non-guillotine cutting problems. Journal of OR Society 56,414–425.

Bischoff, E., Marriott, M., 1990. A comparative evaluation of heuristics for containerloading. European Journal of Operational Research 44, 267–276.

Bischoff, E.E., 2006. Three-dimensional packing of items with limited load bearingstrength. European Journal of Operational Research 168, 952–966.

Caprara, A., Monaci, M., 2004. On the 2-dimensional knapsack problem. OperationsResearch Letters 1, 5–14.

Clautiaux, F., Jouglet, A., Carlier, J., Moukrim, A., 2008. A new constraintprogramming approach for the orthogonal packing problem. Computers andOperations Research 35, 944–959.

de Berg, M., Kreveld, M.V., Overmarks, M., Schvarzkopf, O., 2000. ComputationalGeometry: Algorithms and Applications. Springer-Verlag, Berlin, Germany.

Dyckhoff, H., Scheithauer, G., Terno, J., 1997. Cutting and Packing (C&P). In:Dell’Amico, M., Maffioli, F., Martello, S. (Eds.), Annotated Bibliographies inCombinatorial Optimization. John Wiley and Sons, Chichester.

Egeblad, J., Nielsen, B.K., Brazil, M., 2009. Translational packing of arbitrarypolytopes. Computational Geometry: Theory and Applications (CGTA) 42,269–288.

Egeblad, J., Nielsen, B.K., Odgaard, A., 2007. Fast neighborhood search for two- andthree-dimensional nesting problems. European Journal of Operational Research183, 1249–1266.

Egeblad, J., Pisinger, D., 2009. Heuristic approaches for the two- and three-dimensional knapsack packing problem. Computers and Operations Research36, 1026–1049.

Eley, M., 2002. Solving container loading problems by block arrangement. EuropeanJournal of Operational Research 141 (2), 393–409.

Fekete, S.P., Schepers, J., van der Veen, J.C., 2007. An exact algorithm for higher-dimensional orthogonal packing. Operations Research 55 (3).

Gehring, H., Bortfeld, A., 2002. A parallel genetic algorithm for solving the containerloading problem. International Transactions in Operational Research 9, 497–511.

Gehring, H., Bortfeldt, A., 1997. A genetic algorithm for solving the container loadingproblem. International Transactions in Operational Research 4, 401–418.

George, J., Robinson, D., 1980. A heuristic for packing boxes into a container.Computers and Operations Research 7, 147–156.

Glover, F., 1989. Tabu search – Part I. ORSA Journal on Computing 1, 190–206.Glover, F., 1990. Tabu search – Part II. ORSA Journal on Computing 2, 4–32.Gomes, A.M., Oliveira, J.F., 2006. Solving irregular strip packing problems by

hybridising simulated annealing and linear programming. European Journal ofOperational Research 171, 811–829.

Imamichi, T., Yagiura, M., Nagamochi, H., 2006. An iterated local search algorithmbased on nonlinear programming for the irregular strip packing problem. In:Proceedings of the Third International Symposium on Scheduling, Tokyo, Japan,pp. 132–137.

Kellerer, H., Pferschy, U., Pisinger, D., 2004. Knapsack Problems. Springer, Berlin,Germany.

Kirkpatrick Jr., S., C.D.G., Vecchi, M.P., 1983. Optimization by simulated annealing.Science 220 (4598), 671–680.

Mack, D., Bortfeldt, A., Gehring, H., 2004. A parallel hybrid local search algorithm forthe container loading problem. International Transaction in OperationsResearch 11, 511–533.

Moura, A., Oliveira, J.F., 2005. A GRASP approach to the container-loading problem.IEEE Intelligent Systems 20, 50–57.

Pisinger, D., 2002. Heuristics for the container loading problem. European Journal ofOperations Research 141, 382–392.

Ratcliff, M.S.W., Bischoff, E.E., 1998. Allowing for weight considerations in containerloading. OR Spektrum 20, 65–71.

Skiena, S.S., 1997. Minkowski-sum. In: The Algorithm Design Manual. Springer-Verlag, New York, pp. 395–396.

Stoyan, Y.G., Gil, N.I., Scheithauer, G., Pankratov, A., Magdalina, I., 2005. Packing ofconvex polytopes into a parallelepiped. Optimization 54, 215–235.

Voudouris, C., Tsang, E., 1999. Guided local search and its application to thetraveling salesman problem. European Journal of Operational Research 113,469–499.

Wäscher, G., Haussner, H., Schumann, H., 2007. An improved typology of cuttingand packing problems. European Journal of Operational Research 183, 1109–1130.