Introduction

Roll-on/Roll-off (RoRo) ships are designed for direct loading and unloading of wheeled cargo, such as vehicles, without the use of cranes1. Similar to other cargo ships, RoRo ships make sequential port calls during a single voyage2. As a result, cargoes handled at different ports may be loaded onboard at the same time. This may result in situations where the movement path of cargo handled at a specific port is blocked by cargo not handled at that port. Such cases result in unnecessary unloading and reloading of blocking cargo, known as rehandling3. As rehandling increases time and operational cost, it is essential to establish a stowage plan that minimizes rehandling4. To achieve this, it is necessary to consider multiple factors, including the loading port, discharge port, movement path and height of each cargo.

The problem can be simplified as follows. Individual vehicles are grouped into a single cargo based on their Port of Loading (POL), Port of Discharge (POD), and vehicle type5. POL and POD are represented as sequential indices corresponding to the voyage order. Since vehicles within the same cargo share identical length, width, and height, the required stowage area of the cargo can be expressed as a multiple of the vehicle’s length and width. However, this approach increases computational complexity, therefore, cargo volume is typically defined as a multiple of the standardized metric Car Equivalent Unit (CEU)6. For instance, a cargo composed of 20 vehicles, each measuring 1.2 CEU, is assigned a volume of 24 CEU. Accordingly, a cargo is characterized by primary attributes such as POL, POD, and volume, along with secondary attributes such as height and weight.

Prior to a voyage, a cargo handling schedule is provided, which specifies the POL, POD, and volume of the cargoes. A planner establishes a cargo stowage plan that determines the stowage locations of the cargoes based on this schedule7. Rehandling during actual loading and unloading operations can be predicted by this plan. For instance, rehandling occurs when a cargo with a higher POL is assigned deeper than one with a lower POL, or when a cargo with a lower POD is assigned behind one with a higher POD3,8. In addition, as the loading rate increases, the probability of rehandling also increases and can sometimes be inevitable.

Each cargo has additional attributes such as height in addition to POL, POD, and volume, these attributes must be considered both in the ship’s spatial limitations and its structural constraints such as ramps, pillars, and other obstructions1. For instance, the height of a cargo determines which decks it can be assigned to. Therefore, considering POL and POD, along with various structural constraints is essential to minimize rehandling.

The stowage task can be described simply as the assignment of a specific cargo to a specific location. Just as cargo is standardized by CEU-based volume and height, the stowage space can be modeled in various methods2,9,10. In this study, instead of the conventional \(\hbox {lane}\cdot \hbox {grid}\) model commonly used in previous RSSP studies, we modeled the stowage place as a panel-based discretization graph by dividing it into panels. This graph is partitioned into mutually exclusive subgraphs. Here, mutually exclusive implies that even if cargoes have conflicted handling ports, no rehandling occurs as long as they are assigned to different subgraphs.

The assignment sequence of cargoes is also crucial to minimize rehandling11,12. If a cargo is assigned to a subgraph where conflicted cargo has already been assigned, rehandling occurs. Cargo assigned earlier among those in conflict has more stowage location options. As a cargo may conflict with multiple other cargoes simultaneously, those with more constraints should be prioritized in the assignment sequence. This study proposes the Affinity Volume-based Cargo Ordering (AVCO) method, which considers not only the POL and POD of each cargo but also the combined volume of the cargo and its related cargoes.

The stowage planning is a sequential decision-making problem, where each decision depends on the status of previously assigned cargoes. Thus, deriving an optimal solution through a single attempt is infeasible. As the number of constraints increases, the complexity of the solution space also increases. Therefore, the problem can be formulated as a decision tree-based backtracking algorithm. This approach adds a node to the decision tree for each cargo assignment, if no valid solution is found, the algorithm retracts the assignment and explores alternative stowage plans.

The backtracking approach can yield an optimal solution given sufficient time and memory resources13; however, it may result in excessive resource consumption. To address this issue, this study integrates disjoint subgraph-based structural modeling with the AVCO method to effectively reduce the number of backtracking steps. Additionally, the proposed method incorporates Rehandling Cargo Split (RCS), which partitions rehandled cargo during post-processing when necessary, to further reduce rehandling.

The main contributions of this work are not merely simple heuristics for the RSSP. Each technical component is designed for addressing the core problems of the RSSP fundamentally.

  • Disjoint subgraph-based structural modeling: The interference among cargoes arises from the spatial constraint inherent in RoRo ships, where all cargoes must share the same stowage space and movement path. To effectively address this constraint, a mere space-representation model or search-based approach is insufficient. A structural modeling approach that fundamentally resolves the spatial constraint of the RSSP is required. Accordingly, this study represents the stowage space as a graph structure, and models it as a collection of independent spatial units in which mutual interference is inherently eliminated. This spatial partitioning method structurally guarantees that rehandling will not occur without requiring complex verifications.

  • Assignment sequencing based on inter-cargo dependency modeling: A temporal constraint also exists, in which the occurrence of rehandling depends on the relationship between the (POL, POD) pairs of adjacent cargoes. Accordingly, this study defines the inter-cargo relationships that cause rehandling based on their (POL, POD) pairs. By modeling these relationships as a Directed Acyclic Graph (DAG), the proposed method enables the design of a cargo assignment sequencing strategy grounded in these dependencies. Furthermore, a volume-based prioritization strategy is incorporated to efficiently allocate limited stowage space and enhance search efficiency.

  • Post-processing through reallocation of rehandled cargoes: When cargo booking is highly complex, rehandling is inevitable. This study proposes a post-processing technique that reallocates rehandled cargoes to new stowage spaces instead of their original placement locations after rehandling. Through this approach, the number of rehandlings anticipated in the initial stowage plan can be further reduced.

