This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Box Suite Recommendation

Stuart Rogers Email address: [email protected] or [email protected] Institute for Mathematics and its Applications, College of Science and Engineering, University of Minnesota, 207 Church ST SE, 306 Lind Hall, Minneapolis, MN 55455, USA
Abstract

An algorithm for recommending a suite of boxes for shipping a retailer’s online customer orders is presented.

Keywords: e-commerce, box suite, fitting MILP, pp-median problem, POPSTAR

1 Introduction & Literature Review

By selecting a cost-optimal suite of boxes for shipping its online customer orders, an online retailer such as Amazon, Walmart, or Target can save a significant amount of money through reduced shipping and material (i.e., corrugate, dunnage, and tape) costs [61, 60, 67, 44]. As a consequence of minimizing cost, the cost-optimal suite also reduces the box outer volume and quantity and weight of material shipped, thereby lowering the online retailer’s environmental carbon footprint [61, 60, 67, 44, 41]. An algorithm is presented that recommends such a cost-optimal suite to an online retailer.

The algorithm presented here solves a pp-median problem [12] for a cost matrix obtained by fitting a statistically significant subset of past historical customer shipments into a large set of candidate boxes. The method to solve the fitting problem presented here is based on mixed integer linear programming (MILP). Reference [16] formulates a pp-median problem to solve the box suite recommendation problem when each box is filled with as many copies of a single product as possible (however a particular box may be used for several different products); [16] also assumes that each product is packed into the box in identical layers with the height dimension placed vertically, which makes the fitting problem trivial. Reference [6] also formulates a pp-median problem to solve the box suite recommendation problem; however, [6] uses a heuristic approach to solve the fitting problem. Reference [6] solves the pp-median problem via MILP for small problems and via Lagrangian relaxation for large problems. Unlike previous works, the algorithm presented here modifies the pp-median problem to lock certain candidate boxes in the suite and handles special fitting constraints, including requirements that certain items be height-oriented and/or bottom-resting when packed. Also, unlike previous works, the algorithm presented here suggests two freely available, robust solvers, POPSTAR [51] and dc2 [14], which are capable of efficiently solving the large pp-median problems formulated by the algorithm.

Reference [61] solves the box suite recommendation problem by applying an evolutionary algorithm to a statistically significant subset of historical orders, but [61] does not formulate the fitting problem and does not formulate a pp-median problem. Instead of selecting from a large set of candidate boxes, the iterative evolutionary algorithm varies the dimensions of the boxes in the suite in each iteration. Of note, reference [61] uses stratified random sampling [39], instead of simple random sampling, to obtain a very small sample size, just 2,700 sample orders selected from 8 million historical orders; this small sample size enables enormous reductions in computation time compared to the sample size obtained from simple random sampling.

Reference [2] solves the box suite recommendation problem using distributions rather than real order data. Reference [2] assumes that products must be height-oriented and bottom-resting when packed into a box so that the products only occupy a single layer and only a 2D fitting problem needs to be solved. Since products are packed in a single layer, the height of each box in the set of candidate boxes is fixed, so that only the candidate box lengths and widths vary. Reference [2] also assumes that an order must often be split among several boxes during the packing process because the order cannot fit entirely in a single box; in this work, order splits are ignored because the retailer funding this research rarely has to split orders. Reference [2] uses heuristics for the container loading problem and the bin packing problem to solve the 2D fitting problem.

2 Notation

\mathbb{Z} denotes the set of integers, 2{0,1}\mathbb{Z}_{2}\equiv\left\{0,1\right\} denotes the set of binary numbers, \mathbb{N} denotes the set of natural numbers, which is the same as the set of positive integers, and 0{0}\mathbb{N}_{0}\equiv\mathbb{N}\cup\left\{0\right\} denotes the set of nonnegative integers. If m,n0m,n\in\mathbb{N}_{0}, {m:n}{i0:min}\left\{m:n\right\}\equiv\left\{i\in\mathbb{N}_{0}\colon m\leq i\leq n\right\} denotes the set of nonnegative integers greater than or equal to mm and less than or equal to nn. If NN\in\mathbb{N}, N{1,2,,N}={1:N}\llbracket N\rrbracket\equiv\{1,2,\dots,N\}=\left\{1:N\right\} denotes the set of natural numbers from 11 to NN. \mathbb{R} denotes the set of real numbers, >0\mathbb{R}_{>0} denotes the set of positive real numbers, 0>0{0}\mathbb{R}_{\geq 0}\equiv\mathbb{R}_{>0}\cup\left\{0\right\} denotes the set of nonnegative real numbers, and [0,1]{w:0w1}=[0,1]\mathbb{R}_{\left[0,1\right]}\equiv\left\{w\in\mathbb{R}\colon 0\leq w\leq 1\right\}=\mathbb{R}\cap\left[0,1\right] denotes the set of real numbers in the closed interval [0,1]\left[0,1\right]. If NN\in\mathbb{N}, {an}n=1N\left\{a_{n}\right\}_{n=1}^{N}\subset\mathbb{R}, and ww\in\mathbb{R}, SearchSortedFirst({an}n=1N,w)\textsc{SearchSortedFirst}\left(\left\{a_{n}\right\}_{n=1}^{N},w\right) finds the index of the first value in {an}n=1N\left\{a_{n}\right\}_{n=1}^{N} that is greater than or equal to ww and assumes that the values in {an}n=1N\left\{a_{n}\right\}_{n=1}^{N} are sorted in nondecreasing order. If ww is greater than all values in {an}n=1N\left\{a_{n}\right\}_{n=1}^{N}, then N+1N+1 is returned. The complexity of SearchSortedFirst is O(logN)O\left(\log N\right) if binary search is used and is O(1)O(1) if the algorithm in [7] is used. If a1,a2,a3a_{1},a_{2},a_{3}\in\mathbb{R}, sort(a1,a2,a3)\textsc{sort}\left(a_{1},a_{2},a_{3}\right) returns a permutation (b1,b2,b3)\left(b_{1},b_{2},b_{3}\right) of (a1,a2,a3)\left(a_{1},a_{2},a_{3}\right) such that b1b2b3b_{1}\geq b_{2}\geq b_{3}. Having only 3 inputs, the complexity of sort is O(1)O(1). Given an array of integers WW\subset\mathbb{N} and an integer ii\in\mathbb{N}, push(W,i)\textsc{push}\left(W,i\right) appends ii to the end of the array WW. The complexity of push is O(1)O(1) if an appropriately implemented data structure is utilized to store the array of integers.

3 Algorithm

Algorithm 1 Box Suite Recommendation Part I

Input: Box suite size pp. II shipments. Each shipment iIi\in\llbracket I\rrbracket consists of NiN_{i} 3D rectangular cartons with outer lengths, widths, and heights {(pin,qin,rin)}n=1Ni\left\{\left(p_{in},q_{in},r_{in}\right)\right\}_{n=1}^{N_{i}} and MiM_{i} foldable items with outer lengths, widths, and heights {(sim,tim,uim)}m=1Mi\left\{\left(s_{im},t_{im},u_{im}\right)\right\}_{m=1}^{M_{i}}. JJ candidate boxes, where J>pJ>p, sorted by nondecreasing inner volume with inner lengths, widths, and heights {(xj,yj,zj)}j=1J\left\{\left(x_{j},y_{j},z_{j}\right)\right\}_{j=1}^{J} and inner volumes {Vj=xjyjzj}j=1J\left\{V_{j}=x_{j}y_{j}z_{j}\right\}_{j=1}^{J}. For jJ1j\in\llbracket J-1\rrbracket, VjVj+1V_{j}\leq V_{j+1}. A subset TJT\subset\llbracket J\rrbracket of the candidate boxes, where |T|=k{0,1,2,,p1}\left|T\right|=k\in\left\{0,1,2,\ldots,p-1\right\}, must be in the box suite.
Output: A subset SJS^{*}\subset\llbracket J\rrbracket of the candidate boxes such that SS^{*} ships all the packable shipments with minimum cost, subject to the constraints |S|=p\left|S^{*}\right|=p and TST\subset S^{*}. If such a subset does not exist, then Ø\O is returned.

1:for j=1j=1 to JJ do \triangleright Iterate over candidate boxes.
2:     (x~j,y~j,z~j)Sort(xj,yj,zj)\left(\tilde{x}_{j},\tilde{y}_{j},\tilde{z}_{j}\right)\leftarrow\textsc{Sort}\left(x_{j},y_{j},z_{j}\right) \triangleright Sort box inner dimensions in nonincreasing order.
3:end for
\triangleright \eqparboxCOMMENTDetermine into which candidate boxes each candidate box nests.
4:for j=1j=1 to JJ do \triangleright Iterate over candidate boxes.
5:     Θj{j}\Theta_{j}\leftarrow\left\{j\right\} \triangleright Θj\Theta_{j} stores the set of boxes into which box jj nests.
6:     for kj+1k\leftarrow j+1 to JJ do \triangleright Iterate over equal or larger volume candidate boxes.
7:         if (x~jx~k)(y~jy~k)(z~jz~k)\left(\tilde{x}_{j}\leq\tilde{x}_{k}\right)\wedge\left(\tilde{y}_{j}\leq\tilde{y}_{k}\right)\wedge\left(\tilde{z}_{j}\leq\tilde{z}_{k}\right) then \triangleright If box jj nests inside box kk.
8:              push(Θj,k)\textsc{push}\left(\Theta_{j},k\right)
9:         end if
10:     end for
11:end for
\triangleright \eqparboxCOMMENTConstruct the I×JI\times J fitting matrix BB and determine the packable shipments.
12:I^0\hat{I}\leftarrow 0 \triangleright Initialize the number of packable shipments to 0.
13:WØW\leftarrow\O \triangleright WW stores the indices of shipments that are packable.
14:B𝟎I×JB\leftarrow\mathbf{0}_{I\times J} \triangleright Initialize each entry of the fitting matrix to zero.
15:for i=1i=1 to II do \triangleright Iterate over shipments.
16:     vin=1Nipinqinrin+m=1Misimtimuimv_{i}\leftarrow\sum_{n=1}^{N_{i}}p_{in}q_{in}r_{in}+\sum_{m=1}^{M_{i}}s_{im}t_{im}u_{im} \triangleright Liquid volume of shipment ii.
17:     j0SearchSortedFirst({Vj}j=1J,vi)j_{0}\leftarrow\textsc{SearchSortedFirst}\left(\left\{V_{j}\right\}_{j=1}^{J},v_{i}\right) \triangleright Find the smallest box whose inner volume vi\geq v_{i}.
18:     if j0=J+1j_{0}=J+1 then continue\triangleright This shipment does fit into any box, so skip to the next shipment.
19:     end if
20:     if Ni=0N_{i}=0 then \triangleright Only foldable items in the shipment.
21:         Bi{j0:J}𝟏1×(Jj0+1)B_{i\left\{j_{0}:J\right\}}\leftarrow\mathbf{1}_{1\times\left(J-j_{0}+1\right)}
22:         continue\triangleright Skip to the next shipment.
23:     end if
24:     for n=1n=1 to NiN_{i} do \triangleright Iterate over cartons in shipment ii.
25:         (p~in,q~in,r~in)Sort(pin,qin,rin)\left(\tilde{p}_{in},\tilde{q}_{in},\tilde{r}_{in}\right)\leftarrow\textsc{Sort}\left(p_{in},q_{in},r_{in}\right) \triangleright Sort carton outer dimensions in nonincreasing order.
26:     end for
27:     p̊in=1Nip~inq̊in=1Niq~inr̊in=1Nir~in\mathring{p}_{i}\leftarrow\sum_{n=1}^{N_{i}}\tilde{p}_{in}\quad\quad\mathring{q}_{i}\leftarrow\sum_{n=1}^{N_{i}}\tilde{q}_{in}\quad\quad\mathring{r}_{i}\leftarrow\sum_{n=1}^{N_{i}}\tilde{r}_{in}
28:     p^imax1nNip~inq^imax1nNiq~inr^imax1nNir~in\hat{p}_{i}\leftarrow\max_{1\leq n\leq N_{i}}\tilde{p}_{in}\quad\quad\hat{q}_{i}\leftarrow\max_{1\leq n\leq N_{i}}\tilde{q}_{in}\quad\quad\hat{r}_{i}\leftarrow\max_{1\leq n\leq N_{i}}\tilde{r}_{in}
29:     for j=j0j=j_{0} to JJ do \triangleright Iterate over candidate boxes whose inner volume vi\geq v_{i}.
30:         if Bij=1B_{ij}=1 then continue\triangleright Skip to the next candidate box.
31:         else if (p^ix~j)(q^iy~j)(r^iz~j)\left(\hat{p}_{i}\leq\tilde{x}_{j}\right)\wedge\left(\hat{q}_{i}\leq\tilde{y}_{j}\right)\wedge\left(\hat{r}_{i}\leq\tilde{z}_{j}\right) then \triangleright Each carton in shipment ii must fit in box jj.
32:              if Ni=1N_{i}=1 then BiΘj𝟏1×|Θj|B_{i\Theta_{j}}\leftarrow\mathbf{1}_{1\times\left|\Theta_{j}\right|} \triangleright Only 1 carton in the shipment.
33:              else if (p̊ix~j)(q̊iy~j)(r̊iz~j)\left(\mathring{p}_{i}\leq\tilde{x}_{j}\right)\vee\left(\mathring{q}_{i}\leq\tilde{y}_{j}\right)\vee\left(\mathring{r}_{i}\leq\tilde{z}_{j}\right) then BiΘj𝟏1×|Θj|B_{i\Theta_{j}}\leftarrow\mathbf{1}_{1\times\left|\Theta_{j}\right|} \triangleright Try stacking.
              \triangleright \eqparboxCOMMENTSolve the NP-complete fitting MILP, e.g., with CPLEX or Gurobi.
34:              else if FittingMILP({(pin,qin,rin)}n=1Ni,(xj,yj,zj))\textsc{FittingMILP}\left(\left\{\left(p_{in},q_{in},r_{in}\right)\right\}_{n=1}^{N_{i}},\left(x_{j},y_{j},z_{j}\right)\right) then BiΘj𝟏1×|Θj|B_{i\Theta_{j}}\leftarrow\mathbf{1}_{1\times\left|\Theta_{j}\right|}
35:              end if
36:         end if
37:     end for
38:     if j=1JBij=1\bigvee_{j=1}^{J}B_{ij}=1 then \triangleright Ignore shipments that cannot be packed into any candidate box.
39:         I^=I^+1\hat{I}=\hat{I}+1 \triangleright I^\hat{I} stores the number of packable shipments encountered so far.
40:         JI^{jJ:Bij=1}J_{\hat{I}}\leftarrow\left\{j\in\llbracket J\rrbracket\colon B_{ij}=1\right\} \triangleright Find the subset of candidate boxes into which shipment ii fits.
41:         push(W,i)\textsc{push}\left(W,i\right) \triangleright Add shipment ii to the set of packable shipments.
42:     end if
43:end for
Algorithm 1 Box Suite Recommendation Part II
\triangleright \eqparboxCOMMENTConstruct the (I^+k)×J\left(\hat{I}+k\right)\times J cost matrix CC.
44:C𝟎(I^+k)×JC\leftarrow\boldsymbol{0}_{\left(\hat{I}+k\right)\times J} \triangleright Preallocate memory for a I^+k\hat{I}+k by JJ cost matrix.
45:for i=1i=1 to I^\hat{I} do \triangleright Iterate over packable shipments.
46:     for jJij\in J_{i} do \triangleright Iterate over the subset of candidate boxes into which packable shipment ii fits.
47:         Compute the cost CijC_{ij} of shipping packable shipment ii (shipment WiW_{i}) in candidate box jj.
48:     end for
49:end for
50:Γ[i=1I^maxjJiCij]+1\Gamma\leftarrow\left[\sum_{i=1}^{\hat{I}}\max_{j\in J_{i}}C_{ij}\right]+1 \triangleright Set the penalty cost Γ\Gamma to a sufficiently large positive real number.
51:for i=1i=1 to I^\hat{I} do \triangleright Iterate over packable shipments.
52:     Ci[JJi]𝚪1×(J|Ji|)C_{i\left[J\setminus J_{i}\right]}\leftarrow\boldsymbol{\Gamma}_{1\times\left(J-\left|J_{i}\right|\right)} \triangleright Packable shipment ii ships with penalty cost Γ\Gamma in boxes into which it does not fit.
53:end for
54:for i=I^+1i=\hat{I}+1 to I^+k\hat{I}+k do \triangleright Iterate over fake shipments.
55:     CiTiI^0C_{iT_{i-\hat{I}}}\leftarrow 0 \triangleright Fake shipment ii ships for free in box TiI^T_{i-\hat{I}}.
56:     Ci[J{TiI^}]𝚪1×(J1)C_{i\left[J\setminus\left\{T_{i-\hat{I}}\right\}\right]}\leftarrow\boldsymbol{\Gamma}_{1\times\left(J-1\right)} \triangleright Fake shipment ii ships with penalty cost Γ\Gamma in all other boxes.
57:end for
58:SargminSJ,|S|=pi=1I^+kminjSCijS^{*}\leftarrow\underset{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij} \triangleright Solve the NP-hard pp-median problem, e.g., with POPSTAR or dc2.
59:Φi=1I^+kminjSCij\Phi\leftarrow\sum_{i=1}^{\hat{I}+k}\min_{j\in S^{*}}C_{ij} \triangleright Compute the cost of using SS^{*} to ship the packable shipments.
60:if ΦΓ\Phi\geq\Gamma then
61:     return Ø\O \triangleright There is no feasible solution, so return the empty set.
62:else
63:     return SS^{*} \triangleright Return a cost-optimal suite.
64:end if

Problem Description and Inputs

An online retailer needs a suite of pp\in\mathbb{N} boxes to ship its online customer orders. Moreover, k{0}p1={0:p1}k\in\{0\}\cup\llbracket p-1\rrbracket=\left\{0:p-1\right\} boxes in the suite may be prescribed (or locked). For example, the online retailer may need some special boxes for shipping liquid-containing items such as liquid detergent. To save money, the online retailer wants such a suite that minimizes total shipping (shipping plus material) cost. One approach to designing this suite is to select II\in\mathbb{N} historical customer shipments and JJ\in\mathbb{N} candidate boxes, where J>pJ>p. Each historical customer shipment is assigned a unique index iIi\in\llbracket I\rrbracket, and each candidate box is assigned a unique index jJj\in\llbracket J\rrbracket. The set of historical customer shipments should be a small, but statistically significant, randomly sampled subset of the online retailer’s past (e.g., within the previous year) online customer shipments. Each historical customer shipment iIi\in\llbracket I\rrbracket consists of Ni0N_{i}\in\mathbb{N}_{0} 3D rectangular cartons with positive outer lengths, widths, and heights {(pin,qin,rin)}n=1Ni\left\{\left(p_{in},q_{in},r_{in}\right)\right\}_{n=1}^{N_{i}}, where (pin,qin,rin)>03\left(p_{in},q_{in},r_{in}\right)\in\mathbb{R}_{>0}^{3} for iIi\in\llbracket I\rrbracket and nNin\in\llbracket N_{i}\rrbracket, and Mi0M_{i}\in\mathbb{N}_{0} foldable items with positive outer lengths, widths, and heights {(sim,tim,uim)}m=1Mi\left\{\left(s_{im},t_{im},u_{im}\right)\right\}_{m=1}^{M_{i}}, where (sim,tim,uim)>03\left(s_{im},t_{im},u_{im}\right)\in\mathbb{R}_{>0}^{3} for iIi\in\llbracket I\rrbracket and mMim\in\llbracket M_{i}\rrbracket. For the purposes of packing, foldable items are assumed to be liquid so that they may be deformed to fit into arbitrarily-shaped empty spaces inside a box. The set of JJ candidate boxes should finely discretize the space of all possible boxes and must include the kk locked boxes that must be in the suite. The indices of those kk locked boxes are prescribed in the subset TJT\subset\llbracket J\rrbracket, where |T|=k\left|T\right|=k. Each candidate box jJj\in\llbracket J\rrbracket is characterized by a positive inner length, width, and height (xj,yj,zj)>03\left(x_{j},y_{j},z_{j}\right)\in\mathbb{R}_{>0}^{3}. Therefore, the inner volume of candidate box jJj\in\llbracket J\rrbracket is Vj=xjyjzj>0V_{j}=x_{j}y_{j}z_{j}\in\mathbb{R}_{>0}. It is assumed that the candidate boxes are sorted by nondecreasing inner volume, which may be realized in O(JlogJ)O\left(J\log J\right), so that VjVj+1V_{j}\leq V_{j+1} for jJ1j\in\llbracket J-1\rrbracket. The optimal suite is obtained by selecting a subset SJS\subset\llbracket J\rrbracket of the JJ boxes, such that |S|=p\left|S\right|=p and TST\subset S, that ships the I^\hat{I} packable shipments, where I^I\hat{I}\leq I (since not all of the II shipments necessarily fit in the JJ candidate boxes), with minimum cost. Algorithm (1) gives a method for solving this optimization problem. The next few paragraphs describe the key parts of Algorithm (1).

Fitting Matrix

The algorithm begins by sorting each box’s dimensions in nonincreasing order. Then, the algorithm determines whether each shipment fits into each candidate box, recording the result in the binary fitting matrix B2I×JB\in\mathbb{Z}_{2}^{I\times J}. It is simple to solve the fitting problem when there are 0 or 1 cartons in the shipment. There are brute force algorithms for solving the fitting problem for 2 and 3 cartons in the shipment, but these are omitted from the algorithm for conciseness. For 2 or more cartons in the shipment, the algorithm first attempts to stack the cartons along each of the box’s three orthogonal axes, to see if they fit. If simple stacking does not work, then the algorithm uses the fitting MILP, a feasibility MILP described in Section 4, to solve the fitting problem. Since the fitting MILP must be solved via a third-party MILP solver, which may require a commercial license and which is computationally expensive, substantial run time improvements can be realized by utilizing the brute force fitting algorithms for 2 and 3 cartons. The source code accompanying [43] provides implementations of the brute force algorithms for 2 and 3 cartons; however, the algorithms presented in that code must be modified to permit rotations.

Also note that in order for a shipment to fit into a candidate box, the box’s inner volume must be greater than or equal to the shipment’s liquid volume and each individual carton in the shipment must fit inside the box. For efficiency, the algorithm checks that these necessary conditions are satisfied first before attempting to solve the stacking problem or fitting MILP when there are 2 or more cartons in the shipment. Moreover, if brute force fitting algorithms for 2 and 3 cartons are available, these may be used to check that all pairs and all triples of cartons fit inside the box before attempting to solve the stacking problem or fitting MILP.

Cost Matrix

Next, the algorithm removes shipments that could not be packed into any candidate box, leaving I^I\hat{I}\leq I packable shipments. For each packable shipment iI^i\in\llbracket\hat{I}\rrbracket, JiJJ_{i}\subset J denotes the set of candidate boxes into which packable shipment ii fits. Then, the algorithm constructs the nonnegative cost matrix C0(I^+k)×JC\in\mathbb{R}_{\geq 0}^{\left(\hat{I}+k\right)\times J} which records the cost of shipping each packable shipment into each candidate box. If packable shipment iI^i\in\llbracket\hat{I}\rrbracket fits in candidate box jJj\in\llbracket J\rrbracket (i.e., if jJij\in J_{i}), the cost Cij0C_{ij}\in\mathbb{R}_{\geq 0} to ship packable shipment iI^i\in\llbracket\hat{I}\rrbracket in candidate box jJj\in\llbracket J\rrbracket is computed. Note that in order to compute the cost for packable shipment iI^i\in\llbracket\hat{I}\rrbracket, the data for shipment WiIW_{i}\in\llbracket I\rrbracket is needed; that is, WiW_{i} is the shipment index of packable shipment ii. The data for shipment WiIW_{i}\in\llbracket I\rrbracket may include the outer dimensions and weights of each item, the shipping carrier (e.g., USPS, FedEx, or UPS), the shipping service (e.g., 1 day, 2 day, or 3 day), and the shipping zone, which is determined by the locations of the shipping store or warehouse and the customer. The cost is computed via a detailed formula, which is omitted here, that depends on the shipping cost charged by the carrier and service combination, the cost of the corrugate used to construct the box, the cost to transport the box blank from the box manufacturer to the ratailer’s stores or warehouses, the cost of the dunnage used to fill the empty space between the packed shipment and the box’s interior, and the cost of the tape used to seal the top and bottom flaps of the box shut. More simply, if instead of minimizing cost, the online retailer wishes to minimize box outer (or inner) volume shipped or material weight shipped, then CijC_{ij} is the outer (or inner) volume of box jj or the weight of the material (corrugate, dunnage, and tape) used to ship packable shipment ii in box jj, respectively.

Let Γ>0\Gamma\in\mathbb{R}_{>0} be a sufficiently large positive real number such as [i=1I^maxjJiCij]+1>0\left[\sum_{i=1}^{\hat{I}}\max_{j\in J_{i}}C_{ij}\right]+1\in\mathbb{R}_{>0}. The constant Γ\Gamma serves as a penalty cost to impose constraints on the solution suite SS. In order to ensure that the solution suite SS ships all the packable shipments, CijC_{ij} is set to Γ\Gamma if packable shipment ii does not fit in candidate box jj, i.e., if jJJij\in\llbracket J\rrbracket\setminus J_{i}. In order to force the boxes in TT into the solution suite SS, kk fake shipments are appended to the set of packable shipments and kk rows are added to the bottom of CC, where each row, indexed by i{I^+1,I^+2,,I^+k}i\in\left\{\hat{I}+1,\hat{I}+2,\ldots,\hat{I}+k\right\}, stores the shipping costs for a fake shipment representing box TiI^T_{i-\hat{I}}. The cost of shipping the fake shipment indexed by i{I^+1,I^+2,,I^+k}i\in\left\{\hat{I}+1,\hat{I}+2,\ldots,\hat{I}+k\right\} in box TiI^T_{i-\hat{I}} is 0 and in all other boxes is Γ\Gamma. That is, CiTiI^=0C_{iT_{i-\hat{I}}}=0 and Cij=ΓC_{ij}=\Gamma for jJ{TiI^}j\in\llbracket J\rrbracket\setminus\left\{T_{i-\hat{I}}\right\}.

Formulate the pp-Median Problem

The optimization problem that must be solved is

argminTSJ,|S|=p,JiSØiI^i=1I^minjJiSCij.\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}}\min_{j\in J_{i}\cap S}C_{ij}. (3.1)

Instead, the following optimization problem is solved:

argminSJ,|S|=pi=1I^+kminjSCij.\underset{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}. (3.2)

The optimization problem (3.2) is an instance of the pp-median problem [21, 22, 12], or more precisely the pp-facility location problem [11]. In the literature, the pp-median problem is sometimes also called the kk-median problem [27, 28, 3]. Given nn\in\mathbb{N} customers, mm\in\mathbb{N} candidate facilities, pmp\in\llbracket m\rrbracket candidate facilities to open, and nonnegative costs d0n×md\in\mathbb{R}_{\geq 0}^{n\times m}, where dijd_{ij} is the cost of serving customer ini\in\llbracket n\rrbracket with candidate facility jmj\in\llbracket m\rrbracket, the pp-median problem is to find (or open) a subset SmS\subset\llbracket m\rrbracket comprised of pp candidate facilities that serves all the customers with minimum cost, that is, that minimizes the sum of the costs of serving each customer with its minimum cost open facility. Mathematically, the pp-median problem is

argminSm,|S|=pi=1nminjSdij.\underset{\begin{subarray}{c}S\subset\llbracket m\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{n}\min_{j\in S}d_{ij}. (3.3)

To equate (3.2) to (3.3), the shipments are the customers, the boxes are the facilities, I^+k=n\hat{I}+k=n, J=mJ=m, and C=dC=d.

The equivalence of (3.1) and (3.2) is established as follows.

Lemma 1.

(3.1) does not have a solution if and only if

minSJ,|S|=pi=1I^+kminjSCijΓ.\min_{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}\geq\Gamma. (3.4)
Proof.

If

minSJ,|S|=pi=1I^+kminjSCijΓ,\min_{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}\geq\Gamma, (3.5)

then, by construction of Γ\Gamma and CC, SJ\forall S\subset\llbracket J\rrbracket such that |S|=p\left|S\right|=p, TST\not\subset S or iI^JiS=Ø\exists i\in\llbracket\hat{I}\rrbracket\ni J_{i}\cap S=\O. To see this explicity, suppose that SJ\exists S^{*}\subset\llbracket J\rrbracket such that |S|=p\left|S^{*}\right|=p, TST\subset S^{*}, and iI^JiSØ\forall i\in\llbracket\hat{I}\rrbracket\;J_{i}\cap S^{*}\neq\O. Then

i=1I^+kminjSCij=i=1I^minjSCij+i=I^+1I^+kminjSCij=i=1I^minjSCij=i=1I^minjJiSCiji=1I^maxjJiCij<Γ,\sum_{i=1}^{\hat{I}+k}\min_{j\in S^{*}}C_{ij}=\sum_{i=1}^{\hat{I}}\min_{j\in S^{*}}C_{ij}+\sum_{i=\hat{I}+1}^{\hat{I}+k}\min_{j\in S^{*}}C_{ij}=\sum_{i=1}^{\hat{I}}\min_{j\in S^{*}}C_{ij}=\sum_{i=1}^{\hat{I}}\min_{j\in J_{i}\cap S^{*}}C_{ij}\leq\sum_{i=1}^{\hat{I}}\max_{j\in J_{i}}C_{ij}<\Gamma, (3.6)

which contradicts (3.5). The second equality in (3.6) holds because TST\subset S^{*} implies that minjSCij=CiTiI^=0i{I^+1,I^+2,,I^+k}\min_{j\in S^{*}}C_{ij}=C_{iT_{i-\hat{I}}}=0\quad\forall i\in\left\{\hat{I}+1,\hat{I}+2,\ldots,\hat{I}+k\right\}. The third equality in (3.6) holds because S=(JiS)((JJi)S)S^{*}=\left(J_{i}\cap S^{*}\right)\cup\left(\left(\llbracket J\rrbracket\setminus J_{i}\right)\cap S^{*}\right), Cij<ΓjJiC_{ij}<\Gamma\;\forall j\in J_{i}, Cij=ΓjJJiC_{ij}=\Gamma\;\forall j\in\llbracket J\rrbracket\setminus J_{i}, and JiSØiI^J_{i}\cap S^{*}\neq\O\;\forall i\in\llbracket\hat{I}\rrbracket. In this case, there does not exist a solution to (3.1).

Conversely, if there does not exist a solution to (3.1), then SJ\forall S\subset\llbracket J\rrbracket such that |S|=p\left|S\right|=p, TST\not\subset S or iI^JiS=Ø\exists i\in\llbracket\hat{I}\rrbracket\ni J_{i}\cap S=\O. Therefore, by construction of CC, SJ\forall S\subset\llbracket J\rrbracket such that |S|=p\left|S\right|=p, iI^+kminjSCij=Γ\exists i\in\llbracket\hat{I}+k\rrbracket\ni\min_{j\in S}C_{ij}=\Gamma. Hence, SJ\forall S\subset\llbracket J\rrbracket such that |S|=p\left|S\right|=p,

i=1I^+kminjSCijΓ,\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}\geq\Gamma, (3.7)

so that

minSJ,|S|=pi=1I^+kminjSCijΓ.\min_{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}\geq\Gamma. (3.8)

The contrapositive of Lemma (1) gives the following corollary.

Corollary.

(3.1) has a solution if and only if

minSJ,|S|=pi=1I^+kminjSCij<Γ.\min_{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}<\Gamma. (3.9)
Lemma 2.

If

minSJ,|S|=pi=1I^+kminjSCij<Γ,\min_{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}<\Gamma, (3.10)

that is, if (3.1) has a solution, then

argminTSJ,|S|=p,JiSØiI^i=1I^minjJiSCij=argminSJ,|S|=pi=1I^+kminjSCij.\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}}\min_{j\in J_{i}\cap S}C_{ij}=\underset{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}. (3.11)
Proof.

If the inequality (3.10) holds, then, by construction of CC, SargminSJ,|S|=pi=1I^+kminjSCij\forall S^{*}\in\underset{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij} the following properties hold:

  1. (a)

    TST\subset S^{*}

  2. (b)

    JiSØiI^J_{i}\cap S^{*}\neq\O\;\forall i\in\llbracket\hat{I}\rrbracket.

Consequently,

argminSJ,|S|=pi=1I^+kminjSCij=argminTSJ,|S|=p,JiSØiI^i=1I^+kminjSCij=argminTSJ,|S|=p,JiSØiI^[i=1I^minjSCij+i=I^+1I^+kminjSCij]=argminTSJ,|S|=p,JiSØiI^i=1I^minjSCij=argminTSJ,|S|=p,JiSØiI^i=1I^minjJiSCij.\begin{split}\underset{\begin{subarray}{c}S\subset\llbracket J\rrbracket,\,\left|S\right|=p\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}&=\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}+k}\min_{j\in S}C_{ij}\\ &=\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\left[\sum_{i=1}^{\hat{I}}\min_{j\in S}C_{ij}+\sum_{i=\hat{I}+1}^{\hat{I}+k}\min_{j\in S}C_{ij}\right]\\ &=\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}}\min_{j\in S}C_{ij}\\ &=\underset{\begin{subarray}{c}T\subset S\subset\llbracket J\rrbracket,\,\left|S\right|=p,\\ J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket\end{subarray}}{\operatorname{arg}\,\operatorname{min}}\;\sum_{i=1}^{\hat{I}}\min_{j\in J_{i}\cap S}C_{ij}.\end{split} (3.12)

The first equality follows from properties (a) and (b). The third equality holds because TST\subset S implies that minjSCij=CiTiI^=0i{I^+1,I^+2,,I^+k}\min_{j\in S}C_{ij}=C_{iT_{i-\hat{I}}}=0\quad\forall i\in\left\{\hat{I}+1,\hat{I}+2,\ldots,\hat{I}+k\right\}. The fourth equality holds because S=(JiS)((JJi)S)S=\left(J_{i}\cap S\right)\cup\left(\left(\llbracket J\rrbracket\setminus J_{i}\right)\cap S\right), Cij<ΓjJiC_{ij}<\Gamma\;\forall j\in J_{i}, Cij=ΓjJJiC_{ij}=\Gamma\;\forall j\in\llbracket J\rrbracket\setminus J_{i}, and JiSØiI^J_{i}\cap S\neq\O\;\forall i\in\llbracket\hat{I}\rrbracket. ∎

In summary, if (3.2) does not have a solution with cost less than Γ\Gamma, then (3.1) does not have a solution, and if (3.2) does have a solution with cost less than Γ\Gamma, then (3.1) has a solution and the solution set realized by (3.1) equals that realized by (3.2).

Solving the pp-Median Problem

The pp-median problem is NP-hard [36]. There are many methods to solve the pp-median problem including MILP, Lagrangian relaxation, heuristics (e.g., myopic algorithm, neighborhood search, exchange algorithm, Lin–Kernighan neighborhood exchange algorithm), metaheuristics (e.g., simulated annealing, genetic algorithm, tabu search, heuristic concentration, variable neighborhood search, ant colony optimization, scatter search, and GRASP), and hyper-heuristics [12, 13, 38, 54, 45, 55].

The exchange algorithm [62] is a simple heuristic which starts with a feasible solution SS comprised of pp candidate facilities and finds a pair of facilities, aSa\in S and bS𝖼b\in S^{\mathsf{c}}, such that the new feasible solution (S{a}){b}\left(S\setminus\left\{a\right\}\right)\cup\left\{b\right\} decreases the cost of serving all the customers compared to the original feasible solution SS. This exchange or swapping procedure is repeated iteratively until no further improvement is realized, depending on the definition of the local neighborhood about a feasible solution. There are several variations of the exchange algorithm which search over different local neighborhoods, including the first improvement [66], best improvement [23], and Lin–Kernighan [37] neighborhoods. Moreover, there are several efficient implementations of the exchange algorithm [66, 15, 23, 57] which provide significant computational savings compared to a naïve implementation. Due to its simplicity, the exchange algorithm is only effective at solving very small instances of the pp-median problem. However, the exchange algorithm is often used as a local search algorithm by other more complicated solution methods, such as Lagrangian relaxation and metaheuristics.

Given nn\in\mathbb{N} customers, mm\in\mathbb{N} candidate facilities, pmp\in\llbracket m\rrbracket candidate facilities to open, and nonnegative costs d0n×md\in\mathbb{R}_{\geq 0}^{n\times m}, where dijd_{ij} is the cost of serving customer ini\in\llbracket n\rrbracket with candidate facility jmj\in\llbracket m\rrbracket, the MILP formulation of the pp-median problem (3.3) is [13, 38]

minx,yi=1nj=1mdijxij - minimize the cost of serving all the customers subject to the following constraints:yj{0,1}jm, - whether candidate facility j is openxij0injm, - whether customer i is served by candidate facility jj=1myj=p, - open p candidate facilitiesj=1mxij=1in, - each customer must be served by exactly one candidate facilityxijyjinjm. - if candidate facility j is closed, no customer can be served by it\begin{split}\min_{x,y}\sum_{i=1}^{n}&\sum_{j=1}^{m}d_{ij}x_{ij}\quad\ni\quad\textrm{ {\tiny- minimize the cost of serving all the customers subject to the following constraints:}}\\ &y_{j}\in\{0,1\}\quad\forall j\in\llbracket m\rrbracket,\quad\textrm{ {\tiny- whether candidate facility $j$ is open}}\\ &x_{ij}\geq 0\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket,\quad\textrm{ {\tiny- whether customer $i$ is served by candidate facility $j$}}\\ &\sum_{j=1}^{m}y_{j}=p,\quad\textrm{ {\tiny- open $p$ candidate facilities}}\\ &\sum_{j=1}^{m}x_{ij}=1\quad\forall i\in\llbracket n\rrbracket,\quad\textrm{ {\tiny- each customer must be served by exactly one candidate facility}}\\ &x_{ij}\leq y_{j}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket.\quad\textrm{ {\tiny- if candidate facility $j$ is closed, no customer can be served by it}}\end{split} (3.13)

In (3.13), y2my\in\mathbb{Z}_{2}^{m} determines which candidate facilities are open and x[0,1]n×mx\in\mathbb{R}_{\left[0,1\right]}^{n\times m} determines which open facility is assigned to each customer. (3.13) formulates x[0,1]n×mx\in\mathbb{R}_{\left[0,1\right]}^{n\times m} instead of x2n×mx\in\mathbb{Z}_{2}^{n\times m}, because the former imposes far fewer integrality constraints and therefore is much more computationally tractable for a MILP solver. However, in the solution of (3.13), xijx_{ij} may not be 0 or 1 if customer ini\in\llbracket n\rrbracket may be served by more than one open facility with the same minimum cost. It is trivial to transform a solution x[0,1]n×mx\in\mathbb{R}_{\left[0,1\right]}^{n\times m} of (3.13) into an equivalent solution x~2n×m\tilde{x}\in\mathbb{Z}_{2}^{n\times m} as follows. Let S{jm:yj=1}mS\equiv\left\{j\in\llbracket m\rrbracket\colon y_{j}=1\right\}\subset\llbracket m\rrbracket denote the open facilities in the solution of (3.13). Then, for each ini\in\llbracket n\rrbracket, let

jiargminkSdik,j_{i}\equiv\underset{k\in S}{\operatorname{arg}\,\operatorname{min}}\;d_{ik}, (3.14)

breaking ties arbitrarily if the minimum cost of serving customer ii over the open facilities in SS is not unique. Then for each ini\in\llbracket n\rrbracket and for each jmj\in\llbracket m\rrbracket, x~2n×m\tilde{x}\in\mathbb{Z}_{2}^{n\times m} is constructed via:

x~ij={1ifj=ji,0ifjm{ji}.\tilde{x}_{ij}=\begin{cases}1&\textrm{if}\;j=j_{i},\\ 0&\textrm{if}\;j\in\llbracket m\rrbracket\setminus\left\{j_{i}\right\}.\end{cases} (3.15)

A third-party MILP solver, such as Gurobi [20], CPLEX [26], or CBC [8], must be used to solve the MILP (3.13); the reader is referred to “Solving the Fitting MILP” in Section 4 for more information about the particular MILP solvers mentioned here. However, MILP solvers are only able to solve fairly small instances of the pp-median problem to within a prescribed absolute or relative optimality gap of the globally optimal solution. Because MILP solvers rely on branch-and-bound algorithms, if an MILP solver is able to find a solution (not necessarily the globally optimal solution), it is also able to provide a lower bound of the globally optimal solution via the absolute or relative optimality gap.

The objective function 𝒥\mathcal{J} that is minimized in (3.13) is 𝒥(x)i=1nj=1mdijxij\mathcal{J}\left(x\right)\equiv\sum_{i=1}^{n}\sum_{j=1}^{m}d_{ij}x_{ij}. Construct the Lagrangian function \mathcal{L} by adjoining the fourth constraint, j=1mxij=1in\sum_{j=1}^{m}x_{ij}=1\quad\forall i\in\llbracket n\rrbracket, in (3.13) to the objective function 𝒥\mathcal{J} via the vector of Lagrange multipliers λn\lambda\in\mathbb{R}^{n}:

(x,λ)i=1nj=1mdijxij+i=1nλi(1j=1mxij)=i=1nj=1m(dijλi)xij+i=1nλi=j=1mi=1n(dijλi)xij+i=1nλi.\begin{split}\mathcal{L}\left(x,\lambda\right)\equiv\sum_{i=1}^{n}\sum_{j=1}^{m}d_{ij}x_{ij}+\sum_{i=1}^{n}\lambda_{i}\left(1-\sum_{j=1}^{m}x_{ij}\right)&=\sum_{i=1}^{n}\sum_{j=1}^{m}\left(d_{ij}-\lambda_{i}\right)x_{ij}+\sum_{i=1}^{n}\lambda_{i}\\ &=\sum_{j=1}^{m}\sum_{i=1}^{n}\left(d_{ij}-\lambda_{i}\right)x_{ij}+\sum_{i=1}^{n}\lambda_{i}.\end{split} (3.16)

The primal form of the MILP formulation (3.13) of the pp-median problem is

minx,ymaxλ(x,λ)yj{0,1}jm,xij{0,1}injm,j=1myj=p,xijyjinjm.\begin{split}\min_{x,y}\max_{\lambda}\;&\mathcal{L}\left(x,\lambda\right)\quad\ni\\ &y_{j}\in\{0,1\}\quad\forall j\in\llbracket m\rrbracket,\\ &x_{ij}\in\{0,1\}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket,\\ &\sum_{j=1}^{m}y_{j}=p,\\ &x_{ij}\leq y_{j}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket.\end{split} (3.17)

The primal problem (3.17) is equivalent to (3.13). Now construct the dual function 𝒟\mathcal{D}:

𝒟(λ)minx,y(x,λ)yj{0,1}jm,xij{0,1}injm,j=1myj=p,xijyjinjm.\begin{split}\mathcal{D}\left(\lambda\right)\equiv\min_{x,y}\;&\mathcal{L}\left(x,\lambda\right)\quad\ni\\ &y_{j}\in\{0,1\}\quad\forall j\in\llbracket m\rrbracket,\\ &x_{ij}\in\{0,1\}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket,\\ &\sum_{j=1}^{m}y_{j}=p,\\ &x_{ij}\leq y_{j}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket.\end{split} (3.18)

The following are important properties of the dual function 𝒟\mathcal{D}.

  1. 1.

    For fixed λ\lambda, it is trivial to construct x2n×mx\in\mathbb{Z}_{2}^{n\times m} and y2my\in\mathbb{Z}_{2}^{m} that minimize the Lagrangian \mathcal{L} subject to satisfying the constraints in (3.18) [12, 13, 38]. Therefore, it is simple to solve the constrained Lagrangian minimization problem and compute 𝒟(λ)\mathcal{D}\left(\lambda\right).

  2. 2.

    For fixed λ\lambda, the solution x2n×mx\in\mathbb{Z}_{2}^{n\times m} and y2my\in\mathbb{Z}_{2}^{m} of 𝒟(λ)\mathcal{D}\left(\lambda\right) may be easily transformed into a corresponding primal solution, i.e., a feasible solution of the pp-median problem [12, 13, 38].

  3. 3.

    For fixed λ\lambda, 𝒟(λ)\mathcal{D}\left(\lambda\right) is a lower bound of the solution to the primal problem (3.17) [10].

  4. 4.

    𝒟\mathcal{D} is concave as a function of λ\lambda [10].

  5. 5.

    𝒟\mathcal{D} is piecewise linear, and is therefore nondifferentiable, as a function of λ\lambda [10].

The dual form of the MILP formulation (3.13) of the pp-median problem is

maxλ𝒟(λ)=maxλminx,y(x,λ)yj{0,1}jm,xij{0,1}injm,j=1myj=p,xijyjinjm.\begin{split}\max_{\lambda}\mathcal{D}\left(\lambda\right)=\max_{\lambda}\min_{x,y}\;&\mathcal{L}\left(x,\lambda\right)\quad\ni\\ &y_{j}\in\{0,1\}\quad\forall j\in\llbracket m\rrbracket,\\ &x_{ij}\in\{0,1\}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket,\\ &\sum_{j=1}^{m}y_{j}=p,\\ &x_{ij}\leq y_{j}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket.\end{split} (3.19)

Since the dual function 𝒟\mathcal{D} is concave and nondifferentiable, the dual problem (3.19) may be solved by subgradient optimization [12, 13, 38], which is a particular method of convex optimization. The solution to the dual problem (3.19) is a lower bound to the solution of the primal problem (3.17) [10]; in some cases, the solution to the dual problem (3.19) may even coincide with the solution to the primal problem (3.17). In the Lagrangian relaxation approach to solving the pp-median problem (3.3), the dual problem (3.19) is solved via iterative subgradient optimization, starting from an initial guess λ\lambda of the Lagrange multipliers. In each iteration of the subgradient optimization, 1) a lower bound is constructed by solving the constrained Lagrangian minimization problem and computing the dual function 𝒟\mathcal{D} in (3.18) for the current estimate λ\lambda of the Lagrange multipliers, 2) a corresponding upper bound is constructed from the lower bound, and 3) the current estimate λ\lambda of the Lagrange multipliers is updated. If in a given iteration, a new smallest upper bound is found, it may be further improved via a heuristic such as the exchange algorithm. As described in [13], if in a given iteration, a new smallest upper bound or a new largest lower bound is found, candidate facilities can be forced into and out of the optimal solution, which can reduce the computational time of Lagrangian relaxation. By keeping track of the smallest upper bound and the largest lower bound found over all iterations, Lagrangian relaxation provides both upper and lower bounds of the globally optimal solution to the pp-median problem. The iterations continue until some stopping criterion is satisfied, such as executing a maximum number of iterations or realizing a prescribed absolute or relative optimality gap. Instead of adjoining the fourth constraint, j=1mxij=1in\sum_{j=1}^{m}x_{ij}=1\quad\forall i\in\llbracket n\rrbracket, in (3.13) to the objective function 𝒥\mathcal{J}, it is possible to adjoin the fifth constraint, xijyjinjmx_{ij}\leq y_{j}\quad\forall i\in\llbracket n\rrbracket\quad\forall j\in\llbracket m\rrbracket, in (3.13) to the objective function 𝒥\mathcal{J} via a matrix of nonnegative Lagrange multipliers λ0n×m\lambda\in\mathbb{R}_{\geq 0}^{n\times m}; this alternative approach is discussed in [12].

POPSTAR [51] is a freely available pp-median problem solver implemented in C++. POPSTAR solves the pp-median problem via a hybrid metaheuristic that combines GRASP with path-relinking and the genetic algorithm [56]. Moreover, POPSTAR performs local searches via a fast implementation of the exchange algorithm [57]. Reference [45], published in 2007, comprehensively surveyed many methods, excluding hyper-heuristics, for solving the pp-median problem and concluded that the overall algorithm implemented by POPSTAR is the best. dc2 [14] is a recent, freely available pp-median problem solver implemented in C that is still under development. dc2 solves the pp-median problem via several metaheuristics, including GRASP, path-relinking, and a new metaheuristic called disperse construction, and performs local searches via several fast implementations of the exchange algorithm [66, 23, 57]. Unlike POPSTAR, dc2 is multithreaded and therefore is able to exploit the parallelism offered by multicore CPUs. POPSTAR and dc2 can solve instances of the pp-median problem with several thousand customers, several thousand candidate facilities, and p20p\leq 20 in a few minutes on a modern laptop. Several metaheuristics, including GRASP and the genetic algorithm, have been implemented on GPGPUs to solve the pp-median problem [59, 1].

Validation

The box suite recommendation may be validated by packing the optimization shipment set and a much larger randomly sampled shipment set into the recommended suite SS^{*}, where each shipment is assigned to the minimum cost box in the suite into which it fits. Several metrics, such as percentage of shipments packed into each box, percentage of total cost shipped by each box, percentage of all box outer volume shipped by each box, and percentage liquid void space, collected for both packings can be compared. If the metrics are similar, then the cost savings afforded by the recommended suite SS^{*} should be expected to hold on all shipments. An alternative validation method is to pack the optimization shipment set and a much larger randomly sampled shipment set into several suites QSQ\cup S^{*}, where each suite SQS\in Q satisfies TST\subset S, |S|=p\left|S\right|=p, and JiSØiI^J_{i}\cap S\neq\O\,\forall i\in\llbracket\hat{I}\rrbracket, and ensure that the cost reductions (comparing the cost of each suite SQS\in Q to the cost of SS^{*}) predicted by the optimization shipment set agree with those predicted by the large shipment set. If the various metrics or cost reductions are dissimilar, then Algorithm (1) should be run again using a larger set of randomly sampled historical customer shipments.

Fine-Tuning

The recommended suite SS^{*} can be further refined (or fine-tuned) by running Algorithm (1) again on a new set of candidate boxes JJ^{\prime} obtained by taking small variations above and below the inner lengths, widths, and heights of the unlocked boxes STS^{*}\setminus T in the recommended suite SS^{*}. Like the original set of candidate boxes JJ, the new set of candidate boxes JJ^{\prime} must also include the kk locked boxes.

Modifications to Handle Height-Oriented and Bottom-Resting Cartons

Some shipments may contain cartons that must be packed vertically, so that their height dimensions must be parallel to the box’s height dimension. Such cartons will be called height-oriented (HO). This constraint is quite common in online retail, e.g., liquid detergent often must be HO when packed into a shipping box to prevent spillage. When packed into a box, a HO carton may be rotated in only 2 (instead of 6) possible ways. In order to handle this additional constraint, Algorithm (1) must be modified in the following ways. Lines 1-11 in Algorithm (1) must be replaced with the pseudocode given in Algorithm (2), and lines 24-26 in Algorithm (1) must be replaced with the pseudocode given in Algorithm (3). HO cartons may have the additional constraint that they rest at the bottom of the box, to encourage stability and mitigate the possibility of tipping over. To handle this additional constraint, the Boolean condition in line 33 in Algorithm (1), which checks to see if the cartons can be stacked along any of the 3 box dimensions, must be replaced with the Boolean condition

(p̊ix~j)(q̊iy~j)(Hi1r̊iz~j),\left(\mathring{p}_{i}\leq\tilde{x}_{j}\right)\vee\left(\mathring{q}_{i}\leq\tilde{y}_{j}\right)\vee\left(H_{i}\leq 1\wedge\mathring{r}_{i}\leq\tilde{z}_{j}\right), (3.20)

where HiH_{i} (see lines 1 and 5 in Algorithm (3)) denotes the number of HO cartons in shipment ii, since stacking the cartons along the box’s height dimension is valid only if there are less than 2 HO cartons in the shipment. More generally, only a proper subset of HO cartons may need to rest at the bottom of the box or some non-HO cartons may need to rest at the bottom of the box. Such cartons will be called bottom-resting (BR). To handle this more general case, let RiR_{i} denote the number of BR cartons in shipment ii. Then the Boolean condition in line 33 in Algorithm (1) must be replaced with the Boolean condition

(p̊ix~j)(q̊iy~j)(Ri1r̊iz~j),\left(\mathring{p}_{i}\leq\tilde{x}_{j}\right)\vee\left(\mathring{q}_{i}\leq\tilde{y}_{j}\right)\vee\left(R_{i}\leq 1\wedge\mathring{r}_{i}\leq\tilde{z}_{j}\right), (3.21)

since stacking the cartons along the box’s height dimension is valid only if there are less than 2 BR cartons in the shipment. (3.20) is valid instead of (3.21) only if all HO cartons are BR and there are no non-HO cartons that are BR, in which case Hi=RiH_{i}=R_{i}. The paragraph “Special Packing Constraints” in Section 4 discusses how to enforce HO and BR packing constraints in the fitting MILP.

Algorithm 2 Box Suite Recommendation: HO Modification I
1:for j=1j=1 to JJ do \triangleright Iterate over candidate boxes.
     \triangleright \eqparboxCOMMENTSort the length and width box inner dimensions in nonincreasing order for shipments with HO cartons.
2:     (x¯j,y¯j)Sort(xj,yj)z¯jzj\left(\bar{x}_{j},\bar{y}_{j}\right)\leftarrow\textsc{Sort}\left(x_{j},y_{j}\right)\quad\quad\bar{z}_{j}\leftarrow z_{j}
     \triangleright \eqparboxCOMMENTSort box inner dimensions in nonincreasing order for shipments with no HO cartons.
