Skip to main content
Log in

Packing ellipsoids into volume-minimizing rectangular boxes

  • Published:
Journal of Global Optimization Aims and scope Submit manuscript

Abstract

A set of tri-axial ellipsoids, with given semi-axes, is to be packed into a rectangular box; its widths, lengths and height are subject to lower and upper bounds. We want to minimize the volume of this box and seek an overlap-free placement of the ellipsoids which can take any orientation. We present closed non-convex NLP formulations for this ellipsoid packing problem based on purely algebraic approaches to represent rotated and shifted ellipsoids. We consider the elements of the rotation matrix as variables. Separating hyperplanes are constructed to ensure that the ellipsoids do not overlap with each other. For up to 100 ellipsoids we compute feasible points with the global solvers available in GAMS. Only for special cases of two ellipsoids we are able to reach gaps smaller than \(10^{-4}\).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. The term polylithic has been coined by Kallrath [8, 10] to refer to tailor-made modeling and solution approaches to solve optimization problems exploiting several models, solve statements in an algebraic modeling language such as GAMS, or algorithms.

References

  1. Cafieri, S., Lee, J., Liberti, L.: On convex relaxations of quadrilinear terms. J. Glob. Optim. 47(4), 661–685 (2009). doi:10.1007/s10898-009-9484-1

    Article  MathSciNet  MATH  Google Scholar 

  2. Chernov, N., Stoyan, Y., Romanova, T., Pankratov, A.: Phi-functions for 2D objects formed by line segments and circular arcs. Adv. Oper. Res. (2012). doi:10.1155/2012/346358

  3. Choi, Y.K., Chang, J.W., Wang, W., Kim, M.S., Elber, G.: Continuous collision detection for ellipsoids. IEEE Trans. Vis. Comput. Graph. 15(2), 311–325 (2009). doi:10.1109/TVCG.2008.80

    Article  Google Scholar 

  4. Dirac, P.A.M.: The Principles of Quantum Mechanics. Oxford University Press, Oxford (1974)

    MATH  Google Scholar 

  5. Donev, A., Cisse, I., Sachs, D., Variano, E.A., Stillinger, F.H., Connelly, R., Torquato, S., Chaikin, P.M.: Improving the density of jammed disordered packings using ellipsoids. Science 303(5660), 990–993 (2004). doi:10.1126/science.1093010

    Article  Google Scholar 

  6. Donev, A., Stillinger, F.H., Chaikin, P.M., Torquato, S.: Unusually dense crystal packings of ellipsoids. Phys. Rev. Lett. 92, 255,506 (2004)

    Article  Google Scholar 

  7. Halmos, P.R.: Finite-Dimensional Vector Spaces. Springer, New York (1974)

    Book  MATH  Google Scholar 

  8. Kallrath, J.: Combined strategic design and operative planning in the process industry. Comput. Chem. Eng. 33, 1983–1993 (2009)

    Google Scholar 

  9. Kallrath, J.: Cutting circles and polygons from area-minimizing rectangles. J. Glob. Optim. 43, 299–328 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  10. Kallrath, J.: Polylithic modeling and solution approaches using algebraic modeling systems. Optim. Lett. 5, 453–466 (2011). doi:10.1007/s11590-011-0320-4

    Article  MathSciNet  MATH  Google Scholar 

  11. Kallrath, J., Rebennack, S.: Cutting ellipses from area-minimizing rectangles. J. Glob. Optim. 59(2–3), 405–437 (2014). doi:10.1007/s10898-013-0125-3

    Article  MathSciNet  MATH  Google Scholar 

  12. Systems, Lindo: Lindo API: User’s Manual. Lindo Systems Inc, Chicago (2004)

    Google Scholar 

  13. Lubachevsky, B.D., Stillinger, F.H.: Geometric properties of random disk packings. J. Stat. Phys. 60(5–6), 561–583 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  14. Man, W., Donev, A., Stillinger, F.H., Sullivan, M.T., Russel, W.B., Heeger, D., Inati, S., Torquato, S., Chaikin, P.M.: Experiments on random packings of ellipsoids. Phys. Rev. Lett. 94, 198,001 (2005). doi:10.1103/PhysRevLett.94.198001

    Article  Google Scholar 

  15. Misener, R., Floudas, C.: ANTIGONE: algorithms for continuous/integer global optimization of nonlinear equations. J. Glob. Optim. 59, 503–526 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  16. Romanova, T., Scheithauer, G., Krivulya, A.: Covering a polygonal region by rectangles. Comput. Optim. Appl. 48(3), 675–695 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  17. Stoyan, Y.G., Chugay, A.: Packing cylinders and rectangular parallelepipeds with distances between them. Eur. J. Oper. Res. 197(1), 446–455 (2008)

    MATH  Google Scholar 

  18. Tawarmalani, M., Sahinidis, N.V.: Convexification and Global Optimization in Continuous and Mixed-Integer Nonlinear Programming: Theory, Algorithms, Software, and Applications. Nonconvex Optimization and its Applications Series. Kluwer Academic Publishers, Dordrecht (2002)

    Book  MATH  Google Scholar 

  19. Uhler, C., Wright, S.J.: Packing ellipsoids with overlap. SIAM Review 55(4), 671–706 (2013). doi:10.1137/120872309

    Article  MathSciNet  MATH  Google Scholar 

  20. Waldron, K., Schmiedeler, J.: Kinematics. In: Siciliano, B., Khatib, O. (eds.) Handbook of Robotics, pp. 9–33. Springer, Oxford (2008)

    Chapter  Google Scholar 