Related works

Øvstebø et al. first introduced the RSSP, proposing solutions based on a Mixed Integer Programming (MIP) model and a Squeaky Wheel Optimization (SWO) heuristic2. This was extended to an integrated optimization problem that includes voyage scheduling and routing decisions14. While these foundational studies are significant for systematizing the RSSP within a numerical optimization framework, their reliance on a lane-based discretization - treating decks as simple linear spatial units for vehicle movement - meant that structural constraints such as ramps and pillars were not adequately represented. Moreover, this approach lacked sufficient consideration for cargo movement paths.

Subsequently, 2D RSSP was proposed to minimize rehandling within a single deck9,15. This study discretized a single deck into grids based on vehicle dimension and employed MIP-based model and Adaptive Large Neighborhood Search algorithm to minimize rehandling. However, the 2D RSSP remained a static model confined to a single-deck structure and thus could not address the shared path and inter-deck interference problems that arise in multi-deck structure.

As a result, the lane- and grid-based spatial models proposed in the early stages of RSSP research served merely as a means of representing spatial occupation rather than providing a fundamental solution to the spatio-temporal feature of rehandling. In other words, the RSSP was simplified into a static packing problem, which failed to represent the dynamic relationships among cargoes, such as path conflicts and mutual interference. These early spatial modeling approaches with an inherent structural limitation made it difficult to resolve the fundamental problem of rehandling. Subsequent studies have not overcome these limitations and have instead evolved by introducing additional constraints or employing metaheuristic search algorithms.

Puisa attempted to address these limitations by introducing a flexible discretization strategy that based on cargo dimensions10. However, the study was conducted based on a simplified voyage scenario with only three ports and utilized a Passenger-RoRo ship as the test subject, which limits its generalizability to RoRo ship.

Recent studies have repeatedly highlighted the limited applicability of MIP- and MILP-based algorithms in real operational environments16,17,18,19,20. To address these limitations, there has been a growing interest in heuristic and meta-heuristic approaches as alternative solutions. Sun et al. attempted to solve the 2D-RSSP problem using a heuristic based on the Lowest Horizontal Line Searching Algorithm16,21. Hosseini applied meta-heuristic algorithms such as Tabu Search and Simulated Annealing18. However, these studies primarily focused on improving search efficiency rather than providing a fundamental solution to the structural causes of rehandling.

This trend dose not appear only in RSSP22. The Container Stowage Planning Problem (CSPP) also deals with shifting, a spatio-temporal interference problem fundamentally identical to rehandling in RSSP, and heuristic-based approaches are also increasingly common23,24,25,26. This means that the limitations of numerical optimization model-based algorithms for hundreds or thousands of cargoes have become clear.

Research has also been widely conducted on stowage focused on elements other than rehandling. Studies exist that focus on the stability and safety of the ship, such as ballast water, the placement of dangerous goods, and fuel efficiency20,27,28. However, research that fundamentally addresses the stowage efficiency in multi-deck structures, which is the focus of this study, is lacking.

In summary, research on the RSSP has steadily evolved over the past decade, however, most studies have failed to overcome the structural limitations inherent in the early spatial modeling paradigm. Although various MIP, MILP, heuristic, and meta-heuristic approaches have been proposed, they have not addressed the fundamental causes of rehandling, thereby leaving two practical issues unresolved. First, many studies have focused on single-deck environments such as the 2D RSSP, failing to capture the complex interference and rehandling inherent to multi-deck structure. Second, because the fundamental interference problem remains unsolved, there is still a lack of methodologies capable of systematically analyzing or resolving the increasingly complex inter-cargo relationships that arise as voyage length increases.

Therefore, this study seeks to overcome these limitations by pursuing a fundamental transformation in spatial modeling rather than merely applying or refining simple search techniques. Furthermore, it aims to systematically define the complex inter-cargo relationships found in real-world bookings and propose a practical and generalizable methodology for reducing rehandling.

Fig. 1
figure 1

Panel-based discretization of a single deck.

Fig. 2
figure 2

Graph modeling of deck panels and ramps.

Fig. 3
figure 3

Process of generating mutually exclusive stowage spaces by deactivating path nodes. (Left) Graph modeling of three decks and shared path. (Right) Graph modeling with deactivated path nodes resulted in three connected components.

Exclusive subgraph- and cargo ordering-based stowage planning algorithm

In this section, we propose a method for reducing rehandling at the stowage planning stage. The proposed method is based on two technical components: the partitioning model of the ship stowage space and the assignment sequence prioritization strategy based on affinity cargo volumes. The key components are described first, followed by the overall algorithm.

Algorithm 1
figure a

Balanced CFB generation.

Balanced conflict free block partitioning of the stowage graph

RoRo ships typically have multiple layers, where each layer is referred to as a deck. Each deck is connected to the upper and lower decks via ramps, and in this study, we assume that the upward and downward ramps exist separately. A deck shares its ramp-to-ramp path with other decks29. For instance, in the case of a deck located directly above one with an external ramp, cargoes on this deck must use their own downward ramp to be unloaded, and the deck must share its ramp-to-ramp path - from upward to downward—for upper decks.

If two cargoes with conflicting POD and POD are assigned to different decks—excluding shared paths—no mutual blocking occurs in their handling paths, thus no rehandling occurs also. In this context, decks without shared paths are considered mutually exclusive stowage spaces, and the utilization of such spaces must be maximized to reduce rehandling. However, there are usually fewer than ten decks, which is far less than the hundreds of conflicted cargo pairs. Therefore, this study proposes a disjoint subgraph partitioning method for deck graph modeling to generate a greater number of mutually exclusive stowage spaces.

To apply a stowage planning algorithm, each deck must be divided into smaller units. Previous studies have commonly used grid or lane units to discretize stowage space. However, the grid model divides the space too finely, often failing to reserve sufficient space for vehicle movement and turning. Furthermore, the lane model allocates a large area to a single lane, which limits its realistic stowage planning10. This study models the stowage space using panels, a discretization unit based on deck pillars, rather than traditional units. In summary, the stowage space is modeled as a graph where each panel corresponds to a node30.

Figure 1 visualizes the discretization units-grids, lanes, and panels-on the deck. Figure 2 illustrates a graph of a deck discretized by panels, where each panel corresponds to a node, and adjacency between panels is defined as an edge.

As mentioned earlier, shared paths arise from the structural characteristics of multi-layer decks. Except for the topmost and bottommost decks, every deck contains one such shared path. Since cargo assigned to other decks also uses these paths, they must not be treated as general nodes. Thus, even when the stowage space is fully utilized, shared paths must be considered as the final space for assignment. Since shared paths should be minimized in terms of stowage efficiency, they can be defined, from a graph perspective, as the shortest path between the two ramp nodes of each deck31,32. The ramp nodes and the nodes along the shared path are referred to as path nodes.

Figure 3 depicts shared paths and path nodes across multiple decks. The left figure shows three decks represented as panel-based graph structures, including upward and downward ramps, and the shared paths leading to an external ramp for each deck. The right figure depicts the result of deactivating path nodes, revealing three connected components corresponding to three decks. These connected components are mutually exclusive. Conflict Free Block (CFB) can be generated by partitioning each connected component into multiple vertex-disjoint subgraphs, which also serve as mutually exclusive stowage spaces.

A CFB is defined as a balanced disjoint set adjacent to a specific path node. The components of this definition are as follows: adjacency to a path node implies a direct connection to an external ramp without passing through another CFB; balanced indicates that the CFB sizes are similar within the structural limit of a deck; disjoint means cargo assigned to different CFB can be handled without mutual blocking. Algorithm 1 describes the procedure for generating CFB.

Fig. 4
figure 4

Results of applying the CFB generation algorithm to various deck structures.

Algorithm 1 initializes in Lines 1-4. \(F_P\) is the set of frontier nodes adjacent to path nodes, each node in \(F_P\) becomes a CFB and serves as its head node. All nodes not part of path nodes or any CFB are in the set of unvisited nodes \(\mathcal {U}\). A CFB expands by incorporating one of the unvisited nodes adjacent to its current head and then updating that node as the new head.

The algorithm consists of three main stages. First, during the Minimum-CFB Selection stage, the algorithm selects the CFB with the lowest scale for expansion. Scale is determined by the sum \(|b|+|F_b|\), where |b| is the current CFB size and \(F_b\) is the set of unvisited frontier nodes adjacent to the CFB head. When the sums are equal, the term \((1+\varepsilon )\) ensures that the CFB with the smaller \(|F_b|\) is selected. The rationale for prioritizing a CFB with a smaller \(|F_b|\) is to mitigate the risk of imbalanced partitioning. A smaller \(|F_b|\) implies higher susceptibility to influence by adjacent CFB, increasing the risk of early expansion restriction and imbalance. If the values for both |b| and \(|F_b|\) are still tied, all such CFB are considered selectable for the next stage. If a CFB has no remaining frontiers, it can no longer be expanded and is therefore removed from \(\mathcal {B}\).

Second, in the Target-Frontier Selection stage, let \(\Gamma\) denote the union of all frontier nodes adjacent to the selected CFB set \(\widehat{B}\). The algorithm then selects the target froniter \(f^*\), based on a primary criterion: it chooses the node connected to the minimum number of candidate CFB (i.e., minimizing \(|B_f|\)). This choice is strategic, as a frontier with fewer adjacent CFB represents a less contested and more influential to a specific CFB set. If this primary criterion results in a tie, the algorithm breaks the tie by applying a secondary criterion: it selects from the tied nodes the one with the fewest unvisited nodes \(|U_f|\). This is prioritized because such a node has lower future expandability. In the rare event that a tie still persists, one of the final candidates is selected randomly. Finally, it determines the subset \(B_f^* \subset widehat{B}\) of CFB adjacent to \(f^*\).

Third, CFB is expanded based on the selected \(\widehat{B}\) and \(f^*\). If no CFB is selected, the algorithm terminates abnormally. If one CFB is selected, it connects to the adjacent frontier \(f^*\). If multiple minimum CFB exist and a frontier with only one adjacent CFB exists, that pair is connected. If no such frontier exists, the algorithm evaluates all available expansions and then selects the configuration that maximizes the number of expandable CFB while minimizing size deviation among them.

Figure 4 shows the result of CFB generation based on deck-specific path nodes and structures. Each CFB is connected to at least one path node, disjoint, and has a balanced size. Subsequently, cargoes selected in sequence via the Cargo Ordering method are assigned to one of these CFB for stowage.

Fig. 5
figure 5

Example of cargo relationships of cargo (3, 7) in the POL-POD Volume Matrix.

Affinity volume-based cargo ordering

As mentioned earlier, each stowage unit, referred to as cargo, is a set of identical vehicles sharing the same POL and POD. A cargo is primarily defined by its POL, POD, and volume, with additional attributes such as height and weight. Since rehandling of the stowage plan is determined by the (POL, POD) pairs among cargoes, the proposed method defines cargo relationships based on these pairs and then performs cargo ordering, which determines the assignment sequence of the cargoes according to the defined relationships. Cargo relationships are defined into three types.

  • Parent–child relationship: A parent cargo is defined as a cargo with a POL less than or equal to, and a POD greater than or equal to that of a given cargo. That is, the one loaded earlier or at the same port and unloaded later or at the same port is parent cargo. Conversely, a child cargo is loaded later and unloaded earlier than a given cargo. When two cargoes are in a parent-child relationship, the parent cargo is loaded earlier and the child cargo is unloaded earlier. Even if two cargoes with this relationship are assigned to the same CFB, no rehandling occurs as long as the parent cargo is loaded deeper-that is, assigned earlier-than the child cargo.

  • Conflict relationship: Conflict relationship refers to two cargoes being loaded at different ports, and the one loaded earlier must also be unloaded earlier. This relationship is symmetric. If cargo \(c_1\) is a conflicted cargo of \(c_2\), then \(c_2\) is also a conflicted cargo of \(c_1\). Cargoes in a conflict relationship block each other while being handled and must be assigned to different CFB. Failure to do so inevitably results in rehandling. When multiple cargoes are mutually in conflict, they form a conflicted cargo set.

  • Disjoint relationship: A disjoint relationship refers to the transport periods of two cargoes do not overlap. Since one cargo is unloaded before the other is loaded, the cargoes never coexist on the ship, and thus, there are no constraints on their assignment.

This study constructs a POL-POD Volume Matrix in which POL values are mapped to rows and POD values to columns. Each cell indicates the CEU volume of cargoes belonging to that (POL, POD) pair. Figure 5 illustrates an example centered on cargo (3, 7). Cargoes in cells A, B, C, and D form a conflicted cargo set, where all cargoes are mutually in conflict relationship.

Due to the first-in-last-out mechanism of CFB, earlier assigned cargo is loaded deeper-farther from the path node. Accordingly, the proposed method determines the cargo assignment sequence based on the following principles to prevent rehandling. First, parent cargo must always be assigned before its corresponding child cargoes. Second, cargoes in a conflicted cargo set must not be assigned within the same CFB.

To satisfy these principles, this study models cargo ordering as a topological sorting problem over a DAG. In constructing the DAG, cargoes with identical POL and POD values are grouped as a single node, and arcs are created from parent cargoes to child cargoes. No arcs exist between conflicted or disjoint cargoes. Cargo ordering proceeds by repeatedly selecting a source node from the DAG, assigning it, and removing it from the graph.

During this process, multiple source nodes can exist simultaneously. Since these source nodes typically form conflict relationships, the assignment sequence among them must also be determined. Simply assigning the cargo with the larger volume first may reduce overall rehandling, as only the smaller cargo assigned after within the same CFB would need to be rehandled. However, the potential impact on child cargoes that may be assigned to the same CFB later must also be considered. Therefore, the proposed method prioritizes source nodes based on the combined volume of the node itself and all of its descendant cargoes. A node with a small volume but a large total descendant volume is prioritized to allow influential descendants to be assigned to the same CFB and utilize more vacant CFB later. This method is referred to as cargo ordering based on the total volume of affiliated cargoes, AVCO.