3:     (x¨j,y¨j,z¨j)Sort(xj,yj,zj)\left(\ddot{x}_{j},\ddot{y}_{j},\ddot{z}_{j}\right)\leftarrow\textsc{Sort}\left(x_{j},y_{j},z_{j}\right)
4:end for
\triangleright \eqparboxCOMMENTDetermine into which candidate boxes each candidate box nests.
5:for j=1j=1 to JJ do \triangleright Iterate over candidate boxes.
     \triangleright \eqparboxCOMMENTΨj\Psi_{j} stores the set of boxes into which box jj nests, only permitting the 2 HO rotations for nesting.
6:     Ψj{j}\Psi_{j}\leftarrow\left\{j\right\}
     \triangleright \eqparboxCOMMENTΣj\Sigma_{j} stores the set of boxes into which box jj nests, permitting any of the 6 possible rotations for nesting.
7:     Σj{j}\Sigma_{j}\leftarrow\left\{j\right\}
8:     for kj+1k\leftarrow j+1 to JJ do \triangleright Iterate over equal or larger volume candidate boxes.
9:         if (x¯jx¯k)(y¯jy¯k)(z¯jz¯k)\left(\bar{x}_{j}\leq\bar{x}_{k}\right)\wedge\left(\bar{y}_{j}\leq\bar{y}_{k}\right)\wedge\left(\bar{z}_{j}\leq\bar{z}_{k}\right) then \triangleright If box jj nests inside box kk in a HO way.
10:              push(Ψj,k)\textsc{push}\left(\Psi_{j},k\right)
11:         end if
12:         if (x¨jx¨k)(y¨jy¨k)(z¨jz¨k)\left(\ddot{x}_{j}\leq\ddot{x}_{k}\right)\wedge\left(\ddot{y}_{j}\leq\ddot{y}_{k}\right)\wedge\left(\ddot{z}_{j}\leq\ddot{z}_{k}\right) then \triangleright If box jj nests inside box kk.
13:              push(Σj,k)\textsc{push}\left(\Sigma_{j},k\right)
14:         end if
15:     end for
16:end for
Algorithm 3 Box Suite Recommendation: HO Modification II
1:Hi0H_{i}\leftarrow 0 \triangleright HiH_{i} records the number of HO cartons in shipment ii.
2:for n=1n=1 to NiN_{i} do \triangleright Iterate over cartons in shipment ii.
3:     if carton nn is HO then \triangleright If carton nn must be HO when packed into a box.
         \triangleright \eqparboxCOMMENTSort carton length and width outer dimensions in nonincreasing order for HO packing.
4:         (p~in,q~in)Sort(pin,qin)r~inrin\left(\tilde{p}_{in},\tilde{q}_{in}\right)\leftarrow\textsc{Sort}\left(p_{in},q_{in}\right)\quad\quad\tilde{r}_{in}\leftarrow r_{in}
5:         HiHi+1H_{i}\leftarrow H_{i}+1 \triangleright Increment HiH_{i}.
6:     else\triangleright If carton nn need not be HO when packed into a box.
         \triangleright \eqparboxCOMMENTSort carton outer dimensions in nonincreasing order for non-HO packing.
7:         (p~in,q~in,r~in)Sort(pin,qin,rin)\left(\tilde{p}_{in},\tilde{q}_{in},\tilde{r}_{in}\right)\leftarrow\textsc{Sort}\left(p_{in},q_{in},r_{in}\right)
8:     end if
9:end for
10:if Hi>0H_{i}>0 then \triangleright If shipment ii contains a HO carton.
11:     {Θj}j=j0J{Ψj}j=j0J{(x~j,y~j,z~j)}j=j0J{(x¯j,y¯j,z¯j)}j=j0J\left\{\Theta_{j}\right\}_{j=j_{0}}^{J}\leftarrow\left\{\Psi_{j}\right\}_{j=j_{0}}^{J}\quad\quad\left\{\left(\tilde{x}_{j},\tilde{y}_{j},\tilde{z}_{j}\right)\right\}_{j=j_{0}}^{J}\leftarrow\left\{\left(\bar{x}_{j},\bar{y}_{j},\bar{z}_{j}\right)\right\}_{j=j_{0}}^{J}
12:else\triangleright If shipment ii does not contain a HO carton.
13:     {Θj}j=j0J{Σj}j=j0J{(x~j,y~j,z~j)}j=j0J{(x¨j,y¨j,z¨j)}j=j0J\left\{\Theta_{j}\right\}_{j=j_{0}}^{J}\leftarrow\left\{\Sigma_{j}\right\}_{j=j_{0}}^{J}\quad\quad\left\{\left(\tilde{x}_{j},\tilde{y}_{j},\tilde{z}_{j}\right)\right\}_{j=j_{0}}^{J}\leftarrow\left\{\left(\ddot{x}_{j},\ddot{y}_{j},\ddot{z}_{j}\right)\right\}_{j=j_{0}}^{J}
14:end if

Numerical Experiments

Three 10 box suites are constructed according to Algorithm (1). In this description of the numerical experiments performed to obtain the suites, the inner dimensions of a box and outer dimensions of an item are always assumed to be sorted in nonincreasing order. The suites are selected from a set of 5,284 candidate boxes, which is the set of boxes with integral sorted inner dimensions {(x,y,z)3:xyz,40x5,20y4,16z1}\left\{\left(x,y,z\right)\in\mathbb{N}^{3}\colon x\geq y\geq z,40\geq x\geq 5,20\geq y\geq 4,16\geq z\geq 1\right\} and where the smallest inner volume box has sorted inner dimensions (5,4,1)\left(5,4,1\right) and the largest inner volume box has sorted inner dimensions (40,20,16)\left(40,20,16\right). The first suite does not lock any boxes, the second suite locks the box with sorted inner dimensions (12,7,6)\left(12,7,6\right), and the third suite locks the two boxes with sorted inner dimensions (12,7,6)\left(12,7,6\right) and (16,12,6)\left(16,12,6\right).

The suites are optimized based on 15,000 shipments, where each shipment is comprised of items selected from a set of 2,324 candidate items. Each item is assumed to be a 3D rectangular carton with integral outer dimensions, so that foldable items are excluded. No two items have the same sorted outer dimensions. Moreover, none of the items have special packing constraints, such as having to be height-oriented or bottom-resting. Each shipment is comprised of 1 to 8 unique items, where each unique item has quantity 1 to 8 such that there are no more than 8 total cartons in the shipment.

The set of candidate boxes, the set of candidate items, and the set of shipments are available on Mendeley Data in three separate CSV files, boxes.csv, items.csv, and shipments.csv, respectively [58]. Each candidate box occupies a row in boxes.csv comprised of a unique integral box ID and three integral inner dimensions sorted in nonincreasing order. Each candidate item occupies a row in items.csv comprised of a unique integral item ID and three integral outer dimensions sorted in nonincreasing order. Each row in shipments.csv represents all or part of a shipment and is comprised of a unique integral shipment ID, an item’s integral ID, the item’s quantity, and the item’s outer dimensions sorted in nonincreasing order. All the items in a shipment are assigned the same unique integral shipment ID and therefore can be grouped together based on it.

The 15,000 shipments, consisting of 1 to 8 cartons (i.e., no foldable items), were fit into the 5,284 candidate boxes. In all, it took 1.4 hours to solve all the fitting problems. Of the 15,000 shipments, 20.88% (3,132 shipments) consist of 4 or more cartons, for which the fitting MILP (4.1)-(4.5) was solved by CPLEX v12.10.0 since brute force fitting algorithms were used for shipments consisting of 1, 2, or 3 cartons. 173,066 fitting MILPs had to be solved. MILPs taking more than 5 seconds (s) to solve were terminated early, in which case the underlying shipment was declared to not fit into the underlying candidate box. Of the 173,066 fitting MILPs, 29,618 were feasible (a fit was found), 143,393 were infeasible (no fit possible), and 55 were terminated early due to the 5[s] time limit. Of the 15,000 shipments, 112 shipments did not fit into any candidate box, so that only 14,888 shipments are packable. The reader is referred to “Benchmarking I” in Section 4 for a performance comparison of different MILP solvers on various formulations of the fitting MILP.

The cost of shipping a shipment in a particular candidate box is the box’s inner volume, so that each optimal suite is a set of 10 boxes that ships all the packable shipments with minimum total inner volume shipped, subject to locking no, one, or two boxes. Given the cost matrix CC (obtained from the fitting matrix BB), POPSTAR and dc2 were used to solve three pp-median problems (3.2), one for each suite. The three suites reported in Tables 3.1-3.3 are the best found by POPSTAR and dc2 for each pp-median problem. Given the cost matrix, POPSTAR was able to find each suite in under 7 minutes, while dc2 was able to find each suite in under 3 minutes. POPSTAR was used with the default parameters -graspit 32 -elite 10 for the first two suites and with the non-default parameters -graspit 64 -elite 20 for the third suite. dc2 was used with the non-default parameters -t12 -L -M -B0 -R50 rank:5 _rank:5 for all three suites. POPSTAR was used with non-default parameters for the third suite, because POPSTAR used with the default parameters found a solution suboptimal (total inner volumed shipped is 27,377,482) to the one found by dc2. Lagrangian relaxation [12, 13, 38], as discussed in “Solving the pp-Median Problem” earlier in this section, determined the percentage relative optimality gaps of the first, second, and third suites to be 1.287%, 1.101%, and 1.087%, respectively. The percentage relative optimality gap for a suite is defined as UBLBUB100%\frac{\mathrm{UB}-\mathrm{LB}}{\mathrm{UB}}\cdot 100\%, where UB\mathrm{UB} is the total inner volume shipped by that suite and LB\mathrm{LB} is the greatest lower bound of the minimum cost for that suite’s pp-median problem found by Lagrangian relaxation.

In Tables 3.1-3.3, the column labeled “% Liquid Void Volume Shipped” is the total empty volume shipped by a box divided by the total inner volume shipped by that box, and then scaled by 100%. The empty volume for a shipment shipped in a box is measured as the box inner volume minus the shipment’s liquid volume (sum of all the shipment’s carton outer volumes). The total empty volume shipped by a box is the sum of the empty volumes over all the shipments shipped in that box. The total inner volume shipped by a box is the box’s inner volume multiplied by the number of shipments shipped in that box. In the captions, the percentage liquid void volume shipped by a suite is the total empty volume shipped by the suite divided by the total inner volume shipped by the suite, scaled by 100%.

Algorithm (1) was implemented in Julia v0.6.4 [4, 30] using JuMP v0.18.5 [17] to formulate the fitting MILP (4.1)-(4.5). CPLEX v12.10.0 was used to solve the fitting MILPs, while POPSTAR and dc2 were used to solve the pp-median problems. The software ran under the operating system Ubuntu 18.04.4 LTS (Bionic Beaver) on an Intel Core i7-3930K CPU @ 3.20 GHz with 6 physical cores (12 logical cores with hyper-threading) and 32GB RAM.

