Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

The packing of tetris-like item s, i.e. clusters of mutually orthogonal rectangular parallelepipeds, inside a given domain, is discussed here; see Fig. 2.1. Orthogonal rotations are admitted and additional conditions can be present . Before introducing the general problem and its mathematical formulation, the following definition is provided as a fundamental concept.

Fig. 2.1
figure 1

Tetris-like item packing into a convex domain (polyhedron)

FormalPara Definition 2.1

A tetris-like item is a set of rectangular parallelepipeds positioned orthogonally, with respect to an (orthogonal) reference frame . This is called ‘local’ and each parallelepiped ‘component’ .

In the following, ‘tetris-like item ’ will usually be simply denoted as ‘item’, if no ambiguity occurs. Similarly, ‘rectangular parallelepipeds’ are indicated as ‘parallelepipeds’.

The term ‘domain ’ refers to a subset of the three-dimensional Euclidean space R 3. Convex domain s are mainly considered, providing the proper specifications explicitly, when otherwise. The general problem is examined first (Sect. 2.1), discussing some possible criticalities (Sect. 2.2), before investigating the issue of modelling a set of additional conditions (Sect. 2.3).

2.1 General Problem Statement and Mathematical Model Formulation

This section looks upon a first basic statement of the tetris-like packing issue, as an extension of the classical single container loading problem. The issue of placing small boxes into a big one has consolidated mathematical models. The formulation usually referred to as space-indexed is based on the container discretization (e.g. Beasley 1985; Hadjiconstantinou and Christofides 1995). The relative MIP model provides very strong bounds (see Allen et al. 2012), as it also occurs for similar discretized formulations for scheduling problems (corresponding to one-dimensional packing, e.g. Pan and Shi 2007). This characteristic, in several cases, greatly makes up for the discretization. This holds, in particular, when all the items involved have integer side lengths (e.g. unit squares/cubes). The extension of this space-indexed formulation to the accommodation of the tetris-like items issue discussed in this chapter would be quite straightforward.

A non-space-indexed paradigm is considered in this work. A corresponding mathematical model, expressed in terms of mixed-integer linear programming (MILP ), is formulated (it is usually denoted as the general MIP model , when no ambiguity occurs, omitting the specification ‘linear’).

To state the problem, we shall consider a set of N items, each identified by an associated local reference frame. This set is denoted by I. A (bounded) convex domain D, consisting of a polyhedron (see Fig. 2.1), is considered. It is associated to a given orthogonal reference frame, denoted in the following as main. The problem is that of placing items into D, maximizing the loaded volume (or mass), with the following positioning rules:

  • Each local reference frame axis has to be positioned orthogonally, with respect to the main frame (orthogonality conditions ).

  • For each item, each component has to be contained within D (domain condition s).

  • Components of different items cannot overlap (non-intersection condition s).

This problem can easily be formulated as an MIP (Fasano 2008). When dealing with tetris-like items, each one consisting of a single component only and a domain consisting of a parallelepiped, the tetris-like item general problem stated above reduces to the classical container loading issue (e.g. Bortfeldt and Wäscher 2012). Its MIP formulation can be found, with possible variations, in some previous works (e.g. Chen et al. 1995; Fasano 1989, 1999, 2003, 2004; Padberg 1999; Pisinger and Sigurd 2005).

To formulate the general MIP model in question, the main orthogonal reference frame , with origin O and axes w β , β = {1, 2, 3} = B, is defined. Each local reference frame, associated to every item i, is chosen, without loss of generality, so that all item components lie within its first octant. Its origin coordinates, with respect to the main reference frame , are denoted in the following by o βi . We shall then introduce the set Ω of all possible orthogonal rotation s, admissible for any local reference frame, with respect to the main one. It is easily seen that they are 24 in all, since items are, in general, asymmetric objects.

This is illustrated by Fig. 2.2, where an item, consisting of three mutually orthogonal components, is considered. The components have lengths of 1, 3 and 9 units respectively. The component of length 3 units is parallel to the vertical axis of the observer reference frame. Two sub-cases are considered: in one (corresponding to the four images above) the item is up-oriented, whilst in the other (corresponding to the four images below) it is down-oriented. As can be seen from the figure, four orthogonal (clockwise) rotations (around the vertical axis) are associated to each sub-case, so that when the component of length 3 units is vertical (either up-oriented or down-oriented), eight relative rotations have to be taken into account. The same holds when either the component of length 1 unit or the one of length 9 units assumes the vertical position, so that the total number of orthogonal orientation is 24.

Fig. 2.2
figure 2

Tetris-like item rotations around a single axis

In the following, the set of components associated to the generic item i is denoted by C i . We shall introduce, for each item i, the set E hi of all (eight) vertices associated to each of its component h. An extension of this set is obtained by adding to E hi the geometrical centre of component h. This extended set is denoted in the following by \( {\overset{\frown }{E}}_{hi} \). For each item i and each possible orthogonal orientation ω ∈ Ω, we define the following binary (0–1) variables:

χ i  ∈ {0, 1}, with χ i  = 1 if item i is picked, χ i  = 0 otherwise;

ϑ ωi  ∈ {0, 1}, with ϑ ωi  = 1 if item i is picked and has the orthogonal orientation ω ∈ Ω, ϑ ωi  = 0 otherwise.

The above orthogonality conditions can be expressed as follows:

$$ \forall i\in I\kern1em {\displaystyle \sum_{\omega \in \varOmega }{\vartheta}_{\omega i}}={\chi}_i, $$
(2.1)
$$ \begin{array}{l}\forall \beta \in B,\forall i\in I,\forall h\in {C}_i,\forall \eta \in {\overset{\frown }{E}}_{hi}\hfill \\ {}{w}_{\beta \eta hi}={o}_{\beta i}+{\displaystyle \sum_{\omega \in \varOmega }{W}_{\omega \beta \eta hi}{\vartheta}_{\omega i}}.\hfill \end{array} $$
(2.2)

Here w βηhi (\( \forall \eta \in {\overset{\frown }{E}}_{hi} \)) are the vertex coordinates, with respect to the main reference frame, of component h, or its geometrical centre (η = 0), relative to item i; W ωβηhi are the projections on the axes w β of the coordinate differences between points \( \eta \in {\overset{\frown }{E}}_{hi} \) and the origin of the local reference frame, corresponding to orientation ω of item i.

The domain condition s are expressed as follows:

$$ \begin{array}{l}\forall \beta \in B,\forall i\in I,\forall h\in {C}_i,\forall \eta \in {E}_{hi}\hfill \\ {}{w}_{\beta \eta hi}={\displaystyle \sum_{\gamma \in V}{V}_{\beta \gamma}{\lambda}_{\gamma \eta hi},}\hfill \end{array} $$
(2.3)
$$ \forall i\in I,\forall h\in {C}_i,\forall \eta \in {E}_{hi}\kern1em {\displaystyle \sum_{\gamma \in V}{\lambda}_{\gamma \eta hi}}={\chi}_i. $$
(2.4)

Here w βηhi (η ∈ E hi ) are the vertex coordinates, with respect to the main reference frame, of component h relative to item i; V is the set of vertices delimiting D and V βγ are their coordinates (assumed as non-negative, with no loss of generality) and λ γηhi are non-negative variable s. These conditions correspond to the well-known necessary and sufficient condition s for which a point belongs to a convex domain .

The non-intersection condition s are represented by the constraints below:

$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 hi}-{w}_{\beta 0 kj}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}-{D}_{\beta}\left(1-{\sigma}_{\beta hkij}^{+}\right),\hfill \end{array} $$
(2.5a)
$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 kj}-{w}_{\beta 0 hi}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}-{D}_{\beta}\left(1-{\sigma}_{\beta hkij}^{-}\right),\hfill \end{array} $$
(2.5b)
$$ \begin{array}{l}\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{\displaystyle \sum_{\beta \in B}\left({\sigma}_{\beta hkij}^{+}+{\sigma}_{\beta hkij}^{-}\right)}\ge {\chi}_i+{\chi}_j-1,\hfill \end{array} $$
(2.6)

where D β are the sides (parallel to the main reference frame) of the parallelepiped, of minimum dimensions, containing D (minimum enclosing parallelepiped ); w β0hi and w β0kj are the centre coordinates, with respect to the main reference frame, of components h and k of items i and j respectively; L ωβhi and L ωβkj are their side projections on axes w β , corresponding to orientation ω; σ + βhkij and σ βhkij  ∈ {0, 1}. Inequalities (2.5a) and (2.5b) state that if, for any pair of components h (of i) and k (of j), a variable σ is equal to one, then the corresponding non-intersection constraint is made active; otherwise it becomes redundant. The condition σ + βhkij  = 1 means that k precedes h, with respect to the axis w β and vice versa if σ βhkij  = 1. When both i and j are picked, the relative inequality (2.6) guarantees that at least one σ is equal to one, and this means that, at least, one non-intersection constraint holds.

The objective function has the following expression:

$$ \max {\displaystyle \sum_{i\in I}{K}_i{\chi}_i}, $$
(2.7)

where K i is either the volume V i or the mass M i of item i. The total volume loaded is denoted by v, with \( v={\displaystyle \sum_{i\in I}{V}_i{\chi}_i}, \)whilst analogously, m, with\( m={\displaystyle \sum_{i\in I}{M}_i{\chi}_i}, \) refers to the overall mass.

Remark 2.1

The constants D β can be interpreted as the classical big-Ms of the mathematical programming literature and the inequalities (2.5a) and (2.5b) as big-M constraint s. It is indeed quite easy to rearrange each of them in the more usual general form \( {\displaystyle \sum_l{K}_l{u}_l\le {K}_0+\left(1-\varsigma \right)K} \), where K l , K 0 are constants, u l are continuous variables, ς ∈ {0, 1} and K is the corresponding big-M. Each big-M could be theoretically substituted with any constant, sufficiently big to make the relative constraint redundant when the corresponding ς is zero. In the whole MIP /MINLP context, it is, however, well known that there is computational advantage in making each big-M as small as possible, without excluding any integer-feasible solution s (e.g. Williams 1993).

A property of interest, dealing with the issue of tightening the big-Ms appearing in (2.5a) and (2.5b), is briefly looked upon here below. Prior to introducing Proposition 2.1, we shall define the concept of external component , i.e. a component with, at least, one side adjacent to the minimum enclosing parallelepiped, enveloping the corresponding tetris-like item.

Proposition 2.1

Given that the domain D is a parallelepiped, for any pair of external component s h and k, belonging to two different tetris-like item s, the (big-M) terms D β , appearing in (2.5a) and (2.5b), cannot be further tightened.

Proof

Consider any two items i, j and any relative external component s h and k respectively. We shall write constraints (2.5a) and (2.5b) in the form

$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 hi}-{w}_{\beta 0 kj}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}-{K}_{\beta hkij}^{+}\left(1-{\sigma}_{\beta hkij}^{+}\right),\hfill \end{array} $$
$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 kj}-{w}_{\beta 0 hi}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}-{K}_{\beta hkij}^{-}\left(1-{\sigma}_{\beta hkij}^{-}\right),\hfill \end{array} $$

where K + βhkij and K βhkij are positive constants. If σ + βhkij  = 1, the non-intersection constraint between h and k, with respect to the corresponding axis w β becomes active, as the multiplier of K + βhkij reduces to zero. If, instead, σ + βhkij  = 0, the inequality below must hold for any possible position of i and j in D:

$$ {K}_{\beta hkij}^{+}\ge -{w}_{\beta 0 hi}+{w}_{\beta 0 kj}+\frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}. $$

To prove the proposition, it is therefore sufficient to consider the extreme case, where item j minimum enclosing parallelepiped , is, with respect to the corresponding side D β , at its upper bound and item i minimum enclosing parallelepiped at the lower one. Denoting, for any rotation ω and ω′ of i and j, respectively, by\( {\overline{L}}_{\omega \beta i} \) and\( {\overline{L}}_{\omega^{\prime}\beta j} \), the side projections of their minimum enclosing parallelepiped s on w β , the following inequality must hold:

$$ {K}_{\beta hkij}^{+}\ge {D}_{\beta }-{\overline{L}}_{\omega^{\prime}\beta j}+{W}_{\omega^{\prime}\beta 0 kj}+\frac{1}{2}{L}_{\omega^{\prime}\beta kj}-{\overline{L}}_{\omega \beta i}+{W}_{\omega \beta 0 hi}+\frac{1}{2}{L}_{\omega \beta hi}. $$

As this is requested for any ω and ω′, the condition is true, in particular, also when \( -{\overline{L}}_{\omega^{\prime}\beta j}+{W}_{\omega^{\prime}\beta 0 kj}+\frac{1}{2}{L}_{\omega^{\prime}\beta kj}-{\overline{L}}_{\omega \beta i}+{W}_{\omega \beta 0 hi}+\frac{1}{2}{L}_{\omega \beta hi}=0 \), occurring when both h and k attain the contact condition (with respect the domain sides perpendicular to D β ). The same reasoning occurs, obviously, for σ βhkij , so that neither \( {K}_{{}_{\beta hkij}}^{+} \) nor \( {K}_{{}_{\beta hkij}}^{-} \) can be smaller than D β .□

Remark 2.2