Download references

Acknowledgments

Thanks are directed to Prof. Dr. Siegfried Jetzke (Ostfalia Hochschule, Salzgitter, Germany) for his interest in this work, comments on the manuscript and discussion about the usefulness of ellipses and ellipsoids in real world problems. The author is grateful to Dr. Arash Rezaeian (WIEH Erdgashandelshaus, Berlin, Germany) for his careful proof reading and production of the figures. Finally, we appreciate the constructive reviews of the referees.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Josef Kallrath.

Appendices

Appendix 1: Notation

We begin with a summary of the notation used in the derivation of the model.

\(\mathsf {A}\) :

Positive definite and symmetric matrix defining ellipsoids; we call this also the shape-rotation matrix.

\(\mathbf {c}\) :

Objective function coefficient vector of auxiliary problems; \(\mathbf {c}^{\top } = (1,0,0)\) or \(\mathbf {c}^{\top } = (0,1,0)\) or \(\mathbf {c}^{\top } = (0,0,1)\)

\(\mathsf {D}_i\) :

Diagonal matrix for ellipsoid i with eigenvalues of \(\mathsf {A}_i\) on the diagonal

\(\delta _{mn}\) :

Kronecker delta function takes value 1 if the indices m and n are equal, otherwise it takes the value zero 0

\(\mathcal {L}\left( \mathbf {x}, \bar{\lambda }\right) \) :

Lagrangian function

\(\lambda _{id}\) :

Eigenvalue of matrix \(\mathsf {A}_{i}\); \(\lambda _{i1} = a_i^{-2}\), \(\lambda _{i2} = b_i^{-2}\), and \(\lambda _{i3} = c_i^{-2}\)

\(\bar{\lambda }\) :

Lagrangian multiplier associated with ellipsoid equation

\(\rho \) :

Density of ellipsoids; \(0 \le \rho \le 1\)

\(\mathsf {R}_{\theta i}\) :

Rotation matrix for ellipsoid i at angle \(\theta _i\)

\(x_{id}^{\mathrm {-}}\) :

Minimal extension of ellipsoid i in dimension d

\(x_{id}^{\mathrm {+}}\) :

Maximal extension of ellipsoid i in dimension d

\( \iota \) :

Selected ellipsoid \(\iota \) is to be located in the first octant of the rectangular box

\(\varLambda \) :

Affine transformation matrix of the unit sphere \(\varLambda :=(a,b,c) \)

The notation used in the mathematical programming models is summarized in the following sections.

1.1 Indices and sets

\(d \in \{1,2,3\}\) :

Index for the dimension; \(d=1\) represents the length and \(d=2\) the width, and \(d=3\) the height of the box

\(i\in \mathcal {I}:= \{ 1, \ldots , n \}\) :

Objects (ellipsoids or spheres) to be packed

\((i,j) \in \mathcal {I}^{\mathrm {co}}\) :

Pairs of congruent ellipsoids; we assume \(i < j\)

1.2 Data

\(a_{i}\) :

The largest semi-axis of ellipsoid i; \(a_i \ge b_i \ge c_i\)

\(b_{i}\) :

2nd largest semi-axis of ellipsoid i; \(a_i \ge b_i \ge c_i\)

\(c_{i}\) :

Smallest semi-axis of ellipsoid i; \(a_i \ge b_i \ge c_i\)

\(\overline{D}_{ij}\) :

Bound on the distance variables \(d_{ij}^\mathrm{ab}\) and \(d_{ij}^\mathrm{be}\)

\(\varDelta \) :

Relative gap

\(R_i\) :

Radius of sphere i to be packed

\(S_{d}^{-}\), \(S_{d}^{+}\) :

Minimum (lower bound) and maximum size (upper bound) of the extension of the rectangular box in dimension d

\(V_{i}\) :

Volume of ellipsoid i; \(V_{i} = \frac{4}{3}\pi a_{i}b_{i}c_{i}\)