# ID Inner Dimensions Inner Volume % of Packable Shipments Shipped % Liquid Void Volume Shipped
1 536 (11,7,4)\left(11,7,4\right) 308 35.30% 73.33%
2 1426 (13,10,6)\left(13,10,6\right) 780 19.49% 58.03%
3 2124 (19,14,5)\left(19,14,5\right) 1330 11.65% 57.54%
4 2705 (16,12,10)\left(16,12,10\right) 1920 9.54% 43.88%
5 3502 (32,19,5)\left(32,19,5\right) 3040 5.53% 59.76%
6 3688 (20,14,12)\left(20,14,12\right) 3360 6.51% 40.88%
7 4274 (25,17,11)\left(25,17,11\right) 4675 4.82% 40.90%
8 4854 (31,18,12)\left(31,18,12\right) 6696 3.68% 43.05%
9 5099 (26,20,16)\left(26,20,16\right) 8320 2.14% 40.37%
10 5284 (40,20,16)\left(40,20,16\right) 12800 1.35% 50.15%
Table 3.1: Best 10 box suite minimizing total inner volume shipped, found by POPSTAR and dc2. The boxes are listed by increasing inner volume. The total inner volume shipped by this suite is 26,917,098, which is within 1.287% of the minimum possible total inner volume shipped. The percentage liquid void (box inner - liquid) volume shipped by this suite is 48.89%. POPSTAR found this solution in 235.7[s] using the default parameters -graspit 32 -elite 10. dc2 found this solution in 168.2[s] using the non-default parameters -t12 -L -M -B0 -R50 rank:5 _rank:5.
# ID Inner Dimensions Inner Volume % of Packable Shipments Shipped % Liquid Void Volume Shipped
1 255 (10,6,3)\left(10,6,3\right) 180 25.51% 70.25%
2 958 (𝟏𝟐,𝟕,𝟔)\mathbf{\left(12,7,6\right)} 504 16.13% 59.83%
3 1544 (18,12,4)\left(18,12,4\right) 864 15.82% 60.78%
4 2254 (15,12,8)\left(15,12,8\right) 1440 11.90% 48.33%
5 3132 (19,13,10)\left(19,13,10\right) 2470 9.92% 47.27%
6 3447 (31,19,5)\left(31,19,5\right) 2945 4.66% 62.28%
7 4021 (23,16,11)\left(23,16,11\right) 4048 6.72% 41.95%
8 4770 (25,18,14)\left(25,18,14\right) 6300 5.23% 43.62%
9 5082 (34,20,12)\left(34,20,12\right) 8160 2.52% 49.33%
10 5284 (40,20,16)\left(40,20,16\right) 12800 1.59% 47.66%
Table 3.2: Best 10 box suite locking the boldfaced box with ID 958 and minimizing total inner volume shipped, found by POPSTAR and dc2. The boxes are listed by increasing inner volume. The total inner volume shipped by this suite is 27,224,072, which is within 1.101% of the minimum possible total inner volume shipped. The percentage liquid void (box inner - liquid) volume shipped by this suite is 49.47%. POPSTAR found this solution in 205.9[s] using the default parameters -graspit 32 -elite 10. dc2 found this solution in 157.3[s] using the non-default parameters -t12 -L -M -B0 -R50 rank:5 _rank:5.
# ID Inner Dimensions Inner Volume % of Packable Shipments Shipped % Liquid Void Volume Shipped
1 509 (11,9,3)\left(11,9,3\right) 297 33.88% 73.66%
2 958 (𝟏𝟐,𝟕,𝟔)\mathbf{\left(12,7,6\right)} 504 10.38% 53.36%
3 1918 (𝟏𝟔,𝟏𝟐,𝟔)\mathbf{\left(16,12,6\right)} 1152 19.89% 58.67%
4 2807 (17,12,10)\left(17,12,10\right) 2040 10.79% 47.00%
5 3105 (32,19,4)\left(32,19,4\right) 2432 4.83% 65.61%
6 3651 (20,15,11)\left(20,15,11\right) 3300 7.23% 42.81%
7 4213 (25,18,10)\left(25,18,10\right) 4500 4.67% 43.96%
8 4774 (31,17,12)\left(31,17,12\right) 6324 4.39% 43.81%
9 5099 (26,20,16)\left(26,20,16\right) 8320 2.51% 41.58%
10 5284 (40,20,16)\left(40,20,16\right) 12800 1.44% 51.42%
Table 3.3: Best 10 box suite locking the two boldfaced boxes with IDs 958 and 1918 and minimizing total inner volume shipped, found by POPSTAR and dc2. The boxes are listed by increasing inner volume. The total inner volume shipped by this suite is 27,370,900, which is within 1.087% of the minimum possible total inner volume shipped. The percentage liquid void (box inner - liquid) volume shipped by this suite is 49.74%. POPSTAR found this solution in 402.8[s] using the non-default parameters -graspit 64 -elite 20. dc2 found this solution in 142.0[s] using the non-default parameters -t12 -L -M -B0 -R50 rank:5 _rank:5.

4 Fitting MILP

Introduction

Can nn\in\mathbb{N} 3D rectangular cartons, with positive outer lengths, widths, and heights {(pi,qi,ri)}i=1n\left\{\left(p_{i},q_{i},r_{i}\right)\right\}_{i=1}^{n}, where (pi,qi,ri)>03\left(p_{i},q_{i},r_{i}\right)\in\mathbb{R}_{>0}^{3} for ini\in\llbracket n\rrbracket, fit in a box with positive inner length, width, and height (x,y,z)>03\left(x,y,z\right)\in\mathbb{R}_{>0}^{3}, permitting orthogonal rotations of each carton? When packed into the box, it is assumed that a carton’s edges must be parallel to those of the box, so that there are 6 possible orthogonal rotations of each carton. A right-handed orthogonal 3D Cartesian coordinate system is introduced in the box’s frame, as depicted in Figure 4.1. The XX-axis is parallel to the box length xx, the YY-axis is parallel to the box width yy, and the ZZ-axis is parallel to the box height zz. The axes intersect orthogonally at (0,0,0)\left(0,0,0\right), which coincides with the left-back-bottom (lbb) corner of the box. Left to right is along the XX-axis with 0 on the left and xx on the right. Back to front is along the YY-axis with 0 at the back and yy at the front. Bottom to top is along the ZZ-axis with 0 at the bottom and zz at the top. Whether the nn cartons fit into the box can be determined by checking the feasibility (or satisfiability) of a set of linear inequality constraints depending on a set of continuous and binary variables. These constraints and variables form a feasibility MILP called the fitting MILP. Since any feasibility MILP is NP-complete [29], the fitting MILP is NP-complete. The next few paragraphs present the constraints and variables that comprise the fitting MILP.

Orientation Constraints

For each carton ini\in\llbracket n\rrbracket, there are 9 orientation binary variables that indicate in which of the 6 possible ways each carton is oriented in the box. lXi,lYi,lZi{0,1}l_{Xi},l_{Yi},l_{Zi}\in\left\{0,1\right\} indicate whether the length dimension pip_{i} of carton ii is parallel to the XX-, YY-, or ZZ-axis, wXi,wYi,wZi{0,1}w_{Xi},w_{Yi},w_{Zi}\in\left\{0,1\right\} indicate whether the width dimension qiq_{i} of carton ii is parallel to the XX-, YY-, or ZZ-axis, and hXi,hYi,hZi{0,1}h_{Xi},h_{Yi},h_{Zi}\in\left\{0,1\right\} indicate whether the height dimension rir_{i} of carton ii is parallel to the XX-, YY-, or ZZ-axis. The reader is referred to Figure 4.1 for a 3D illustration of the meaning of the orientation binary variables. Since each carton dimension is parallel to one and only one axis, there are six linear equality constraints on the orientation binary variables. The 6 constraints are linearly dependent with rank 5, so that only 5 are needed.

lXi+lYi+lZi=1in,wXi+wYi+wZi=1in,hXi+hYi+hZi=1in,lXi+wXi+hXi=1in,lYi+wYi+hYi=1in,lZi+wZi+hZi=1in.\begin{split}l_{Xi}+l_{Yi}+l_{Zi}&=1\quad\forall i\in\llbracket n\rrbracket,\\ w_{Xi}+w_{Yi}+w_{Zi}&=1\quad\forall i\in\llbracket n\rrbracket,\\ h_{Xi}+h_{Yi}+h_{Zi}&=1\quad\forall i\in\llbracket n\rrbracket,\\ l_{Xi}+w_{Xi}+h_{Xi}&=1\quad\forall i\in\llbracket n\rrbracket,\\ l_{Yi}+w_{Yi}+h_{Yi}&=1\quad\forall i\in\llbracket n\rrbracket,\\ l_{Zi}+w_{Zi}+h_{Zi}&=1\quad\forall i\in\llbracket n\rrbracket.\end{split} (4.1)
Refer to caption
Figure 4.1: Orientation binary variables for cartons ii and kk: lXi=wZi=hYi=lZk=wXk=hYk=1l_{Xi}=w_{Zi}=h_{Yi}=l_{Zk}=w_{Xk}=h_{Yk}=1.

Containment Constraints

For each carton ini\in\llbracket n\rrbracket, (xi,yi,zi)03\left(x_{i},y_{i},z_{i}\right)\in\mathbb{R}_{\geq 0}^{3} denotes the nonnegative coordinates of the lbb corner of carton ii. Each carton ini\in\llbracket n\rrbracket must be contained in the box, which requires the following 6 linear inequality constraints.

xi0in,yi0in,zi0in,xi+pilXi+qiwXi+rihXixin,yi+pilYi+qiwYi+rihYiyin,zi+pilZi+qiwZi+rihZizin.\begin{split}x_{i}&\geq 0\quad\forall i\in\llbracket n\rrbracket,\\ y_{i}&\geq 0\quad\forall i\in\llbracket n\rrbracket,\\ z_{i}&\geq 0\quad\forall i\in\llbracket n\rrbracket,\\ x_{i}+p_{i}l_{Xi}+q_{i}w_{Xi}+r_{i}h_{Xi}&\leq x\quad\forall i\in\llbracket n\rrbracket,\\ y_{i}+p_{i}l_{Yi}+q_{i}w_{Yi}+r_{i}h_{Yi}&\leq y\quad\forall i\in\llbracket n\rrbracket,\\ z_{i}+p_{i}l_{Zi}+q_{i}w_{Zi}+r_{i}h_{Zi}&\leq z\quad\forall i\in\llbracket n\rrbracket.\end{split} (4.2)

Nonoverlapping Constraints

Every distinct pair of cartons i,kni,k\in\llbracket n\rrbracket, with i<ki<k, cannot overlap. To enforce these constraints, 6 nonoverlapping binary variables indicate the relative position of pairs of cartons. aik=1a_{ik}=1 implies that carton ii is left of carton kk, bik=1b_{ik}=1 implies that carton ii is right of carton kk, cik=1c_{ik}=1 implies that carton ii is behind carton kk, dik=1d_{ik}=1 implies that carton ii is in front of carton kk, eik=1e_{ik}=1 implies that carton ii is below carton kk, and fik=1f_{ik}=1 implies that carton ii is on top of carton kk. The reader is referred to Figure 4.2 for a 3D illustration of the meaning of the nonoverlapping binary variables. In order for cartons ii and kk to be nonoverlapping, at least one of aika_{ik}, bikb_{ik}, cikc_{ik}, dikd_{ik}, eike_{ik}, and fikf_{ik} must be 1. The following 7 linear inequality constraints enforce nonoverlapping of every distinct pair of cartons ii and kk.

xi+pilXi+qiwXi+rihXixk+(1aik)xi,kn,i<k,xk+pklXk+qkwXk+rkhXkxi+(1bik)xi,kn,i<k,yi+pilYi+qiwYi+rihYiyk+(1cik)yi,kn,i<k,yk+pklYk+qkwYk+rkhYkyi+(1dik)yi,kn,i<k,zi+pilZi+qiwZi+rihZizk+(1eik)zi,kn,i<k,zk+pklZk+qkwZk+rkhZkzi+(1fik)zi,kn,i<k,aik+bik+cik+dik+eik+fik1i,kn,i<k.\begin{split}x_{i}+p_{i}l_{Xi}+q_{i}w_{Xi}+r_{i}h_{Xi}&\leq x_{k}+\left(1-a_{ik}\right)x\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ x_{k}+p_{k}l_{Xk}+q_{k}w_{Xk}+r_{k}h_{Xk}&\leq x_{i}+\left(1-b_{ik}\right)x\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ y_{i}+p_{i}l_{Yi}+q_{i}w_{Yi}+r_{i}h_{Yi}&\leq y_{k}+\left(1-c_{ik}\right)y\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ y_{k}+p_{k}l_{Yk}+q_{k}w_{Yk}+r_{k}h_{Yk}&\leq y_{i}+\left(1-d_{ik}\right)y\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ z_{i}+p_{i}l_{Zi}+q_{i}w_{Zi}+r_{i}h_{Zi}&\leq z_{k}+\left(1-e_{ik}\right)z\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ z_{k}+p_{k}l_{Zk}+q_{k}w_{Zk}+r_{k}h_{Zk}&\leq z_{i}+\left(1-f_{ik}\right)z\quad\forall i,k\in\llbracket n\rrbracket,\,i<k,\\ a_{ik}+b_{ik}+c_{ik}+d_{ik}+e_{ik}+f_{ik}&\geq 1\quad\forall i,k\in\llbracket n\rrbracket,\,i<k.\end{split} (4.3)
Refer to caption
Figure 4.2: Illustration of the nonoverlapping binary variables.

Symmetry-Breaking Constraints: Identical Cartons

Suppose that some of the nn cartons are identical, in the sense that they share the same sorted dimensions, and that each subset of identical cartons has been assigned consecutive indices in n\llbracket n\rrbracket. Let VnV^{*}\subset\llbracket n\rrbracket denote the subset of carton indices in the union of all subsets of identical cartons (i.e., cartons with identical sorted dimensions). Let VVV\subset V^{*} denote the subset of carton indices such that mVm\in V if and only if sort(pm,qm,rm)=sort(pm+1,qm+1,rm+1)\textsc{sort}\left(p_{m},q_{m},r_{m}\right)=\textsc{sort}\left(p_{m+1},q_{m+1},r_{m+1}\right). For mVm\in V, the XX-coordinates (or alternatively the YY- or ZZ-coordinates) of the lbb corners of identical cartons can be arranged in nondecreasing order.

xmxm+1mV.x_{m}\leq x_{m+1}\quad\forall m\in V. (4.4)

Symmetry-Breaking Constraints: Carton LBB Corner in First Orthant

Let βn\beta\in\llbracket n\rrbracket be the index of a particular carton. For example, β\beta might be the index of the smallest volume carton. If βV\beta\in V^{*}, β\beta should be the smallest index of the subset of identical cartons in which β\beta lies, in order to be compatible with (4.4). Any feasible packing of the nn cartons into the box can be rearranged, through a finite sequence of reflections across the box’s 3 inner half-planes, to realize a feasible packing such that the lbb corner of the carton with index β\beta is located in the box’s first orthant {(u,v,w)03:0ux2,0vy2,0wz2}\left\{\left(u,v,w\right)\in\mathbb{R}_{\geq 0}^{3}\colon 0\leq u\leq\frac{x}{2},0\leq v\leq\frac{y}{2},0\leq w\leq\frac{z}{2}\right\}.

xβx2,yβy2,zβz2.\begin{split}x_{\beta}&\leq\frac{x}{2},\\ y_{\beta}&\leq\frac{y}{2},\\ z_{\beta}&\leq\frac{z}{2}.\end{split} (4.5)

Comments on the Constraints

