Manuscript Offprint
arXiv:2610.40169Retrieval Sequencing in a Compact Storage System with Side Access
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
In a compact storage system with side access, bins are arranged in adjacent vertical stacks. In each retrieval cycle, bins blocking access are lifted to create a temporary tunnel through which a robot extracts one requested bin from the side. The lifted bins are then lowered again, and the energy expenditure of the cycle equals the number of lifted bins. Given a pick list known in advance, we seek a retrieval order that minimizes total energy expenditure. For every number of stacks, we prove that the total energy separates into an instance constant and a pairwise penalty, and that every energy-optimal order is laminar within each stack. For two stacks, we prove that the retrieval sequencing problem is solvable in polynomial time. For three stacks, we give an exact polynomial-time reduction to a merge problem and characterize which merge-problem instances arise from the storage model. We define a recursive class of retrieval orders and construct a polynomial-time dynamic program that minimizes energy expenditure over this class. Finally, we quantify the additional energy savings from batching, which allows several requested bins to be retrieved in one cycle.
Keywords: Order picking; compact storage; retrieval sequencing; computational complexity; dynamic programming
1 Introduction
Compact storage systems eliminate the aisles of conventional warehouses. Bins are arranged in vertical stacks placed directly next to one another, and autonomous robots (bots) store and retrieve them. The bins requested for retrieval are called target bins, or simply targets. In the side-access system introduced by Fauvé and Neumann (2023), a target bin is retrieved by lifting all bins that block access, creating a temporary tunnel through which a bot extracts the target from the side. A retrieval cycle consists of lifting the blocking bins, extracting the target bin, and lowering the lifted bins again. The energy expenditure of the cycle equals the number of lifted bins.
We consider a pick list of target bins known before retrieval begins, with exactly one target bin retrieved in each cycle. The objective is to determine a retrieval order that minimizes total energy expenditure. Earlier retrievals change the number of bins in the stacks and the heights of the remaining target bins, affecting both their accessibility and the energy required to retrieve them. We therefore investigate the structure of optimal retrieval orders and how the number of stacks affects the computational complexity of finding them.
Previous work. Research on compact storage includes puzzle-based or live-cube systems (Gue and Kim 2007, Zaerpour et al. 2017) and robotic compact storage and retrieval systems (Tappia et al. 2017, Zou et al. 2018). AutoStore is a prominent example of the latter class. Meller (2023) describes its principal components and identifies the interacting requirements and decision variables governing system design. Its robots access bins from above, whereas the system studied here creates a temporary tunnel for side access. Within the puzzle-based literature, Yalcin et al. (2019) study single-item retrieval on a sliding grid. Related structural assumptions and computability considerations for automated compact storage are discussed by Fauvé et al. (2024). For a comprehensive overview of these and other types of storage systems, see Fauvé (2026), as well as Azadeh et al. (2019) and Boysen and de Koster (2025).
Complexity boundaries governed by stack parameters also arise in adjacent stacking models. Lehnfeld and Knust (2014) survey known complexity results for stack loading, unloading, and premarshalling. For the Block Retrieval Problem, de Melo da Silva et al. (2018) prove NP-hardness when the number of stacks is part of the input and polynomial-time solvability for every fixed number of stacks. For storage loading with stacking constraints, Bruns et al. (2016) obtain polynomial-time algorithms at stack capacity two and strong NP-completeness for several variants in which each stack has capacity three. Unlike these models, retrieval costs here arise from temporarily lifting bins rather than relocating them between stacks.
Fliedner et al. (2026) initiate the algorithmic study of this recently introduced storage system through the Side-Access Compact Retrieval Problem (SACRP), which allows several targets to be retrieved in one cycle. They establish strong NP-completeness and develop exact solution methods. We study the single-target case to understand the structure and complexity of the underlying sequencing problem. This removes the grouping decision while retaining the effects of earlier retrievals on accessibility and energy expenditure. Determining when this basic case admits polynomial-time optimization provides a starting point for developing efficient retrieval policies for the system.
Our Contribution. We express total energy expenditure as an instance-dependent constant and a pairwise ordering penalty, and prove within-stack laminarity for any number of stacks. The lower targets retrieved before a given target form a consecutive block beginning with the next target below it. This restriction remains valid despite interactions between stacks, allowing algorithms to exclude all orders that violate it without losing an optimum. For two stacks, the exact reduction to M2 and this structure yield an -time dynamic program.
Extending this approach to three stacks requires selecting and interleaving the orders of stacks 2 and 3. The exact reduction to M3 represents these interactions but leaves this optimization problem to be solved. We develop a recursive decomposition that permits polynomial-time optimization over a class of retrieval orders. Whether this class contains an optimal order for every feasible three-stack instance remains open. The computational study assesses the practical benefit of exploiting this structure through computation times and energy savings, and quantifies the additional savings from batching.
A preliminary version submitted to the GOR proceedings contains the two-stack result, the three-stack reduction, and the realizability theorem, and outlines the three-stack dynamic program (Gül 2026). The present paper establishes within-stack laminarity for every number of stacks and develops the full recursive formulation and its guarantees.
Sections 2–3 formulate the problem and establish the penalty identity and within-stack laminarity. Section 4 solves the two-stack case; Sections 5–6 develop the three-stack reduction, realizability characterization, and dynamic program. Section 7 evaluates computation times and energy savings from sequencing and batching. Section 8 concludes with open problems.
2.1 The Storage System and Retrieval Problem
We consider a compact storage system with side access, following the physical model of Fliedner et al. (2026). The system consists of rack modules, called slices, each containing a row of adjacent vertical stacks. Since slices operate independently, we consider one slice, represented by a sequence of stacks , indexed from the entry side. Stack initially contains uniform bins, placed directly on top of one another without gaps. The height of a bin is the number of bins below it, so stack contains bins at heights .
Two lifting mechanisms provide access to the bins. A bot lift raises the bot to the required height at the entry side. A top lift engages bins in the stacks and raises each engaged bin together with all bins above it. We assume sufficient vertical headroom for these lifts. Raising the blocking bins in consecutive stacks creates a horizontal tunnel through which the bot drives to reach a target bin from the side.
We are given a pick list of target bins, where . We assume that the entire pick list is available before retrieval begins. Each target has stack and initial height , with , and distinct targets occupy distinct positions. An instance is specified by the stack counts and target positions, with all integers encoded in binary.
Retrieval proceeds in cycles, each of which retrieves exactly one target. The bot drives on top of the bins left in place, without rails. To retrieve target from its current height , every preceding stack must retain exactly bins. If any preceding stack contains fewer than bins, is not accessible because the bot cannot cross that stack at height . Stack must retain and the bins below it. Equivalently, the clearance level is in every preceding stack and in the target stack. No bins in later stacks are raised. We call accessible if these clearance levels are valid in the current configuration. The resulting lifts clear the horizontal path to and remove the bins blocking its retrieval from above. After leaves the system, all lifted bins are lowered. The lifted substack above drops by one level, whereas bins lifted from preceding stacks return to their previous heights. No non-target bin is relocated to another stack. The energy expenditure of the cycle is the number of lifted bins. Figure 1 illustrates a two-cycle retrieval process.
A solution consists of exactly cycles and is therefore determined by a permutation of , the retrieval order. Feasibility and energy expenditure depend on this order, since earlier retrievals change bin counts and target heights. We write if is retrieved before under , and call feasible if every target is accessible when it is retrieved. Its total energy is the sum of the energy expenditures of its cycles. The objective is to find a feasible retrieval order minimizing .
For a target in a retrieval order , let denote the number of targets retrieved from stack before , and let denote the number of targets below in its own stack that are retrieved before , that is, the within-stack inversion count of . When is retrieved, stack contains bins, and is at height . Hence, is feasible if and only if
At the instance level, let denote the total number of targets initially below b in its stack. By Fliedner et al. (2026), an instance admits a feasible retrieval order if and only if
Necessity follows because can descend by at most levels. Sufficiency follows by processing the stacks from right to left and each stack from bottom to top. Throughout, denotes the initial height of target , and denotes the initial number of bins in stack .
2.2 The Penalty Identity
Earlier retrievals affect the energy expenditure of the cycle retrieving a target b in two ways. Namely, (i) a target retrieved before b from b's stack or a preceding stack removes one bin that the cycle of b would

(a)
(b)