\(V^{-}\), \(V^{+}\) :

Lower and upper bounds on volume, v, of the rectangular box obtained during the computation

\(V^\mathrm{ci, -}\) :

Minimal volume of the design rectangle to host the inner spheres associated with the ellipsoids. \(V^\mathrm{ci, -}\) provides a lower bound on the associated ellipsoid packing problem

\(V^\mathrm{ci, +}\) :

Volume of the rectangular box to host the outer spheres associated with the ellipsoids. \(A^\mathrm{ci, -}\) provides an upper bound on the associated EPP

\(\varLambda _{inn}\) :

Elements of affine transformation matrix

1.3 Decision variables

\(d^\mathrm {c}_{ijd}\) :

Difference of the center coordinates of ellipsoid i and j

\(\mathbf {n}^\mathrm {H}_{ij}\) :

Normal vector of the hyperplane \(H_{ij}\) separating ellipsoid i and j; in the GAMS implementation we use \(n^\mathrm {H}_{ijd}\) for each coordinate direction d subject to \(-1 \le n^\mathrm {H}_{ijd} \le +1\)

\(L_{ij}\) :

Elements of the rotation matrix \(\mathsf {L}\) in the half-space approach; the elements are subject to the bounds \(-1 \le R_{ij} \le +1\)

\(R_{ij}\) :

Elements of the rotation matrix \(\mathsf {R}\); the elements are subject to the bounds \(-1 \le R_{ij} \le +1\)

\(u_{jkmn}\) :

Auxiliary variables considered only for tuples with \(j\le m\) and \(k\le n\)

v :

Volume of the rectangular box; \(v^*\) defines (globally) optimal volume

\(v_i\) :

Auxiliary variable representing the trigonometric term \(\cos \theta _i\); \(v_i \in [-1,1]\) for ellipsoid i when using the one-axis-one angle-approach

\(w_i\) :

Auxiliary variable representing the trigonometric term \(\sin \theta _i\); \(w_i \in [0,1]\) for ellipsoid i when using the one axis-one angle approach

\(x_{d}^{\mathrm {R}}\) :

Extension of the rectangular box in dimension d

\(x_{id}^0\) :

Coordinates of the center vector of ellipsoid i

z :

Waste of the rectangular box; \(z = v - \sum \nolimits _{i \in \mathcal {I}} V_{i}\)

\(\theta _{i}\) :

Orientation angle of ellipsoid i; \(\theta _{i} \in [0,2\pi ]\)

The model contains only continuous variables.

Appendix 2: Detailed derivations

1.1 Bounds on rotation matrices

A rotation matrix \(\mathsf {R}\) in real space \({\mathbb {R}}\) is a \(n\times n\) matrix with the following properties:

$$\begin{aligned} \mathsf {RR}^{\mathrm {T}}=\mathsf {R}^{\mathrm {T}}\mathsf {R}=\mathbbm {1},\quad \det \mathsf {R}=+1, \end{aligned}$$
(6.1)

i.e., the inverse matrix \(\mathsf {R}^{-1}\) of \(\mathsf {R}\) is just the transposed matrix \(\mathsf {R}^{\mathrm {T}}\). From (6.1 ) we follow and proof that for all elements \(R_{ij}\) the following bound inequalities

$$\begin{aligned} \left| R_{ij}\right| \le 1,\quad \forall \{ij\} \end{aligned}$$
(6.2)

are true. These bounds are useful to provide them to the global solvers. The proof only exploits \(\mathsf {R}^{\mathrm {T}}\mathsf {R}=\mathbbm {1}\) and works as follows:

$$\begin{aligned} \mathsf {R}^{\mathrm {T}}\mathsf {R}=\mathbbm {1}\end{aligned}$$

is equivalent to

$$\begin{aligned} \left( \mathsf {R}^{\mathrm {T}}\mathsf {R}\right) _{ik}=\mathop {\textstyle \sum }_{j}R_{ij}^{ \mathrm {T}}R_{jk}=\delta _{ik}=\left\{ \begin{array}{c} 1,\text { if }i=k \\ 0,\text { if }i\ne k \end{array} \right. ,\quad \forall \{ik\}. \end{aligned}$$

Therefore, using the transposed form, we also have

$$\begin{aligned} \mathop {\textstyle \sum }_{j}R_{ji}R_{jk}=\delta _{ik},\quad \forall \{ik\}. \end{aligned}$$
(6.3)

As (6.3) must be fulfilled for all \(\{ik\}\), it is especially true for \(k=i\), which implies

$$\begin{aligned} \mathop {\textstyle \sum }_{j}R_{ji}R_{ji}=\mathop {\textstyle \sum }_{j}R_{ji}^{2}=\delta _{ii}=1,\quad \forall \{i\}. \end{aligned}$$
(6.4)

As in (6.4) we have \(\mathop {\textstyle \sum }_{j}R_{ji}^{2}=\mathop {\textstyle \sum }_{j}R_{ij}^{2}=1\) for all i, it follows \(\left| R_{ij}\right| \le 1\) for all \(\forall \{ij\}\). Thus, as we work in real space \({\mathbb {R}}\), we can add the bounds

$$\begin{aligned} -1\le R_{ij}\le +1,\quad \forall \{ij\}. \end{aligned}$$
(6.5)

1.2 Minimal and maximal extensions of rotated ellipsoids

We compute the extreme extensions, \(x_{id}^{\mathrm {-}}\) and \(x_{id}^{ \mathrm {+}}\), of ellipsoid i in dimension d with center \(x_{id}^{0}\) from the optimization problems

$$\begin{aligned} x_{id}^{\mathrm {-}}= & {} \min \;\mathbf {c}^{\top }\mathbf {x}=\min \;x_{id},\quad \forall d\quad \mathrm {and} \\ x_{id}^{\mathrm {+}}= & {} \max \;\mathbf {c}^{\top }\mathbf {x}=\max \;x_{id},\quad \forall d, \end{aligned}$$

subject to the ellipsoid equation (2.10); for \(d=1\) we use \(\mathbf {c}^{\top }:=(1,0,0)\), for \(d=2\) we select \(\mathbf {c}^{\top }:=(0,1,0)\), and for \(d=3\) we use \(\mathbf {c}^{\top }:=(0,0,1)\). Instead of using (2.10), we solve the modified and easier optimization problem

$$\begin{aligned} x_{id}^{\mathrm {-}}= & {} \min \;\mathbf {c}^{\top }(\mathbf {x}+\mathbf {x} _{i}^{0})=x_{id}^{0}+\min \;x_{id},\quad \forall d\quad \mathrm { and} \end{aligned}$$
(6.6)
$$\begin{aligned} x_{id}^{\mathrm {+}}= & {} \max \;\mathbf {c}^{\top }(\mathbf {x}+\mathbf {x} _{i}^{0})=x_{id}^{0}+\max \;x_{id},\quad \forall d, \end{aligned}$$
(6.7)

respectively, subject to ellipsoid equation

$$\begin{aligned} \mathbf {x}^{\top }\mathsf {A}\mathbf {x}=1, \end{aligned}$$
(6.8)

for an origin-centered ellipsoid. Note, however, that ellipsoid i cannot be placed at the origin, the left-bottom corner of the rectangular box. Actually, a lower bound on the center coordinate, \(x_{id}\), in all coordinate directions d is given by

$$\begin{aligned} x_{id}^{0}\ge c, \end{aligned}$$
(6.9)

if we assume that the semi-axis of ellipsoid i are sorted according to \( a\ge b\ge c\).

The Lagrangian function of both optimization problems (6.6) and (6.7) reads

$$\begin{aligned} \mathcal {L}(\mathbf {x},\bar{\lambda })=\mathbf {c}^{\top }(\mathbf {x}+\mathbf {x }_{i}^{0})+\bar{\lambda }\left( \mathbf {x}^{\top }\mathsf {A}_{i}\mathbf {x} -1\right) \quad \end{aligned}$$
(6.10)

with the unrestricted Lagrangian multiplier \(\bar{\lambda }\in \mathbb {R}\). The first-order Karush–Kuhn–Tucker (KKT) conditions follow as

$$\begin{aligned} \mathbf {c}+2\bar{\lambda }\mathsf {A}_{i}^{\top }\mathbf {x}=\mathbf {0} \end{aligned}$$
(6.11)

together with (6.8).

We left-multiply (6.11) by \(\mathbf {x}^{\top }\), (this operation is safe, as the origin cannot be an extremum) and exploit (6.8) to obtain \(x_{d}+2\bar{\lambda }=0\) for all d . This enables us to substitute \(\bar{\lambda }\) from (6.11) yielding

$$\begin{aligned} \mathbf {c}-x_{d}\mathsf {A}^{\top }\mathbf {x}=0,\quad \forall d. \end{aligned}$$
(6.12)

with

$$\begin{aligned} \mathsf {A}=\left( \begin{array}{c@{\quad }c@{\quad }c} A_{11} &{} A_{12} &{} A_{13} \\ A_{21} &{} A_{22} &{} A_{23} \\ A_{31} &{} A_{32} &{} A_{33} \end{array} \right) ,\quad \mathsf {A}^{\top }=\left( \begin{array}{c@{\quad }c@{\quad }c} A_{11} &{} A_{21} &{} A_{31} \\ A_{12} &{} A_{22} &{} A_{32} \\ A_{13} &{} A_{23} &{} A_{33} \end{array} \right) . \end{aligned}$$

For the first dimension (\(d=1\), x-axis) the three equations in (2.32) read

$$\begin{aligned} 1-x_{1}\left( A_{11}x_{1}+A_{21}x_{2}+A_{31}x_{3}\right)= & {} 0 \end{aligned}$$
(6.13)
$$\begin{aligned} -x_{1}\left( A_{12}x_{1}+A_{22}x_{2}+A_{32}x_{3}\right)= & {} 0 \end{aligned}$$
(6.14)
$$\begin{aligned} -x_{1}\left( A_{13}x_{1}+A_{23}x_{2}+A_{33}x_{3}\right)= & {} 0. \end{aligned}$$
(6.15)

As \(x_{1}\ne 0\) (the origin cannot be a stationary point of this problem), we divide the 2nd and 3rd equation by \(x_{1}\) and derive

$$\begin{aligned} 1-x_{1}\left( A_{11}x_{1}+A_{21}x_{2}+A_{31}x_{3}\right)= & {} 0 \nonumber \\ A_{12}x_{1}+A_{22}x_{2}+A_{32}x_{3}= & {} 0 \nonumber \\ A_{13}x_{1}+A_{23}x_{2}+A_{33}x_{3}= & {} 0 . \end{aligned}$$
(6.16)

At first, let us express \(x_{2}\) and \(x_{3}\) as functions of \(x_{1}\). This leads to

$$\begin{aligned} x_{2}=\frac{A_{12}A_{33}-A_{13}A_{32}}{A_{23}A_{32}-A_{22}A_{33}}x_{1}\quad ,\quad x_{3}=\frac{A_{13}A_{22}-A_{12}A_{23}}{A_{23}A_{32}-A_{22}A_{33}} x_{1}. \end{aligned}$$
(6.17)

If we enter the expressions (6.17) into (6.13), we obtain

$$\begin{aligned} 1-x_{1}^{2}\left( A_{11}+A_{21}\frac{A_{12}A_{33}x-A_{13}A_{32}}{ A_{23}A_{32}-A_{22}A_{33}}+A_{31}\frac{A_{13}A_{22}-A_{12}A_{23}}{ A_{23}A_{32}-A_{22}A_{33}}\right) =0, \end{aligned}$$

from which we further derive

$$\begin{aligned} x_{1}^{-2}= & {} \left( A_{11}+A_{21}\frac{A_{12}A_{33}x-A_{13}A_{32}}{ A_{23}A_{32}-A_{22}A_{33}}+A_{31}\frac{A_{13}A_{22}-A_{12}A_{23}}{ A_{23}A_{32}-A_{22}A_{33}}\right) \\= & {} \frac{A_{23}A_{32}-A_{22}A_{33}}{ A_{11}A_{23}A_{32}\!-\!A_{11}A_{22}A_{33}\!-\!A_{12}A_{31}A_{23}\!-\!A_{21}A_{13}A_{32}+A_{13}A_{22}A_{31}+A_{12}A_{21}A_{33}} \end{aligned}$$

and thus

$$\begin{aligned} x_{1}^{2}=\frac{A_{22}A_{33}-A_{23}A_{32}}{\lambda _{i1}\lambda _{i2}\lambda _{i3}}=\left( A_{22}A_{33}-A_{23}A_{32}\right) a^{2}b^{2}c^{2} \end{aligned}$$
(6.18)

where we exploit the fact that

$$\begin{aligned} \det \mathsf {A}= & {} A_{11}A_{22}A_{33}\!-\!A_{11}A_{23}A_{32}\!-\!A_{12}A_{21}A_{33}\!+\!A_{12}A_{31}A_{23}+A_{21} A_{13}A_{32}-A_{13}A_{22}A_{31} \\= & {} \lambda _{i1}\lambda _{i2}\lambda _{i3}>0 \end{aligned}$$

(cf. Eigenvector Decomposition). From the geometrical background of the optimization problems (6.6) and (6.7), we know that each problem has a unique, global extremum. We further know that the global extremal values necessarily satisfy the KKT conditions (6.8) and (6.11). Because we have not excluded any global optima in our derivation to obtain (6.18) which leads to exactly two points, we know that \(x_{1}\) in (6.18) gives the global optimum for (6.7) and (6.6); we just need to select the proper one.

The minimal and maximal extensions of the ellipsoid in the first dimension, \((d=1)\), then reduce to

$$\begin{aligned} x_{1}^{\mathrm {-}}=\min \;\mathbf {c}^{\top }(\mathbf {x}+\mathbf {x} ^{0})=x_{1}^{0}-\sqrt{x_{1}^{2}}=x_{1}^{0}-abc\sqrt{A_{22}A_{33}-A_{23}A_{32} }\quad \end{aligned}$$
(6.19)

and

$$\begin{aligned} x_{1}^{\mathrm {+}}=x_{1}^{0}+abc\sqrt{A_{22}A_{33}-A_{23}A_{32}},\quad \end{aligned}$$
(6.20)

respectively. Note that these formulae are similar to (18) and (19) in [11] obtained for the maximal extensions of ellipses (2D case). If the ellipsoids were spheres (\(a=b=c=r\)), for \(\theta _{1}=\theta _{2}=\theta _{3}=0\), we obtain \( x_{1}^{\mathrm {+}}=x_{1}^{0}+abc\sqrt{b^{-2}c^{-2}-0}=x_{1}^{0}+r\).

Similarly, for \(d=2\) we derive

$$\begin{aligned} \ -x_{2}\left( A_{11}x_{1}+A_{21}x_{2}+A_{31}x_{3}\right)= & {} 0 \end{aligned}$$
(6.21)
$$\begin{aligned} 1-x_{2}\left( A_{12}x_{1}+A_{22}x_{2}+A_{32}x_{3}\right)= & {} 0 \end{aligned}$$
(6.22)
$$\begin{aligned} -x_{2}\left( A_{13}x_{1}+A_{23}x_{2}+A_{33}x_{3}\right)= & {} 0. \end{aligned}$$
(6.23)

At first, let us express \(x_{1}\) and \(x_{3}\) as functions of \(x_{2}\). This leads to

$$\begin{aligned} x_{1}=\frac{A_{21}A_{33}-A_{31}A_{23}}{A_{13}A_{31}-A_{11}A_{33}}x_{2},\quad x_{3}=\frac{A_{11}A_{23}-A_{21}A_{13}}{A_{13}A_{31}-A_{11}A_{33}} x_{2}. \end{aligned}$$
(6.24)

If we enter the expressions (6.17) into (6.13), we obtain

$$\begin{aligned} 1-x_{2}^{2}\left( A_{12}\frac{A_{21}A_{33}-A_{31}A_{23}}{ A_{13}A_{31}-A_{11}A_{33}}+A_{22}+A_{32}\frac{A_{11}A_{23}-A_{21}A_{13}}{ A_{13}A_{31}-A_{11}A_{33}}\right) =0, \end{aligned}$$

from which we further derive

$$\begin{aligned} x_{1}^{2}= & {} \left( A_{12}\frac{A_{21}A_{33}-A_{31}A_{23}}{ A_{13}A_{31}-A_{11}A_{33}}+A_{22}+A_{32}\frac{A_{11}A_{23}-A_{21}A_{13}}{ A_{13}A_{31}-A_{11}A_{33}}\right) ^{-1} \\= & {} \left( A_{13}A_{31}-A_{11}A_{33}\right) \left( \det \mathsf {A}\right) ^{-1} \end{aligned}$$

and thus

$$\begin{aligned} x_{2}^{2}=\frac{A_{11}A_{33}-A_{13}A_{31}}{\lambda _{i1}\lambda _{i2}\lambda _{i3}}=a^{2}b^{2}c^{2}\left( A_{11}A_{33}-A_{13}A_{31}\right) , \end{aligned}$$

which finally leads to

$$\begin{aligned} x_{2}^{\mathrm {-}}= & {} x_{2}^{0}-abc\sqrt{A_{11}A_{33}-A_{13}A_{31}} \end{aligned}$$
(6.25)
$$\begin{aligned} x_{2}^{\mathrm {+}}= & {} x_{2}^{0}+abc\sqrt{A_{11}A_{33}-A_{13}A_{31}}. \end{aligned}$$
(6.26)

Similarly, for \(d=3\) we derive

$$\begin{aligned} -x_{3}\left( A_{11}x_{1}+A_{21}x_{2}+A_{31}x_{3}\right)= & {} 0 \end{aligned}$$
(6.27)
$$\begin{aligned} \ -x_{3}\left( A_{12}x_{1}+A_{22}x_{2}+A_{32}x_{3}\right)= & {} 0 \end{aligned}$$
(6.28)
$$\begin{aligned} 1-x_{3}\left( A_{13}x_{1}+A_{23}x_{2}+A_{33}x_{3}\right)= & {} 0. \\ \left( A_{11}x_{1}+A_{21}x_{2}+A_{31}x_{3}\right)= & {} 0 \nonumber \\ \left( A_{12}x_{1}+A_{22}x_{2}+A_{32}x_{3}\right)= & {} 0\nonumber \end{aligned}$$
(6.29)

At first, let us express \(x_{1}\) and \(x_{2}\) as functions of \(x_{3}\). This leads to

$$\begin{aligned} x_{1}=\frac{A_{22}A_{31}-A_{21}A_{32}}{A_{12}A_{21}-A_{11}A_{22}}x_{3},\quad x_{2}=\frac{A_{11}A_{32}-A_{12}A_{31}}{A_{12}A_{21}-A_{11}A_{22}} x_{3}. \end{aligned}$$
(6.30)

If we enter the expressions (6.30) into (6.29 ), we obtain

$$\begin{aligned}&A_{13}\frac{A_{22}A_{31}-A_{21}A_{32}}{A_{12}A_{21}-A_{11}A_{22}}+A_{23} \frac{A_{11}A_{32}-A_{12}A_{31}}{A_{12}A_{21}-A_{11}A_{22}}+A_{33}x_{3}\\&\quad 1-x_{3}^{2}\left( A_{13}\frac{A_{22}A_{31}-A_{21}A_{32}}{ A_{12}A_{21}-A_{11}A_{22}}+A_{23}\frac{A_{11}A_{32}-A_{12}A_{31}}{ A_{12}A_{21}-A_{11}A_{22}}+A_{33}\right) =0, \end{aligned}$$

from which we further derive

$$\begin{aligned} x_{3}^{2}= & {} \left( A_{13}\frac{A_{22}A_{31}-A_{21}A_{32}}{ A_{12}A_{21}-A_{11}A_{22}}+A_{23}\frac{A_{11}A_{32}-A_{12}A_{31}}{ A_{12}A_{21}-A_{11}A_{22}}+A_{33}\right) ^{-1} \\= & {} \left( A_{12}A_{21}-A_{11}A_{22}\right) \left( \det \mathsf {A}\right) ^{-1} \end{aligned}$$

and thus

$$\begin{aligned} x_{3}^{2}=\frac{A_{11}A_{22}-A_{12}A_{21}}{\lambda _{i1}\lambda _{i2}\lambda _{i3}}=a^{2}b^{2}c^{2}\left( A_{11}A_{22}-A_{12}A_{21}\right) . \end{aligned}$$

Therefore, the minimal and maximal extensions of ellipsoid i in the third dimension, \((d=3)\), reduce to

$$\begin{aligned} x_{3}^{\mathrm {-}}=\min \;\mathbf {c}^{\top }(\mathbf {x}+\mathbf {x} ^{0})=x_{3}^{0}-\sqrt{x_{3}^{2}}=x_{3}^{0}-abc\sqrt{A_{11}A_{22}-A_{12}A_{21} }\quad \end{aligned}$$
(6.31)

and

$$\begin{aligned} x_{3}^{\mathrm {+}}=x_{3}^{0}+abc\sqrt{A_{11}A_{22}-A_{12}A_{21}},\quad \end{aligned}$$
(6.32)

respectively.

1.3 Inner rectangular box

Inner rectangular boxes can be computed by maximizing the first octant volume xyz (later we multiply this by \(2^{3}\)) subject to the condition that the point (xyz) is on the ellipsoid and fulfills the equality

$$\begin{aligned} \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}+\frac{z^{2}}{c^{2}}=1. \end{aligned}$$