The orientation (4.1), containment (4.2), and nonoverlapping (4.3) constraints are given in [9, 64, 65]. References [64, 65, 40, 24, 25, 63] provide alternative formulations of these constraints, however the author found that a MILP solver is able to determine feasibility faster using the constraints (4.1), (4.2), and (4.3) compared to the other constraint formulations. The symmetry-breaking constraints (4.4) and (4.5) are new and have not appeared in the literature before and should benefit formulations of related packing problems such as the knapsack container loading problem (KCLP) [50, 46, 48, 49, 18, 19, 52, 53, 6], the three-dimensional bin packing problem (3D-BPP) [42], and the three-dimensional open-dimension rectangular packing problem (3D-ODRPP) [25]. The symmetry-breaking constraints tend to help the MILP solver determine feasibility faster by reducing the number of feasible solutions and thereby reducing the size of the search tree. Altogether, the constraints (4.1)-(4.5) comprise the fitting MILP. The fitting MILP consists of 3n3n nonnegative continuous variables, 3n(n1)+9n3n(n-1)+9n binary variables, 5n5n linear equality constraints, and 72n(n1)+6n+|V|+3\frac{7}{2}n(n-1)+6n+\left|V\right|+3 linear inequality constraints.

Special Packing Constraints

Some cartons must be packed in special ways, in which case the special packing constraints must be enforced without conflicting with the symmetry-breaking constraints (4.4)-(4.5). For example, some cartons cannot be stacked on top of other cartons, so that the ZZ-coordinates of their lbb corners must equal 0, in which case the constraint zi=0z_{i}=0 must be added to the fitting MILP for each such carton ii and the third constraint zβz2z_{\beta}\leq\frac{z}{2} in (4.5) must be removed since a feasible packing cannot be reflected across the vertical half-plane. In “Modifications to Handle Height-Oriented and Bottom-Resting Cartons” in Section 3, such cartons were called bottom-resting (BR).

As another example, some cartons must be packed vertically, so that their height dimensions must be parallel to the box’s ZZ-axis, in which case the constraint hZi=1h_{Zi}=1 must be added to the fitting MILP for each such carton ii. In “Modifications to Handle Height-Oriented and Bottom-Resting Cartons” in Section 3, such cartons were called height-oriented (HO). If there is at least one carton in the shipment that must be height-oriented, then the definition of identical cartons given earlier must be revised in order to construct the subset VV for the symmetry-breaking constraints (4.4). A pair of cartons i,jni,j\in\llbracket n\rrbracket, with iji\neq j, is identical if and only if either of the following conditions is satisfied:

  1. (i)

    they are both not height-oriented and sort(pi,qi,ri)=sort(pj,qj,rj)\textsc{sort}\left(p_{i},q_{i},r_{i}\right)=\textsc{sort}\left(p_{j},q_{j},r_{j}\right)

  2. (ii)

    they are both height-oriented, sort(pi,qi)=sort(pj,qj)\textsc{sort}\left(p_{i},q_{i}\right)=\textsc{sort}\left(p_{j},q_{j}\right), and ri=rjr_{i}=r_{j}.

With this new definition of identical cartons, it is still assumed that each subset of identical cartons has been assigned consecutive indices in n\llbracket n\rrbracket and VnV^{*}\subset\llbracket n\rrbracket denotes the subset of carton indices in the union of all subsets of identical cartons. In addition, VVV\subset V^{*} denotes the subset of carton indices such that mVm\in V if and only if cartons mm and m+1m+1 are identical in the new sense.

As a third example, stability may be required for cartons which do not rest on the box’s bottom, which requires additional constraints [63] and elimination of the third constraint zβz2z_{\beta}\leq\frac{z}{2} in (4.5) since a feasible stable packing cannot necessarily be reflected across the vertical half-plane to generate another feasible stable packing (reflecting a stable packing across the vertical half-plane may result in an unstable packing).

Solving the Fitting MILP

A third-party MILP solver must be used to solve the fitting MILP. There are many MILP solvers available, but only Gurobi [20], CPLEX [26], and CBC [8] are mentioned here. Gurobi and CPLEX are regarded as the best available MILP solvers, though they are commercial and require an expensive license for non-academic use. As of this writing, there is a free edition of CPLEX that solves MILPs having less than 1000 variables and 1000 constraints, which means that it can be used to solve the fitting MILP for shipments with less than 16 cartons (though the author’s tests showed that it worked for shipments with less than 18 cartons). CBC is regarded as the best available free MILP solver, though its performance is quite inferior to any of the commercial MILP solvers.

Benchmarking I

15,000 synthetic shipments, consisting of 1 to 8 cartons (i.e., no foldable items), were fit into 5,284 candidate boxes using CPLEX v12.10.0 and Gurobi v9.0.0 with and without the symmetry-breaking constraints (4.4)-(4.5). Of the 15,000 synthetic shipments, 20.88% (3,132 shipments) consist of 4 or more cartons, for which the fitting MILP was solved by one of the MILP solvers since brute force fitting algorithms were used for shipments consisting of 1, 2, or 3 cartons. 173,066 fitting MILPs had to be solved for each of the eight MILP solver and constraint combinations. MILPs taking more than 5 seconds (s) to solve were terminated early. Table 4.4 shows the run times (measured in seconds) and the number of MILPs terminated early due to the 5[s] time limit (TL) for each of the eight combinations. Table 4.4 also shows the speedup and the percentage change in the number of MILPs terminated early due to the 5[s] time limit realized by using CPLEX v12.10.0 instead of Gurobi v9.0.0 and by using the symmetry-breaking constraints (4.4)-(4.5). Table 4.4 shows that CPLEX v12.10.0 is faster than Gurobi v9.0.0, but does not necessarily terminate fewer MILPs early due to the 5[s] time limit. Table 4.4 also shows that the symmetry-breaking constraints (4.4)-(4.5) yield faster run times. The symmetry-breaking constraints (4.4)-(4.5) terminate fewer MILPs early due to the 5[s] time limit for CPLEX but not for Gurobi. The symmetry-breaking constraint (4.5) alone does not improve run times much; however, (4.5) in concert with (4.4) gives a significant improvement over (4.4) alone. The benchmarking results in Table 4.4 were obtained using the same set of shipments, set of candidate boxes, software (Julia v0.6.4 and JuMP v0.18.5), operating system (Ubuntu 18.04.4 LTS (Bionic Beaver)), and hardware (an Intel Core i7-3930K CPU @ 3.20 GHz with 6 physical and 12 logical cores and 32GB RAM) described earlier in “Numerical Experiments” in Section 3. As described there, the set of shipments and the set of candidate boxes are publicly available on Mendeley Data [58].

CPLEX v12.10.0 Gurobi v9.0.0 CPLEX Speedup / %Δ\Delta # MILP TL
(4.1)-(4.3) 7490.2[s] / 129 8463.8[s] / 42 1.13 / 207.1%
(4.1)-(4.3) & (4.4) 5806.3[s] / 105 7964.0[s] / 129 1.37 / -18.6%
(4.1)-(4.3) & (4.5) 7187.2[s] / 116 8289.8[s] / 50 1.15 / 132.0%
(4.1)-(4.3) & (4.4)-(4.5) 5047.4[s] / 55 6944.0[s] / 76 1.38 / -27.6%
(4.4) Speedup / %Δ\Delta # MILP TL 1.29 / -18.6% 1.06 / 207.1%
(4.5) Speedup / %Δ\Delta # MILP TL 1.04 / -10.1% 1.02 / 19.0%
(4.4)-(4.5) Speedup / %Δ\Delta # MILP TL 1.48 / -57.4% 1.22 / 81.0%
Table 4.4: Comparison of CPLEX v12.10.0 and Gurobi v9.0.0 with and without the symmetry-breaking constraints (4.4)-(4.5). Both run times and number of MILPs terminated early due to the 5[s] time limit are compared. CPLEX v12.10.0 is faster than Gurobi v9.0.0, but does not necessarily terminate fewer MILPs early due to the 5[s] time limit. The symmetry-breaking constraints (4.4)-(4.5) yield faster run times. The symmetry-breaking constraints (4.4)-(4.5) terminate fewer MILPs early due to the 5[s] time limit for CPLEX but not for Gurobi.

Benchmarking II

20,425 historical customer shipments, consisting of less than 13 cartons, were fit into 4,922 candidate boxes using CPLEX v12.10.0 and Gurobi v9.0.0 with and without the symmetry-breaking constraints (4.4)-(4.5). Of the 20,425 historical customer shipments, 26% (5,330 shipments) consist of 4 or more cartons, for which the fitting MILP was solved by one of the MILP solvers since brute force fitting algorithms were used for shipments consisting of 0, 1, 2, or 3 cartons. Slightly under 676,000 fitting MILPs had to be solved for each of the eight MILP solver and constraint combinations. MILPs taking more than 5 seconds (s) to solve were terminated early. Table 4.5 shows the run times (measured in seconds) and the number of MILPs terminated early due to the 5[s] time limit (TL) for each of the eight combinations. Table 4.5 also shows the speedup and the percentage reduction in the number of MILPs terminated early due to the 5[s] time limit afforded by using CPLEX v12.10.0 instead of Gurobi v9.0.0 and by using the symmetry-breaking constraints (4.4)-(4.5). Table 4.5 shows that CPLEX v12.10.0 is faster than Gurobi v9.0.0, resulting in fewer MILPs terminated early due to the 5[s] time limit. Table 4.5 also shows that the symmetry-breaking constraints (4.4)-(4.5) yield faster run times, resulting in fewer MILPs terminated early due to the 5[s] time limit. The symmetry-breaking constraint (4.5) alone does not improve run times much; however, (4.5) in concert with (4.4) gives a bit of improvement over (4.4) alone. The benchmarking results in Table 4.5 were obtained using the same software (Julia v0.6.4 and JuMP v0.18.5), operating system (Ubuntu 18.04.4 LTS (Bionic Beaver)), and hardware (an Intel Core i7-3930K CPU @ 3.20 GHz with 6 physical and 12 logical cores and 32GB RAM) described earlier in “Numerical Experiments” in Section 3. Unfortunately, the set of historical customer shipments and the set of candidate boxes used to generate Table 4.5 are confidential to Target Corporation and cannot be released publicly.

CPLEX v12.10.0 Gurobi v9.0.0 CPLEX Speedup / %Δ\Delta # MILP TL
(4.1)-(4.3) 259252.0[s] / 31110 334261.9[s] / 40837 1.29 / -23.8%
(4.1)-(4.3) & (4.4) 231698.4[s] / 27606 283056.1[s] / 32600 1.22 / -15.3%
(4.1)-(4.3) & (4.5) 256932.6[s] / 30658 336187.4[s] / 40615 1.31 / -24.5%
(4.1)-(4.3) & (4.4)-(4.5) 220688.7[s] / 25832 272121.7[s] / 30902 1.23 / -16.4%
(4.4) Speedup / %Δ\Delta # MILP TL 1.12 / -11.3% 1.18 / -20.2%
(4.5) Speedup / %Δ\Delta # MILP TL 1.01 / -1.5% 0.99 / -0.5%
(4.4)-(4.5) Speedup / %Δ\Delta # MILP TL 1.17 / -17.0% 1.23 / -24.3%
Table 4.5: Comparison of CPLEX v12.10.0 and Gurobi v9.0.0 with and without the symmetry-breaking constraints (4.4)-(4.5). Both run times and number of MILPs terminated early due to the 5[s] time limit are compared. CPLEX v12.10.0 is faster than Gurobi v9.0.0, resulting in fewer MILPs terminated early due to the 5[s] time limit. The symmetry-breaking constraints (4.4)-(4.5) yield faster run times, resulting in fewer MILPs terminated early due to the 5[s] time limit.

An Additional Application

Aside from being used for box suite recommendation, an online retailer can also use the fitting MILP to recommend a box from its box suite for shipping a customer’s order. Given a suite of boxes and a customer’s order, the fitting MILP can be used to determine into which boxes the order fits, from which the box having minimum total shipping (shipping plus material) cost can be selected.

5 Summary & Future Work

This paper offers an algorithm that recommends an optimal suite of shipping boxes subject to being able to 1) lock specific boxes in the suite and 2) pack certain items that must be height-oriented and/or bottom-resting. The algorithm assumes that shipped items are either foldable (in which case they are modeled to be liquid) or rigid (in which case they are modeled as 3D rectangular cartons). If not height-oriented, the algorithm assumes that a 3D rectangular carton must be oriented in 1 of 6 possible ways when packed into a shipping box, so that its edges are parallel to those of the box. The fitting problem is formulated and solved using MILP. New symmetry-breaking constraints are introduced that lower the computation time required to solve each fitting MILP. By solving the fitting MILPs, the algorithm determines the costs of shipping a set of shipments into a set of candidate boxes. Then, given the cost matrix, the algorithm solves a pp-median problem to select the minimum cost subset of pp boxes.

An avenue for further investigation is to model additional physically accurate constraints, such as cargo stability, in the fitting problem [5, 47, 33, 32, 34, 35, 31, 63]. In future work, instead of using the computationally expensive MILP, it may be possible to solve the fitting problem more rapidly by using metaheuristics that solve the KCLP [50, 46, 48, 49, 18, 19, 52, 53, 6] or by using supervised machine learning (e.g., by training a neural network on a set of shipments and a fine set of candidate boxes, using the results of the fitting MILP or KCLP metaheuristics as truth). Another approach to reduce computation times is to use stratified random sampling [61, 39] to obtain a smaller sample of historical shipments, which would reduce the number of fitting problems and the size of the pp-median problem that must be solved.

Finally, since it is logistically challenging and expensive for an online retailer to change its box suite, the sensitivity of the optimal box suite to changes in the price of corrugate, carrier rate tables, and online customer demand should be investigated and understood.