(c)
(d)
Figure 1: Illustration of two retrieval cycles. Consider a layout with four stacks and pick list , where . Figure 1(a) shows the initial configuration. In the first cycle (Figure 1(b)), target is retrieved with an energy expenditure of 1, resulting in the configuration shown in Figure 1(c). In the second cycle (Figure 1(d)), target is retrieved with an energy expenditure of 4. The resulting total energy expenditure is . Targets are highlighted in dark gray, and lifted bins in each cycle are shown in light gray.
otherwise lift, and (ii) a target retrieved before b from below b in the same stack lowers b by one level, so that the cycle lifts one additional bin in each of the stacks traversed by the bot. These effects are additive across previously retrieved targets. Summing them over all retrievals separates the total energy into an order-independent constant and a pairwise penalty, as stated in the following lemma.
Lemma 1 (Penalty identity). For every feasible retrieval order ,
where the baseline K does not depend on and the penalty is a sum over unordered pairs of targets. A pair from distinct stacks contributes 1 if the target from the higher-indexed stack is retrieved first, and a pair from a common stack s contributes s if the lower target is retrieved first. Every other pair contributes 0.
Equivalently, let be the number of targets in stack t. Using and as defined above, we have
The first term counts targets below b that are retrieved before b, each with weight ; the second counts targets in preceding stacks that are retrieved after b.
Proof. Fix a target . Before is retrieved, stack contains bins. Moreover, descends one level whenever a target below it in the same stack is retrieved. Thus, when is retrieved, it is at height .
To clear the tunnel for , we lift every bin at height or above in each preceding stack , and every bin strictly above in stack . Hence,
Feasibility ensures that each preceding stack reaches height and that stack contains at that height. Summing over all targets gives
Both A and R can be written as sums over ordered pairs with :
Each unordered pair appears once, indexed by its earlier target. counts every same-stack pair retrieved bottom-up, with weight equal to the stack index. Thus, .
counts every same-stack pair once. For two targets in different stacks, it counts the pair if the target in the lower-index stack is retrieved first. Consequently, the only unordered pairs not counted by are cross-stack pairs for which the target in the higher-index stack is retrieved first. These are precisely the pairs contributing to . Hence, . Combining this identity with gives
We index each same-stack bottom-up pair by its upper target. If is below in the same stack and , then this pair is counted by and contributes . Therefore, . Moreover, we index each cross-stack pair by its earlier target , which lies in the higher-index stack. For each , there are targets in stack retrieved after , each forming one cross-stack pair with . Summing over all targets and preceding stacks gives
Because is independent of the retrieval order, minimizing is equivalent to minimizing . In the per-element form, the feasibility condition (1) becomes
3 Within-Stack Laminarity of Optima
In this section, we examine the order in which targets are retrieved from the same stack. We show that, in every optimal retrieval order, the lower targets retrieved before any given target form a consecutive block in the stack's top-to-bottom sequence of targets, beginning with the next target below it. We call an order with this property within every stack a laminar-delay order. This result holds for any number of stacks. We prove it using an exchange argument, called the stack-local promotion swap, which transforms any violation of this structure into a feasible order with strictly lower energy expenditure.
Consider a stack containing targets, which we index from top to bottom by , so that their heights satisfy . For a feasible retrieval order and a target in stack , we denote by the set of targets below that are retrieved before :
We refer to as the within-stack inversion set of x. Moreover, we call each target in an inverted successor of x.
We say that is a prefix if it consists of the first targets below in top-to-bottom order, that is, . We call an order of the sequence a laminar-delay order if the within-stack inversion set of every target is a prefix.
For every preceding stack , we define the cap of with respect to stack as . Each inverted successor retrieved before lowers by one level and therefore increases its cap by one. Since , the feasibility constraint (1) becomes
Moreover, if , then is above . Since consecutive targets are at least one level apart, . Consequently, for every .
Suppose is not a prefix. Let be the largest index between and that does not belong to . Thus, is retrieved after , whereas every target with index in is retrieved before . Let be the last of these targets to be retrieved. Exchanging the positions of and removes exactly one within-stack inversion and leaves all other cost terms unchanged. The cap inequality above ensures that both targets remain feasible after the exchange.
Lemma 2 (Stack-local promotion swap). Let be any feasible order, a stack, and a target of stack whose within-stack inversion set is not a prefix. Let , and let be the largest index between and that does not belong to . Then and . Let be the target in that is retrieved last under . Exchanging the positions of and in yields a feasible order with
in which the inversion set of becomes , and the position, , and of every target remain unchanged.
The proof of Lemma 2 is provided in Appendix A.1.
Based on Lemma 2, the following result immediately follows.
Corollary 1 (Within-stack laminarity of optima). In every optimal retrieval order, each target's within-stack inversion set is a prefix. Equivalently, the restriction of the order to any stack is a laminar-delay order of that stack's top-down sequence.
Proof. Suppose an optimal order contains a target x whose within-stack inversion set is not a prefix. Lemma 2 then yields a feasible order with strictly smaller energy, contradicting optimality. The equivalence follows as within-stack inversion sets depend only on the relative order of targets in the same stack.
Corollary 1 characterizes the within-stack structure of an optimal order for any number of stacks. Thus, the search within each stack is restricted to laminar-delay orders rather than arbitrary permutations. Building on this result, we analyze the cases of two and three stacks in Sections 4 and 5, respectively.
4 Two Stacks: An Exact Reduction and a Polynomial-Time Algorithm
We solve the two-stack problem in time through an exact reduction (Section 4.1) and a dynamic program over laminar-delay orders (Section 4.2). Optimality follows from the top-target decomposition (Section 4.3) and a feasible, cost-reducing promotion swap (Section 4.4).
4.1 An Exact Reduction to a One-Dimensional Scheduling Problem
Let m = 2. Observe that the targets in stack 1 can be retrieved from top to bottom without loss of optimality. This order avoids every within-stack penalty in stack 1, while stack 1 affects the feasibility and cost of a stack 2 target only through the number of its targets already retrieved. Consequently, we can represent stack 1 by this number. We must therefore choose the order of the stack 2 targets and the number of stack 1 targets retrieved before each of them. This yields the following one-dimensional scheduling problem.
Theorem 1 (Reduction to M2). Let an instance have targets in stack 1 and targets in stack 2, the latter indexed from top to bottom by , with caps , which are strictly increasing integers. Then minimizing is equivalent to the following problem (M2): choose a permutation of and, for each target with index , an integer representing the number of stack 1 targets retrieved before . The values are nondecreasing along and satisfy
Here, is the within-stack inversion count of target j. The objective is to minimize
The instance is feasible if and only if for every .
The proof is given in Appendix A.2.
In the objective (6), each stack 1 target that remains when a stack 2 target is retrieved contributes one unit to the penalty. Each inversion among the stack 2 targets contributes two units: retrieving a lower target first lowers the upper target by one level, so that its retrieval requires lifting one additional bin in each of the two traversed stacks (Lemma 1). Retrieving lower stack 2 targets before target also raises its cap from to .
4.2 Laminar-Delay Orders and the Dynamic Program
We next develop a polynomial-time algorithm for M2. Since , constraint (5) implies that every feasible solution satisfies . Because the caps are strictly increasing integers, this upper bound is nondecreasing in (see Appendix A.2, Lemma 7).
Nevertheless, it may be beneficial to retrieve a lower target before an upper target. Suppose that target j is delayed past one additional lower target. Then increases by one, which adds 2 to the objective. At the same time, the upper bound on may increase by one. This may permit a larger value of , reducing the term , and may also affect the values assigned to other targets. Hence, whether target j should be delayed depends on the order and values of the remaining targets.
By Corollary 1, the order of the stack-2 targets in every optimal solution of M2 is a laminar-delay order. The following recursive characterization yields the decomposition used by the dynamic program.
For a target , we call a set an index prefix if or for some .
Lemma 3 (Characterization of laminar-delay orders). An order of can be generated recursively by
where an empty interval generates the empty order, if and only if, for every j, its inversion set
is an index prefix. Thus, the generated orders are precisely the laminar-delay orders. In this case, since , any two intervals are either disjoint or one contains the other.
The proof is given in Appendix A.2.
This recursive decomposition leads to the following dynamic program.
Proposition 1 (Two-stack dynamic program). For and , let denote the minimum cost of a feasible laminar-delay order on whose values lie in . Set when .
For a nonempty interval, target is either retrieved first with value , leaving the state , or delayed past . In the latter case, its inversion count satisfies , and the two remaining states are and . Hence,
(7)
The dynamic program has states. For each state, the first case contains feasible values of , while the second contains feasible pairs . Therefore, it runs in time.
4.3 The Decomposition at the Top Target
In recurrence (7), the set of targets retrieved before is either empty or equal to for some . We now show that restricting the recurrence to these sets does not exclude an optimal solution.
Consider an arbitrary order on an interval with window , and let . Let denote the set of targets retrieved before , and set . The targets in are retrieved first, followed by , while all targets in are retrieved afterward. If is not a consecutive block, two additional effects may arise. First, a target in and a target in may form an additional inversion. Second, retrieving the targets in may increase the caps of some targets in . We formalize these two effects as follows.
Because every target in is retrieved before every target in , a pair is an inversion exactly when . Let cross denote the number of these additional inversions. If , then cross, since is the number of targets in with index smaller than .
For a set of targets, consider the M2 instance obtained by deleting every target outside . The value and the caps of the targets in remain unchanged, and the targets are relabeled consecutively in increasing order of their original indices. For a window , let denote the minimum cost of this instance when all values are restricted to . Similarly, denotes the minimum cost under the same objective after increasing the cap of each by .
Proposition 2 (Decomposition at the top target). Let , , and .
(a) Suppose a feasible solution on , with values in , has cost . Suppose also that a feasible solution on , with values in , has cost after the cap of each is increased by . Retrieving the targets in according to the first solution, then with value , and finally the remaining targets according to the second solution gives a feasible solution on with cost . Any solution on that is feasible under the original caps may also be used, since increasing the caps preserves feasibility.
(b) Conversely, consider a feasible solution on I in which precisely the targets in B are retrieved before j, and j is assigned value v. Its restriction to B is feasible with values in . Its restriction to uses values in and is feasible under the increased caps. The total cost remains .
If , then for every and . Consequently, no cap is increased and cross() = 0.
The proof is given in Appendix A.2.
4.4 The Core Exchange
We now show that, in the decomposition of Proposition 2, an arbitrary set can be replaced by the index prefix of the same cardinality without increasing the cost. An adjacent exchange may violate the cap of the upper target, whereas an arbitrary nonadjacent exchange may also change the inversion counts of targets between the exchanged positions. We therefore introduce the following promotion swap.
Consider a windowed M2 instance with targets 1, ..., q, strictly increasing integer caps , and a window [lo, hi], where . A feasible solution has values that are nondecreasing along and satisfy
Its cost is .
Let , and suppose that is not an index prefix. Set and , and let be the target in retrieved last under . Then . The promotion swap exchanges the positions of and , leaving the value assigned to each position unchanged. By construction, every target between and in satisfies or . Hence, its inversion count remains unchanged. The strict increase of the cap sequence ensures that both exchanged targets remain feasible. The swap replaces by , decreases the total inversion count by one, and therefore decreases the cost by exactly 2. The complete proof is provided by Lemma 8 in Appendix A.3.
Lemma 8 implies that the inversion set of target 1 is an index prefix in every optimal solution of a windowed instance (see Appendix A.3, Corollary 3). Applying this property recursively to the two subproblems in Proposition 2 shows that the order of every optimal solution is a laminar-delay order (see Appendix A.3, Corollary 4).
Accordingly, repeated promotion swaps transform a nonprefix inversion set into the prefix of the same size, preserve the top value, and strictly decrease the cost.
Theorem 2 (Core exchange). With the notation of Proposition 2, let , set , and let . Define
Then
If , then .
The proof is given in Appendix A.3.
Propositions 1 and 2, together with Theorem 2, yield the following theorem.
Theorem 3 (Polynomial-time solvability for two stacks). For every window [lo, hi] and every index interval ,
Consequently, the retrieval sequencing problem with two stacks can be solved in time.
The proof is given in Appendix A.3.
Thus, for two stacks, it is sufficient to consider retrieval orders in which every delayed target is preceded by a consecutive block of targets immediately below it. The dynamic program enumerates exactly these recursive delay decisions and therefore computes an optimal retrieval order in polynomial time.
5 Three Stacks: Exact Reduction and Realizability
We extend the two-stack reduction to the merge problem M3, which interleaves the retrieval orders of stacks 2 and 3 (Section 5.1), and characterize exactly which M3 instances arise from the storage model (Section 5.2).
5.1 Reduction to the Merge Problem M3
Consider an instance with m = 3. As in the two-stack case, the targets in stack 1 can be retrieved from top to bottom without loss of optimality. This order avoids every within-stack penalty in stack 1, while stack 1 affects the feasibility and cost of targets in stacks 2 and 3 only through the number of its targets already retrieved. Consequently, we represent stack 1 by this number, denoted by .
Let and denote the target sets of stacks 2 and 3, respectively, and let and . Within each stack, we index the targets from top to bottom, as in Section 3. This yields the following merge problem.
Theorem 4 (Reduction to M3). Consider an instance of the retrieval sequencing problem with , and let denote the number of targets in stack 1. For each , define . For each , define
A solution to problem M3 consists of an order of and, for each target , an integer representing the number of stack-1 targets retrieved before . The values are nondecreasing along . Let
Here, and are the within-stack inversion counts of targets and , respectively. For each , let
The feasibility conditions are
and the cost is
The minimum cost of problem M3 equals the minimum penalty over all feasible retrieval orders .
Problem M3 differs from problem M2 through the interaction between stacks 2 and 3. For each , retrieving more stack-2 targets before reduces its contribution to (9) but may violate its feasibility bound in (8). The interleaving must therefore balance these two effects.
Consider a feasible retrieval order in which the targets in stack 1 are retrieved from top to bottom. Deleting these targets yields the order , and setting equal to the number of stack-1 targets preceding b yields a feasible solution to problem M3. Conversely, any feasible solution to problem M3 defines a feasible retrieval order by inserting the stack-1 targets into , in top-to-bottom order, so that exactly of them precede each target b, and placing any remaining stack-1 targets last. By Lemma 1, the two solutions have the same cost. The complete proof is provided in Appendix A.4.
delayed target
block: next stack-2 target (2, 2),
uppermost stack-3 target (3, 1)
suffix
(3, 1)
(2, 2)
(2, 1)
(2, 3)
(3, 2)
values in [lo, v]
{v}
values in [v, hi]
retrieval order
Figure 2: Illustration of the delayed case. Target (2, 1) is retrieved after a block containing targets (2, 2) and (3, 1), followed by the remaining targets. Values lie in [lo, v] within the block and in [v, hi] afterward; the delayed target receives value v. Each target is labeled by its stack and top-to-bottom index.
5.2 Realizability
By Theorem 4, a three-stack instance is represented by a tuple , where is a nonnegative integer, is an integer, and and are finite integer sequences, possibly empty. We refer to this tuple as the cap vector of the instance. A cap vector is admissible if both and are strictly increasing, and realizable if it is induced by an instance.
Observe that every realizable cap vector is admissible, as target heights strictly decrease with their top-to-bottom indices. If is nonempty, the height range in stack 2 further implies . Theorem 5 shows that these necessary conditions are also sufficient.
Theorem 5 (Realizability). Let be a nonnegative integer, let and be finite integer sequences, possibly empty, and let be an integer. Then the tuple is realizable if and only if it is admissible and either is empty or .
The proof is given in Appendix A.4. Its sufficiency direction is constructive.
6 The Joint-Interval Dynamic Program and its Soundness
In this section, we develop a dynamic programming approach for the three-stack problem M3. The main idea is based on a recursive decomposition of the target sequences of stacks 2 and 3. At each step, the uppermost remaining target of either stack is retrieved immediately or delayed behind a structured block of targets. We characterize the class of retrieval orders generated by this decomposition and show that a minimum-cost order in this class can be computed in polynomial time.
Consider a subproblem defined by one interval of targets from each of stacks 2 and 3. The dynamic program selects the uppermost target of either interval. It may retrieve this target first within the subproblem. Alternatively, it may delay the target until after a block containing a nonempty consecutive sequence of the next targets in the same stack and, possibly, a consecutive sequence beginning with the uppermost target of the other stack. The targets from the two sequences may be interleaved within the block. The same decomposition is then applied recursively to this block and to the targets retrieved after the delayed target.
The solution space explored by the dynamic program consists of all retrieval orders that can be constructed entirely through these two cases. Figure 2 illustrates the delayed case. A formal definition of the recursive decomposition is given in Definition 1 in Appendix A.5.
Proposition 3 (Three-stack dynamic program). A state comprises two index intervals and , a value window , and an integer B. The intervals identify the stack-2 and stack-3 targets in the subproblem. The value window bounds the number of stack-1 targets that may precede these targets, while B equals the number of stack-2 targets retrieved before any target in the subproblem.
Let denote the minimum cost for this state over feasible recursively decomposable orders, with when both intervals are empty. For a nonempty state, cases (I2) and (I3) immediately retrieve the uppermost remaining target from stacks 2 and 3, respectively, while cases (D2) and (D3) delay the corresponding target until after a block of targets has been retrieved. In a delayed case, the block is assigned values in , the delayed target receives value , and the remaining targets are assigned values in . The resulting recurrence is
where
(I2)
Here . Cases (I2) and (D2) apply only when , while cases (I3) and (D3) apply only when . In (D2), the block boundaries satisfy and . In (D3), they satisfy and . These bounds ensure that the block contains at least one additional target from the same stack as the delayed target. If no admissible value of exists, the corresponding case has value . In the delayed cases, the selected target remains unretrieved while the block is processed. The block subproblem therefore retains the same value of , while the remaining subproblem uses the updated value .
Proposition 4 (State count and running time). The joint-interval DP has states. The value of its initial state, , can be computed in time by evaluating the states in order of increasing interval size.
Proof. The interval of stack-2 targets, interval of stack-3 targets, value window, and parameter B have , , , and possible choices, respectively, giving states. Each case in recurrence (10) refers only to states with fewer remaining targets, so the states can be evaluated in increasing interval size. Cases (I2) and (I3) examine values of , whereas cases (D2) and (D3) examine triples . The total running time is therefore
12
□
Proposition 5 (Soundness of the dynamic program).
If the initial-state value is finite, then there exists a feasible schedule of that cost. Hence, .
The proof is given in Appendix A.5.
The parameter B cannot be inferred from the left endpoint of the interval of stack-2 targets. When the uppermost stack-2 target is delayed, it is excluded from the block subproblem but remains unretrieved until the block is completed. Consequently, setting overcounts the number of stack-2 targets retrieved before the block. Example 1 shows that this substitution can cause the dynamic program to return a value below the optimum.
Example 1 (failure of the substitution ). Consider the instance with parameters , , , . The optimum is 20, whereas the dynamic program obtained by setting in every state returns 19.
Proposition 6 (Minimum over the explored solution space). For every instance of problem M3, the dynamic program returns the minimum cost among all feasible solutions whose retrieval orders it explores. If no such solution exists, it returns .
The proof is given in Appendix A.5.
Proposition 6 establishes that the dynamic program computes a minimum-cost solution over the recursively decomposable orders. We conjecture that this class contains an optimal solution for every feasible realizable instance of problem M3.
Conjecture 1 (Completeness of the recursive decomposition). For every feasible order of a realizable instance of problem M3, there exists a recursively decomposable feasible order whose cost does not exceed the cost of .
Across verification test sets with , no feasible order was found with cost below the recursive-decomposition minimum. The dynamic program also agreed with exhaustive enumeration on 3,268 instances with , with zero mismatches.
7 Computational Study
We describe the experimental setup (Section 7.1), compare running times (Section 7.2), and measure energy savings over greedy retrieval (Section 7.3) and from batching (Section 7.4).
7.1 Experimental Setup
As operational data are not available, our experiments use synthetic instances. The storage layouts and target positions are generated randomly, following the procedure of Fliedner et al. (2026). We consider two and three stacks with targets. For each stack containing at least one target, we calculate the proportion of target bins. The instance's target density is the average of these proportions. We distinguish between three target densities, namely, low (below 0.50), medium (0.50 to 0.70), and high (above 0.70). We retain a generated instance only if it is feasible. Moreover, every stack contains at least one bin, and the instance's target density falls within the specified range. We generate 30 instances for each of the 48 parameter combinations, yielding 1,440 instances in total.
All algorithms are implemented in C# and run under .NET 8 on a Windows workstation with an AMD Ryzen Threadripper PRO 9965WX 24-core processor. Each algorithm runs in a separate process restricted to a single core, with a time limit of 600 seconds and a memory limit of 12 GiB.
7.2 Computational Performance
We first examine the computational benefits of exploiting the structural properties established in this paper. We compare the two-stack DP of Section 4 and the three-stack DP of Section 6 with an exact exponential-time dynamic program whose states represent subsets of retrieved targets, referred to as the subset DP. Table 1 reports the number of instances solved within the computational limits and the average running time over all 90 instances, with timeouts recorded at 600 seconds. Figure 3 illustrates how average running times increase with the number of targets.
Table 1: Computational performance by number of stacks and targets. Each row contains 90 instances across the three target densities. “Completed” gives the number of runs completed within the computational limits. The time limit is set at 600 seconds.
| n | Two-/three-stack DP | Subset DP | Batched DP | |||
|---|---|---|---|---|---|---|
| Completed | Average time [s] | Completed | Average time [s] | Completed | Average time [s] | |
| Two stacks | ||||||
| 6 | 90 | 0.004 | 90 | 0.001 | 90 | 0.001 |
| 12 | 90 | 0.004 | 90 | 0.009 | 90 | 0.028 |
| 18 | 90 | 0.004 | 90 | 0.396 | 90 | 1.507 |
| 24 | 90 | 0.006 | 90 | 16.116 | 77 | 312.921 |
| 30 | 90 | 0.008 | 0 | 600.000 | 0 | 600.000 |
| 36 | 90 | 0.017 | 0 | 600.000 | 0 | 600.000 |
| 48 | 90 | 0.060 | 0 | 600.000 | 0 | 600.000 |
| 60 | 90 | 0.218 | 0 | 600.000 | 0 | 600.000 |
| Three stacks | ||||||
| 6 | 90 | 0.002 | 90 | 0.001 | 90 | 0.001 |
| 12 | 90 | 0.003 | 90 | 0.010 | 90 | 0.031 |
| 18 | 90 | 0.021 | 90 | 0.420 | 90 | 2.186 |
| 24 | 90 | 0.273 | 90 | 17.971 | 55 | 425.641 |
| 30 | 90 | 1.068 | 0 | 600.000 | 0 | 600.000 |
| 36 | 90 | 5.609 | 0 | 600.000 | 0 | 600.000 |
| 48 | 90 | 114.380 | 0 | 600.000 | 0 | 600.000 |
| 60 | 22 | 532.928 | 0 | 600.000 | 0 | 600.000 |
Both dynamic programs found optimal solutions for all instances with at most 24 targets, matching the subset DP on all 360 instances for each stack count. For the two-stack DP, this confirms the correctness of the implementation. For the three-stack DP, these results provide further support for Conjecture 1.
The two-stack DP solved all instances, with average runtimes increasing from 0.004 seconds for 6 targets to 0.218 seconds for 60 targets. The three-stack DP completed all runs with up to 48 targets, but its runtimes increased more sharply, averaging 114.4 seconds at that size. For 60 targets, it completed 22 of the 90 runs, with an average runtime of 532.9 seconds including timeouts. In comparison, the subset DP required an average of 16.1 and 18.0 seconds for 24 targets with two and three stacks, respectively, and reached the time limit on all larger instances.

Figure 3: Average running times by number of targets for two stacks (left) and three stacks (right), on a logarithmic time axis. Each point averages 90 instances, with runs that did not complete within the computational limits counted at 600 seconds (dashed line). Filled markers indicate that all runs completed; hollow markers indicate otherwise. Annotations give the number of completed runs out of 90.
7.3 Energy Savings Relative to Greedy Retrieval
In this section, we compare optimized retrieval orders with a greedy heuristic based on the approach of Fliedner et al. (2026), modified to retrieve exactly one target per cycle. At each step, the heuristic retrieves the highest accessible target whose removal preserves feasibility of the remaining instance, breaking ties by choosing the target in the rightmost stack. The pseudocode of the greedy heuristic is given in Algorithm 1.
Algorithm 1 Greedy heuristic
Require: A feasible instance of the retrieval sequencing problem
1: Initialize the retrieved set and retrieval order
2: while do
3: Let contain every accessible whose retrieval preserves feasibility of the remaining instance
4: Select from A a target b of maximum current height, breaking ties by maximum
5: Retrieve b, set , and append b to
6: end while
7: return
The set A is nonempty at every iteration because the remaining instance is feasible. Hence, the heuristic returns a feasible retrieval order.
For each instance, we calculate the energy saving as , where is the energy expenditure of the greedy heuristic and is the minimum energy expenditure for single-target retrieval. The penalties returned by the two-stack and three-stack DPs are converted to energy expenditure using Lemma 1. We consider the 720 instances with at most 24 targets, for which the subset DP establishes the optimum. On all these instances, . Table 2 reports the average and median energy savings by number of stacks and target density (see the columns under “Saving over greedy”).
Optimizing the retrieval order reduces energy expenditure by 32.17% on average compared with the greedy heuristic, with a median saving of 26.17%. The optimal solution improves on the greedy solution.
Table 2: Energy savings (%) by number of stacks and target density. “Saving over greedy” compares optimal single-target retrieval with the greedy heuristic (). “Reduction from batching” compares optimal batched retrieval with optimal single-target retrieval (). denotes the number of instances included in each average and median.
| Stacks | Target density | Saving over greedy (through 24 targets) | Reduction from batching* (through 18 targets) | ||||
|---|---|---|---|---|---|---|---|
| N | Average | Median | N | Average | Median | ||
| 2 | Low | 120 | 13.61 | 13.57 | 90 | 28.77 | 31.83 |
| 2 | Medium | 120 | 22.68 | 22.46 | 90 | 35.86 | 40.00 |
| 2 | High | 120 | 46.81 | 43.17 | 82 | 48.71 | 53.39 |
| 2 | All | 360 | 27.70 | 22.60 | 262 | 37.45 | 36.51 |
| 3 | Low | 120 | 18.30 | 17.79 | 90 | 24.34 | 24.18 |
| 3 | Medium | 120 | 32.49 | 30.46 | 89 | 38.48 | 40.00 |
| 3 | High | 120 | 59.11 | 55.56 | 73 | 46.44 | 50.00 |
| 3 | All | 360 | 36.63 | 30.30 | 252 | 35.74 | 33.84 |
| Overall | 720 | 32.17 | 26.17 | 514 | 36.61 | 35.71 | |
Note. * Of the 90 instances per combination of stack count and target density, those with zero optimal single-target energy expenditure are excluded from the percentages: 8 (two stacks, high), 1 (three stacks, medium), and 17 (three stacks, high); 26 in total.
in 719 of the 720 instances and has the same energy expenditure in one. The average saving increases with target density from to for two stacks, and from to for three stacks. At every target density, the average saving is higher for three stacks. Thus, optimizing the retrieval order is particularly beneficial on the tested instances with high target density.
For two stacks, the average energy saving is and the median is across all 720 two-stack instances. For three stacks with 30 to 60 targets, the DP completed 292 runs. In every completed run, the resulting retrieval order consumed less energy than the greedy solution, with an average saving of and a median of .
7.4 Energy Benefit of Batching
In this section, we allow several targets to be retrieved in one cycle, as in the batched retrieval formulation of Fliedner et al. (2026). We examine the additional energy savings from batching and the computation time required to obtain them. For batched retrieval, we use their original dynamic programming implementation, including its dominance rules. Note that every single-target retrieval order is also a feasible batched solution, with one target retrieved per cycle. Hence, the minimum energy expenditure under batched retrieval cannot exceed that under single-target retrieval.
We consider the 540 instances with at most 18 targets, for which both the subset DP and the batched DP found optimal solutions. For each instance, we calculate the additional energy saving from batching as , where denotes the minimum energy expenditure under batched retrieval. Both optimal energy expenditures are zero on 26 instances. We exclude these instances from the percentages, leaving 514 instances. Table 2 reports the average and median savings by number of stacks and target density (see the columns under “Reduction from batching”).
Batching reduces energy expenditure by on average, with a median saving of . The optimal batched solution improves on the optimal single-target solution in 474 of the 540 instances and has the same energy expenditure in 66. The average saving increases with target density from to for two stacks, and from 24.34% to 46.44% for three stacks. Overall, the average savings are similar for both stack counts, at 37.45% and 35.74%, respectively.
At 24 targets, both single-target DPs completed all instances in under 0.3 seconds on average, whereas the batched DP completed only 77 of 90 two-stack instances and 55 of 90 three-stack instances within the computational limits (Table 1). The batched DP completed no run with 30 or more targets.
8 Conclusion
Developing efficient retrieval policies for a recently introduced storage system requires understanding which decisions can be optimized efficiently and which interactions make the problem difficult. The single-target case provides a starting point for this analysis by separating retrieval sequencing from the grouping of targets into cycles. Our results show that the accessibility and energy effects of side access permit a structural restriction: every optimal retrieval order is laminar within each stack, regardless of the number of stacks. Together with the pairwise representation of energy expenditure, this structure yields a polynomial-time algorithm for two stacks. For three stacks, the recursive decomposition provides a way to coordinate retrievals across stacks and optimize over the resulting class of orders in polynomial time. The within-stack theorem therefore supplies a basis for algorithm design that extends beyond the two-stack case.
The computational results show the practical value of exploiting this structure. On all tested instances with at most 24 targets, both dynamic programs matched the exact subset dynamic program, and optimizing the retrieval order reduced energy expenditure by 32.17% on average relative to the greedy heuristic. At 24 targets, both algorithms required less than 0.3 seconds on average. These results suggest that accounting for the effects of retrieval decisions can yield substantial energy savings within short computation times. Batching offers further savings, averaging 36.61% on the instances with at most 18 targets and positive optimal single-target energy expenditure, but requires substantially more computation time. Thus, the single-target case also provides a reference for assessing the additional energy benefit and computational effort associated with batching.
Whether the recursive decomposition contains an optimal retrieval order for every feasible three-stack instance remains open. Establishing this would extend polynomial-time solvability from two to three stacks. For larger numbers of stacks, the within-stack structure established here continues to restrict optimal retrieval orders, but exploiting it algorithmically requires further understanding of the interactions between stacks. This raises the question of whether retrieval sequencing is polynomially solvable for every fixed number of stacks, and whether it becomes NP-hard when the number of stacks is part of the input. Resolving these questions would clarify how far the computational advantage of the single-target case extends. The computational results also motivate studying retrieval policies that limit the number of targets per cycle and connect the single-target case with batched retrieval. Studying how this limit affects energy expenditure and computation time would help determine how much of the energy benefit of batching can be retained while allowing faster optimization.
References
Azadeh K, De Koster R, Roy D (2019) Robotized and automated warehouse systems: Review and recent developments. Transportation Science 53(4):917–945, URL http://dx.doi.org/10.1287/trsc.2018.0873.
Boysen N, de Koster R (2025) 50 years of warehousing research—an operations research perspective. European Journal of Operational Research 320(3):449–464, URL http://dx.doi.org/10.1016/j.ejor.2024.03.026.
Bruns F, Knust S, Shakhlevich NV (2016) Complexity results for storage loading problems with stacking constraints. European Journal of Operational Research 249(3):1074–1081, URL http://dx.doi.org/10.1016/j.ejor.2015.09.036.
de Melo da Silva M, Erdoğan G, Battarra M, Strusevich VA (2018) The block retrieval problem. European Journal of Operational Research 265(3):931–950, URL http://dx.doi.org/10.1016/j.ejor.2017.08.048.
Fauvé N (2026) A systematic literature review on grid-based compact storage systems with temporary aisles. Working paper, Helmut Schmidt University, Hamburg, Germany, URL http://dx.doi.org/10.24405/24847.
Fauvé N, Jaehn F, Golak J, Gül Y, Koch P, Neumann S, Kirchheim A, Nehrke L (2024) Optimierung der auslagerungsprozesse in automatisierten kompaktlagern. Schulz M, Fay A, Niggemann O, Matiaske W, Schulz D, eds., dtec.bw-Beiträge der Helmut-Schmidt-Universität / Universität der Bundeswehr Hamburg: Forschungsaktivitäten im Zentrum für Digitalisierung- und Technologieforschung der Bundeswehr dtec.bw, Band 2 – 2024, 100–104 (Hamburg: Universitätsbibliothek der Helmut-Schmidt-Universität / Universität der Bundeswehr Hamburg), ISBN 978-3-86818-329-0, URL http://dx.doi.org/10.24405/16784.
Fauvé N, Neumann S (2023) Storage and retrieval in fully automated grid-based storage systems. Grothe O, Nickel S, Rebennack S, Stein O, eds., Operations Research Proceedings 2022, 589–594 (Cham: Springer), URL http://dx.doi.org/10.1007/978-3-031-24907-5_70.
Fliedner M, Golak J, Gül Y, Neumann S (2026) Order retrieval in a compact storage system with side access. IISE Transactions 1–35, URL http://dx.doi.org/10.1080/24725854.2026.2749572.
Gue KR, Kim BS (2007) Puzzle-based storage systems. Naval Research Logistics 54(5):556–567, URL http://dx.doi.org/10.1002/nav.20230.
Gül Y (2026) Single-target retrieval in a compact storage system with side access: A polynomial-time two-stack algorithm and an exact three-stack reduction, submitted to the Operations Research Proceedings.
Lehnfeld J, Knust S (2014) Loading, unloading and premarshalling of stacks in storage areas: Survey and classification. European Journal of Operational Research 239(2):297–312, URL http://dx.doi.org/10.1016/j.ejor.2014.03.011.
Meller RD (2023) Considerations when designing an AutoStore system. Progress in Material Handling Research: 16th IMHRC Proceedings (Dresden, Germany), URL https://digitalcommons.georgiasouthern.edu/pmhr_2023/12/, paper 12.
Tappia E, Roy D, de Koster R, Melacini M (2017) Modeling, analysis, and design insights for shuttle-based compact storage systems. Transportation Science 51(1):269–295, URL http://dx.doi.org/10.1287/trsc.2016.0699.
Yalcin A, Koberstein A, Schocke KO (2019) An optimal and a heuristic algorithm for the single-item retrieval problem in puzzle-based storage systems with multiple escorts. International Journal of Production Research 57(1):143–165, URL http://dx.doi.org/10.1080/00207543.2018.1461952.
Zaerpour N, Yu Y, de Koster R (2017) Small is beautiful: A framework for evaluating and optimizing live-cube compact storage systems. Transportation Science 51(1):34–51, URL http://dx.doi.org/10.1287/trsc.2015.0586.
Zou B, De Koster R, Xu X (2018) Operating policies in robotic compact storage and retrieval systems. Transportation Science 52(4):788–811, URL http://dx.doi.org/10.1287/trsc.2017.0786.
Appendix
A.1 Stack-Local Promotion for Every m
We use the notation of Section 3. If are targets in stack , then is at least levels above . Consequently, for every preceding stack ,
Proof of Lemma 2. Since and , with , we have . Moreover, since is retrieved last among the targets in , every other target in this set is retrieved before .
Step 1 (Targets between the exchanged positions). Let be a target in stack that is retrieved strictly between and . We show that or .
If , the claim follows from . Suppose first that . If , then . Since , this contradicts the choice of as the last target in retrieved under . Hence, .
Now suppose that . If , then . Otherwise, and . Because every target in belongs to , and , it follows that or .
Step 2 (Effects on all other targets). Consider any target . If belongs to a stack other than , the exchange does not change the relative order of the targets in its stack. Therefore, the number of lower targets retrieved before remains unchanged.
Now suppose that belongs to stack . The set of targets from stack retrieved before can change only if is retrieved strictly between and . In that case, is replaced by in this set. By Step 1, either or . In the first case, both and are below ; in the second case, both are above . Hence, replacing by does not change the number of lower targets retrieved before , and remains unchanged.
Furthermore, because and both belong to stack , exchanging them does not change the stack from which the target at any position in the retrieval order is retrieved. Consequently, for every target and every stack , the number of stack- targets retrieved before remains unchanged. It follows that every such target remains feasible and that its contribution to the penalty is unchanged.
Step 3 (Inversion counts of the exchanged targets). Let denote the number of targets in stack with that are retrieved before . We first compute the inversion counts of and under . Since , every target in stack that is retrieved before also belongs to , and therefore satisfies . Conversely, because is the last target in retrieved under , every target in is retrieved before . Hence, . Moreover, every target in is retrieved before , and therefore before . Together with the targets with index greater than , this gives .
Let and denote the inversion counts after the exchange. At its new position, is preceded by every target in . No target precedes at its new position, since any such target would belong to under , contradicting . Therefore, . At its new position, is preceded by every target in and by the targets with index greater than that were retrieved before . Consequently, , and hence .
Step 4 (Feasibility after the exchange). Fix a preceding stack . After the exchange, is retrieved at the former position of , so the number of stack- targets retrieved before is . Similarly, the number of stack- targets retrieved before at its new position is . Both counts are at most . It therefore remains to verify the corresponding cap bounds.
First, consider target . Since , we have . The feasibility of gives . Moreover, , and hence . Applying inequality (11) to gives . Consequently, so is feasible at its new position.
Now consider target . The feasibility of under gives . Applying inequality (11) to gives . Therefore, so is also feasible at its new position.
Since was arbitrary, both exchanged targets satisfy every feasibility constraint under .
Step 5 (Change in energy and the inversion set of x). By Step 2, every target other than a and b retains the same contribution to the penalty. After the exchange, a has the values , while b has the values , for every preceding stack . Because a and b belong to the same stack, the same preceding stacks enter their penalty terms. Hence, by (4), their combined cross-stack contribution is unchanged.
By Step 3, . Each within-stack inversion in stack contributes to the penalty, so the combined within-stack contribution of and decreases by exactly . Therefore, . Because by (3) and the remaining terms are independent of the retrieval order, the same decrease holds for the energy.
Finally, the exchange changes the relative order of only with respect to and : target moves from before to after , while moves from after to before . Therefore, is feasible, satisfies , and the inversion set of under is .
A.2 The Two-Stack Reduction and Decomposition
Lemma 4 (Monotonicity). For a fixed set of targets, increasing one or more caps cannot increase OPT. Likewise, replacing the window [lo, hi] by [lo', hi'], where lo' ≤ lo ≤ hi ≤ hi', cannot increase OPT.
Proof. Each change only relaxes a feasibility constraint and leaves the objective function unchanged. Hence, every solution that was feasible before the change remains feasible afterward, so the optimum cannot increase.
Lemma 5. Let . If the top target is feasible at inversion count , that is, , then, for every , the targets in admit a feasible solution with values in .
Proof. When , is empty and hence admits a feasible solution. Now suppose that . Retrieve the targets in from bottom to top and assign every target the value lo. For , target then has inversion count . Since the caps are strictly increasing integers, , and therefore . The latter inequality also gives lo . Moreover, since , the assigned value lo lies in [lo, v]. Thus, every target satisfies its cap and window constraints, proving the claim.
Proof of Theorem 1. Consider any feasible retrieval order. Keep the positions occupied by stack 1 targets fixed and assign the targets to these positions from top to bottom. The relative order of the stack 2 targets and the number of preceding stack 1 retrievals for each such target remain the same. Thus, their feasibility and all penalty terms involving them are unaffected. Stack 1 targets have no preceding-stack feasibility constraints, while their top-to-bottom order eliminates all within-stack penalties in stack 1. The resulting order is therefore feasible and has no greater penalty. Hence, it suffices to consider orders that retrieve the targets in stack 1 from top to bottom.
Let be a feasible retrieval order with this property. Deleting the stack 1 targets from gives a permutation of . For each stack 2 target , let denote the number of stack 1 targets retrieved before . Since this count cannot decrease during the retrieval process, the values are nondecreasing along and satisfy . Moreover, the targets below that are retrieved before it are precisely the targets that precede in ; their number is . The feasibility condition (1) therefore becomes . Thus, satisfies the feasibility conditions of problem M2.
Since the stack 1 targets are retrieved from top to bottom, pairs of targets in stack 1 contribute no penalty. Exactly lower targets from the same stack are retrieved before each stack 2 target j, and each such pair contributes 2. Moreover, exactly stack 1 targets are retrieved after , and each forms a cross-stack pair that contributes 1. Hence, , which equals the objective value of in problem M2.
Conversely, consider a feasible solution to problem M2. We construct a corresponding retrieval order . Now retrieve the stack 2 targets in the order . Before retrieving target , retrieve targets from stack 1, from top to bottom, until exactly stack 1 targets have been retrieved. This is possible because the values are nondecreasing along . After all stack 2 targets have been retrieved, retrieve the remaining stack 1 targets from top to bottom.
Observe that every stack 1 target is accessible because there is no stack to its left. Moreover, when stack 2 target is retrieved, we have , while its inversion count is . Its feasibility condition is therefore precisely the corresponding constraint of problem M2. Consequently, is feasible, and Lemma 1 yields .
Thus, minimizing over feasible retrieval orders is equivalent to minimizing over feasible solutions to problem M2. Finally, by (2), a two-stack instance is feasible if and only if for every target in stack 2. Since the targets are indexed from top to bottom, . By , the feasibility condition is equivalent to for every .
Lemma 7 (Monotonicity of the upper bounds). For every , let . Then every feasible solution satisfies , and the sequence is nondecreasing.
Proof. Since , the feasibility condition of problem M2 gives
Moreover, since the caps are strictly increasing integers, for every . Consequently, . Taking the minimum with preserves this inequality, and hence .
Proof of Lemma 3. Suppose first that is generated by the recursive rule in the statement. We show by induction on that every inversion set is a prefix. For , every inversion set is empty. An order with has either the form or , where, in the second case, orders and orders . Hence, or . For every target in or , targets outside the respective order are retrieved later or have smaller indices and therefore do not enter its inversion set. The induction hypothesis shows that all remaining inversion sets are prefixes.
Conversely, suppose that every inversion set is a prefix. We show by induction on that is generated by the recursive rule. For , the rule generates the only possible order. Since is a prefix, either or . In the first case, . In the second, , where orders and orders . Both and retain the prefix property. By induction, they are generated by the recursive rule. Thus, the same rule generates .
Finally, let . If , the intervals are disjoint. Otherwise, . If , then belongs to , so , which contradicts . Hence, , and .
Proof of Proposition 2. (a) Retrieve the targets in according to the feasible solution on , followed by target with value , and then the targets in according to the feasible solution on with increased caps. The targets in retain their inversion counts and values and therefore remain feasible. Target has inversion count and is feasible because . For each target , exactly the targets with are additional inverted successors. Its inversion count therefore increases by , which equals the increase in its cap. Hence, the feasibility condition for under the increased cap is identical to its feasibility condition when the targets in are retrieved before . Moreover, all values assigned to targets in are at most , target has value , and all values assigned to targets in are at least . Thus, the values are nondecreasing throughout the retrieval order, which is therefore feasible.
The solution on contributes , and the solution on contributes . Every forms a bottom-up pair with , contributing in total, whereas pairs between and contribute zero. Each pair with contributes exactly 2, giving in total. Target additionally contributes . Together, these contributions give .
(b) Conversely, restrict the given solution to and . Every inverted successor of a target in that precedes it also lies in , so the restriction to is feasible. For each , the additional inverted successors from are exactly the targets , which are accounted for by its cap increase. Since the values are nondecreasing and target has value , the two restrictions use values in and , respectively. Their costs, together with the contributions , , and , give .
If , then for every and . Hence, all cap increases and cross( ) are zero.
A.3 The Promotion Swap, Core Exchange, and the Two-Stack Theorem
Lemma 8 (Promotion swap). Let be any feasible solution whose inversion set of target 1 is not an index prefix. Put , let
and let be the target in retrieved last under . Exchange the positions of and in , leaving the value assigned to each position unchanged. The result is a feasible solution in which the inversion set of target 1 is and the cost is exactly 2 smaller.
Proof. Since and , we have . Moreover, since is retrieved last under among the targets in , every target in precedes . Let .
Step 1 (indices of the intermediate targets). Every target appearing strictly between and in satisfies or . For this, first suppose that . Then . If , the definitions of and imply that . However, is retrieved after , whereas is the target in retrieved last under . Therefore, . If , then . Finally, if , then , and hence . It follows that or .
Step 2 (all other targets are unaffected). For any target , the exchange changes the set of targets preceding only if appears strictly between and in . In that case, is replaced by among the targets preceding . By Step 1, either or . Thus, if and only if , and the inversion count , as well as the cap of , is unchanged. Every position retains its assigned value. Therefore, the sequence of values along the resulting retrieval order remains nondecreasing, and every target other than and retains its assigned value. In particular, and are unchanged.
Step 3 (inversion counts of the moved targets). Every target retrieved before is also retrieved before target 1 and hence belongs to . No target with an index greater than therefore precedes . Because is retrieved last under among the targets in , every target in precedes . Thus, the targets with indices greater than that precede are exactly , and . Every target in also precedes 1 and therefore precedes , while counts the targets with indices greater than that precede . Hence, .
Let and denote the new inversion counts after the exchange. Target is retrieved at the former position of . Every target in precedes this position, whereas no target with an index greater than does. Therefore, . Target is retrieved at the former position of . It is then preceded by the targets and by the targets with indices greater than that preceded . Therefore, .
Step 4 (feasibility at the earlier position). At its new position, is assigned . Since , monotonicity and the feasibility of target 1 give . Moreover, , so , while the strictly increasing integer caps give . Hence,
and a is feasible.
Step 5 (feasibility at the later position). At its new position, is assigned . The feasibility of before the exchange gives
Since the caps are strictly increasing integers, . Hence,
and b is feasible.
Step 6 (cost and the new inversion set). Since the value assigned to each position is unchanged, the term is unchanged. By Step 2, only the inversion counts of and can change. Step 3 gives , whereas . Thus, the total inversion count decreases by one and the cost decreases by exactly 2. Finally, now precedes target 1, while follows it, and no other target changes its position relative to target 1. Therefore, the new inversion set of target 1 is .
Lemma 8 immediately yields the following corollary.
Corollary 3 (Inversion set of target 1). In every optimal solution of a windowed instance, the inversion set of target 1 is an index prefix.
Corollary 4 (Recursive structure of optimal orders). For every windowed instance, the order of every optimal solution is a laminar-delay order.
Proof. Consider an optimal solution on targets. If , its order is trivially a laminar-delay order. Suppose , and assume the claim holds for all smaller windowed instances. By Corollary 3, the inversion set of target 1 is . Hence, , where and are the restrictions of to and , respectively. By Proposition 2(b), these restrictions give feasible solutions to the subinstances and . Each solution is optimal for its subinstance; otherwise, replacing it with a lower-cost solution via Proposition 2(a) would contradict the optimality of . By induction, and are laminar-delay orders. If , the production
generates . If , the production
generates . Thus, is a laminar-delay order.
The core exchange and the two-stack theorem
Proof of Theorem 2. Observe first that if , the claim follows because the left-hand side is finite for every admissible , by Lemma 5 and the feasibility criterion for the remaining interval. Consider the case . Choose optimal solutions to the two subproblems defining . By Proposition 2(a), combining these solutions with target , assigned value , yields a feasible solution for in which the inversion set of is and the cost is .
After shifting the indices by , Lemma 8 applies to target . Whenever its inversion set differs from , perform the exchange from Lemma 8. Each exchange preserves feasibility, the position and assigned value of , and the cardinality of its inversion set, while decreasing the cost by 2. Let denote the current inversion set of . Each exchange replaces some by a target with , thereby decreasing cross() by . Initially, . Since cross() is a nonnegative integer and equals zero precisely when , after at most cross() exchanges we obtain a feasible solution whose inversion set for is . Let denote the number of exchanges and let denote the resulting solution. Then , the cost of is , and if .
Since the inversion set of in is , Proposition 2(b) shows that its restrictions to and are feasible for the subinstances and , respectively. Their costs are at least the corresponding optimal costs. Including the cost of target , we obtain
Since , this establishes the first inequality. If , then , and the right-hand side is at most , establishing the second inequality.
Proof of Theorem 3. Consider an interval and a window . If is empty, both sides are zero. Suppose that is nonempty and that the result holds for shorter intervals.
First, assume that is finite and consider a minimizing choice in the recurrence. By the induction hypothesis, its subproblem values are attained by feasible solutions. Proposition 2(a) combines these solutions with target into a feasible solution for . Hence, .
For the reverse inequality, assume that is finite and consider an optimal solution . Let be the inversion set of , let , and let be the value assigned to . Proposition 2(b) decomposes this solution at . Replacing the two resulting solutions by optimal solutions to their respective subproblems cannot increase the cost, and therefore . By Theorem 2, replacing by does not increase the cost. The resulting subproblems are shorter intervals, so their optimal costs equal the corresponding dynamic-program values by the induction hypothesis. This prefix decomposition is included in the recurrence, and thus
The two inequalities establish the result.
A.4 The Reduction to Problem M3
Proof of Theorem 4. Step 1 (Retrieving stack 1 from top to bottom). Consider a feasible retrieval order . Keep the positions occupied by targets from stack 1 fixed and assign these targets to the positions from top to bottom. For every target b in stack 2 or 3, the number of targets retrieved earlier from stack 1 remains unchanged. Hence, its feasibility and contribution to are preserved. Targets in stack 1 are always accessible because no stack lies to their left. Moreover, retrieving them from top to bottom eliminates every within-stack penalty in stack 1. The resulting order is therefore feasible and has no greater penalty.
Consequently, it suffices to consider retrieval orders in which the targets in stack 1 are retrieved from top to bottom. In such an order, stack 1 affects the retrievals from stacks 2 and 3 only through the number of its targets that have already been retrieved. Observe that this number, denoted by , is nondecreasing throughout the retrieval process.
Step 2 (From a retrieval order to an M3 solution). Consider a feasible retrieval order in which the targets in stack 1 are retrieved from top to bottom. Deleting these targets yields an order of . For each , set . These values belong to and are nondecreasing along .
For , feasibility with respect to stack 1 gives . For , feasibility with respect to stacks 1 and 2 gives and . Here , and are determined by : they count, respectively, the lower targets from retrieved before , the lower targets from retrieved before , and the targets from retrieved before . Thus, is feasible for problem M3.
Step 3 (From an M3 solution to a retrieval order). Conversely, consider a feasible solution to problem M3. Process the targets in the order . Before retrieving a target , retrieve targets from stack 1, from top to bottom, until exactly targets from that stack have been retrieved. This is possible because the values are nondecreasing along . After processing , retrieve any remaining targets from stack 1.
The stack 1 retrievals are feasible because no stack lies to their left. When is retrieved, , while , , and are precisely the values determined by . Therefore, the constraints of problem M3 are exactly the feasibility conditions of the constructed retrieval order. Hence, this order is feasible.
Step 4 (Preservation of the penalty). In an order that retrieves stack 1 from top to bottom, its targets contribute no penalty. By Lemma 1, a target contributes , while a target contributes . Hence,
This is exactly the objective function of problem M3. Steps 2 and 3 show that a feasible solution in either formulation yields a feasible solution in the other with the same penalty. Together with Step 1, this proves that the minimum penalty over all feasible retrieval orders equals the minimum cost of problem M3.
Proof of Theorem 5. Necessity. Consider a realizable cap vector . Within each stack, target heights strictly decrease with their top-to-bottom indices. Consequently, and are strictly increasing whenever they are nonempty, and the cap vector is admissible. If is nonempty, its first entry corresponds to the highest target in stack 2. Since this target has height at most , we have , and hence .
Sufficiency. Consider an admissible cap vector satisfying or . Choose an integer that is at least 1, , , and every entry of and , and set . If is nonempty, set ; otherwise, set .
Place the targets in stack 1 at heights , each target at height , and each target at height . All these heights are nonnegative by the choice of . The stack 1 targets fit because . If is nonempty, the stack 2 heights are at most . Similarly, if is nonempty, the stack 3 heights are at most . Strict monotonicity of and ensures that the target heights within each stack are distinct. These placements therefore define a three-stack instance with cap vector , proving realizability.
A.5 Dynamic-Program Soundness and the Recursive-Decomposition Minimum
Definition 1 (recursive decomposition). Let be an order on targets from . The order is recursively decomposable if it contains at most one target or admits one of the following decompositions.
Choose a stack represented in , and let be its uppermost remaining target. This target may appear first in , in which case the suffix following it must be recursively decomposable. Alternatively, it may be delayed behind a block containing exactly the next targets of stack , namely , and the first remaining targets of the other stack , namely
, where is that stack's uppermost remaining target. The latter sequence is empty when or stack is absent. The two sequences may be interleaved within the block. Both the block and the suffix following must themselves be recursively decomposable.
Lemma 9. Consider a recursive decomposition at the uppermost remaining target , where , and let denote the other stack. In stack , the block together with the selected target contains a consecutive sequence of targets beginning with index . In stack , the block is empty or contains a consecutive sequence beginning with its uppermost remaining target. If the selected target is retrieved first, the block is empty. The suffix contains exactly the remaining targets of the current subproblem. Consequently, starting from and , every subproblem in the recursive decomposition contains one index interval from each stack, possibly empty.
Proof of Lemma 9. In the delayed case, Definition 1 requires the block to contain consecutive targets immediately below in stack and, if any, consecutive targets beginning with the uppermost remaining target of stack . Together with the selected target, these form an initial index interval in each stack. If the selected target is retrieved first, only that target is removed. In both cases, the suffix contains exactly the remaining targets. Thus, whenever the current subproblem contains one index interval from each stack, so do the block and suffix. Starting from and , the claim follows by induction.
Proof of Proposition 5. Consider a state in the recursive construction of a complete retrieval order. Before the targets in this subproblem are retrieved, exactly stack-2 targets have been retrieved, all with indices smaller than . Similarly, every previously retrieved stack-3 target has index smaller than . Any target with a smaller index in its stack that remains unretrieved has been delayed until after the current subproblem. All previously retrieved targets have assigned values at most lo.
Suppose that is finite. We show by induction on the number of targets in the two intervals that the recurrence constructs a retrieval order containing exactly these targets, with nondecreasing values in . In the complete retrieval order:
(1) Each target in has the same within-stack inversion count as in .
(2) For each stack-3 target in , equals plus the number of stack-2 targets preceding in .
(3) Every target in satisfies the feasibility conditions of problem M3.
(4) The targets in contribute exactly to the M3 objective.
The claim is immediate when both intervals are empty. Otherwise, the recurrence selects one of cases (I2), (I3), (D2), or (D3). We verify these cases below.
Cases (I2) and (I3). Both cases retrieve the uppermost remaining target of one stack first and assign it value v. Every previously retrieved target in the same stack has a smaller index, while all lower targets are retrieved later. Thus, the selected target has within-stack inversion count zero.
In case (I2), the condition ensures feasibility of target . Its contribution to the M3 objective is . After its retrieval, the number of previously retrieved stack-2 targets increases to , and the recurrence continues with .
In case (I3), target is preceded by exactly stack-2 targets, so . The conditions and ensure its feasibility. Its contribution to the M3 objective is , and the recurrence continues with .
In both cases, the remaining targets form a smaller subproblem with value window . By the induction hypothesis, the corresponding state supplies a retrieval order satisfying the four properties. Retrieving the selected target first and then following this order establishes the properties for the current state.
Case (D2). Target is delayed behind a block containing the stack-2 targets indexed by and the stack-3 targets indexed by , and is assigned value . By the induction hypothesis, supplies a retrieval order for this block with nondecreasing values in . Target remains unretrieved while the block is processed.
The selected target is then retrieved at value . Its inverted successors are exactly the stack-2 targets in the block, so . The condition ensures its feasibility. Its contribution to the M3 objective is .
The block and the selected target contain stack-2 targets. Thus, before the suffix begins, stack-2 targets have been retrieved. By Lemma 9, the suffix contains the intervals and . The induction hypothesis supplies a retrieval order for this subproblem with nondecreasing values in . Retrieving the block, followed by and then the suffix, establishes the four properties. Since case (D2) attains the minimum, the total contribution equals .
Case (D3). Target is delayed behind a block containing the stack-2 targets indexed by and the stack-3 targets indexed by , and is assigned value . By the induction hypothesis, supplies a retrieval order for this block with nondecreasing values in . Target remains unretrieved while the block is processed.
The selected target is then retrieved at value . Its inversion count is , and it is preceded by stack-2 targets. The conditions and ensure its feasibility. Its contribution to the M3 objective is .
Retrieving leaves the number of retrieved stack-2 targets at . By Lemma 9, the suffix contains the intervals and . The induction hypothesis supplies a retrieval order for this subproblem with nondecreasing values in . Retrieving the block, followed by and then the suffix, establishes the four properties. Since case (D3) attains the minimum, the total contribution equals .
At the initial state, no target has been retrieved, , and the value window is . The construction therefore yields a feasible retrieval order of cost , proving .
Proof of Proposition 6. By Proposition 5, every finite initial-state value is attained by a feasible retrieval order constructed through cases (I2), (I3), (D2), and (D3). These cases follow the recursive decomposition in Definition 1, so the constructed order is recursively decomposable. The dynamic-program value is therefore no smaller than the minimum cost among feasible solutions with recursively decomposable orders. If no such solution exists, the initial-state value must be .
For the reverse inequality, consider a feasible solution to problem M3 with a recursively decomposable order, and fix a decomposition under Definition 1. Let be a consecutive subsequence arising in this decomposition. By Lemma 9, its targets form one index interval from each stack. These intervals define a dynamic-program state, with equal to the number of stack-2 targets retrieved before . The initial state has value window . If the selected target receives value , the suffix receives window and, in the delayed case, the block receives window . Since the values are nondecreasing along , every target lies within its assigned value window.
By Lemma 9, previously retrieved targets have smaller indices in their respective stacks, while lower targets outside are retrieved afterward. Thus, each target's within-stack inversion count in the complete order equals its inversion count in . For each stack-3 target in , equals plus the number of stack-2 targets preceding in .
We show by induction on the number of targets in that the corresponding state value does not exceed their total contribution to the M3 objective. The claim is immediate when is empty.
For a nonempty , choose the recurrence case corresponding to its fixed decomposition and assign the selected target its value . The block, when present, and the suffix have exactly the index intervals, value windows, and numbers of previously retrieved stack-2 targets specified by this case. The counts established above and feasibility of ensure that all conditions of the case hold. The recurrence adds exactly the selected target's contribution to the M3 objective. By the induction hypothesis, the block and suffix state values do not exceed their respective contributions. Their sum, including the selected target's contribution, therefore bounds the current state value from above.
At the initial state, is therefore at most the cost of . Minimizing over all feasible solutions with recursively decomposable orders proves the reverse inequality.