The Lagrangian function is

$$\begin{aligned} xyz-\lambda \left[ \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}+\frac{z^{2}}{c^{2} }-1\right] . \end{aligned}$$

The KKT are

$$\begin{aligned} yza^{2}-2\lambda x= & {} 0 \\ xzb^{2}-2\lambda y= & {} 0 \\ xyc^{2}-2\lambda z= & {} 0. \end{aligned}$$

Multiplication by y and x of the first, and z and y of the second and third equation, gives

$$\begin{aligned} y^{2}za^{2}-2\lambda xy= & {} 0 \\ x^{2}zb^{2}-2\lambda xy= & {} 0 \end{aligned}$$

and

$$\begin{aligned} xz^{2}b^{2}-2\lambda yz= & {} 0 \\ xy^{2}c^{2}-2\lambda yz= & {} 0 \end{aligned}$$

which can be reduced to

$$\begin{aligned} y^{2}za^{2}-x^{2}zb^{2}= & {} 0=y^{2}a^{2}-x^{2}b^{2} \\ xz^{2}b^{2}-xy^{2}c^{2}= & {} 0=z^{2}b^{2}-y^{2}c^{2}, \end{aligned}$$

where we have exploited that \(z\ne 0\) and \(x\ne 0\). That implies

$$\begin{aligned} \frac{x^{2}}{a^{2}}=\frac{y^{2}}{b^{2}}=\frac{z^{2}}{c^{2}}. \end{aligned}$$

Together with

$$\begin{aligned} \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}+\frac{z^{2}}{c^{2}}=1 \end{aligned}$$

we thus obtain

$$\begin{aligned} \frac{x^{2}}{a^{2}}=\frac{y^{2}}{b^{2}}=\frac{z^{2}}{c^{2}}=\frac{1}{3} \end{aligned}$$

or

$$\begin{aligned} x=\frac{1}{\sqrt{3}}a\approx 0.58a,\quad y=\frac{1}{\sqrt{3}}b\approx 0.58b,\quad z=\frac{1}{\sqrt{3}}c\approx 0.58c, \end{aligned}$$

and the volume maximal volume of the complete rectangular box is

$$\begin{aligned} v=2^{3}\left( \frac{\sqrt{3}}{3}a\right) \left( \frac{\sqrt{3}}{3}b\right) \left( \frac{\sqrt{3}}{3}c\right) =\sqrt{3}\frac{8}{9}abc\approx 1.54abc<\pi abc \end{aligned}$$

which is approximately half the volume \(\pi abc\) of the ellipsoid.

1.4 Plotting ellipsoids

Knowing the rotation-shape matrix A and the origin \(\mathbf {x}^{0}\), we exploit the ellipsoid equation

$$\begin{aligned} \mathbf {x}^{\top }\left( \begin{array}{c@{\quad }c@{\quad }c} A_{11} &{} A_{21} &{} A_{31} \\ A_{12} &{} A_{22} &{} A_{32} \\ A_{13} &{} A_{23} &{} A_{33} \end{array} \right) \mathbf {x}=1 \end{aligned}$$