The proof of Proposition 2.1 suggests how to determine, albeit in a much more complicated way, the smallest big-Ms when the domain D is not just a parallelepiped but a more general polyhedron. For this purpose, let us introduce the terms \( {\underset{\bar{\mkern6mu}}{W}}_{\omega \beta 0 hi} \), representing the minimum value that w β0hi can attain (in D) when item i has the orientation ω, and \( {\overline{W}}_{\omega \beta 0 hi} \), representing the maximum value that w β0hi can attain (in D) when item i has the orientation ω.

The minimum \( {\underset{\bar{\mkern6mu}}{K}}_{\beta hkij}^{+} \) is hence determined by the expression \( {\underset{\bar{\mkern6mu}}{K}}_{{}_{\beta hkij}}^{+}={\displaystyle \underset{\omega, {\omega}^{\prime}\in \varOmega }{ \max }}\left\{-{\underset{\bar{\mkern6mu}}{W}}_{\omega \beta 0 hi}+{\overline{W}}_{\omega^{\prime}\beta 0 kj}+\frac{1}{2}\left({L}_{\omega \beta hi}+{L}_{\omega^{\prime}\beta kj}\right)\right\} \) and analogously for the corresponding minimum \( {\underset{\bar{\mkern6mu}}{K}}_{\beta hkij}^{-} \). The above considerations hold both for external and non-external components, including, for these, the case when D is a parallelepiped.

Special case of single parallelepiped s (single-component items)

The special case concerning single-component items is introduced here. The resulting single parallelepipeds are assumed to be of homogeneous density, so that the problem is greatly simplified, as six orthogonal rotation s, with respect to the main reference frame, are sufficient to determine their actual orientation. A further simplification is carried out, restricting the domain D to be a parallelepiped.

Posing α ∈ {1, 2, 3} = A, for each parallelepiped i, denote by L αi its sides, supposing, with no loss of generality, L 1i  ≤ L 2i  ≤ L 3i (as this assumption can be of use in extended versions of this model). The coordinates of its centre, with respect to the main reference frame , are indicated as w βi . The domain D is a parallelepiped with sides D β parallel to the main reference frame axes w β , respectively. A vertex of D is, moreover, supposed to be coincident with its origin O and D lies within the first octant . For each item i, the binary variable s δ αβi  ∈ {0, 1} are introduced, with the meaning δ αβi  = 1 if L αi is parallel to the axis w β and δ αβi  = 0 otherwise.

The general objective function (2.7) is kept unchanged, whilst the overall conditions are rewritten as follows:

Orthogonality constraints:

$$ \forall \alpha \in A,\forall i\in I\kern1em {\displaystyle \sum_{\beta \in B}{\delta}_{\alpha \beta i}}={\chi}_i, $$
(2.8a)
$$ \forall \beta \in B,\forall i\in I\kern1em {\displaystyle \sum_{\alpha \in A}{\delta}_{\alpha \beta i}}={\chi}_i. $$
(2.8b)

Domain constraints:

$$ \forall \beta \in B,\forall i\in I\kern1em 0\le {w}_{\beta i}-\frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha i}{\delta}_{\alpha \beta i}}\le {w}_{\beta i}+\frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha i}{\delta}_{\alpha \beta i}}\le {D}_{\beta }{\chi}_i. $$
(2.9)

Non-intersection constraints:

$$ \forall \beta \in B,\forall i,j\in I/i<j\kern1em {w}_{\beta i}-{w}_{\beta j}\ge \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha \beta i}+{L}_{\alpha j}{\delta}_{\alpha \beta j}\right)}-\left(1-{\sigma}_{\beta i j}^{+}\right){D}_{\beta }, $$
(2.10a)
$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j\hfill \\ {}{w}_{\beta j}-{w}_{\beta i}\ge \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha \beta i}+{L}_{\alpha j}{\delta}_{\alpha \beta j}\right)}-\left(1-{\sigma}_{\beta i j}^{-}\right){D}_{\beta },\hfill \end{array} $$
(2.10b)
$$ \begin{array}{l}\forall i,j\in I/i<j\hfill \\ {}{\displaystyle \sum_{\beta \in B}\left({\sigma}_{\beta ij}^{+}+{\sigma}_{\beta ij}^{-}\right)}\ge {\chi}_i+{\chi}_j-1,\hfill \end{array} $$
(2.11)

where σ + βij and σ βij  ∈ {0, 1}.

2.2 Excluding Non-realistic Solutions

The general MIP model discussed in Sect. 2.1 can be subject to criticism, whenever some practical aspects cannot be neglected . First of all, it does not include constraints that prevent items to assume a ‘floating’ position within the container. This flaw is scarcely influential in some contexts, such as that of bag loading in space logistics , where the internal empty spaces are usually filled with packaging material (e.g. bubble wrap or foam). Nonetheless, it can be non-negligible in several different applications.

For the sake of simplicity, referring to the case of single parallelepipeds, a ‘trick’ to overcome this difficulty in practice can easily be adopted. To this purpose, it is sufficient to carry out a two-step optimization process, the first aimed at finding what the maximum cargo (in terms of volume or mass) is and the second at lowering the position of the items towards the container floor, as much as possible.

Let us suppose that the general MIP model is aimed at maximizing the loaded volume (similar considerations would hold in the case of the mass) and denote by \( \widehat{v} \) the (optimal) value, obtained at the first step. The second is executed by adopting a variation of the general MIP. The constraint\( {\displaystyle \sum_{i\in I}{V}_i{\chi}_i},=\widehat{v} \) is therefore added, imposing that the total volume must be equal to that obtained (as an optimal solution) in the first step. The objective function min \( {\displaystyle \sum_{i\in I}{w}_{3i}}, \) replaces (2.7) (axes w 3 is assumed as the vertical one). This will lower the position of each item, reducing, as a consequence, the undesired ‘floating’ position effect (if an optimal solution, in particular, is found, no item can stay totally suspended any longer).

Remark 2.3

If, in the first step, only a suboptimal (or a nonproven optimal) solution is found, the inequality \( {\displaystyle \sum_{i\in I}{V}_i{\chi}_i},\ge \widehat{v} \) can substitute the corresponding equation. As an alternative to what is outlined above, a more sophisticated approach could be followed. This may be done by providing the main general MIP model with further constraints, to make the packing solutions as realistic as possible, taking into account both layer and stability conditions (see Sect. 2.3.5).

In addition to the criticality due to the aforementioned ‘floating’ positions, a non-trivial issue may arise when in the presence of ‘closed’ tetris-like items, as shown in Fig. 2.3. In some cases, to exclude solutions that are not feasible from the practical point of view, particular precautions should be taken. This may be done by stating special constraints not contemplated by the general MIP model of Sect. 2.1.

Fig. 2.3
figure 3

Concatenated ‘squared’ rings

To explain the concept, let us consider a very simple example (see Fig. 2.3), by introducing a pair of (identical) items i and j, each composed of four parallelepipeds (components) forming a ‘squared’ ring (homeomorphic to the classical topological figure of the torus).

As is immediately gathered, the non-intersection condition s (2.5a), (2.5b) and (2.6), reported in Sect. 2.1, are not sufficient to avoid situations such as the one illustrated in Fig. 2.3. They, indeed, prevent the intersection of each component of i with every one of j, and this holds also for the situation represented in the figure, as a matter of fact.

Nonetheless, in most real-world frameworks , a similar result would not be acceptable. In the case under consideration, in particular, to overcome this stumbling block, it would be sufficient to represent the empty space (internal ‘hole’) associated to item i as an equivalent (zero mass) additional component (see Fig. 2.4) and include it in the non-intersection conditions between items i and j.

Fig. 2.4
figure 4

‘Squared’ ring (left) with additional (zero-mass internal) component (right)

It is understood that the additional components have to be neglected when not necessary, as in the case, for instance, of the items represented in Fig. 2.5. The presence of additional components should indeed be considered, case by case, for each pair of items, depending on the specific context under analysis. Of course, much more tricky situations could also occur, even if they are not considered here. As is easily understood, however, the approach proposed above could simply be extended, to tackle adequately the specific cases under consideration.

Fig. 2.5
figure 5

Acceptable solution

2.3 Additional Conditions

The MIP approach introduced in Sect. 2.1, differently from other packing methodologies (especially the ones based on sequential placement algorithms), is quite suitable for treating a number of additional conditions . A survey of cases, quite frequent in practice, is reported hereinafter. Before going on with this part, it is however useful to introduce, for each pair of items i and j, the variable χ ij  ∈ [0, 1] (implicitly binary, i.e. χ ij  ∈ {0, 1}), with the following conditions:

$$\forall i,j\in I/i<j\kern3em {\chi}_{ij}\le {\chi}_i, $$
(2.12a)
$$ \forall i,j\in I/i<j\kern3em {\chi}_{ij}\le {\chi}_j, $$
(2.12b)
$$ \forall i,j\in I/i<j\kern1em {\chi}_{ij}\ge {\chi}_i+{\chi}_j-1. $$
(2.13)

2.3.1 Conditions on Item Position and Orientation

Specific loading conditions, such as those concerning the pre-fixed position and orientation of some items, are straightforward. Indeed this task, from the modelling point of view adopted, simply consists of fixing the relative variables o βi at the desired values and setting to one the ϑ ωi corresponding to the orientation that is targeted.

Weaker conditions on the item position can easily be introduced, if necessary, by posing lower and upper bound s on its local reference frame origin or even on the centre of each single component. Some orientations can be inhibited simply by setting to zero the corresponding ϑ ωi this allows, for instance, to force a local reference frame axis to be parallel to a particular direction (i.e. parallel to an axis of the main reference frame).

Similarly, (pairwise ) ‘parallelism’ conditions can be taken into account, by acting properly on the relevant variables ϑ. Given, for instance, two identical items i and j, the constraints below state that if both of them are loaded, they must have the same orientation : ∀ ω ∈ Ω, θ ωi  ≥ θ ωj  + χ ij  − 1.

2.3.2 Conditions on Pairwise Relative Distance

In some practical applications , either minimum or maximum distance conditions, involving pairs of components, belonging to different items, can be posed. From a general point of view, constraints like the following can thus be required for components h and k of item i and j, respectively:

$$ {\displaystyle \sum_{\beta \in B}{\left({w}_{\beta 0 hi}-{w}_{\beta 0 kj}\right)}^2}\ge {\underset{\bar{\mkern6mu}}{D}}_{hkij}^2{\chi}_{ij}, $$
(2.14)
$$ {\displaystyle \sum_{\beta \in B}\Big({w}_{\beta 0 hi}-{w}_{\beta 0 kj}}\Big){}^2\le {\overline{D}}_{hkij}^2{\chi}_{ij}+\left({\displaystyle \sum_{\beta \in B}{D}_{\beta}^2}\right)\left(1-{\chi}_{ij}\right), $$
(2.15)

where\( {\underset{\bar{\mkern6mu}}{D}}_{hkij} \) and \( {\overline{D}}_{hkij} \) are the given lower and upper bounds for their relative distance, respectively, whilst the other terms have already been defined. Clearly, inequality (2.14) expresses the minimum distance condition, whilst (2.15) the one on the maximum, holding if both items are loaded. Inequalities (2.14) and (2.15) become redundant, otherwise, if at least one of the items is not loaded, i.e. χ ij  = 0.

Constraint (2.14) coincides (when χ ij  = 1) with the classical one that guarantees the non-intersection between two spheres . This is notoriously non-convex and well known for being very difficult to deal with, as results from the specialist literature on circle/sphere packing (e.g. Addis et al. 2008a, b; Castillo et al. 2008; Gensane 2004, Kampas and Pintér 2005; Locatelli and Raber 2002; Stoyan and Yaskov 2008; Stoyan et al. 2003; Sutou and Dai 2002). Constraint (2.15), on the contrary, is convex and, as such, much easier to treat, even if still nonlinear (it could be observed that tighter big-Ms could be profitably chosen).

Remark 2.4

To show that the constraint \( {\displaystyle \sum_{\beta \in B}}{\left({w}_{\beta 0 hi},-,{w}_{\beta 0 kj}\right)}^2\le {\overline{D}}_{hkij}^2 \) is convex, it suffices to observe that, for any β, each quadratic form (w β0hi  − w β0kj )2 is obviously positive semi-definite and the first member of the inequality above is thus a sum (with positive coefficients) of convex function s (e.g. Minoux and Vajda 1986).

In order to remain within an MIP framework, a piecewise linear approximation (e.g. Williams 1993) can easily be applied both to (2.14) and (2.15). To this purpose, it is useful to pose e βhkij  = w β0hi  − w β0kj , with e βhkij  ∈ [−D β , D β ]. Adopting an obvious simplification of the symbols, constraints (2.14) and (2.15) hence assume the form

$$ {\displaystyle \sum_{\beta \in B}{e}_{\beta}^2}\ge {\underset{\bar{\mkern6mu}}{D}}^2\chi, $$
(2.16)
$$ {\displaystyle \sum_{\beta \in B}{e}_{\beta}^2}\le {\overline{D}}^2\chi +\left({\displaystyle \sum_{\beta \in B}{D}_{\beta}^2}\right)\left(1-\chi \right). $$
(2.17)