Acknowledgements

This research was funded by Target Corporation and by the Institute for Mathematics and its Applications at the University of Minnesota, Twin Cities. The author thanks his Target colleagues Kaveh Khodjasteh and Neil Witte for their leadership and organization, Chinmay Jethwa and Sunita Venkatachalam for providing historical shipment data, Brian Ager for his leadership and organization and for providing copious data and input parameters, and Jake Streich for his expertise in packaging engineering. Brian Ager suggested the idea of optimizing the box suite based on a statistically significant, randomly sampled subset of the previous year’s customer shipments. Francisco Casas B. provided advice on using, improved, and corrected errors in his software dc2.

References

  • [1] B.F. AlBdaiwi and H.M.F. AboElFotoh “A GPU-based genetic algorithm for the pp-median problem” In The Journal of Supercomputing 73.10 Springer, 2017, pp. 4221–4244
  • [2] M.T. Alonso, R. Alvarez-Valdes, F. Parreño and J.M. Tamarit “Determining the best shipper sizes for sending products to customers” In International Transactions in Operational Research 23.1-2 Wiley Online Library, 2016, pp. 265–285
  • [3] V. Arya et al. “Local search heuristics for kk-median and facility location problems” In SIAM Journal on Computing 33.3 SIAM, 2004, pp. 544–562
  • [4] J. Bezanson, A. Edelman, S. Karpinski and V.B. Shah “Julia: A fresh approach to numerical computing” In SIAM Review 59.1 SIAM, 2017, pp. 65–98 DOI: 10.1137/141000671
  • [5] A. Bortfeldt and G. Wäscher “Constraints in container loading–A state-of-the-art review” In European Journal of Operational Research 229.1 Elsevier, 2013, pp. 1–20
  • [6] J. Brinker and H.I. Gündüz “Optimization of demand-related packaging sizes using a pp-median approach” In The International Journal of Advanced Manufacturing Technology 87.5-8 Springer, 2016, pp. 2259–2268
  • [7] F. Cannizzo “A fast and vectorizable alternative to binary search in O(1)O(1) with wide applicability to arrays of floating point numbers” In Journal of Parallel and Distributed Computing 113 Elsevier, 2018, pp. 37–54
  • [8] “CBC” URL: https://github.com/coin-or/Cbc
  • [9] C.S. Chen, S.-M. Lee and Q.S. Shen “An analytical model for the container loading problem” In European Journal of Operational Research 80.1 Elsevier, 1995, pp. 68–76
  • [10] M. Conforti, G. Cornuéjols and G. Zambelli “Integer programming” Springer, 2014
  • [11] G. Cornuéjols, G. Nemhauser and L. Wolsey “The Uncapicitated Facility Location Problem”, 1983
  • [12] M.S. Daskin “Median Problems” In Network and Discrete Location: Models, Algorithms, and Applications John Wiley & Sons, 2013
  • [13] M.S. Daskin and K.L. Maass “The pp-median problem” In Location science Springer, 2015, pp. 21–45
  • [14] “dc2” URL: https://github.com/autopawn/dc2/releases/tag/v1.1.0
  • [15] P.J. Densham and G. Rushton “Strategies for solving large location-allocation problems by heuristic methods” In Environment and Planning A 24.2 SAGE Publications Sage UK: London, England, 1992, pp. 289–304
  • [16] K.A. Dowsland, E. Soubeiga and E. Burke “A simulated annealing based hyperheuristic for determining shipper sizes for storage and transportation” In European Journal of Operational Research 179.3 Elsevier, 2007, pp. 759–774
  • [17] I. Dunning, J. Huchette and M. Lubin “JuMP: A Modeling Language for Mathematical Optimization” In SIAM Review 59.2, 2017, pp. 295–320 DOI: 10.1137/15M1020575
  • [18] T. Fanslau and A. Bortfeldt “A tree search algorithm for solving the container loading problem” In INFORMS Journal on Computing 22.2 Informs, 2010, pp. 222–235
  • [19] J.F. Gonçalves and M.G.C. Resende “A parallel multi-population biased random-key genetic algorithm for a container loading problem” In Computers & Operations Research 39.2 Elsevier, 2012, pp. 179–190
  • [20] “Gurobi” URL: https://www.gurobi.com
  • [21] S.L. Hakimi “Optimum locations of switching centers and the absolute centers and medians of a graph” In Operations Research 12.3 Informs, 1964, pp. 450–459
  • [22] S.L. Hakimi “Optimum distribution of switching centers in a communication network and some related graph theoretic problems” In Operations Research 13.3 INFORMS, 1965, pp. 462–475
  • [23] P. Hansen and N. Mladenović “Variable neighborhood search for the pp-median” In Location Science 5.4 Elsevier, 1997, pp. 207–226
  • [24] H. Hu et al. “Solving a new 3d bin packing problem with deep reinforcement learning method” In arXiv preprint arXiv:1708.05930, 2017
  • [25] Y.-H. Huang and F.J. Hwang “Global optimization for the three-dimensional open-dimension rectangular packing problem” In Engineering Optimization 50.10 Taylor & Francis, 2018, pp. 1789–1809
  • [26] “IBM ILOG CPLEX Optimization Studio” URL: https://www.ibm.com/products/ilog-cplex-optimization-studio
  • [27] K. Jain and V.V. Vazirani “Primal-dual approximation algorithms for metric facility location and kk-median problems” In 40th Annual Symposium on Foundations of Computer Science, 1999, pp. 2–13 IEEE
  • [28] K. Jain and V.V. Vazirani “Approximation algorithms for metric facility location and kk-median problems using the primal-dual schema and Lagrangian relaxation” In Journal of the ACM 48.2 ACM New York, NY, USA, 2001, pp. 274–296
  • [29] D.S. Johnson and M.R. Garey “Computers and intractability: A guide to the theory of NP-completeness” WH Freeman, 1979
  • [30] “Julia” URL: https://julialang.org
  • [31] L. Junqueira and R. Morabito “On solving three-dimensional open-dimension rectangular packing problems” In Engineering Optimization 49.5 Taylor & Francis, 2017, pp. 733–745
  • [32] L. Junqueira, R. Morabito and D.S. Yamashita “MIP-based approaches for the container loading problem with multi-drop constraints” In Annals of Operations Research 199.1 Springer, 2012, pp. 51–75
  • [33] L. Junqueira, R. Morabito and D.S. Yamashita “Three-dimensional container loading models with cargo stability and load bearing constraints” In Computers & Operations Research 39.1 Elsevier, 2012, pp. 74–85
  • [34] L. Junqueira, R. Morabito, D.S. Yamashita and H.H. Yanasse “Optimization models for the three-dimensional container loading problem with practical constraints” In Modeling and Optimization in Space Engineering Springer, 2012, pp. 271–293
  • [35] L. Junqueira, J.F. Oliveira, M.A. Carravilla and R. Morabito “An optimization model for the vehicle routing problem with practical three-dimensional loading constraints” In International Transactions in Operational Research 20.5 Wiley Online Library, 2013, pp. 645–666
  • [36] O. Kariv and S.L. Hakimi “An algorithmic approach to network location problems. II: The pp-medians” In SIAM Journal on Applied Mathematics 37.3 SIAM, 1979, pp. 539–560
  • [37] Y. Kochetov, T. Levanova, E. Alekseeva and M. Loresh “Large neighborhood local search for the pp-median problem” In Yugoslav Journal of Operations Research 15.1 University of Belgrade-Faculty of Organizational Sciences, Belgrade, et al., 2005, pp. 53–63
  • [38] C. Kwon “Lagrangian Relaxation” In Julia programming for operations research Independently Published, 2019
  • [39] P.S. Levy and S. Lemeshow “Sampling of populations: methods and applications” John Wiley & Sons, 2013
  • [40] M.-H. Lin, J.-F. Tsai and S.-C. Chang “A superior linearization method for signomial discrete functions in solving three-dimensional open-dimension rectangular packing problems” In Engineering Optimization 49.5 Taylor & Francis, 2017, pp. 746–761
  • [41] S. Lu, L. Yang, W. Liu and L. Jia “User preference for electronic commerce overpackaging solutions: Implications for cleaner production” In Journal of Cleaner Production 258 Elsevier, 2020, pp. 120936
  • [42] S. Martello, D. Pisinger and D. Vigo “The three-dimensional bin packing problem” In Operations Research 48.2 INFORMS, 2000, pp. 256–267
  • [43] S. Martello et al. “Algorithm 864: General and robot-packable variants of the three-dimensional bin packing problem” In ACM Transactions on Mathematical Software (TOMS) 33.1 ACM, 2007, pp. 1–12
  • [44] J.C. McGinty “A Nation Awash in Cardboard, but for How Long?” In The Wall Street Journal, 2019 URL: https://www.wsj.com/articles/a-nation-awash-in-cardboard-but-for-how-long-11565348400
  • [45] N. Mladenović, J. Brimberg, P. Hansen and J.A. Moreno-Pérez “The pp-median problem: A survey of metaheuristic approaches” In European Journal of Operational Research 179.3 Elsevier, 2007, pp. 927–939
  • [46] A. Moura and J.F. Oliveira “A GRASP approach to the container-loading problem” In IEEE Intelligent Systems 20.4 IEEE, 2005, pp. 50–57
  • [47] C. Paquay, M. Schyns and S. Limbourg “A mixed integer programming formulation for the three-dimensional bin packing problem deriving from an air cargo application” In International Transactions in Operational Research 23.1-2 Wiley Online Library, 2016, pp. 187–213
  • [48] F. Parreño, R. Alvarez-Valdés, J.M. Tamarit and J.F. Oliveira “A maximal-space algorithm for the container loading problem” In INFORMS Journal on Computing 20.3 INFORMS, 2008, pp. 412–422
  • [49] F. Parreño, R. Alvarez-Valdés, J.F. Oliveira and J.M. Tamarit “Neighborhood structures for the container loading problem: a VNS implementation” In Journal of Heuristics 16.1 Springer, 2010, pp. 1–22
  • [50] D. Pisinger “Heuristics for the container loading problem” In European Journal of Operational Research 141.2 Elsevier, 2002, pp. 382–392
  • [51] “POPSTAR” URL: http://mauricio.resende.info/popstar/popstar.html
  • [52] A.G. Ramos, J.F. Oliveira and M.P. Lopes “A physical packing sequence algorithm for the container loading problem with static mechanical equilibrium conditions” In International Transactions in Operational Research 23.1-2 Wiley Online Library, 2016, pp. 215–238
  • [53] A.G. Ramos, J.F. Oliveira, J.F. Gonçalves and M.P. Lopes “A container loading algorithm with static mechanical equilibrium stability constraints” In Transportation Research Part B: Methodological 91 Elsevier, 2016, pp. 565–581
  • [54] J. Reese “Solution methods for the pp-median problem: An annotated bibliography” In NETWORKS: An International Journal 48.3 Wiley Online Library, 2006, pp. 125–142
  • [55] Z. Ren, H. Jiang, J. Xuan and Z. Luo “Ant based hyper heuristics with space reduction: a case study of the pp-median problem” In International Conference on Parallel Problem Solving from Nature, 2010, pp. 546–555 Springer
  • [56] M.G.C. Resende and R.F. Werneck “A hybrid heuristic for the pp-median problem” In Journal of Heuristics 10.1 Springer, 2004, pp. 59–88
  • [57] M.G.C. Resende and R.F. Werneck “A fast swap-based local search procedure for location problems” In Annals of Operations Research 150.1 Springer, 2007, pp. 205–230
  • [58] S.M. Rogers “Box Suite Recommendation” Mendeley, 2020 DOI: 10.17632/F2BNNNM5ZC.3
  • [59] L. Santos et al. “A parallel GRASP resolution for a GPU architecture” In International Conference on Metaheuristics and Nature Inspired Computing, META10, Tunisia, 2010, 2010
  • [60] L. Stevens and E.E. Phillips “Amazon Puzzles Over the Perfect Fit–in Boxes” In The Wall Street Journal, 2017 URL: https://www.wsj.com/articles/amazon-aims-for-one-box-fits-all-1513765800
  • [61] M. Stroehmer “Repac - reduced packaging assortment costs for sustainable transport packaging optimization” In Eighteenth IAPRI World Packaging Conference DEStech, 2012, pp. 335–341
  • [62] M.B. Teitz and P. Bart “Heuristic methods for estimating the generalized vertex median of a weighted graph” In Operations Research 16.5 INFORMS, 1968, pp. 955–961
  • [63] C.T.T. Truong et al. “A product arrangement optimization method to reduce packaging environmental impacts” In International Conference on Sustainable Energy and Green Technology, 2019
  • [64] J.-F. Tsai and H.-L. Li “A global optimization method for packing problems” In Engineering Optimization 38.6 Taylor & Francis, 2006, pp. 687–700
  • [65] J.-F. Tsai, P.-C. Wang and M.-H. Lin “A global optimization approach for solving three-dimensional open dimension rectangular packing problems” In Optimization 64.12 Taylor & Francis, 2015, pp. 2601–2618
  • [66] R.A. Whitaker “A fast algorithm for the greedy interchange for large-scale clustering and median location problems” In INFOR: Information Systems and Operational Research 21.2 Taylor & Francis, 1983, pp. 95–108
  • [67] M. Wilson “The hot new product Amazon and Target are obsessing over? Boxes” In Fast Company, 2019 URL: https://www.fastcompany.com/90342864/rethinking-the-cardboard-box-has-never-been-more-important-just-ask-amazon-and-target