to obtain \(\mathbf {x}^{\top }=(x,y,z)\) and plot the ellipsoid.

$$\begin{aligned} (x,y,z)\left( \begin{array}{c@{\quad }c@{\quad }c} A_{11} &{} A_{21} &{} A_{31} \\ A_{21} &{} A_{22} &{} A_{32} \\ A_{31} &{} A_{32} &{} A_{33} \end{array} \right) \left( \begin{array}{c} x \\ y \\ z \end{array} \right) =1 \end{aligned}$$

leads to

$$\begin{aligned} x^{2}A_{11}+y^{2}A_{22}+z^{2}A_{33}+2xyA_{21}+2xzA_{31}+2yzA_{32}= 1. \end{aligned}$$
(6.33)

If we introduce spherical coordinates (\(\theta \),\(\varphi \)) with \(-\pi /2\le \theta \le \pi /2\) and \(0\le \varphi \le 2\pi \) we get

$$\begin{aligned} \left( \begin{array}{c} X \\ Y \\ Z \end{array} \right) =\left( \begin{array}{c} \cos \theta \cos \varphi \\ \cos \theta sin \varphi \\ \sin \theta \end{array} \right) \end{aligned}$$

for the coordinates of a point (XYZ) on the unit sphere, resp.,

$$\begin{aligned} X= & {} X(\theta ,\varphi )=\cos \theta \cos \varphi \\ Y= & {} Y(\theta ,\varphi )=\cos \theta \sin \varphi \\ Z= & {} Z(\theta ,\varphi )=\sin \theta . \end{aligned}$$

Finally, with the scaling function \(\rho =\rho (\theta ,\varphi )\) we obtain the ellipsoid points

$$\begin{aligned} \left( \begin{array}{c} x^{\prime } \\ y^{\prime } \\ z^{\prime } \end{array} \right) =\rho \left( \begin{array}{c} X \\ Y \\ Z \end{array} \right) \end{aligned}$$

and from (6.33)

$$\begin{aligned} \rho ^{2}=\frac{1}{ X^{2}A_{11}+Y^{2}A_{22}+Z^{2}A_{33}+2XYA_{21}+2XZA_{31}+2YZA_{32}}. \end{aligned}$$

Note that \(\rho \) is the extension of the ellipsoid measured from the center of the ellipsoid in the direction of \((\theta ,\varphi )\). Thus, it is always positive and bounded by \(c\le \rho \le a\), if we assume that \(a\ge b\ge c\).

Considering the origin \(\mathbf {x}^{0}\), we obtain the parametric representation of the ellipsoid

$$\begin{aligned} \mathbf {x}=\mathbf {x}(\theta ,\varphi )=\left( \begin{array}{c} x \\ y \\ z \end{array} \right) =\left( \begin{array}{c} x^{0} \\ y^{0} \\ z^{0} \end{array} \right) +\rho \left( \begin{array}{c} X \\ Y \\ Z \end{array} \right) . \end{aligned}$$

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kallrath, J. Packing ellipsoids into volume-minimizing rectangular boxes. J Glob Optim 67, 151–185 (2017). https://doi.org/10.1007/s10898-015-0348-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10898-015-0348-6

Keywords

Navigation