For the sake of simplicity, focusing just on constraint (2.16), we shall then discretize the interval [−D β , D β ] in N S subintervals, i.e. \( \left[-{D}_{\beta },{D}_{\beta}\right]={\displaystyle \underset{\gamma -1,\gamma \in {D}_s}{\cup }}\left[{D}_{\gamma -1},{D}_{\gamma}\right] \), with D s  = {0, …, γ, …, N s }. The terms e 2 β can then be approximated by piecewise linear function s ([−D β , D β ] → [0, D 2 β ]) simply by posing

$$ \forall \beta \in B\kern1em {e}_{\beta }={\displaystyle \sum_{\gamma \in {D}_S}{\lambda}_{\beta \gamma}{D}_{\gamma }}, $$
(2.18)
$$ \forall \beta \in B\kern1em {e}_{\beta}^2\approx {\displaystyle \sum_{\gamma \in {D}_S}{\lambda}_{\beta \gamma}{D}_{\gamma}^2}, $$
(2.19)
$$ {\displaystyle \sum_{\gamma \in {D}_S}{\lambda}_{\beta \gamma}}=1, $$
(2.20)

where the λ βγ are non-negative variable s and such that at most two adjacent can be non-zero (adjacency condition ). Indeed, this restriction has to be added in order to guarantee that for each e β  ∈ [−D β , D β ], the point \( \left({e}_{\beta },{\displaystyle \sum_{\gamma \in {D}_S}{\lambda}_{\beta \gamma}{D}_{\beta}^2}\right)\in {\boldsymbol{R}}^2 \) actually lies on a segment of the corresponding piecewise linear function .

Variables subject to the adjacency condition stated above are said to determine a special ordered set of variable s of type 2 (SOS2, e.g. Williams 1993). It is well known that such a condition (or, more in general, special ordered sets of the various types) can be tackled either algorithmically (most MIP solver s have dedicated features) or by introducing additional binary variable s and proper constraints in the model (an highly efficient formulation for the SOS2 case can be found in Vielma and Nemhauser 2009).

Piecewise linear approximation (and the SOS2 approach) is directly applicable to separable functions in general, but also more complex classes can be considered (e.g. Williams 1993). Here it is worth pointing out that when convex constraints (expressed by separable functions) are concerned, as, for instance, (2.17), it can easily be shown that the adjacency condition may be dropped, without bringing in any undesirable solution (e.g. Williams 1993). In the specific case in question, (2.18), (2.19) and (2.20) are indeed sufficient, per se, to guarantee that each point \( \left({e}_{\beta },{\displaystyle \sum_{\gamma \in {\overline{D}}_S}{\lambda}_{\beta \gamma}{D}_{\gamma}^2}\right) \) belongs to the convex domain (in R 2) delimited by the vertices (D γ , D 2 γ ), for all γ ∈ D S . This way, the convex constraint (2.17) is always satisfied, since, for any values assumed by the variables λ βγ , it is never underestimated (similar considerations hold when the minimization of a separable convex objective function is concerned, e.g. Williams 1993).

In addition to what is discussed above, very simple indirect conditions on the relative distance between components of two different items can be obtained as variations of (2.5a) and (2.5b):

$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 hi}-{w}_{\beta 0 kj}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}+{G}_{hkij}-\left({D}_{\beta }+{G}_{hkij}\right)\left(1-{\sigma}_{\beta hkij}^{+}\right),\hfill \end{array} $$
(2.21a)
$$ \begin{array}{l}\forall \beta \in B,\forall i,j\in I/i<j,\forall h\in {C}_i,\forall k\in {C}_j\hfill \\ {}{w}_{\beta 0 kj}-{w}_{\beta 0 hi}\ge \frac{1}{2}{\displaystyle \sum_{\omega \in \varOmega}\left({L}_{\omega \beta hi}{\vartheta}_{\omega i}+{L}_{\omega \beta kj}{\vartheta}_{\omega j}\right)}+{G}_{hkij}-\left({D}_{\beta }+{G}_{hkij}\right)\left(1-{\sigma}_{\beta hkij}^{-}\right).\hfill \end{array} $$
(2.21b)

Here G hkij are given constants. Inequalities (2.21a) and (2.21b) thus guarantee a minimum gap between component s h of i and k of j, respectively, along the axis corresponding to the active non-intersection condition . Of course, more complicated gap conditions could be stated similarly, but are not reported here.

Remark 2.5

It is, instead, worth mentioning that close-related topics come up in the context of the electronic design automation (EDA) and very large scale integration (VLSI), when dealing with the issue of minimizing the total wire length . Depending on the specific framework to look upon, the wire-length objective function terms are expressed by linear, quadratic or, more in general, nonlinear function s (e.g. Kahng and Wang 2005; Kim and Kim 2003; Kleinhans et al. 1991).

2.3.3 Conditions on Domains

Quite often in practice one has to take into account domains that are not convex , owing to the presence of forbidden zone s , e.g. due to clearance requirement s or actual ‘holes ’. This makes the domain non-convex , as a matter of fact.

If the forbidden zone s and ‘holes ’ are tetris-like-shaped (or properly approximated as such), they can easily be treated by the model reported in Sect. 2.1. They may indeed simply be considered as zero-mass items with given position and orientation. Analogous considerations hold also if the domain external shape is not convex, since it can easily be approximated by introducing forbidden zones, as appropriate, see Fig. 2.6.

Fig. 2.6
figure 6

Non-convex domain (left) approximated with forbidden zones (right, 2D representation)

A similar approach can be adopted, in the presence of structural element s that can be taken account of in terms of non-zero-mass items with fixed position and orientation: see Fig. 2.7 .

Fig. 2.7
figure 7

Domain with structural elements (left) and items packed around (right)

Further conditions , quite useful in practice, can be introduced to deal with separation plane s, partitioning the whole domain in sectors. They can simply be represented as ‘flat’ parallelepipeds: their bases are assumed to be parallel to one of the planes of the main reference frame and cover the whole domain sections they cut; their position (distance with respect to the parallel plane of the main reference frame) is allowed to vary within a given range. An alternative formulation can be applied by introducing, for each item, a set of binary variable s, one per sector, that are equal to one if the item belongs to the corresponding sector and zero otherwise (Fasano 2003).

2.3.4 Conditions on the Total Mass Loaded and Its Distribution

In several real-world applications , such as aerospace engineering and transportation systems in general, quite demanding requirements on the total mass or its distribution inside the domain have to be taken into account. Restrictions on the overall load are simply posed as follows:

$$ \underset{\bar{\mkern6mu}}{M}\le {\displaystyle \sum_{i\in I}{M}_i}{\chi}_i\le \overline{M}, $$
(2.22)

where \( \underset{\bar{\mkern6mu}}{M} \) and \( \overline{M} \) are the given lower and upper mass bounds, respectively. Some insights concerning balancing conditions are provided next.

