Next Article in Journal
Accurate Extraction Method for Continental Margin FOS Line Considering Terrain Continuity
Previous Article in Journal
PDO-Modulated ENSO Impact on Southern South China Sea Winter SST: Multi-Anticyclone Synergy
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Optimization of Container Relocation in Terminal Yards: A Computational Study Using Strategy-Iterative Deepening Branch-and-Bound Algorithm

Institute of Logistics Science and Engineering, Shanghai Maritime University, Shanghai 201306, China
*
Author to whom correspondence should be addressed.
J. Mar. Sci. Eng. 2025, 13(9), 1743; https://doi.org/10.3390/jmse13091743
Submission received: 26 July 2025 / Revised: 3 September 2025 / Accepted: 5 September 2025 / Published: 10 September 2025
(This article belongs to the Section Ocean Engineering)

Abstract

Container relocation operations at terminal yards represent a fundamental pillar in the optimization of stowage scheduling during vessel loading, serving as a critical component of port operational efficiency. This paper focuses on the restricted container relocation problem (RCRP), in which the objective is to minimize the number of relocations for retrieving all containers from a bay under a predetermined retrieval sequence. A strategy-oriented algorithm (SOA) was proposed to address this issue, and a strategy-iterative deepening branch-and-bound algorithm (S-IDB&B) was constructed based on this algorithm. Among them, the SOA can quickly find feasible solutions to the problem, while the S-IDB&B algorithm can find the optimal solution to the problem and can also set an early stopping mechanism to obtain high-quality solutions in a shorter period of time. Comparative computational experiments demonstrate that the strategy-iterative deepening branch-and-bound algorithm finds optimal solutions for all small-scale instances within 0.01 s and achieves optimal solutions for over 80% of medium-to-large-scale instances, and it outperforms existing exact algorithms (solve larger scale instances with shorter computation time); moreover, when equipped with the early stopping mechanism, it yields higher solution quality than existing heuristic algorithms (the maximum accuracy deviation is around 20%) while maintaining comparable computation times.

1. Introduction

With the gradual increase in global maritime trade, port operators are increasingly prioritizing operational optimization in container terminals. The container yard, being a critical component, directly impacts terminal profitability through its operational efficiency. Given the scarcity of yard space, containers are temporarily stored in vertical stacks after being transported via vessels, rail, automated guided vehicles (AGVs), or trucks. A standard yard configuration consists of multiple container zones, each containing several bays. These bays are further subdivided into stacks where containers are physically stored. Figure 1 illustrates a typical container yard block layout.
Given the uncertainty in vessel arrival schedules during container stacking operations, terminal operators cannot fully predict container departure sequences [1]. This unpredictability often leads to misalignment between initial stacking orders and actual retrieval sequences—for instance, containers requiring early departure may be stacked beneath those with later schedules. Such scenarios necessitate relocation operations where upper containers (with later schedules) must be moved to adjacent stacks to access priority containers below [2], as illustrated in Figure 2 depicting intra-bay relocation processes.
Container prioritization follows numerical identification, with lower-numbered units receiving higher retrieval priority. In Figure 2, retrieving Container 1 requires the preliminary relocation of Containers 8 and 5. The strategic selection of relocation positions proves critical [3], as improper choices may trigger cascading relocation demands.
In response to national strategies for developing advanced productive capacities, global container terminals have accelerated intelligent transformation while expanding yard capacities. However, these advancements paradoxically intensify the computational complexity of container relocation problems, which now exhibit exponential growth patterns with increasing terminal intelligence and yard scale. This emerging challenge has become a critical bottleneck in terminal operations. Reducing the number of container relocations directly translates into crucial operational advantages for terminals, including lower fuel consumption for handling equipment, decreased operational costs, and faster vessel turnaround times. Therefore, developing efficient algorithms for container relocation optimization is imperative to enhance operational efficiency through minimized relocation frequency and optimized decision-making processes.
The remaining part of this paper is arranged as follows: Section 2 reviews the relevant literature on dealing with the container relocation problem. Section 3 briefly describes the restricted container relocation problem and mathematical model studied in this paper. Section 4 introduces a heuristic algorithm for quickly solving the RCRP, which is used for the upper-bound calculation of the algorithm in Section 5. Section 5 introduces the strategy-iterative deepening branch-and-bound algorithm for solving the RCRP. Section 6 presents the computational experimental results and analysis of the algorithm proposed in this paper on both random and benchmark datasets. Section 7 summarizes this paper and provides some future research directions.

2. Literature Review

For decades, scholars have maintained unwavering enthusiasm in researching the Container Relocation Problem (CRP). Lersteau and Shen [4] systematically categorized existing research into the Unrestricted Container Relocation Problem (UCRP) and restricted container relocation problem (RCRP) based on container movement constraints. They further classified the CRP into duplicate priorities and unique priorities according to container numbering (priority) uniqueness. This section reviews existing CRP resolution methodologies, which are broadly categorized into heuristic algorithms and exact algorithms.
We first introduce heuristic algorithms for solving the Container Relocation Problem (CRP), as König and Lübbecke [5], Felsner and Pergel [6], and Caserta et al. [7] have demonstrated through their research that this problem belongs to the NP-Hard class. Consequently, researchers have actively explored and developed heuristic algorithms aimed at substantially reducing computational time without significantly compromising solution quality, thereby effectively addressing large-scale and complex CRP instances. Expósito-Izquierdo et al. [8] proposed a domain-specific knowledge-based heuristic algorithm for restricted container relocation problems. This algorithm iteratively attempts to construct an improved feasible solution within predefined iteration limits, while its heuristic search direction prioritizes nodes where target containers have been retrieved and subsequent relocation operations are minimized during the solution construction process. Caserta et al. [9] pioneered the successful application of the Corridor Method to the CRP by integrating dynamic programming as a sub-algorithm, where exogenous constraints strategically reduced solution space dimensionality while maintaining efficacy in large-scale instances. Jovanovic et al. [10] developed a generalized Ant Colony Optimization (ACO) algorithm applicable to both constrained and unconstrained CRP variants, employing greedy strategies with localized bay-state information storage and a novel Pheromone Matrix formulation to minimize yard crane operational duration. He et al. [11] proposed a hybrid algorithm that combines heuristic rules with parallel genetic algorithm and conducted simulation experiments. If each bay configuration is considered as a node, and each feasible container relocation operation between two bay configurations is regarded as an edge, then the container relocation problem is transformed into a shortest path problem on a graph [12]. Given the prohibitively large vertex count in the obtained undirected graph, Yi et al. [13] introduced a Pulse-Coupled Neural Network (PCNN) to circumvent limitations of conventional shortest-path algorithms. Zhu et al. [14] formulated an optimization model targeting minimal relocation operations while incorporating yard crane movement costs, proposing three search evaluation strategies solved via a Beam Search algorithm. Caserta et al. [7] developed the Min–Max algorithm by prioritizing target relocation stacks through comparative analysis of candidate placement stack priorities and pending relocation urgencies. Forster and Bortfeldt [15] designed a tree search-based algorithm that evaluates branching options through greedy principles to identify optimal search pathways. Jin et al. [16] devised an enhanced greedy look-ahead heuristic for the Unrestricted CRP, featuring a tri-layer architecture, a greedy-driven top layer, a tree search-based middle layer generating relocation strategies, and a heuristic rule-embedded bottom layer evaluating leaf nodes, demonstrating superior scalability in large-scale scenarios. Feillet et al. [17] developed a refined local search heuristic that strategically defines state spaces and employs dynamic programming to identify locally optimal container relocation sequences. Yang et al. [18] established a rule-based system for container relocation, where decision-making strictly adheres to predefined priority criteria, with benchmark dataset evaluations demonstrating robust algorithmic performance. Tricoire et al. [19] introduced the SM-2 rapid heuristic for the unconstrained CRP, capable of processing large-scale instances within seconds, with empirical validation showing superior efficacy on standardized test cases. Chen et al. [20] designed a directed search algorithm utilizing rule-scoring prioritization, exhibiting exceptional scalability in constrained CRP scenarios. Furthermore, metaheuristic frameworks including Tabu Search [21,22,23], Beam Search [24,25,26], Genetic Algorithms [27,28], and Simulated Annealing [29,30] have been adapted to address the CRP and related combinatorial challenges. In summary, existing methodologies can be categorized into domain-specific knowledge-driven heuristics and metaheuristic architecture-based approaches.
Next, we will introduce the exact algorithm for solving the CRP, with mathematical programming approaches that formalize the problem into precise mathematical formulations serving as foundational frameworks for subsequent methodologies. Research in this domain primarily involves constructing mathematical programming models (e.g., Mixed-Integer Programming (MIP) and Constraint Programming (CP)) through a rigorous analysis of optimization objectives and constraints, with solver-based implementations or numerical experiments employed to validate model fidelity and computational complexity. For instance, Caserta et al. [7] formulated BRP-I and BRP-II models; they are both binary integer programming models, with the former indicating that free relocating is allowed and possessing a complete feasible region, while the latter reduces the feasible region by adding the assumption of reality that free relocating is not allowed, so they represent the Unrestricted CRP (UCRP) and Restricted CRP (RCRP) variants, respectively. Zehendner and Feillet [31] advanced this paradigm by decomposing the BRP-II model into master and pricing subproblems via column generation, proposing a branch-and-price algorithm for the RCRP that achieves tighter dual bounds and resolves small-scale instances with reduced column counts and iteration cycles. Zehendner et al. [32] streamlined the BRP-II model by eliminating redundant variables and parameters while refining and tightening operational constraints to develop the enhanced BRP-II-A variant capable of resolving instances exceeding 25 containers. Boysen and Emde [33] formalized the parallel stack storage problem with fundamental complexity proofs, subsequently deriving Mixed-Integer Programming (MIP) formulations aligned with distinct optimization objectives. Le and Knust [34] addressed the stack storage problem under height constraints by establishing an MIP framework that minimizes stack utilization under uncertain stacking constraints.
While mathematical programming approaches enable exact solutions for the CRP and related problems, their applicability is constrained by instance size limitations and exponentially increasing computational demands [35,36]. Consequently, scholars have developed branch-and-bound frameworks integrating heuristic-derived upper bounds and problem-specific relaxation lower bounds to establish tree-search-based exact algorithms. Kim and Hong [37] proposed depth-first branch and bound with backtracking for the restricted CRP with duplicate priorities, incorporating practical constraints of destination-based container grouping by attributes like size and weight. Expósito-Izquierdo et al. [38] devised a best-first branch-and-bound algorithm employing intelligent node selection strategies to balance solution quality and optimality guarantees for multi-priority restricted CRP scenarios. Zhu et al. [39] pioneered the application of iterative deepening A* (IDA*) to CRP, leveraging its low memory footprint and computational efficiency to address large-scale instances. Tanaka and Takii [40] enhanced IDA* through tighter lower-bound formulations, significantly accelerating exact solutions for restricted CRP variants. These branch-and-bound-based exact algorithms provide theoretically optimal solutions, establishing critical benchmarks for advancing CRP research.
In addition, some researchers have attempted to apply machine learning and reinforcement learning methods to solve the Container Relocation Problem (CRP). Ye et al. [41] identified 22 key features influencing the number of relocation moves and employed various machine learning methods to validate the relationships between critical relocation features and the number of relocations using unrestricted Block Relocation Problem (BRP) and restricted BRP models. Tang et al. [42] further addressed the challenges posed by the stochastic nature of container dwell times in three-dimensional stacking yards. They proposed a two-stage approach integrating historical data-driven predictions of container extraction dates and deep reinforcement learning (DRL) to optimize relocation strategies.
In summary, the main challenge in solving the CRP lies in how to balance the quality and speed of the solution in large-scale cases. Exact methods based on mathematical programming rely heavily on the accuracy of the model and often require a long solving time, while existing heuristic methods, although fast, struggle to guarantee the quality of the solution. To address the scarcity of simultaneously rapid and exact algorithms in prior literature, this paper proposes a strategy-iterative deepening branch-and-bound (S-IDB&B) algorithm with three key innovations:
(1)
A refined lower-bound estimation method was developed to enhance node potential evaluation, enabling the earlier identification of unpromising branches through amplified lower-bound differentiation, coupled with two dominance rules to facilitate the pruning of unpromising branches, thereby reducing search space and improving algorithmic efficiency.
(2)
The algorithm incorporates a proactive probe mechanism, and the proposed strategy-oriented algorithm can quickly calculate a more powerful (tighter) upper bound. At the same time, the algorithm optimized the node search order (considering both the current node state and future container relocate conditions) to accelerate convergence.
(3)
Algorithms can set truncation conditions to achieve early stopping, breaking the binary opposition pattern where precise algorithms are equal to “slow but accurate” and heuristics are equal to “fast but secondary”. This allows precise algorithms to be adjusted to “accurate but fast”, providing a new paradigm for the practical application of precise algorithms in industrial scenarios.
The first two innovative points mentioned above make the proposed strategy-iterative deepening branch-and-bound algorithm more capable of accurately solving the CRP compared to traditional branch-and-bound algorithms, while the last point makes the proposed exact algorithm still competitive compared to existing heuristic algorithms and even more efficient in solving performance.