Fig. 6
figure 6

Affinity-based cargo ordering using DAG representation.

Figure 6 presents an example of AVCO in operation. The POL-POD volume matrix is constructed based on the cargo handling schedule. And DAG is generated by this matrix. First, the unique source node (1, 9) is assigned and removed from the graph. Next, one of the two source nodes in the conflict relationship should be selected: (1, 7) and (3, 9). The total volume of (1, 7) is computed as \(100\; CEU (itself) + 150\; CEU (descendants) = 250\; CEU\), while (3, 9) has \(120\; CEU (itself) + 50\; CEU (descendants) = 170\; CEU\). Therefore, (1, 7) with a larger potential volume is assigned earlier.

Backtracking-based CFB selection and advancements

After the cargo assignment sequence is determined, each selected cargo should be assigned to a specific CFB with two key considerations. First is the diversity of stowage objectives. RoRo ship stowage planning may involve various objectives and considerations. For example, when cargo consists of vehicles with widely varying heights-such as passenger cars, buses, or heavy equipment-deck height limitations must be considered. In addition, various objectives such as the ship’s stability, lowering the center of gravity, and minimizing handling distance. These objectives can be formulated as heuristic metrics or designed as reward functions in reinforcement learning. This study focuses on the effect of CFB construction and AVCO on rehandling reduction; therefore, only cargo height is considered in planning.

Second, since stowage planning is a sequential decision-making problem dependent on the previously assigned cargoes, this study models the problem using a decision tree-based backtracking algorithm. Each cargo assignment adds a node to the decision tree. The algorithm evaluates node validity based on CFB availability; if valid, it proceeds with depth-first search (DFS), otherwise, it retracts the assignment, prunes the node, and explores alternatives. Although this approach guarantees an optimal solution given sufficient time and memory, such assumptions are practically infeasible. Thus, reducing the number of backtracking steps by the proposed CFB configuration and AVCO is a key objective also.

Algorithm 2
figure b

Backtracking-based CFB selection with rehandling option.

Algorithm 2 outlines the process of determining CFB for each cargo selected via DAG-based AVCO. The selection option \(opt_r\) is initialized as \(no_rehandling\), which implies that any CFB containing conflicted cargo is not considered for assignment. When cargo c is selected, the algorithm searches for an appropriate CFB b that satisfies the defined conditions. It first verifies that both the selection option and c have not been retracted, and then determines b satisfying additional constraints for stowage objectives. In this case, height-based constraint \(fit-height\) is used.

Starting from line 22, once a suitable CFB b is selected, c is assigned sequentially from its innermost node up to its remaining capacity. If c still has remaining volume after fully utilizing the b’s remaining capacity, the remaining volume of c is updated in the DAG \(\mathcal {D}\), and AVCO is executed again. Since a cargo can be assigned to multiple CFB, the remaining volume can be treated as a new cargo and re-ordered. Once all volume is assigned, the corresponding node is appended to the decision tree \(\mathcal {T}\).

At line 7, there may be cases where no suitable b can be selected for c. If the number of searches remains within the threshold \(\tau _{search}\), the previous assignment is retracted and the corresponding node is pruned from T. Additionally, if the total remaining volume is smaller than the stored minimum, the current state, represented as the tuple (BDT), is stored as a snapshot. If \(\tau _{search}\) is exceeded while \(opt_r\) is still set to \(no_rehandling\), \(opt_r\) is switched to \(rehandling_allowed\), and the search is resumed from the best snapshot. Here, \(rehandling_allowed\) indicates that CFB already assigned with conflicted cargoes can be selected for assignment. If the number of search attempts exceeds \(\tau _{search}\) again in the \(rehandling_allowed\) state, the algorithm terminates with a failure.

The meaning of the search threshold \(\tau _{search}\) is to define the computational limit for the NP-hard problem. In Algorithm 2, for the sake of logical clarity, this is expressed as a search step limit. However, in this study’s actual experiments, we adopt a more practical \(\tau _{search}\) by using a time limit.

(Advancement) rehandling cargo split scheme

To further reduce rehandling, this study also proposes a post-processing method called RCS. The rehandled cargoes are temporarily unloaded and then reloaded at the port of rehandling. If the rehandled cargoes are reloaded to the same location as before, it is likely to cause additional rehandling, as it was previously assigned with a low priority. Therefore, when reloading, a new location that does not cause additional rehandling must be considered. To achieve this in the proposed algorithm, the rehandled cargoes are treated as newly loaded cargoes at the relevant port, and re-assigned with other cargoes loaded at that port.

Specifically, once the CFB selection algorithm is completed, the rehandled cargoes are virtually split into two logical cargoes. The DAG is reconstructed reflecting the split, and the cargo ordering and CFB selection are restarted from the beginning. For example, if cargo (3,6) is rehandled at Port 4, it is split into (3,4) and (4,6), and the entire algorithm is re-executed.

Implications and generalizability of the proposed method

As mentioned earlier, rehandling in RSSP arises from two constraints: (i) a spatial constraint where cargoes must be stowed in a confined space sharing a single entrance and a common movement path and (ii) a temporal constraint arising from different entry and exit timings for each cargo. Our method tackles these two constraints using two conceptually separate modules, CFB and AVCO.

This modular approach implies that each method can be extended to other logistics domains. The CFB can be adapted or applied to problems sharing similar spatial constraints, such as storage location allocation problems in warehouses, where goods share a single entrance or a main corridor and must be placed to avoid interference. The AVCO method also can be adapted or applied to CSPP. As mentioned earlier, the CSPP has the same temporal constraints associated with cargoes’ POL and POD and shifting problems.

Moreover, by adopting a backtracking-based search architecture, the proposed method demonstrates low empirical complexity while effectively reducing the search space. Therefore, the proposed method not only solves the RSSP but also possesses the generalizability to be applied to other NP-hard logistics problems that share similar constraints.

Code availability

The code implementing the proposed stowage planning algorithms, including the exclusive subgraph modeling and affinity-based cargo ordering methods, has been openly released and permanently archived on Zenodo (DOI: 10.5281/zenodo.17882862).

Simulation results

Four types of simulations were conducted to evaluate the proposed methods: the CFB-based deck modeling, the cargo ordering based on the total volume of affiliated cargoes, the backtracking-based CFB selection method, and the post-splitting method for rehandled cargoes. The first two simulations focused on evaluating the individual components of the proposed method, namely CFB construction, AVCO, and RCS. The third simulation compared the overall performance of the proposed method with previous studies. Lastly, an in-depth analysis was conducted to evaluate the proposed cargo ordering method under various configuration options.

Simulation environment and test case generation

Table 1 Deck capacity and height of the RoRo ship.

The sample ship used in the simulation consists of 12 decks, with the capacity and height information for each deck presented in Table. 1. The total capacity of the ship is 8,113 CEU.

The probability of rehandling increases with a higher loading rate, a greater number of conflicted cargoes, and a larger port count. Here, the loading rate refers to the peak loading rate observed during the voyage. As the loading rate increases, the available capacity in CFB decreases, leading to more frequent rehandling. Furthermore, as the number of conflicted cargoes exceeds that of parent-child cargoes, it becomes more difficult to find appropriate CFB for later-selected cargoes with no rehandling option, which leads to a higher probability of rehandling. Each cargo’s (POL, POD) pair is assumed to follow a normal distribution unless otherwise specified. As a result, an increase in the number of ports leads to more conflicted cargoes and a higher probability of rehandling, even under the same loading rate. Especially in such cases, conflict relationships tend to form sets rather than simple pairs, which amplifies their overall impact.

To evaluate the effectiveness of rehandling reduction, test cases were configured as follows. Loading rates range from 50% to 90% of the sample ship’s capacity, conflict relationship cargoes to parent-child relationship cargoes ratios range from 2:1 to 5:1, and port counts range from 6 to 12. A default loading rate of 80% and a port count of 9 are used for each test case. When the loading rate is 80%, there are approximately 3,500 cargo units. Disjoint cargoes do not exist simultaneously and were therefore excluded from the evaluation of the proposed method.

A time limit of 15 seconds was applied to all backtracking algorithms in this experiment. This threshold was determined experimentally. The performance of the proposed method was not highly sensitive to this specific value. Instead, this specific time limit was established primarily to ensure that the comparison algorithms had sufficient time to converge and find valid solutions. Furthermore, all simulation results are based on the arithmetic mean of 100 repetitions under each loading condition.

Comparative evaluation of proposed method components

To analyze the individual contribution of each component of the proposed method, five simulation configurations were established for comparison.

  • BT Only applies only backtracking without CFB generation and AVCO. Cargoes are assigned per deck, not CFB. Cargo ordering prioritizes those with larger (POD-POL) values, that is, cargoes that remain for longer during the voyage. The pure baseline without applying backtracking and POD-POL-based cargo ordering diverged with more than 2,000 rehandlings, and was therefore excluded from the experiments.

  • BT-C applies (POD-POL)-based cargo ordering with CFB-based assignment.

  • BT-A applies the proposed AVCO method with a deck-based assignment.

  • BT-CA applies both CFB-based assignment and AVCO.

  • BT-CA-R applies a RCS post-processing after the CFB+AVCO, rerunning CFB selection.

Fig. 7
figure 7

Comparison of the number of rehandlings among the proposed component methods under various loading conditions (a) loading rate, (b) conflicted cargo rate, (c) port count.

Fig. 8
figure 8

Comparison of the total number of backtracking steps among the proposed component methods under various loading conditions (a) loading rate, (b) conflicted cargo rate, (c) port count.

Figure 7 presents the number of rehandlings across different loading conditions for each method combination. Across all simulations, it is evident that rehandling increases significantly with a higher loading rate, a greater conflicted cargo ratio, and larger port counts. The Baseline showed the worst results in all conditions. Applying either CFB or AVCO alone reduced rehandling by an average of 33% compared to the Baseline. Notably, the combined use of both CFB and AVCO reduced rehandling by an average of 63%, with a maximum reduction of 84%. When RCS was applied as a post-processing step, the average and maximum rehandling reductions were 68% and 86% respectively, compared to the Baseline.

A noteworthy observation is that under cases with identical loading rates and port counts, the CFB Only outperformed AVCO Only when the ratio of conflicted cargoes increased. This is because, as the proportion of parent-child relationship cargoes decreases, the structural partitioning of CFB was more effective than AVCO, which primarily considers child cargoes.

Figure 8 illustrates the impact of each method combination on the number of backtracking steps. The results are similar to those in Fig. 7, and the CFB+AVCO reduced backtracking steps by an average of 47% and a maximum of 60% relative to the Baseline. The RCS was excluded from this comparison.

In terms of individual contributions, CFB plays a central role in fundamentally reducing the dimensionality of the search space. Whereas existing approaches navigate a vast search space of (cargo, grid) or (cargo, panel) combinations, CFB effectively restructures this into a (cargo, CFB) combination space. In particular, CFB itself is a structural unit designed to satisfy numerous path-collision constraints by design, so the algorithm no longer needs to specify placement points or repeatedly verify collisions. In other words, CFB essentially eliminates a large portion of the invalid search space at its origin.

AVCO, in contrast, optimizes the search process within this reduced space. It prunes the search tree by modeling inter-cargo relationships as a DAG, which eliminates invalid assignment sequences from a rehandling perspective. In addition, it determines efficient search paths by dynamically adjusting the assignment sequence of source nodes, critically accounting for the competition over limited CFB resources. In other words, AVCO establishes the pruning and priority search criteria within the backtracking tree defined by cargo-to-CFB assignments.

Empirical complexity analysis

Fig. 9
figure 9

Comparison of the number of backtracking steps required to first discover the final solution under various loading conditions (a) Loading rate, (b) conflicted cargo rate, (c) port count.

To evaluate the efficiency of practical solutions to NP-hard problems, a theoretical time complexity analysis is generally required. However, when a heuristic actively prunes the search sapce, such as the backtracking-based algorithm proposed in this study, theoretical complexity analysis can make it difficult to assess practical search efficieny. Therefore, we conducted an additional experiment to measure the empirical complexity of the proposed method.

The total number of backtracking steps performed within a 15-sceond time limit was presented at Fig. 8. However, this metric alone does not clearly represent the true empirical complexity of each algorithm. For example, a less efficient algorithm (BT Only) may spend the entire 15 seconds repeatedly updating poor-quality solutions, whereas a more efficient algorithm (BT-CA) may quickly find a high-quality solution at an early stage and spend the remaining time without improvement. In both cases, Fig. 8 could report similarly high steps, even though the underlying search efficiencies are entirely different.

Figure 9 addresses this ambiguity by analyzing when each method first reached its final solution. The figure shows the average number of backtracking steps at which the final solution - the best solution selected at the end of the 15-second search - is first discovered.

Across all loading conditions, BT-CA discovered the final solution at approximately 8% of the total search steps, whereas BT Only found it after about 53% of the total search steps. The fact that BT-CA found the solution 45 percentage points earlier than BT Only demonstrates once again that the combination of CFB and AVCO effectively reduces the search space and enhances search efficiency. As a result the algorithm can rapidly identify a good-enough solution.

Comparison with other stowage strategies

Fig. 10
figure 10

Comparison of the number of rehandlings with other stowage strategies for 12-deck under various loading conditions (a) loading rate, (b) conflicted cargo rate, (c) port count.

In this section, the full proposed method including RCS is compared with three existing algorithms: øvstebø’s heuristic algorithm, the Conflict-Aware First-Fit (CAFF) heuristic, and Hosseini’s TS metaheuristic2,18. Ovstebo’s heuristic method operates based on SWO. The algorithm prioritizes cargoes in descending order of height and assigns the selected cargo from the bottommost deck, discretized by lane unit, followed by additional SWO optimization. In contrast, CAFF also prioritizes higher cargoes and assigns from the bottommost decks, but simply assigns conflicted cargoes on different decks without additional optimization. The TS algorithm was re-implemented to operate on the node-based ship rather than grid model to fit the conditions of this study. The comparison results are presented in Fig. 10.

Heuristic-based algorithms such as Øvstebø’s and CAFF do not consider complex cargo relationship such as parent-child relationship and instead only consider cargo height and conflict relationship for cargo ordering. Consequently, they consistently resulted in more rehandling across all test cases compared to the proposed method. Although Ovstebo’s heuristic showed better performance than CAFF due to the additional SWO optimization step, it generated significantly more rehandling and fell well short of the proposed method.

In contrast, the TS metaheuristic showed a different result. For simple cases—where the number of ports was small or the loading rate was low—TS outperformed Øvstebø’s heuristic. This indicates that the neighborhood search mechanism of TS can effectively escape local optima and find non-rehandling stowage plan when the search space is relatively simple. However, as the number of ports increased beyond ten and the cargo relationship became more complex, the number of rehandlings produced by TS rose sharply. This result highlights the limitation of general-purpose metaheuristics in addressing the RSSP. When the relationship complexity among cargoes increases, infeasible solutions that cause rehandlings occupy most of the search space. Consequently, regardless of the neighborhood direction, the algorithm fails to improve and terminates at a poor-quality local solution.

In conclusion, these experiments suggest that for highly constrained problems such as the RSSP, a simple heuristic like Øvstebø’s may outperform general metaheuristics such as TS. Furthermore, the results demonstrate the effectiveness of the proposed method’s constraint-aware mechanisms in handling complex cargo relationships.

Experiment with 8-deck RoRo ship

Fig. 11
figure 11

Comparison of the number of rehandlings with other stowage strategies for 8-deck under various loading conditions (a) loading rate, (b) conflicted cargo rate, (c) port count.

All previous experiments were conducted in a 12-deck environment. However, in real-world operations, RoRo ships vary in size. In particular, the number of decks typically ranges from 8 to 12. For this reason, an additional comparative experiment was conducted in an 8-deck environment to evaluate the scalability and real-world applicability of the proposed algorithm. The 8-deck environment corresponds to using only decks 1-8 of the ship used in previous experiments.

Figure 11 presents the comparison results obtained in the 8-deck environment. The key finding is that the relative performance among algorithms remained consistent with that observed in the 12-deck environment. Even in the 8-deck case, the proposed method maintained a significantly lower number of rehandlings compared with the other approaches. This indicates that the proposed algorithm operates robustly regardless of the ship’s size. A slight decrease in the average number of rehandlings was also observed under most loading conditions compared with the 12-deck results. This reduction is mainly due to the smaller total number of cargoes in the 8-deck environment.

In-depth evaluation of affinity volume-based cargo ordering

Fig. 12
figure 12

Comparison of the number of rehandlings based on AVCO source node prioritization under various loading conditions (a) loading rate, (b) conflicted cargo rate, (c) port count.

In applying the proposed CFB+AVCO method, three variations were compared to analyze the priority criteria for selecting source nodes in AVCO. The results are shown in Fig. 12

  • Max ordering (proposed AVCO) prioritizes cargoes with a larger total volume. Total volume is defined as the sum of their own volume and the cumulative volume of all their descendants.

  • Min ordering prioritizes cargoes with a smaller total volume.

  • Self ordering prioritizes cargoes with a larger individual volume. The descendant cargoes’ volume is not considered.

Min ordering resulted in significantly more rehandling than self ordering, which ignores all descendant cargoes. This result became more pronounced under worse loading conditions. In certain cases, Min ordering even showed worse results than baseline. This indirectly highlights the substantial contribution of the AVCO itself. Self ordering also does not adequately account for a large volume of child cargoes. As a result, these child cargoes are assigned with conflicted cargoes instead of parent cargoes, and the effect on rehandling reduction is limited.

Conclusion

This study proposes a novel stowage planning method for RoRo ship stowage planning that reduces rehandling by combining two core methods: (i) modeling deck space as CFB, which are balanced and disjoint blocks adjacent to path nodes, and (ii) applying cargo ordering based on the total volume of affiliated cargoes. By introducing a panel-based graph modeling strategy and the CFB concept, the method minimizes rehandling during loading and unloading while maximizing spatial utilization. Additionally, we propose the AVCO method that accounts for both parent-child and conflict relationships, enabling effective prioritization and further reduction of rehandling. Simulation results confirm that the proposed method reduces rehandling occurrences by up to 65% compared to existing heuristics such as the Øvstebø’s heuristic and provides stable stowage planning even in multi-deck conditions and complex booking cargoes.

The practical benefits of this rehandling reduction are substantial. For example, consider a complex voyage with 4000 cargo units that incurs 1500 rehandlings using a conventional method. Since each rehandling involves two operations (unloading and reloading), this baseline requires approximately 11,000 total handling operations (4000 load, 4000 unload, 3000 rehandling). If the proposed method reduces rehandlings to 525, the total operations decrease to 9,050 (4000 load, 4000 unload, 1050 rehandling). In this scenario, a 65% reduction in rehandling instances translates to an approximate 18% reduction in the total operational workload, which directly saves significant port time and labor costs.

The CFB modeling and AVCO methods are not limited to the proposed framework but are considered generalizable methods applicable to other logistics problems. In particular, the CFB Selection algorithm was designed to accommodate additional constraints beyond the default conditions, facilitating its integration into diverse applications. Other studies may adopt the CFB structure or AVCO method independently or in combination to enhance their performance. Therefore, the proposed method is expected to be easily adaptable to real-world RoRo logistics operations. Future work will explore hierarchical CFB configurations, more advanced cargo ordering strategies, and practical constraints such as vehicle rotation angles to improve the applicability and precision of the stowage planning.