2.3.4.1 Static Balancing Restriction

The problem of loading a set of single parallelepiped s inside a convex domain , each with a given mass, so that the overall centre of mass lies within a given convex subdomain (inside the container), has been previously discussed (Fasano 2004, 2008). This restriction is denoted in the following by static balancing .

To generalize this issue to the case of tetris-like items, we shall firstly introduce for each one of them the terms W * ωβi . These represent the projections, on the axes w β , of the coordinate differences between item i centre of mass and the origin of the local reference frame, corresponding to orientations ω. With w * βi we shall denote, for each item i, its centre of mass coordinates, with respect to the main reference frame. Conditions (2.2), (2.3) and (2.4) are then properly adapted to take into account also this point (so that, in particular, w * βi  = 0 if χ i  = 0). Let us indicate with D * the convex subdomain in which the overall centre of mass must stay, in compliance with the static balancing restriction. Denoting with V * the set of vertices delimiting D * and with V * βγ their coordinates, with respect to the main reference frame, the proposition stated below holds.

Proposition 2.2

Static balancing necessary and sufficient condition s are as follows:

$$ \forall \beta \in B\kern1em {\displaystyle \sum_{i\in I}{M}_i{w}_{\beta i}^{*}}={\displaystyle \sum_{\gamma \in {V}^{*}}{V}_{\beta \gamma}^{*}{\psi}_{\gamma}^{*}}, $$
(2.23)
$$ {\displaystyle \sum_{\gamma \in {V}^{*}}{\psi}_{\gamma}^{*}}=m, $$
(2.24)

where \( m={\displaystyle \sum_{i\in I}{M}_i{\chi}_i} \) and ∀ γ ∈ V* \( {\psi}_{\gamma}^{*}={\tilde{\psi}}_{\gamma}^{*}m \), with \( {\tilde{\psi}}_{\gamma}^{*}\ge 0 \).

Proof

To prove this proposition, it can simply be observed that the following conditions are necessary and sufficient for the overall centre of mass staying inside the given (sub)domain (supposing m > 0): ∀ β ∈ B \( {\displaystyle \sum_{i\in I}\frac{M_i{w}_{\beta i}^{*}}{m}}={\displaystyle \sum_{\gamma \in {V}^{*}}{V}_{\beta \gamma}^{*}{\tilde{\psi}}_{\gamma}^{*}} \), with \( {\displaystyle \sum_{\gamma \in {V}^{*}}{\tilde{\psi}}_{\gamma}^{*}}=1 \) and \( {\tilde{\psi}}_{\gamma}^{*}\ge 0 \). Indeed they state that point \( {\displaystyle \sum_{i\in I}\frac{M_i{w}_{\beta i}^{*}}{m}} \), i.e. the overall centre of mass , lies inside the convex (sub)domain D * of vertices V * γ  ∈ V *. The above conditions are obviously equivalent to (2.23) and (2.24), by using \( {\psi}_{\gamma}^{*}=m{\tilde{\psi}}_{\gamma}^{*} \). (If m = 0, (2.23) and (2.24) are trivially satisfied, as, by (2.2), for each non-picked item i, the variables w * βi become zero). □

Remark 2.6

It is important to point out that the correlations ∀ γ ∈ V * \( {\psi}_{\gamma}^{*}={\tilde{\psi}}_{\gamma}^{*}m \), \( {\tilde{\psi}}_{\gamma}^{*}\ge 0 \) can simply be substituted with ∀ γ ∈ V * ψ * γ  ≥ 0 (as the variables \( {\tilde{\psi}}_{\gamma}^{*} \) only play an ‘ancillary’ role, having no ‘physical’ meaning in the model). This way, conditions (2.23) and (2.24) are linear (as the nonlinear ones \( {\psi}_{\gamma}^{*}=m{\tilde{\psi}}_{\gamma}^{*} \) are omitted tout court). Moreover, the above balancing conditions are simplified when the centre of mass (sub)domain is a parallelepiped, i.e. defined, for each axis w β , by the intervals \( \left[{\underset{\bar{\mkern6mu}}{C}}_{\beta}^{*},{\overline{C}}_{\beta}^{*}\right]. \) In such a case, they have the simpler form ∀ β \( {\underset{\bar{\mkern6mu}}{C}}_{\beta}^{*}m\le {\displaystyle \sum_{i\in I}{M}_i{w}_{\beta i}^{*}}\le {\overline{C}}_{\beta}^{*}m \). It is gathered that (2.23) and (2.24) do not take account of the mass of the container. An appropriate modification of them can easily be attained, in order to include it and its contribution to the overall centre of mass .

Remark 2.7

An item consisting of a single nonhomogeneous parallelepiped can simply be considered as composed of two elements: one parallelepiped with zero mass, geometrically identical to the item itself and its centre of mass. The composed item can hence be treated as a (degenerate) tetris-like item, whose components are the parallelepiped with zero mass and this point.

An interesting issue arises when looking upon the presence of a filling material of non-negligible density. This situation can occur, for instance, in the space engineering context, when quite dense protective foam has to fill every gap between the loaded items. To formulate the related model, it is sufficient to consider the whole domain D as if it were entirely filled with the filling material and replace all the mass associated to the volumes occupied by each item, with their actual one. Recalling the general definition of centre of mass , its coordinates w * β are expressed by the following equations:

$$ \forall \beta \in B\kern1em {w}_{\beta}^{*}=\frac{{\displaystyle \underset{D}{\int }{u}_{\beta }r(u)d{u}_{\beta }}}{m}. $$
(2.25)

Here m represents the total mass contained in D (referring both to the items loaded and the filling material ), whilst r(u) its relative density function (that in the specific case under consideration is a constant). The following equations hold:

$$ \forall \beta \in B\kern1em m{w}_{\beta}^{*}={\displaystyle \underset{\overset{\smile }{D}}{\int }{u}_{\beta }r}d{u}_{\beta }+{\displaystyle \sum_{i\in I}{M}_i{w}_{\beta i}^{*}}=\overset{\smile }{M}{\overset{\smile }{W}}_{\beta}^{*}+{\displaystyle \sum_{i\in I}\left({M}_i-{\overset{\smile }{M}}_i\right){w}_{\beta i}^{*}}. $$
(2.26)

Here \( \overset{\smile }{D} \) is the subdomain of D corresponding to the volume not occupied by the items (and thus occupied by the filling material ); \( {\overset{\smile }{M}}_i \) denotes the mass each item i would assume if its density were the same of the filling material; \( \overset{\smile }{M} \) and \( {\overset{\smile }{\boldsymbol{W}}}^{*} \) indicate the total mass of the filling material and its relative centre of mass, respectively, if it filled the whole domain D (i.e. with no items inside). Thus, the following conditions extend the static balancing conditions (2.23) and (2.24):