3. Problem Description and Optimization Model

3.1. Problem Description

This paper focuses on the Container Relocation Problem (CRP) within a single bay configuration. As depicted in Figure 3 (cross-sectional visualization), the bay structure organizes containers spatially through horizontal stacks and vertical tiers, and “slot” represents the coordinates of the container in bay.
The retrieval sequence follows an ascending numerical priority system where lower-numbered containers need to leave the bay earlier. A critical operational challenge arises when target containers (e.g., Container #1) are obstructed by blocking containers (e.g., #8 and #5 in Stack 4), necessitating their strategic relocation to alternate stacks. When the target container is not obstructed, it can be directly transferred (this operation is called “retrieve”) to a horizontal transport vehicle (such as a container truck) to participate in the next operational stage of the terminal. The CRP optimization objective centers on determining the minimal sequence of relocation operations required to systematically retrieve all containers from their initial stacked configuration while adhering to strict priority constraints.
Obviously, the container relocation operation is performed for the containers located at the top of the bay. Here, it should be noted that this paper studies the restricted container relocation problem (RCRP), where the containers to be relocated are not freely selected from the top of the berth, but only the obstacle container located at the top of the stack where the current target container is located can be selected until the current target container has been retrieved, and then the obstacle container of the stack where the next target container is located will be selected accordingly for relocation.

3.2. Optimization Model

Section 3.1 establishes that this paper researches the fundamental classical RCRP, with a primary focus on algorithmic innovations. The proposed methodology fundamentally differs from mathematical programming-based approaches that rely on precise mathematical modeling (using commercial solvers to solve established mathematical programming models), thus adopting the classical mathematical model from reference [20]. As a classic model in the field of the RCRP, it can characterize the application scenario of restricted relocation in single bay.

3.2.1. Model Assumption

The following assumptions are made for the model:
(1)
There are unique container identifiers within the bay, eliminating duplicate numbering.
(2)
There is strict adherence to predefined retrieval sequences without deviation.
(3)
There is stack height compliance with maximum tier capacity constraints.
(4)
Only topmost blocking containers above the current target are eligible for relocation until target container has been retrieved, after which subsequent target stacks become active.
(5)
All operations of container relocation and retrieve occur within the same bay.
(6)
There are standardized container dimensions ensuring spatial uniformity.

3.2.2. Notations

The notations of the model are shown in Table 1 and Table 2.

3.2.3. Model Establishment

Objective function:
min   Z = s = 1 S h = 1 H   s = 1 S   h = 1 H n = 1 N t = 1 T r sh ,   s h n , t
Constraints:
s = 1 S h = 1 H e sh n , t + f n , t = 1 , n N , t T
f n , t = s = 1 S h = 1 H   t = 1 t - 1 l sh n ,   t , n N , t T
n = 1 N e sh n , t 1 , s S , h H , t T
n = 1 N e s h + 1 n , t n = 1 N e sh n , t , s S , h { 1 , H 1 } , t T
e sh n , t = e sh n , t 1   s = 1 S   h = 1 H r sh   s h n , t 1 +   s = 1 S   h = 1 H r   s h sh n , t 1 l sh n , t 1 , s S , h H , n N , t T
M ( 1 n = 1 N r sh ,   s h n , t ) n = 1 N x = h + 1 H y = h + 1 H r sx ,   s y n , t , s ,   s S , h ,   h H , t T , M
M ( 1 h = 1 H e sh t , t ) n = 1 N h = 1 H   s = 1 S   h = 1 H r   s h ,   s h n , t , s S , t T ,   s S \ s , M
r sh , s h n , t = 0 , s S , h ,   h H , n N , t T
Equation (1) is the objective function with the optimization goal of minimizing the total number of relocation. Constraint (2) ensures that at any stage, any container is either stored in a bay or has been retrieved. Constraint (3) ensures that if there is a retrieve operation on container n before stage t, container n will no longer be stored in the bay during stage t. Constraint (4) ensures that at any stage, a maximum of one container can be stored in any container slot. Constraint (5) ensures that no container is allowed to be suspended in any position at any stage. Constraint (6) indicates that whether container n is stored in container slot (s, h) at the beginning of stage t is determined by the initial position of the container in the previous stage, as well as the subsequent relocation and retrieve situations. This ensures that each container follows the logic of relocating and retrieving during the transition from stage t − 1 to stage t. Constraint (7) ensures that containers undergoing prior relocation operations within the same stage cannot be positioned directly above subsequently relocated containers. Constraint (8) ensures that only when all the blocking containers above the target container n have been relocated in the current stage t can the blocking container above the next target container be relocated. Constraint (9) ensures that a blocking container can only be relocated to other stacks.
This paper naturally encoded the stacking state, operations (relocate and retrieve), and related constraints using a tree search-based method. Among the tree, the root node corresponds to the initial stacking state of containers in the bay, the leaf nodes correspond to the bay clearance state, and the edges between nodes correspond to feasible container relocate actions. The goal is equivalent to finding the shortest path from the root node to the leaf node.

4. Strategy-Oriented Algorithm

The strategy-oriented algorithm can quickly find a reasonable and feasible solution through a set of container relocation strategies, which can serve as an upper bound for the strategy-iterative deepening branch-and-bound algorithm. For the convenience of describing the container relocation strategy, it is first necessary to define some related concepts.
Let n r denote the blocking container above the target container that is waiting to be relocated. Let s can represents the stack with stacking vacancies in the bay, except for the stack where blocking container n r is located. Let s dst denote the final destination of container n r . Let q s denote the support capability of stack s, which is numerically equal to the smallest container number among all the containers stacked on the stack, and q s of an empty stack is infinite. Let n g denote the containers with higher priority than all the containers under it, and the container at the bottom of the bay is also considered n g . Let n b denote the containers other than n g . Let s g denote s can with q s greater than the number of n r , and let s b denote the stack other than s g .
Based on the above definition, the container relocation strategy is described as follows.
Strategy 1: If the current n r can be converted into n g through the relocation operation, that is, there is s g in s can , then choose to relocate it to s g with q s just greater than the number of n r , without occupying other s g with larger q s .
Strategy 2: If n r cannot be converted into n g , that is, there is no s g in s can , further determination of the current configuration of the bay is required, which can be divided into Situation A and Situation B. Situation A refers to the existence of two or more unfilled s b , and s b with the highest q s is only one container away from being filled. Situation B refers to all situations except for Situation A. If the current configuration of the bay meets Situation A, choose s b with the second largest q s as s dst ; otherwise, choose s b with the largest q s as s dst .
Algorithm 1 gives the pseudocode for the strategy-oriented algorithm, and Figure 4 gives the flow chart for the strategy-oriented algorithm.
Algorithm 1. Strategy-Oriented Algorithm (SOA)
1 :   function   SOA :   num 0 ;
2 :     target , n r , n b , q s checkconf ( )
3 :   while   ( | n b | > 0 ) :
4 :           if     ( | n r | > 0 ) :
5 :       if     configuration   satisfy   strategy 1 : n b -   - ,   num +   + , relo 1 _ upd ( ) ;
6:      else:
7 :       if     configuration   satisfy   situationA : num +   + , reloa _ upd ( ) ;
8 :       else :     num   +   + ,   relob _ upd ( ) ;
9 :           else :   retri _ upd ( ) ;
10 :   return   num ;
The strategy-oriented algorithm implementation process is as follows. After inputting the CRP instance, the first step is to initialize the number of relocation to 0 (line 1). Then determine the target container, n b , n r , q s and other information by function “checkconf()”, and enter a loop with the goal of retrieving all the containers in the bay. As long as the number of n b is greater than 0, it means that the goal has not been completed. The internal loop is the relocation strategy, and the algorithm will execute the corresponding relocate actions through functions “relo1_upd()”, “reloa_upd()”, and “relob_upd()”, which represent executing the process according to strategy 1, executing it according to strategy 2 Situation A, and executing it according to strategy 2 Situation B, respectively. And “retri_upd()” represents retrieving the target container. The algorithm keeps running until the goal is achieved and finally returns the number of relocation.

5. Strategy-Iterative Deepening Branch-and-Bound Algorithm

With the increasing scale of automated container terminals, the solution space of the CRP is growing exponentially, making it difficult for traditional branch-and-bound algorithms to efficiently solve large-scale problems in a short period of time. Therefore, this paper proposes a strategy-iterative deepening branch-and-bound algorithm, which integrates the idea of branch-and-bound with an iterative deepening search. Compared with traditional branch-and-bound algorithms, it has the following significant characteristics: Firstly, it sets a search depth threshold, limits the tree depth, avoids the excessive exploration of invalid nodes, and significantly reduces the search space. Secondly, the algorithm introduces dominance rules to identify equivalent nodes and non-optimal branches, thereby reducing redundant calculations. Finally, the node search order is prioritized according to predetermined rules, focusing on high potential nodes to improve optimization efficiency.

5.1. Upper and Lower Bound

In the strategy-iterative deepening branch-and-bound algorithm, each branch node corresponds to a container stacking situation, and each branch corresponds to a feasible container relocation. This paper uses a triplet (c, s, d) to represent it, such as (5, 5, 6), which represents the movement of container 5 from stack 5 to stack 6. As shown in Figure 5, the blocking container (container 5) above the target container (container 1) has five feasible relocations, forming five branches and corresponding branch states.
The upper bound of the branch node represents the feasible number of relocations for retrieving all containers at that node. When solving the upper bound of the root node and probing the node (see Section 5.3), the SOA proposed in this paper is used for the solution.
The lower bound of a branch node represents the minimum number of relocations for retrieving all containers at that node, which is composed of the number of n b and the estimated value of the blocking container caused again during the relocation. As shown in Figure 6, each blocking container (highlighted in yellow) at this node obstructs the container with higher priority. Due to the need to retrieve the containers in order, these blocking containers must be relocated first, so this type of relocation is referred to as forced relocation.
If n b cannot be converted to n g after relocation, it means that it has caused obstacles again and needs to be relocated again. As shown in Figure 7, no matter which stack container 16 is relocated to, it is still n b and must be relocated again.
It is worth noting that when container 9 is relocated to stack 3, it may seem like it can be converted to n g , but the prerequisite is that the support capacity of stack 3 in the previous stage has not deteriorated and container 8 in the previous stage has destroyed the original support capacity of stack 3, resulting in container 9 actually needing to be relocated again, and this type of relocation is referred to as additional relocation.
To establish a tight lower bound, estimating additional relocation counts necessitates accounting for the dynamic variation in q s across stacks during container relocation operations. While an exhaustive enumeration of minimal additional relocation scenarios is theoretically possible, this approach inevitably compromises computational efficiency. To balance lower bound estimation tightness with computational efficiency, this paper applies a relaxation approach when calculating the lower bound of a node; if the node has a stack that is not fully stacked, it is assumed that the stack height of the stack is unlimited. Algorithm 2 gives the pseudocode for the lower-bound algorithm, and Figure 8 gives the flow chart for the lower-bound algorithm.
Algorithm 2. Lower-Bound Algorithm
1: function LowerBound:  LB 0 , forcedrelo 0 , addirelo 0 ;
2:   function countfr ( node )
3:     for: each stack in bay
4:     for:  each tier in stack
5:       if find n b : forcedrelo ++;
6:     end for
7:    end for
8:    function countar ( node )
9:     for: each n r above target container
10:     if ( n r > q s _ max ): addirelo ++;
11:     else: s dst = argmi n s s g { | q s - n r | } ,update( node );
12:     if current target container has been retrieved:
       determine the next target container, line 9;
13:   end for
14:   return LB = forcedrelo + addirelo ;
The lower-bound algorithm implementation process is as follows. After inputting the CRP instance, the first step is to calculate the count of forced relocation, and the function “countfr” in the pseudocode is used to traverse all containers in the bay to determine the count of n b , denoted as “forcedrelo”. The second step is to calculate the count of additional relocation. The function “countar” is used to traverse all n r . If n r can be converted to n g , it means that there must be s g in s can . It is then relocated to the stack with the smallest q s and the q s of the stack is updated. If n r cannot be converted to n g , it means that any relocation will not change the q s of the stack, the count of additional relocation is incremented by 1 and n r is marked as processed. When all n r are marked as processed, the algorithm ends and finally returns the sum of forced relocation and additional relocation as the lower bound of the node.

5.2. Iterative Deepening Framework

The iterative deepening framework is described as follows. After inputting the CRP instance, check if the node is the simplest (a stacking state where there is no target container located at the top level, which means that there is no target container that can be directly retrieved). If not, retrieve the containers that can be directly retrieved from the bay. Subsequently, invoke the SOA and lower-bound algorithm to compute the current optimal solution, s best , and search threshold, μ , respectively. If the two are equal (indicating the convergence of the upper and lower bounds), the optimal solution is confirmed and returned. Otherwise, initiate the depth-limited tree search (DLTS) constrained by the search threshold to explore the solution space for the optimal solution. If it cannot be found under this threshold, increment the search threshold and repeat the process until termination conditions are satisfied. Algorithm 3 provides the pseudocode of the iterative deepening framework.
Algorithm 3. Iterative deepening framework
1 : function   crpmain ( bay i n p u t ) ;
2 :       bay 0 bay input ;
3 :       μ LowerBound ( bay 0 ) ;
4 :         s best SOA ( bay 0 ) ;
5:      loop
6 :       if ( μ = | s best | ) :   return   s best ;
7 :       else :   ( sign , s best ) DLTS ( p , bay , μ , s best ) ;
8 :       if ( sign ) :   return   s best ;
9 :       else :   μ ++;
And the pseudocode can be represented as the algorithm flow chart shown in Figure 9.

5.3. Depth-Limited Tree Search

As aforementioned (Section 5.2), when the computed upper bound fails to converge with the lower bound, the algorithm initiates a depth-limited tree search that aims to identify a solution whose objective function value precisely matches the lower bound, thereby proving its optimality. Even if no optimal solution is found within the search threshold, DLTS continues to iteratively refine the incumbent optimal solution. The depth-limited tree search is implemented via the recursive search function DLTS, as show in Algorithm 4. The function accepts four input parameters: parameter p stores the container relocation path from the root node to the current node, formatted as [(c, s, d), …]; parameter bay lay denotes the current node state (container distribution configuration); parameter μ represents the search threshold for the current iteration, which corresponds to the global lower bound of the problem; and parameter s best denotes the incumbent optimal solution.
Algorithm 4. Depth-Limited Tree Search
1 :   function   DLTS ( p , bay lay , μ , s best )
2 :           Branches Ø ;
3 :               for   each   ( c ,   s ,   d )   to   bay lay do
4 :                 p p [ ( c , s , d ) ] ;
5 :               if ( bedomin ( p ) ): continue
6 :               else :   bay lay bay lay ( c , s , d ) ;
7 :               if ( isleaf ( bay lay ) ) :   return   ( True , s best );
8 :               lb LowerBound ( bay lay ) ;
9 :               f est ( bay lay ) lb + | p | ;
10 :             if   ( f est ( bay lay ) > μ ): continue;
11 :             if ( probecond ( bay lay ) ) :   s cpl p SOA ( bay lay ) ;
12 :             if ( | s cpl | < | s best | ) : s best s cpl ;
13 :               if ( | s best | = μ ) :   return   s best ;
14 :             Branches Branches { ( c , s , d , lb ) } ;
15:     end for
16 :       Branches reorder ( Branches , lb , q d )
17 :             for :   each   branches   in   Branches
18 :               p p [ ( c , s , d ) ] ;
19 :               bay lay bay lay ( c , s , d ) ;
20 :             ( sign , s best ) DLTS ( p , bay lay , μ , s best ) ;
21 :               if ( sign ) :   return   ( true , s best );
22 :               else :   line 17;
23:          end for
24 :     return   ( false , s best );
Lines 2–15 implement a dual-pruning mechanism: eliminating dominated branches (relocation path) through dominance rules (the function “bedomin” will check whether the relocation path will be dominated) and discarding nodes with evaluation values exceeding the threshold within the current search iteration. This two-stage filtration process preserves only the most promising branches with potential to reach optimal solutions. Initially, a branch set, Branches , is created for the current node, bay lay , followed by an enumeration of feasible container relocation (c, s, d) to generate child nodes. If the relocation path, p , corresponding to the child node is not dominated and the evaluation value, f est , of the child node does not exceed the search threshold, μ , then the branch will be retained and stored in the branch set. The node evaluation value set in this paper consists of its lower bound and the number of relocation from the root node to it. The algorithm divides the branch tree into layers of different “depths” based on the node evaluation value, and each search iteration exclusively explores nodes whose evaluation values fall within the current search threshold; this approach effectively implements a depth-limited search through evaluation-based constraints.
In addition, the algorithm continuously verifies during child node generation whether a leaf node is reached, indicating the discovery of the optimal solution and triggering immediate termination. At the same time, if the child node satisfies the probing conditions (the function “probecond” will check whether the node meets the probing conditions), it will call the SOA to combine with the historical relocation path to obtain the complete solution, s cpl . And if its objective function value can meet the search threshold, the algorithm can be immediately terminated. This is the original intention of setting an proactive probing mechanism in this paper. The probing conditions are set as follows.
Probing condition 1:
f e s t   = μ 1
This condition ensures that each node is only probed once (when and only when it is visited for the second time), avoiding the time consumption caused by repeated calls.
Probing condition 2:
g est   = γ × n n _ cur b n n _ ini b + ( 1 γ ) × n n _ cur n n _ ini < δ ε × μ cur μ 0 SOA ( bay 0 ) μ 0
It should be noted that probing condition 2 is a condition set on the basis of condition 1, and it implements secondary evaluation for nodes within the same depth layer. Metric g est is composed of the ratio of n b count and the ratio of container count, both between the current node and the root node, and parameter γ is a weight used to balance the relative importance of these two ratios. We believe that the smaller the value of g est , the higher the probability of discovering the optimal solution for that node. We only probe nodes with g est not greater than the probing threshold. Considering that the deeper the node, the more concise the corresponding distribution of the bay, we also reduce the probing threshold accordingly. We set it in the form of the right-hand equation in Equation (11), where parameter δ represents the upper limit of the probing threshold and parameter ε controls the speed at which the probing threshold decreases. These parameters will be defined and analyzed later (Section 6.3).
The advantage of setting probing condition 2 is that calling the SOA for probing itself can be time-consuming, while setting probing condition 2 can minimize unnecessary calls and reduce algorithm runtime as much as possible.
And the schematic diagram of the DLTS process is shown in Figure 10.
Line 16 sorts the previously selected branches. We hope that the exploration order of the nodes is not arbitrary but rather prioritizes the exploration of nodes that may lead to the optimal solution faster in high order to reduce the algorithm’s running time. Therefore, we reorder the branches according to the rules of ascending lb and descending q d .
The above process can also be represented as the algorithm flow chart shown in Figure 11.
In the process of the depth-limited tree search, once a leaf node is found below a certain threshold or the optimal solution is found through probing, the algorithm ends immediately. If it is not found, it indicates that the objective function value corresponding to the optimal solution must be greater than the current search threshold. The DLTS returns false and incumbers the optimal solution.

5.4. Dominance Rules

As mentioned in the previous section (Section 5.3), in the process of the DLTS, the generated branches and child nodes undergo verification to see if they will be dominated.
Due to the possibility of some symmetric or duplicated node states during the branching process, which have the same subtree, they are equivalent for the algorithm to find the optimal solution, so only one needs to be retained for subsequent analysis. Therefore, this paper designs dominance rule 1 to eliminate redundant equivalent nodes and improve search efficiency.
Dominance rule 1 consists of the following conditions:
(1)
h d n 1 ( Bay n 1 lay ) = 0
(2)
h d n 2 ( Bay n 1 lay ) = 0
(3)
min { | s n d n 1 | , | s n d n 2 | }
If a node is verified to meet conditions (1) and (2) during the branching process, it indicates that there will be two empty stacks (denoted as d n 1 and d n 2 ) in the candidate stack for the next relocation of the node.
As shown in Figure 12, after the completion of the ( n 1 ) th relocation, there are two empty stacks (stack 1 and stack 2) in the bay, and equivalent nodes will definitely appear during the process of relocating container 10. In this case, cut out the redundant node ( bay n lay ) according to condition (3); that is, select the node ( bay n lay ) that retains the minimum lateral movement distance of the lifting device within the bay.
During the branching process, there may be some nonoptimal relocation paths that need to be eliminated as early as possible. Therefore, this paper designs dominance rule 2 to prune non-optimal paths. We consider the scenario where the relocation path p [ ( c 1 , s 1 , d 1 ) , , ( c n , s n , d n ) ] formed during the node branching process is verified to have integer k that satisfies the following conditions:
(1)
c k = c n { c k + 1 , , c n 1 }
(2)
d n { s k , d k , , s n 1 , d n 1 }
(3)
h d n ( Bay k 1 lay ) = h d n ( Bay n 1 lay )
It will definitely be dominated by the shorter path   p [ ( c 1 , s 1 , d 1 ) , , ( c k , s k , d n ) , , ( c n 1 , s n 1 , d n 1 ) ] . Condition (1) requires the same container to be relocated at both k th and n th relocation in path p , with zero displacement occurring between these steps. Conditions (2) and (3) enforce that no containers have been relocated into or out of stack d n between k th and n th relocation. The stacking height of stack d n must remain identical prior to both k th and n th relocation.
As shown in Figure 13, k th and n th relocation are both for container 7, and there is no movement of container 7 in between. The height of stack 3 remains identical prior to both k th and n th relocation. Therefore, relocations (7, 2, 4) and (7, 4, 3) can be merged into (7, 2, 3), path p [ ( 7 , 2 , 4 ) , ( 4 , 1 , 4 ) , ( 7 , 4 , 3 ) ] is dominated by p [ ( 7 , 2 , 3 ) , ( 4 , 1 , 4 ) ] , and during the branching process, path p will be directly pruned.

6. Computational Experiments and Analysis

In this section, we evaluated the performance of the proposed strategy-iterative deepening branch-and-bound algorithm on datasets of different scales. Firstly, a comparative computational experiment with the exact algorithm was set up (to evaluate the ability of the algorithm to find the optimal solution); a comparative analysis was conducted with the algorithm in reference [20] on randomly generated small-scale and medium-to-large-scale cases. Secondly, a comparative computational experiment with the heuristic algorithm was carried out using partial instances from the public dataset ZQLZ (generated by Zhu et al. [39]). The performance of the proposed SOA was compared and analyzed against the algorithms in reference [18] and reference [7]. Additionally, the performance of the proposed S-IDB&B algorithm was examined under various truncation conditions and compared with the algorithms from references [9,18]. Finally, the impact of different probing conditions on the algorithm performance was also explored. All computational experiments were developed in C programming language and conducted on a system equipped with an Intel Core i7-14650HX processor (boost clock up to 5.8 GHz) and 32 GB RAM.

6.1. Comparison with Exact Algorithm

6.1.1. Comparative Analysis in Small-Scale Instance

For the small-scale instances, the bay configurations range from 3 to 4 tiers (H) and 3 to 6 stacks (S), with the number of containers per bay varying between 7 and 23 (N). For each bay configuration, 100 container distribution instances were randomly generated. This paper selects the S-B&B algorithm [20] as the basic comparison of the S-IDB&B algorithm designed in this paper. Table 3 presents the mean values for each experimental group, in which “opt” refers to the number that the algorithm can accurately solve for these 100 instances, “time” refers to the average CPU calculation time in seconds, and “node” represents the average number of nodes traversed during the search process, determined by the total number of DLTS function calls.
For the convenience of display, the main data in Table 3 are organized as shown in Figure 14 and Figure 15.
From Table 3 and Figure 14 and Figure 15, it can be seen that in the performance of the small-scale instance, the SOA can solve very quickly, and the average CPU computation time is less than 1 millisecond (for the convenience of statistics, we uniformly use seconds as the unit and only retain three significant digits, so the results in the table show 0.000). For the scale with four tiers and four stacks and below, it can find the optimal solution, and for the scale of four tiers and four stacks and above, it can also accurately solve more than 95% of the instances.
The S-IDB&B algorithm utilizes the SOA to compute upper bounds, consequently enabling it to find optimal solutions for all small-scale instances, with computation times consistently under 0.01 s. Although the S-B&B algorithm also finds optimal solutions on all small-scale instances, it requires the exploration of a marginally higher number of nodes compared to S-IDB&B, resulting in a computation time of 0.023 s.

6.1.2. Comparative Analysis in Medium-to-Large-Scale Instance

For the medium-to-large-scale instances, the bay configurations range from four to six tiers (H) and seven to ten stacks (S), with the number of containers per bay varying between 26 and 56 (N). For each bay configuration, 100 container distribution instances were randomly generated. Table 4 presents the mean values for each experimental group. Note: The symbol “/” indicates that the solving time was excessively long (significantly exceeding 600 s), while “#” denotes that data were not collected (we were unable to find the optimal solution or unable to find the optimal solution within the specified time).
For the convenience of display, the main data in Table 4 are organized as shown in Figure 16 and Figure 17.
As evidenced in Table 4 and Figure 16 and Figure 17, the SOA algorithm can rapidly obtain feasible solutions for medium-to-large-scale instances. However, the number of instances for which it can find optimal solutions decreases significantly with increasing bay dimensions. When bay configurations reach or exceed four tiers and ten stacks, its capability to identify optimal solutions diminishes progressively. For six-tier bays, the SOA fails to find any optimal solutions. The inability to find the optimal solution for the SOA in six-tier configurations mainly primarily stems from the inherent combinatorial challenges of its heuristic design. As the bay height increases, the exponential growth in possible container states significantly challenges the efficiency of the SOA. While strategy 1 and strategy 2 perform well in bays (under six tiers) by leveraging domain-specific knowledge (preserving good stacks and strategically using bad stacks), their rule-based nature faces limitations in deeply layered contexts. Specifically, first, local optimization choices under these strategies accumulate suboptimal effects over extended relocation sequences in taller stacks. Second, the predefined strategy conditions become less adaptable to the increased diversity of complex states in six-tier bays.
The S-IDB&B algorithm finds optimal solutions for instances up to five-tier eight-stack bays with an average solving time within 0.1 s. In contrast, the S-B&B algorithm fails to solve five-tier 10-stack or larger instances within the time limit. Consequently, S-IDB&B demonstrates superior performance to S-B&B at these scales, attributable to its iterative deepening search strategy, tighter lower-bound estimations, and enhanced pruning techniques. It has to be admitted that although our algorithm can precisely solve more instances than the S-B&B algorithm, as the scale of instances increases, the number of its precise solutions keeps decreasing. Moreover, for large-scale individual instances, although it can find the optimal solution, the time it takes is very long, resulting in an increase in the average solution time. Nevertheless, it maintains exact solution capability for over 80% of instances within the time threshold.

6.2. Comparison with Heuristic Algorithm

6.2.1. Comparison Between SOA and Heuristic Algorithms

In order to test the solving performance of the SOA, this paper selects the RB algorithm [18] and Min–Max algorithm [7] as the basic comparison of the SOA designed in this paper. We select a portion of the instances from the ZQLZ dataset, with 40 instances set for each group. The performance indicators in Table 5 are all mean values, and “relo” denotes the feasible solution obtained by the algorithm, that is, the number of relocations.
For the convenience of display, the main data in Table 5 are organized as shown in Figure 18 and Figure 19.
Figure 18 compares the number of relocations obtained by the SOA and the RB and Min–Max algorithms for selected instances within the ZQLZ dataset. The legends “DevSR%” and “DevSM%” denote the percentage deviation in the number of relocations for the RB and Min–Max algorithms, respectively, relative to those obtained by the SOA. It can be observed that the SOA consistently achieves a lower average number of relocations than both comparative algorithms across all tested instance sizes (ranging from four tiers and 7 bays to six tiers and 10 bays). This indicates that the SOA produces superior feasible solutions, yielding a tighter upper bound. As the bay size increases, the maximum DevSM% deviation (19.9%) occurs for the six-tier 9-bay instance, while the maximum DevSR% (13.5%) is observed for the six-tier 10-bay instance. These results demonstrate that the SOA’s optimization effectiveness becomes more pronounced with larger bay sizes. As illustrated in Figure 19, the average computation times for these three algorithms show minimal differences, with none exceeding 0.1 s. Therefore, considering both the tightness of the upper bounds obtained and the computational efficiency, the SOA demonstrates superior performance over the RB and Min–Max algorithms on the ZQLZ dataset instances.

6.2.2. Comparison Between S-IDB&B and Heuristic Algorithms

In order to test the performance of the strategy-iterative deepening branch-and-bound algorithm (S-IDB&B) in solving the CRP under the early stopping mechanism, in this section, the algorithm sets truncation conditions of ulgap ≤ 2%, 5%, and 10%, where ulgap is
ulgap = s best μ μ × 100 %
We select the Beam Search algorithm [18] and Corridor Method [9] for comparative testing. The test dataset is a subset of the ZQLZ dataset. The experimental results are shown in Table 6. The time unit is seconds. Note: “/” indicates that the solution time is too long, and “#” indicates that it has not been counted.
For the convenience of display, the main data in Table 6 are organized as shown in Figure 20 and Figure 21.
The legends “Dev_BS5%” and “Dev_BS10%” represent the percentage deviations in the number of relocations calculated by the Beam Search algorithm and the S-IDB&B algorithm, with truncation conditions set at 5% and 10%, respectively,. Similarly, “Dev_CM5%” and “Dev_CM10%” represent the same for the Corridor Method algorithm.
As indicated by Table 6 and Figure 20 and Figure 21, under the strict truncation condition (ulgap ≤ 2%), S-IDB&B achieves the highest solution quality among these algorithms. However, its computational time for medium-to-large-scale instances (particularly those with five tiers and 10 stacks or more) is significantly longer than that of other algorithms. Under the truncation condition (ulgap ≤ 5%), the solution quality of S-IDB&B slightly decreases but remains superior to that of the Beam Search and Corridor Method algorithms. For most tested instances, the “DevBS5%” deviation reached approximately 15%. This value even reached 20% in many instances with four and six tiers. Similarly, the “DevCM5%” deviation was around 15%, approaching 20% for instances with seven tiers. Nevertheless, the computational time difference between S-IDB&B and the comparative algorithms became substantial for instances with five tiers and eight stacks or more. Under the looser truncation condition (ulgap ≤ 10%), S-IDB&B maintained solution quality exceeding the Beam Search and Corridor Method, with “DevBS10%” and “DevCM10%” around 10%. It also achieved significantly shorter computational times, with the time difference relative to the comparative algorithms falling within a much smaller range (showing only a linear, acceptable increase in solution time). In summary, the exact algorithm S-IDB&B proposed in this study, through its early termination strategy, transcends the traditional binary opposition between exact and inexact algorithms. By setting appropriate truncation conditions, it demonstrates performance superior to the Beam Search and Corridor Method algorithms. This challenges the conventional perception of exact algorithms being “slow but accurate” and provides a novel perspective on the practical applicability of exact algorithms for industrial optimization.

6.3. Analysis of Probing Condition Change

In order to investigate the impact of different probing conditions on algorithm optimization, two sets of comparative experiments using the S-IDB&B algorithm were conducted. “S-IDB&B I” represents the configuration where the probing condition is set to Equation (10). “S-IDB&B II” represents a stricter configuration requiring both Equations (10) and (11) to be satisfied before a node is probed. We believe the ratio of n b count and the ratio of container count, both between the current node and the root node, are equally important in measuring the probing value of nodes, so we set parameter γ to 0.5. As mentioned earlier (Section 5.3), the bay distribution corresponding to a node becomes more concise as the depth increases, and its g est also decreases. Therefore, the corresponding probing threshold is dynamically set to decrease, with the upper limit of δ set to 0.8 and the rate of decrease in ε set to 0.3. The experimental results are shown in Table 7. The term “#probe” denotes the number of SOA calls executed during the algorithm run.
For the convenience of display, the main data in Table 7 are organized as shown in Figure 22.
It can be seen that in the instances of five-tier 9-stack and five-tier 10-stack configurations, S-IDB&B II missed some nodes that may have obtained the optimal solution due to the use of stricter probing conditions, resulting in a slightly longer solution time than S-IDB&B I. However, for larger-scale instances (six-tier seven-stack and above), stricter probing conditions successfully eliminate some invalid probes, thereby reducing the average computation time significantly (by up to about 1 min). This demonstrates that probing strategies significantly impact algorithmic efficiency, especially for larger instances with more iterations. Stricter probing conditions are beneficial for accelerating algorithm execution efficiency.

7. Conclusions

This paper investigates the restricted container relocation problem (RCRP) in port container terminals and verifies the effectiveness and advantages of the proposed algorithm through computational experiments. It treats the problem as a shortest path problem, where each bay container configuration is represented as a node in a search tree, and each container relocating operation is considered an edge. The path from an initial bay stacking state to an empty bay state with the fewest edges corresponds to the minimum number of relocations required.
Firstly, a strategy-oriented algorithm (SOA) is proposed. This algorithm guides the selection of the target stack for containers awaiting relocation by establishing a set of container relocation strategies, enabling the rapid identification of reasonably feasible solutions. The computational comparative experimental results (Section 6.2.1) demonstrate the competitiveness of the SOA.
Secondly, a strategy-iterative deepening branch-and-bound algorithm (S-IDB&B) is developed. Upper bounds for branch-and-bound nodes in the S-IDB&B algorithm are computed using the strategy-oriented algorithm, while lower bounds consider the dynamic changes in stack support capability to achieve more accurate estimations. Furthermore, to enhance the search efficiency of S-IDB&B, a proactive probing mechanism is introduced. This mechanism actively attempts to improve the quality of the current optimal solution during the search, aiming to identify a solution whose objective function value equals the lower bound, thereby allowing the immediate termination of the algorithm. The S-IDB&B algorithm also integrates two dominance rules designed to eliminate symmetric nodes and non-optimal paths generated during the relocating process, thereby reducing redundant searches. The computational experimental results on randomly generated instances of varying sizes (Section 6.1) demonstrate that the proposed S-IDB&B algorithm exhibits superior exact solving capabilities for the RCRP compared to general B&B algorithms. Specifically, on large-scale instances where general B&B algorithms fail to find optimal solutions within a time limit, the S-IDB&B algorithm can identify the optimal solution within the specified time frame. The computational experimental results (Section 6.2.2) on public datasets show that S-IDB&B exhibits both high-quality solutions and fast computation performance by adopting an early stopping mechanism and flexibly setting truncation conditions. In the case of computation time similar to other heuristic algorithms, the quality of the solutions is higher than theirs.
Thirdly, the impact of different probing conditions on the S-IDB&B algorithm was briefly explored, and appropriate probing conditions may result in less computation time for the S-IDB&B algorithm.
Future research on container relocation problems could extend the application of these algorithms to the Unrestricted Container Relocation Problem (UCRP) or multi-bay relocation scenarios [43,44]. Additional dominance rules [45] could be developed to facilitate rapid pruning and enhance algorithmic efficiency. Machine learning mechanisms could be incorporated into the algorithm to extract node features indicative of potentially optimal solutions, thereby guiding the refinement of probing mechanisms. And a promising direction for future research is to extend the current work by comparing the proposed algorithm with established heuristic methods such as the Tabu Search and Genetic Algorithm. Such comparisons would provide deeper insights into algorithmic performance and could guide practitioners in selecting appropriate solutions for real-world scenarios.

Author Contributions

Methodology, software, validation, writing, J.Z. (Jiangbei Zhang); resources, review and editing, supervision, J.Z. (Jin Zhu). All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (No.62073212) and Shanghai Science and Technology Commission (No. 23ZR1426600).

Data Availability Statement

The data used to support the findings of this study are included within the paper.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
BSBeam Search
CMCorridor Method
CRPContainer Relocation Problem
DLTSDepth-Limited Tree Search
RCRPRestricted Container Relocation Problem
S-IDB&BStrategy-Iterative Deepening Branch and Bound
SOAStrategy-Oriented Algorithm
UCRPUnrestricted Container Relocation Problem

References

  1. Ni, M.; Chang, D. Storage space allocation based on dynamic strategy in container terminal yard. Appl. Res. Comput. 2019, 36, 2363–2367. [Google Scholar] [CrossRef]
  2. Filom, S.; Amiri, A.M.; Razavi, S. Applications of Machine Learning Methods in Port Operations—A Systematic Literature Review. Transp. Res. Part E Logist. Transp. Rev. 2022, 161, 102722. [Google Scholar] [CrossRef]
  3. Świeboda, J.; Zając, M. Analysis of Reshuffling Cost at a Container Terminal. In Proceedings of the Dependability Engineering and Complex Systems, Brunów, Poland, 27 June–1 July 2016; Zamojski, W., Mazurkiewicz, J., Sugier, J., Walkowiak, T., Kacprzyk, J., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 491–503. [Google Scholar]
  4. Lersteau, C.; Shen, W. A Survey of Optimization Methods for Block Relocation and PreMarshalling Problems. Comput. Ind. Eng. 2022, 172, 108529. [Google Scholar] [CrossRef]
  5. König, F.G.; Lübbecke, M.E. Sorting with Complete Networks of Stacks. In Algorithms and Computation; Hong, S.-H., Nagamochi, H., Fukunaga, T., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2008; Volume 5369, pp. 895–906. ISBN 978-3-540-92181-3. [Google Scholar]
  6. Felsner, S.; Pergel, M. The Complexity of Sorting with Networks of Stacks and Queues. In Proceedings of the Algorithms—ESA 2008, Karlsruhe, Germany, 15–17 September 2008; Halperin, D., Mehlhorn, K., Eds.; Springer: Berlin/Heidelberg, Germany, 2008; pp. 417–429. [Google Scholar]
  7. Caserta, M.; Schwarze, S.; Voß, S. A Mathematical Formulation and Complexity Considerations for the Blocks Relocation Problem. Eur. J. Oper. Res. 2012, 219, 96–104. [Google Scholar] [CrossRef]
  8. Expósito-Izquierdo, C.; Melián-Batista, B.; Marcos Moreno-Vega, J. A Domain-Specific Knowledge-Based Heuristic for the Blocks Relocation Problem. Adv. Eng. Inform. 2014, 28, 327–343. [Google Scholar] [CrossRef]
  9. Caserta, M.; Voß, S.; Sniedovich, M. Applying the Corridor Method to a Blocks Relocation Problem. Spectrum 2011, 33, 915–929. [Google Scholar] [CrossRef]
  10. Jovanovic, R.; Tuba, M.; Voß, S. An Efficient Ant Colony Optimization Algorithm for the Blocks Relocation Problem. Eur. J. Oper. Res. 2019, 274, 78–90. [Google Scholar] [CrossRef]
  11. He, J.; Chang, D.; Mi, W.; Yan, W. A Hybrid Parallel Genetic Algorithm for Yard Crane Scheduling. Transp. Res. Part E Logist. Transp. Rev. 2010, 46, 136–155. [Google Scholar] [CrossRef]
  12. Jin, B.; Tanaka, S. An Exact Algorithm for the Unrestricted Container Relocation Problem with New Lower Bounds and Dominance Rules. Eur. J. Oper. Res. 2023, 304, 494–514. [Google Scholar] [CrossRef]
  13. Yi, Z.; Jiang, J.; Hu, Y. An Optimization Control Algorithm for Containers Relocation Based on PCNN Model. Acta Autom. Sin. 2011, 37, 241–244. [Google Scholar] [CrossRef]
  14. Zhu, M.; Cheng, H.; Fan, X. Block Relocation Problem With Filter Based Beam Search Algorithm. Comput. Integr. Manuf. Syst. 2012, 18, 639–644. [Google Scholar] [CrossRef]
  15. Forster, F.; Bortfeldt, A. A Tree Search Procedure for the Container Relocation Problem. Comput. Oper. Res. 2012, 39, 299–309. [Google Scholar] [CrossRef]
  16. Jin, B.; Zhu, W.; Lim, A. Solving the Container Relocation Problem by an Improved Greedy Look-Ahead Heuristic. Eur. J. Oper. Res. 2015, 240, 837–847. [Google Scholar] [CrossRef]
  17. Feillet, D.; Parragh, S.N.; Tricoire, F. A Local-Search Based Heuristic for the Unrestricted Block Relocation Problem. Comput. Oper. Res. 2019, 108, 44–56. [Google Scholar] [CrossRef]
  18. Yang, X.; Zhou, Y.; Geng, Z.; Xu, Z. Loading Relocation Problem Based on Rule Set Based Beam Search Algorithm. Comput. Integr. Manuf. Syst. 2023, 29, 1040–1054. [Google Scholar] [CrossRef]
  19. Tricoire, F.; Scagnetti, J.; Beham, A. New Insights on the Block Relocation Problem. Comput. Oper. Res. 2018, 89, 127–139. [Google Scholar] [CrossRef]
  20. Chen, Y.; Han, X.; Niu, Y. Optimization of Export Container Relocation Operations Based on Policy Search Algorithm. Comput. Eng. 2024, 1–10. [Google Scholar] [CrossRef]
  21. Xiao, X.; Ji, B.; Yu, S.S.; Wu, G. A Tabu-Based Adaptive Large Neighborhood Search for Scheduling Unrelated Parallel Batch Processing Machines with Non-Identical Job Sizes and Dynamic Job Arrivals. Flex. Serv. Manuf. J. 2024, 36, 409–452. [Google Scholar] [CrossRef]
  22. Karpuzoğlu, O.; Akyüz, M.H.; Öncan, T. A Tabu Search Based Heuristic Approach for the Dynamic Container Relocation Problem. In Proceedings of the Operations Research Proceedings 2015, Vienna, Austria, 1–4 September 2015; Dörner, K.F., Ljubic, I., Pflug, G., Tragler, G., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 165–171. [Google Scholar]
  23. Wang, S.; and Zhao, Q. Probabilistic Tabu Search Algorithm for Container Liner Shipping Problem with Speed Optimisation. Int. J. Prod. Res. 2022, 60, 3651–3668. [Google Scholar] [CrossRef]
  24. Bacci, T.; Mattia, S.; Ventura, P. The Bounded Beam Search Algorithm for the Block Relocation Problem. Comput. Oper. Res. 2019, 103, 252–264. [Google Scholar] [CrossRef]
  25. Zhu, M.; Fan, X.; He, Q. A Heuristic Approach for Transportation Planning Optimization in Container Yard. In Proceedings of the 2010 IEEE International Conference on Industrial Engineering and Engineering Management, Macau, China, 7–10 December 2010; IEEE: New York, NY, USA, 2010; pp. 1766–1770. [Google Scholar]
  26. Hakan Akyüz, M.; Lee, C.-Y. A Mathematical Formulation and Efficient Heuristics for the Dynamic Container Relocation Problem. Nav. Res. Logist. NRL 2014, 61, 101–118. [Google Scholar] [CrossRef]
  27. Gulić, M.; Maglić, L.; Krljan, T.; Maglić, L. Solving the Container Relocation Problem by Using a Metaheuristic Genetic Algorithm. Appl. Sci. 2022, 12, 7397. [Google Scholar] [CrossRef]
  28. Junqueira, C.; de Azevedo, A.T.; Ohishi, T. Solving the Integrated Multi-Port Stowage Planning and Container Relocation Problems with a Genetic Algorithm and Simulation. Appl. Sci. 2022, 12, 8191. [Google Scholar] [CrossRef]
  29. ElWakil, M.; Gheith, M.; Eltawil, A. A New Simulated Annealing Based Method for the Container Relocation Problem. In Proceedings of the 2019 6th International Conference on Control, Decision and Information Technologies (CoDIT), Paris, France, 23–26 April 2019; pp. 1432–1437. [Google Scholar]
  30. Wang, R.; Li, J.; Bai, R.; Wang, L. Storage Strategy of Outbound Containers with Uncertain Weight by Data-Driven Hybrid Genetic Simulated Annealing Algorithm. PLoS ONE 2023, 18, e0277890. [Google Scholar] [CrossRef]
  31. Zehendner, E.; Feillet, D. A Branch and Price Approach for the Container Relocation Problem. Int. J. Prod. Res. 2014, 52, 7159–7176. [Google Scholar] [CrossRef]
  32. Zehendner, E.; Caserta, M.; Feillet, D.; Schwarze, S.; Voß, S. An Improved Mathematical Formulation for the Blocks Relocation Problem. Eur. J. Oper. Res. 2015, 245, 415–422. [Google Scholar] [CrossRef]
  33. Boysen, N.; Emde, S. The Parallel Stack Loading Problem to Minimize Blockages. Eur. J. Oper. Res. 2016, 249, 618–627. [Google Scholar] [CrossRef]
  34. Le, X.T.; Knust, S. MIP-Based Approaches for Robust Storage Loading Problems with Stacking Constraints. Comput. Oper. Res. 2017, 78, 138–153. [Google Scholar] [CrossRef]
  35. Lin, X.; Huang, X. Mathematical Model Analysis of Container Terminal Yard. Adv. Appl. Math. 2023, 12, 830. [Google Scholar] [CrossRef]
  36. Du, Y.; Xu, G. Data Analysis and Application of Container Relocation in Terminal Yard Stowage. Containerization 2024, 35, 5–8. [Google Scholar] [CrossRef]
  37. Kim, K.H.; Hong, G.-P. A Heuristic Rule for Relocating Blocks. Comput. Oper. Res. 2006, 33, 940–954. [Google Scholar] [CrossRef]
  38. Expósito-Izquierdo, C.; Melián-Batista, B.; Moreno-Vega, J.M. An Exact Approach for the Blocks Relocation Problem. Expert Syst. Appl. 2015, 42, 6408–6422. [Google Scholar] [CrossRef]
  39. Zhu, W.; Qin, H.; Lim, A.; Zhang, H. Iterative Deepening A* Algorithms for the Container Relocation Problem. IEEE Trans. Autom. Sci. Eng. 2012, 9, 710–722. [Google Scholar] [CrossRef]
  40. Tanaka, S.; Takii, K. A Faster Branch-and-Bound Algorithm for the Block Relocation Problem. IEEE Trans. Autom. Sci. Eng. 2016, 13, 181–190. [Google Scholar] [CrossRef]
  41. Ye, R.; Ye, R.; Zheng, S. Machine Learning Guides the Solution of Blocks Relocation Problem in Container Terminals. Transp. Res. Rec. J. Transp. Res. Board 2023, 2677, 721–737. [Google Scholar] [CrossRef]
  42. Tang, Y.; Ye, Z.; Chen, Y.; Lu, J.; Huang, S.; Zhang, J. Regulating the Imbalance for the Container Relocation Problem: A Deep Reinforcement Learning Approach. Comput. Ind. Eng. 2024, 191, 110111. [Google Scholar] [CrossRef]
  43. Zhou, S.; Guo, Z.; Chen, J.; Jiang, G. Large Containership Stowage Planning for Maritime Logistics: A Novel Meta-Heuristic Algorithm to Reduce the Number of Shifts. Adv. Eng. Inform. 2025, 64, 102962. [Google Scholar] [CrossRef]
  44. Bacci, T.; Mattia, S.; Ventura, P. The Realization-Independent Reallocation Heuristic for the Stochastic Container Relocation Problem. Soft Comput. 2023, 27, 4223–4233. [Google Scholar] [CrossRef]
  45. Đurasević, M.; Đumić, M.; Čorić, R.; Gil-Gala, F.J. Automated Design of Relocation Rules for Minimising Energy Consumption in the Container Relocation Problem. Expert Syst. Appl. 2024, 237, 121624. [Google Scholar] [CrossRef]
Figure 1. Container yard block diagram.
Figure 1. Container yard block diagram.
Jmse 13 01743 g001
Figure 2. Schematic diagram of container relocation.
Figure 2. Schematic diagram of container relocation.
Jmse 13 01743 g002
Figure 3. Diagram of restricted container relocation.
Figure 3. Diagram of restricted container relocation.
Jmse 13 01743 g003
Figure 4. Flow chart for strategy-oriented algorithm.
Figure 4. Flow chart for strategy-oriented algorithm.
Jmse 13 01743 g004
Figure 5. Schematic diagram of container relocation branching.
Figure 5. Schematic diagram of container relocation branching.
Jmse 13 01743 g005
Figure 6. Schematic diagram of blocking container.
Figure 6. Schematic diagram of blocking container.
Jmse 13 01743 g006
Figure 7. Schematic diagram of stack support capability being destroyed.
Figure 7. Schematic diagram of stack support capability being destroyed.
Jmse 13 01743 g007
Figure 8. Flow chart for lower-bound algorithm.
Figure 8. Flow chart for lower-bound algorithm.
Jmse 13 01743 g008
Figure 9. Flow chart for iterative deepening framework.
Figure 9. Flow chart for iterative deepening framework.
Jmse 13 01743 g009
Figure 10. Schematic diagram of the DLTS.
Figure 10. Schematic diagram of the DLTS.
Jmse 13 01743 g010
Figure 11. Schematic diagram of depth-limited tree search.
Figure 11. Schematic diagram of depth-limited tree search.
Jmse 13 01743 g011
Figure 12. Diagram of dominance rule 1.
Figure 12. Diagram of dominance rule 1.
Jmse 13 01743 g012
Figure 13. Diagram of dominance rule 2.
Figure 13. Diagram of dominance rule 2.
Jmse 13 01743 g013
Figure 14. Comparative analysis of exact solving (small scale).
Figure 14. Comparative analysis of exact solving (small scale).
Jmse 13 01743 g014
Figure 15. Comparative analysis of nodes explored and solving time (small scale).
Figure 15. Comparative analysis of nodes explored and solving time (small scale).
Jmse 13 01743 g015
Figure 16. Comparative analysis of exact solving (medium to large scale).
Figure 16. Comparative analysis of exact solving (medium to large scale).
Jmse 13 01743 g016
Figure 17. Comparative analysis of nodes explored and solving time (medium to large scale).
Figure 17. Comparative analysis of nodes explored and solving time (medium to large scale).
Jmse 13 01743 g017
Figure 18. Comparative tightness analysis of upper bounds.
Figure 18. Comparative tightness analysis of upper bounds.
Jmse 13 01743 g018
Figure 19. Comparative analysis of upper bound and solution time.
Figure 19. Comparative analysis of upper bound and solution time.
Jmse 13 01743 g019
Figure 20. Comparison of relocations and deviation.
Figure 20. Comparison of relocations and deviation.
Jmse 13 01743 g020
Figure 21. Comparison of relocations and solution time.
Figure 21. Comparison of relocations and solution time.
Jmse 13 01743 g021
Figure 22. Comparison of S-IDB&B algorithm under different probing conditions.
Figure 22. Comparison of S-IDB&B algorithm under different probing conditions.
Jmse 13 01743 g022
Table 1. RCRP model symbol definition.
Table 1. RCRP model symbol definition.
NotationDescription of Notation
S set of stack s, indexed from 1 to S
H set of tier h, indexed from 1 to H
N set of container number n, indexed from 1 to N
T set of container’s retrieve stage t, each stage containing one or more container relocation operation (nonessential) and one retrieve operation (essential), indexed from 1 to T
Table 2. Decision variables.
Table 2. Decision variables.
NotationDescription of Notation
e s h n , t If container n is located in a slot in stage t, it is 1; otherwise, it is 0
r s h ,   s   h n , t If container n is relocated from slot (s, h) to (s′, h′) in stage t, it is 1; otherwise, it is 0
l s , h n , t If the container n is retrieved from slot (s, h) in stage t, it is 1; otherwise, it is 0
f n , t If container n has been retrieved in stage t, it is 1; otherwise, it is 0
Table 3. Computational results of the experiments for exact solving of small-scale instances.
Table 3. Computational results of the experiments for exact solving of small-scale instances.
HSNINSTSOAS-IDB&BS-B&B [20]
Time (s)OptTime (s)OptNodeTime (s)OptNode
3371000.0001000.00010000.0011005.2
4101000.0001000.00110000.00110011.7
5131000.0001000.00110000.00610018.5
6151000.0001000.0041000.250.00710022.3
6161000.0001000.0041001.10.00710031.8
6171000.0001000.0041000.050.00810035.2
44141000.0001000.0041001.30.00610027.5
5171000.000980.0041000.80.01110050.6
6211000.000950.0051003.040.01510076.2
6221000.000950.00610034.70.018100129.0
6231000.000950.00610080.40.023100180.2
Table 4. Computational results of the experiments for exact solving of medium-to-large-scale instances.
Table 4. Computational results of the experiments for exact solving of medium-to-large-scale instances.
HSNINSTSOAS-IDB&BS-B&B [20]
Time (s)OptTime (s)OptNodeTime (s)OptNode
47261000.001920.0071006.7 × 1020.0611004.8 × 103
8301000.002980.0071001.2 × 1030.4951006.1 × 104
9341000.002960.0121008.5 × 1034.721009.2 × 105
10371000.004940.0231002.2 × 10452.61001.2 × 107
57321000.001770.0421006.3 × 1059.281008.2 × 106
8371000.002660.0541007.9 × 10626.31005.3 × 107
9421000.047547.13991.7 × 107208.31001.6 × 108
10471000.052#18.1974.5 × 107/##
67381000.031#75.6951.2× 108/##
8441000.048#286.3922.5 × 108/##
9501000.062#472.6863.8 × 108/##
10561000.061#608.8804.3 × 108/##
Table 5. Performance of SOA vs. RB, Min–Max for ZQLZ subset.
Table 5. Performance of SOA vs. RB, Min–Max for ZQLZ subset.
HSNINSTSOARB [18]Min-Max [7]
Time (s)ReloTime (s)ReloTime (s)Relo
4726400.00116.510.00317.230.00218.51
830400.00218.660.02519.620.00720.28
934400.00220.610.02321.580.01321.64
1037400.00421.940.00522.730.00324.18
5732400.00119.570.00321.920.00121.86
837400.00222.610.03624.270.02623.94
942400.04725.070.07627.060.03826.72
1047400.05228.730.01730.760.07431.26
6738400.03125.120.02427.730.03927.86
844400.04828.560.05430.640.03432.49
950400.06230.510.05934.570.04536.61
1056400.06133.290.05137.790.08738.26
Table 6. Performance of S-IDB&B with early stopping vs. BS and CM on ZQLZ subset.
Table 6. Performance of S-IDB&B with early stopping vs. BS and CM on ZQLZ subset.
S × HINSTS-IDB&BBeam Search [18]Corridor Method [9]
Ulga 2% Ulgap ≤ 5%Ulgap ≤ 10%
ReloTimeReloTimeReloTimeReloTimeReloTime
6 × 3402600.032600.032600.032600.022600.02
7 × 3403060.033060.033060.033060.023060.02
8 × 3403550.103550.103550.103550.053550.05
9 × 3404090.164090.164090.164090.104090.10
10 × 3404570.384570.384570.384570.324570.32
6 × 4404740.384740.384740.384740.324740.32
7 × 4405520.485520.435520.436240.306350.30
8 × 4406330.486330.456970.437600.307280.30
9 × 4407060.777060.567770.438480.328120.32
10 × 4407980.387980.388610.389790.309390.30
6 × 5407241.547241.027810.778520.328660.35
7 × 5408527.308774.309192.3010020.3410270.38
8 × 540972139.39100030.6010483.8410951.0911431.20
9 × 540107052.99110217.2011545.7612592.1012062.31
10 × 5401186434.30122142.7012797.6814543.0013963.30
6 × 6401010405.89103958.3010899.9811381.3111881.44
7 × 64011552077.82118970.60124615.7413592.7613023.04
8 × 64013115536.13135094.62141421.5016074.4715694.24
9 × 64014629912.191505118.27157726.8817926.6117206.28
10 × 640160015,421.821647133.06172529.5718829.1519138.70
6 × 740#/1282124.42134327.6514653.5915263.41
7 × 740#/1457160.36152733.4116666.0716935.77
8 × 740#/1625174.99170335.7118589.66193511.11
9 × 740#/1808191.92189437.63206614.39215216.55
10 × 740#/1979203.52207338.40226119.39237422.30
Table 7. Performance of S-IDB&B under different probing conditions.
Table 7. Performance of S-IDB&B under different probing conditions.
HSNINSTS-IDB&B IS-IDB&B II ( γ = 0.5, δ =0.8, ε = 0.3)
TimeOpt# ProbeTimeOpt# Probe
47261000.0071006.7 × 1020.0071006.5 × 102
8301000.0071001.2 × 1030.0071001.1 × 103
9341000.0121008.5 × 1030.0121007.2 × 103
10371000.0231002.2 × 1040.0221002.1 × 104
57321000.0421006.3 × 1050.0411005.7 × 105
8371000.0541007.9 × 1060.0571007.6 × 106
9421007.13991.7 × 10716.82991.6 × 107
104710018.1974.5 × 10722.3974.1 × 107
673810075.6951.2 × 10872.6959.7 × 107
844100286.3922.5 × 108261.4922.2 × 108
950100472.6863.8 × 108436.3863.4 × 108
1056100608.8804.3 × 108553.6803.7 × 108
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, J.; Zhu, J. The Optimization of Container Relocation in Terminal Yards: A Computational Study Using Strategy-Iterative Deepening Branch-and-Bound Algorithm. J. Mar. Sci. Eng. 2025, 13, 1743. https://doi.org/10.3390/jmse13091743

AMA Style

Zhang J, Zhu J. The Optimization of Container Relocation in Terminal Yards: A Computational Study Using Strategy-Iterative Deepening Branch-and-Bound Algorithm. Journal of Marine Science and Engineering. 2025; 13(9):1743. https://doi.org/10.3390/jmse13091743

Chicago/Turabian Style

Zhang, Jiangbei, and Jin Zhu. 2025. "The Optimization of Container Relocation in Terminal Yards: A Computational Study Using Strategy-Iterative Deepening Branch-and-Bound Algorithm" Journal of Marine Science and Engineering 13, no. 9: 1743. https://doi.org/10.3390/jmse13091743

APA Style

Zhang, J., & Zhu, J. (2025). The Optimization of Container Relocation in Terminal Yards: A Computational Study Using Strategy-Iterative Deepening Branch-and-Bound Algorithm. Journal of Marine Science and Engineering, 13(9), 1743. https://doi.org/10.3390/jmse13091743

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop