A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

  • Upload
    truc-le

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    1/11

    A note on Robot-packable and Orthogonal variants of the

    three-dimensional bin packing problem

    Edgar den Boef, Jan Korst, Silvano Martello, David Pisinger, Daniele Vigo

    Abstract

    In the three-dimensional bin packing problem the task is to orthogonally pack a given

    set of rectangular items into a minimum number of three-dimensional rectangular bins. We

    give a characterization of the algorithm proposed by Martello, Pisinger and Vigo (2000) for

    the exact solution of the problem, showing that not all orthogonal packings can be gener-

    ated by the proposed algorithm. The packings however have the property of being robot

    packings, which is of great relevance to the industry. A new (and correct) algorithm for solv-

    ing the general orthogonal packing problem is presented based on constraint programming.

    Extensive computational experiments compare the algorithm for the three-dimensional bin

    packing when solving general orthogonal packings and when restricted to robot packings.

    1 Introduction

    In the three-dimensional bin packing problem we are given a set of n rectangular-shaped items

    (boxes) j 12

    n, each having a width w j, height h j and depth dj, and an unlimited number

    of identical three-dimensional bins (containers) having width W, height H and depth D. The task

    is to orthogonally pack all the items into a minimum number of bins. We assume that the items

    may not be rotated, i.e., that they are packed with each edge parallel to the corresponding bin

    edge. Such packings will be denoted as general packings.

    If additionally it is demanded that the items can be cut out of the bin through sequential

    guillotine cuts (i.e., face-to-face cuts parallel to the faces of the bin), the packing is said to be

    guillotine cuttable. A robot packing is a packing which can be achieved by successively placing

    items starting from the bottom-left-behind corner, and such that each item is in front of, rightof, or above each of the previously placed items. The name comes from the fact that robots

    used for packing boxes in the industry are equipped with a rectangular hand parallel to the base

    of the bins, which is covered with vacuum cells for lifting the boxes. To avoid collisions, it is

    demanded that no already packed box is positioned in front of, right of, or above the destination

    of the current box.

    1

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    2/11

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    3/11

    In Martello, Pisinger and Vigo [7], a branch-and-bound algorithm for the exact solution of

    the three-dimensional bin packing problem with general packings was presented. The algorithm

    consists of a main depth-first branching tree in which, at each node, the current item is repeatedlyassigned to each bin already containing some items (plus, possibly, to a new bin), without speci-

    fying the actual placements of the items. The feasibility of the assignment of the current subset

    of items to a single bin is checked as follows. First, lower bounds are computed for the subset: if

    one of them gives a value greater than one, the node is immediately pruned. Otherwise, heuristic

    algorithms are executed: if a solution requiring a single bin is obtained, the node is accepted. If

    none of the two cases occurs, the optimal solution for the sub-instance is determined through a

    subroutine ONEBIN: the node is then accepted if a single bin solution is found, or pruned other-

    wise. The ONEBIN algorithm is a constructive branch-and-bound algorithm which, at each step,

    places an item in a feasible point, according to the following rule (see Property 2 of Martello,

    Pisinger and Vigo [7]): each new item is placed such that it is in front of, right of, or above each

    of the previously placed items. More formally, when successively placing items 1 2 m, for

    each pair i j with i j (i.e., item i is placed before item j), at least one of the following three

    equations should be true:xi

    wi x jyi

    hi y jzi

    di z j

    (1)

    Obviously the packing patterns generated in this way are robot packable. However, not all

    general packings satisfy this property. Indeed, packing (c) in Figure 1 cannot be achieved by the

    ONEBIN algorithm as for items 1, 4, and 9, irrespective of the order in which they are packed, the

    last placed item violates the above property.In Section 2 we describe an MILP model for the general single-bin packing problem, based on

    the modeling technique proposed by Onodera, Taniguchi and Tamaru [10] for a two-dimensional

    case. The model may also be seen as a specialization of that proposed by Chen, Lee and Shen

    [4] for the multiple-container loading problem. Solving this model by a standard MILP solver

    may replace the ONEBIN procedure in the algorithm, thus making it possible to solve the general

    three-dimensional bin packing problem. Computational experiments, however, indicated that

    solving the model through commercial software (CPLEX 7.0) was quite time consuming, and

    only problems of small size could be solved. Thus, in Section 3, a new algorithm is proposed

    based on constraint programming. Use of domain restriction and constraint propagation makes

    it possible to determine infeasible packings early in the search tree, resulting in a much better

    performing algorithm. In Section 4 we finally compare the two versions of the algorithm, deal-

    ing with general and robot packing, respectively. These extensive computational experiments,

    comprising more than one year of total CPU time, have solved considerably more instances to

    optimality than previously reported in the literature.

    2 Formulation of the single-bin packing problem

    The decision problem whether a given subset of items fits into a single bin of size W H D

    may be formulated as follows. Let the items be denoted as 1 2 m, and let us introduce the

    3

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    4/11

    binary decision variables i j (left), ri j (right), ui j (under), ai j (above), bi j (behind), fi j (in front)

    for items i j with i j. As no two items i j may overlap, we must demand that they are located

    left, right, under, above, behind or in front of each other. Thus

    i j

    ri j

    ui j

    ai j

    bi j

    fi j 1 i j 1 2 m i j (2)

    If just one of the relations is satisfied, no overlap will occur. However, more than one relation is

    allowed, e.g., i j bi j

    ai j 1. Ifi is located on the left of j, i.e., i j

    1, then we have that

    xi

    wi x j . In general we get, for i j 1 2 m with i j, the logical constraints:

    i j 1 xi

    wi x jri j

    1 x j

    w j xiui j

    1 yi

    hi y j

    ai j

    1

    y j

    h j yibi j

    1 zi

    di z jfi j

    1 z j

    dj zi

    (3)

    Obviously we must also demand that 0

    x j W w j , 0 y j H h j and 0 z j D dj, to

    ensure that no part of item j exceeds the bin.

    By linearizing (3), the single-bin packing problem can be formulated as the following MILP

    problem. (See, e.g., Mitra et al. [9] for a general discussion on how logical constraints can be

    linearized.)

    i j

    ri j

    ui j

    ai j

    bi j

    fi j 1 i j 1

    2

    m

    i j

    xi

    x j

    W i j W

    wi i

    j

    1

    2

    m

    i

    jx j xi

    W ri j W w j i j 1 2 m i j

    yi y j

    Hui j H hi i j 1 2 m i j

    y j yi

    Hai j H h j i j 1 2 m i j

    zi z j

    Dbi j D di i j 1 2 m i j

    z j zi

    D fi j D dj i j 1 2 m i j

    0

    x j W w j j 1 2 m

    0

    y j H h j j 1 2 m

    0

    z j D dj j 1 2 m

    i j ri j ui j ai j bi j fi j 0 1 i j 1 2 m i j

    (4)

    Due to the large number of decision variables, the MILP formulation (4), however, turned out to

    be difficult to solve through commercial software (CPLEX 7.0). This confirms analogous results

    obtained by Chen, Lee and Shen [4] with the original container loading model. Thus a different

    approach based on techniques from constraint programming was used.

    3 A constraint programming approach

    Constraint programming has recently been recognized as a promising tool for solving decision

    problems which are difficult to formulate in ILP form (see, e.g., Brailsford, Potts and Smith [3]).

    4

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    5/11

    In our problem, the domain of each pair of items i j is Mi j

    l, r, u, a, b, f meaning that they

    can be placed relative to each other as given by the six relations. To avoid symmetries, items 1

    and 2 have the restricted domain M12

    l, u, b

    .The problem is solved recursively by an algorithm, called CSPBIN, where at each iteration

    two items i and j are considered, and one of the relations i j ri j ui j ai j bi j fi j is imposed. The

    feasibility of the imposed relations is then checked, and if it can be proved that no solution exists,

    the algorithm backtracks. Otherwise the algorithm calls itself recursively. If all pairs of items

    i

    j have been imposed a relation, and a feasible assignment of coordinates exists, the algorithm

    terminates with a positive answer.

    The feasibility of a partially ordered problem is checked as follows. First, the items are

    ordered according to the i j and ri j relations. Then, for a given item j the position x j is defined

    as the maximum of xi

    wi for all items i located left to item j (while x j is set to 0 if no item

    is located left of j). If xj

    wj

    W for some j then the relations cannot be satisfied. The

    algorithm runs in O

    n2

    time since the topological ordering takes O

    n2

    time and the assignment

    of coordinates can be done in O

    n2

    as there are O

    n2

    relations i j, ri j. The same approach is

    used for relations ui j ai j and bi j fi j.

    To further speed up the solution algorithm, domain restriction and constraint propagation

    is applied. Domain restriction is obtained by the Forward Check (FC) approach proposed by

    Haralick and Elliot [6]. Having chosen a relation between items i j, we may remove all other

    relations from Mi j as we know that only one relation needs to be chosen.

    We use the Mainaining Arc Consistency (MAC) approach proposed by Gaschnig [5] to prop-

    agate the chosen constraints. The MAC algorithm is a more sophisticated FC algorithm which

    at any step keeps the problem arc consistent. The present problem is arc consistent if for all

    possible assignments of a relation between two boxes i and j there is a feasible assignment of

    coordinates to the boxes such that all constraints are satisfied. If this is not possible then the

    relation is removed from the domain of Mi j. In the case where a domain becomes empty the

    problem cannot be satisfied, and we backtrack.

    Although the use of MAC means that the time complexity of each node in the search tree

    grows considerably, the number of nodes investigated decreases correspondingly. Sabin and

    Freuder [12] showed that the additional effort ofMAC pays off when dealing with hard problems.

    The MAC strategy is implemented as follows. For each recursive call ofCSPBIN (i.e., for

    each new assignment of a relation) we run through all pairs of items i and j with

    Mi j 2

    and

    test feasibility of each relation R

    Mi j. If the packing becomes infeasible with the additional

    relation imposed, the relation is removed from the domain. If Mi j in this way becomes empty,we may conclude that no feasible packing can be obtained by following this branch, and thus we

    may backtrack in CSPBIN. If only one relation is left in a domain Mi j then this relation is fixed.

    All reductions in the domain achieved by the forward propagation are pushed to a stack, such

    that the domains quickly can be restored upon backtracking from CSPBIN.

    The best performance of algorithm CSPBIN was obtained by sorting the items according to

    non-increasing volume, and then branching on pairs of items

    1 2

    ,

    1 3

    ,

    2 3

    ,

    1 4

    ,

    2 4

    ,

    34

    ,

    15

    . In this way the largest items were placed relatively to each other at an early stage

    of the algorithm and infeasibility could quickly be detected. This complies with the Fail First

    Strategy proposed by Bartak [1].

    5

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    6/11

    4 Computational Experiments

    The algorithm by Martello, Pisinger and Vigo [7] was modified as follows. When the actualfeasibility of the assignment of the current subset of items to a single bin has to be checked,

    lower bounds and heuristic algorithms are first executed as described in Section 1. If they fail in

    (respectively) pruning or accepting the node, algorithmCSPBIN is executed for a final decision on

    node acceptance. We refer to the resulting algorithm as the general packing algorithm, and if the

    execution of algorithm CSPBIN is replaced by the execution of the original algorithm ONEBIN,

    we refer to it as the robot packing algorithm.

    Both versions of the algorithm were tested on eight classes of random instances, generated

    according to different distributions. The first group of classes (15) are generalizations of the

    instances considered by Martello and Vigo in [8]. The bin size is W H D 100 and five

    types of items are considered. Type 1: w j

    1 12

    W , h j

    2

    3H

    H , dj

    2

    3D

    D . Type 2: w j

    2

    3W

    W , h j 1

    1

    2H , dj

    2

    3D

    D . Type 3: w j

    2

    3W

    W , h j

    2

    3H

    H , dj 1

    1

    2D . Type 4:

    w j

    1

    2W

    W , h j

    1

    2H

    H , dj

    1

    2D

    D . Type 5: w j

    1 12

    W , h j

    1 12

    H , dj

    1 12

    D . We

    then obtained five classes of instances as follows. For Class k(k 1 5), each item is of type

    k with probability 60%, and of the other four types with probability 10% each.

    The second group of classes (68) is a generalization of the instances presented by Berkey

    and Wang [2]. The bin size is always W H D, with W 10 for Class 6, W 40 for Class

    7 and W 100 for Class 8. The item sizes are obtained by uniformly randomly generating w j,

    h j and dj in 1 10 , 1 35 and 1 100 , respectively for the three classes. The last class (Class

    9) are the so-called all-fill problems, obtained by cutting three bins into smaller parts through

    guillotine and non-guillotine cuttings. A complete description of this class can be found in

    Martello, Pisinger and Vigo [7].

    For each class, we considered instances of different size, with n ranging between 10 and

    50. The algorithms were implemented in C, and the experiments were run on a Sun4 Sparc

    Ultra-Enterprise 400 MHz. A time limit of 300,000 seconds was given to each instance, and

    10 instances were solved for each class and size of a problem. The time limit was chosen very

    huge in order to solve as many instances as possible to optimality, as this makes it possible

    to evaluate the quality of the bounds in more detail than in previous papers published on this

    subject. All the obtained solutions are available from the internet at the first authors webpage

    ( " % ' ) 1 3 ). In the following tables, results for the general packing algorithm

    are presented at the top of the tables, while results for the robot packing algorithm are given at

    the bottom. Both algorithms were run on the same computer, so the solution times are directlycomparable.

    Tables I and II compare the number of instances solved to optimality using a time limit of

    300,000 and 1,000 seconds, respectively. With the huge time limit, the general version is able to

    solve more instances in most of Classes 18, while the robot packing version is better in Class

    9. The better performance for Classes 18 may be explained by the fact that the general version

    has more freedom in arranging the items and thus may find solutions using fewer bins. In this

    way, having tighter upper bounds, the algorithms may terminate faster as the lower bounds used

    by both algorithms are the same. For Class 9, the behavior can be explained by the fact that the

    6

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    7/11

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    8/11

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    9/11

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    10/11

    find an optimal solution for more problem instances than previously presented in the literature,

    thus making it possible to study quite large instances with respect to the quality of upper and

    lower bounds (see [11] for more detailed computational results). The extensive computationalexperiments are also promising from a different point of view as they show that the solution times

    do not grow as fast as one could expect. This could indicate that in a couple of years we will be

    able to systematically solve instances with 50 items to optimality.

    6 Acknowledgements

    The first author would like to thank Sun Microsystems for providing resources for the computa-

    tional experiments.

    References

    [1] R. Bartak (1998), Online Guide to Constraint Programming, available at

    "

    '

    3

    ' %

    3 '

    % .

    [2] J.O. Berkey and P.Y. Wang (1987) Two Dimensional Finite Bin Packing Algorithms,

    Journal of the Operational Research Society 38, 423429.

    [3] S.C. Brailsford, C.N. Potts and B.M. Smith (1999), Constraint Satisfaction Problems: Al-

    gorithms and Applications, European Journal of Operational Research 119, 557581

    [4] C.S. Chen, S.M. Lee and Q.S. Shen (1995), An Analytical Model for the Container Load-

    ing Problem, European Journal of Operational Research 80, 6876.

    [5] J. Gaschnig (1979). Performance Measurement and Analysis of Certain Search Algo-

    rithms Tech. rep. CMU-CS-79-124, Carnegie-Mellon University, 1979.

    [6] R.M. Haralick and G.L. Elliot (1980) Increasing Tree Search Efficiency for Constraint

    Satisfaction Problems, Artificial Intelligence 14, 263313.

    [7] S. Martello, D. Pisinger and D. Vigo (2000), The Three-Dimensional Bin Packing Prob-

    lem, Operations Research 48, 256267.

    [8] S. Martello and D. Vigo (1998), Exact Solution of the Two-Dimensional Finite Bin Pack-

    ing Problem, Management Science 44, 388399.

    [9] G. Mitra, C. Lucas, S. Moody and E. Hadjiconstantinou (1994), Tools for Reformulating

    Logical Forms into Zero-One Mixed Integer Programs, European Journal of Operational

    Research 72, 263277.

    [10] H. Onodera, Y. Taniguchi and K. Tamaru (1991), Branch-and-Bound Placement for Build-

    ing Block Layout, Proceedings 28th ACM/IEEE Design Automation Conference, 433439.

    10

  • 8/7/2019 A note on Robot-packable and Orthogonal variants of the three dimensions bin packing problem

    11/11