$$ \forall \beta \in B\kern1em \overset{\smile }{M}{\overset{\smile }{W}}_{\beta}^{*}+{\displaystyle \sum_{i\in I}\left({M}_i-{\overset{\smile }{M}}_i\right){w}_{\beta i}^{*}}={\displaystyle \sum_{\gamma \in {V}^{*}}{V}_{\beta \gamma}^{*}{\psi}_{\gamma}^{*}}, $$
(2.27)
$$ {\displaystyle \sum_{\gamma \in {V}^{*}}{\psi}_{\gamma}^{*}}=\overset{\smile }{M}-{\displaystyle \sum_{i\in I}\left({\overset{\smile }{M}}_i-{M}_i\right){\chi}_i}, $$
(2.28)
$$ \forall \gamma \in {V}^{*},\kern0.75pc {\psi}_{\gamma}^{*}\ge 0. $$

2.3.4.2 Dynamic Balancing Restrictions

Quite demanding requirements, involving inertia propert ies of the whole system, may be posed (e.g. Egeblad 2009; Limbourg et al. 2012). In space engineering , for instance, quite frequently, specific conditions on the spacecraft inertia matrix are set to address fuel consumption or attitude control concerns. Assuming the items as point masses, we shall introduce the following constraints:

$$ \begin{array}{l}\forall \beta, {\beta}^{\prime}\in B/\beta <{\beta}^{\prime}\hfill \\ {}\left|{\displaystyle \sum_{i\in I}{M}_i{w}_{\beta i}^{*}{w}_{\beta^{\prime }i}^{*}}\right|\le {\overline{I}}_{\beta {\beta}^{\prime }}(m),\hfill \end{array} $$
(2.29)
$$ \begin{array}{l}\forall \beta, {\beta}^{\prime },{\beta}^{{\prime\prime}}\in B/\beta <{\beta}^{\prime },\beta, {\beta}^{\prime}\ne {\beta}^{{\prime\prime}}\hfill \\ {}{\displaystyle \sum_{i\in I}{M}_i}\left({w}_{\beta i}^{*2}+{w}_{\beta^{\prime }i}^{*2}\right)\ge {\underset{\bar{\mkern6mu}}{I}}_{\beta^{{\prime\prime} }}(m),\hfill \end{array} $$
(2.30a)
$$ \begin{array}{l}\forall \beta, {\beta}^{\prime },{\beta}^{{\prime\prime}}\in B/\beta <{\beta}^{\prime },\beta, {\beta}^{\prime}\ne {\beta}^{{\prime\prime}}\hfill \\ {}{\displaystyle \sum_{i\in I}{M}_i}\left({w}_{\beta i}^{*2}+{w}_{\beta^{\prime }i}^{*2}\right)\le {\overline{I}}_{\beta^{{\prime\prime} }}(m),\hfill \end{array} $$
(2.30b)

where \( {\overline{I}}_{\beta {\beta}^{\prime }}(m) \), \( {\underset{\bar{\mkern6mu}}{I}}_{\beta^{{\prime\prime} }}(m) \) and \( {\overline{I}}_{\beta^{{\prime\prime} }}(m) \) are (non-negative) functions of the total loaded mass m.

Remark 2.8

It is immediately gathered that (2.29), (2.30a) and (2.30b) are nonlinear constraint s, giving rise to an MINLP model . In these constraints, the inertia characteristic s of each single item have been neglected, considering, for the sake of simplicity, just simple point masses, but more precise formulations could be looked into.

It is of particular interest when\( {\underset{\bar{\mkern6mu}}{I}}_1(m)\approx {\overline{I}}_1(m)\approx {\underset{\bar{\mkern6mu}}{I}}_2(m)\approx {\overline{I}}_2(m) \) (and \( {\overline{I}}_{\beta {\beta}^{\prime }}(m)\approx 0 \)). With an appropriate setting of the static balancing conditions, indeed, this case makes the system mass distribution assume, at a certain grade of approximation, the dynamic propert ies of a homogeneous cylinder.

2.3.5 Further Loading Restrictions

A significant number of further restrictions could be added , depending on the specific framework. Conditions concerning the relative position between items, such as, for instance, ‘item i must stay over or under j’, would also be treated easily, simply by acting properly on the relevant variables σ +/−.

Much more demanding scenarios are, instead, tackled in the specialist packing literature, looking upon further additional loading conditions such as stability , load bearing and multi-dropping (e.g. Bischoff 2006; Bortfeldt and Gehring 2001; Christensen and Rousøe 2009; Eley 2002; Junqueira et al. 2011; Junqueira et al. 2012; Lai et al. 1998; Morabito and Arenales 1994; Moura and Oliveira 2005; Pisinger 2002; Ratcliff and Bischoff 1998; Silva et al. 2003).

These can be defined as follows (Junqueira et al. 2013): ‘Cargo stability refers to the support of the bottom faces of boxes, in the case of vertical stability (i.e., the boxes must have their bottom faces supported by other box top faces or the container floor), and the support of the lateral faces of boxes, in the case of horizontal stability. Load bearing strength refers to the maximum number of boxes that can be stacked one above each other, or more generally, to the maximum pressure that can be applied over the top face of a box. Multi-dropping refers to cases where boxes that are delivered to the same customer (destination) must be placed close to each other inside the container and the loading pattern must take into account the delivery route of the vehicle and the sequence in which the boxes are unloaded’.

Dealing with such additional conditions, an interesting approach has been suggested (Junqueira et al. 2013). It develops a ‘grid -based position paradigm’ (i.e. space-indexed formulation, e.g. Allen et al. 2012), as opposed to the ‘position free’ one, i.e. the MIP model of Sect. 2.1 (or equivalent versions), that instead allows for continuous item positions.

Extensions of the single parallelepiped MIP model (Sect. 2.1), aimed at tackling a number of additional conditions, are taken into account by Pesch (working paper) . Those, for instance, denoted by layer constraints consider the presence of incompatibility relations of the type: item i cannot be positioned ‘on the top’ of item j. As pointed out in this work, they can be represented by a directed graph G, where arc(i, j) ∈ G if and only if item i cannot be placed on item j. Moreover, if an item is not placed on the floor, it has to be supported by at least another item.

Whilst such additional conditions can be expressed by an MINLP formulation (Pesch, working paper), an alternative MIP model is briefly discussed here, also referring, for the sake of simplicity, to the case of single parallelepipeds.

To this purpose, we shall introduce, firstly, the binary variable s \( {\underset{\bar{\mkern6mu}}{\chi}}_i \) and \( {\overset{\frown }{\chi}}_i \), with the meaning:

  • \( {\underset{\bar{\mkern6mu}}{\chi}}_i=1 \) if item i lies on the container basis; \( {\underset{\bar{\mkern6mu}}{\chi}}_i=0 \) either if it is not loaded or it is supported by (at least) another item.

  • \( {\overset{\frown }{\chi}}_i=1 \) if item i is supported by (at least) another item; \( {\overset{\frown }{\chi}}_i=0 \) either if it is not loaded or it lies on the container basis.

These have the task of controlling the status of possible contact, for each item i, with respect to the lower basis of the container (floor). They are linked, in a mutually exclusive mode, to the corresponding variables χ i as follows:

$$ \forall i\in I\kern1em {\underset{\bar{\mkern6mu}}{\chi}}_i+{\overset{\frown }{\chi}}_i={\chi}_i, $$

This way, if item i is picked, then one and only one of the two related statuses is admissible. Thus, assuming that the axis w 3 of the main reference frame is the ‘vertical’ one, the conditions below hold:

$$ \forall i\in I\kern1em {w}_{3i}\ge \frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha i}{\delta}_{\alpha 3i}}-\frac{1}{2}{L}_{3i}\left(1-{\underset{\bar{\mkern6mu}}{\chi}}_i\right), $$
$$ \forall i\in I\kern1em {w}_{3i}\le \frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha i}{\delta}_{\alpha 3i}}+\left({D}_3-{L}_{1i}\right)\left(1-{\underset{\bar{\mkern6mu}}{\chi}}_i\right). $$

These constraints force item i to lie on the container base, when the corresponding condition is active, i.e. \( {\underset{\bar{\mkern6mu}}{\chi}}_i=1 \), and become redundant otherwise, i.e. when \( {\underset{\bar{\mkern6mu}}{\chi}}_i=0 \).

In addition to this, the case corresponding to \( {\overset{\frown }{\chi}}_i=1 \), i.e. when item i is picked but it is supported by (at least) another item, has to be properly examined. Before going ahead with this point, however, we shall introduce the binary variable s \( {\overset{\frown }{\sigma}}_{3 ij}^{+} \) and \( {\overset{\frown }{\sigma}}_{3 ij}^{-} \), with the meaning:

\( {\overset{\frown }{\sigma}}_{3 ij}^{+}=1 \) if item i is placed on the top of j and zero otherwise.

\( {\overset{\frown }{\sigma}}_{3 ij}^{-}=1 \) if item j is placed on the top of i and zero otherwise.

The inequalities below are thus added to (2.10a) and (2.10b), respectively:

$$ \forall i,j\in I/i<j\kern1em {w}_{3i}-{w}_{3j}\ge \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)}-\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{+}\right){D}_3, $$
$$ \forall i,j\in I/i<j\kern1em {w}_{3i}-{w}_{3j}\le \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)}+\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{+}\right){D}_3, $$
$$ \forall i,j\in I/i<j\kern1em {w}_{3j}-{w}_{3i}\ge \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)}-\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{-}\right){D}_3, $$
$$ \forall i,j\in I/i<j\kern1em {w}_{3j}-{w}_{3i}\le \frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)}+\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{-}\right){D}_3. $$

They imply, as is immediately seen, that \( {w}_{3i}={w}_{3j}+\frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)} \) (i.e. i lies on the top of j), when \( {\overset{\frown }{\sigma}}_{3 ij}^{+}=1 \), and \( {w}_{3j}={w}_{3i}+\frac{1}{2}{\displaystyle \sum_{\alpha \in A}\left({L}_{\alpha i}{\delta}_{\alpha 3i}+{L}_{\alpha j}{\delta}_{\alpha 3j}\right)} \) (i.e. j lies on the top of i), when \( {\overset{\frown }{\sigma}}_{3 ij}^{-}=1 \). The first pair of inequalities becomes redundant otherwise when \( {\overset{\frown }{\sigma}}_{3 ij}^{+}=0 \) and, similarly for the second one, when \( {\overset{\frown }{\sigma}}_{3 ij}^{-}=0 \). Inequalities (2.11) are then extended as follows:

$$ \forall i,j\in I/i<j\kern1em {\displaystyle \sum_{\beta \in B}\left({\sigma}_{\beta ij}^{+}+{\sigma}_{\beta ij}^{-}\right)}+{\overset{\frown }{\sigma}}_{3ij}^{+}+{\overset{\frown }{\sigma}}_{3ij}^{-}+\ge {\chi}_i+{\chi}_j- 1, $$

where the terms \( {\overset{\frown }{\sigma}}_{3 ij}^{+} \) are set, a priori, to zero if arc(i, j) ∈ G and, analogously, for \( {\overset{\frown }{\sigma}}_{3 ij}^{-} \), if arc(j, i) ∈ G. The conditions stated below imply that if \( {\overset{\frown }{\chi}}_i=1 \), item i has to be positioned on the top of (at least) another one:

$$ \forall i\in I\kern1em {\overset{\frown }{\chi}}_i\le {\displaystyle \sum_{\begin{array}{l}j\in I/\\ {}i<j\end{array}}{\overset{\frown }{\sigma}}_{3 ij}^{+}+{\displaystyle \sum_{\begin{array}{l}{i}^{\prime}\in I/\\ {}{i}^{\prime }<i\end{array}}{\overset{\frown }{\sigma}}_{3{i}^{\prime }i}^{-}}}. $$

Further conditions can be taken into account to include the stability requirements (e.g. Pesch, working paper). This way, it is guaranteed that when item i is on the top of item j, the projection of its centre of mass, on the ‘horizontal’ plane, i.e. (O, w 1, w 2), lies inside the rectangle determined by the projection of item j. The following conditions (or more refined ones, with tighter big-Ms) can thus be added:

$$ \beta \in \left\{ 1, 2\right\},\forall i,j\in I/i<j\kern1em {w}_{\beta i}\le {w}_{\beta j}+\frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha j}{\delta}_{\alpha \beta j}}+\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{+}\right){D}_{\beta }, $$
$$ \beta \in \left\{ 1, 2\right\},\forall i,j\in I/i<j\kern1em {w}_{\beta i}\ge {w}_{\beta j}-\frac{1}{2}{\displaystyle \sum_{\alpha \in A}{L}_{\alpha j}{\delta}_{\alpha \beta j}}-\left(1-{\overset{\frown }{\sigma}}_{3 ij}^{+}\right){D}_{\beta }. $$

The layer and stability additional conditions can efficiently be tackled algorithmically, by means of a dedicated heuristic (Pesch, working paper). The (non-trivial) computational aspects, related to the extended MIP model discussed above (or possible alternative formulations), could, nevertheless, represent an interesting line for further in-depth investigation.