Container ship stowage method based on improved ant colony algorithm under adaptive multiple targets
By optimizing container ship stowage using an adaptive multi-objective improved ant colony algorithm, the problems of time-consuming, labor-intensive, and premature convergence in existing technologies are solved, achieving efficient and safe stowage of container ships and improving the rationality of loading sequence and weight distribution.
Patent Information
- Application Number
- CN202511036207.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-26
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-07-26
AI Technical Summary
Existing container ship stowage methods rely on manual experience, which is time-consuming and labor-intensive. They are difficult to meet stowage requirements under complex and multi-constraint conditions, and are prone to premature convergence, leading to local overloading of ships and unstable stacking, which affects safety and operational efficiency.
An adaptive multi-objective improved ant colony algorithm is adopted, which optimizes the loading order by using dynamic constraint factors, pheromone updates and heuristic factors, and removes nodes that violate constraints in real time. Combined with a multi-objective weighting strategy, it balances efficiency and safety.
It achieves rationality and efficiency in ship loading under complex conditions, reduces the number of times containers are turned over in the yard, improves the efficiency of container handling, ensures the stability and safety of ships, and optimizes the loading sequence and weight distribution.
Smart Images

Figure CN120911863A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of container ship stowage, in particular to a self-adaptive multi-objective container ship stowage method based on an improved ant colony algorithm. BACKGROUND
[0002] The existing container ship stowage still mainly relies on manual experience. This method not only consumes time and effort, but also is difficult to exhaust feasible solutions when facing thousands of containers and multiple stability constraints, and is prone to safety problems such as local overloading of the ship and unstable stacking of containers, thereby reducing the seaworthiness of the ship and the operation efficiency. Therefore, the existing technology uses heuristic algorithms to optimize the stowage efficiency.
[0003] Limitations of existing algorithms: when applied to container ship stowage, traditional meta-heuristic algorithms such as genetic algorithms and particle swarm algorithms are prone to premature convergence into local optima, lack sufficient ability to fully explore the global solution space, and are difficult to meet the stowage requirements under complex and multiple constraints. There are limitations in optimizing the loading sequence, reducing the number of yard rehandling times, and improving the efficiency of whole picking. It is difficult to accurately balance the weight of each pre-stow position, and it is difficult to effectively ensure the stability of the ship and the smoothness of the operation, resulting in a significant reduction in the feasibility and effectiveness of the stowage scheme.
[0004] In summary, the existing algorithms do not fully consider the multi-objective and multi-constraint collaborative optimization of container ship stowage, and there is an urgent need for an efficient ship stowage method that can balance stability, strength, and operation efficiency. SUMMARY
[0005] The present application aims to solve the defects of premature convergence and insufficient multi-objective coupling in the prior art, and provides a self-adaptive multi-objective container ship stowage method based on an improved ant colony algorithm. By optimizing the loading sequence, the number of yard rehandling times is effectively reduced, the efficiency of yard whole picking is improved, the weight requirements of the pre-stow position of the ship berth are accurately met, and the ship berth presents a reasonable container delivery layout.
[0006] The present application is achieved by the following technical solutions: The self-adaptive multi-objective container ship stowage method based on the improved ant colony algorithm comprises the following steps: Step 1: parameter initialization, construct a multi-objective ant colony model, determine the number of ants according to the specific parameters of the ship and the manifest information of the containers , the maximum number of iterations , initialize the pheromone concentration , set the pheromone evaporation coefficient , the pheromone importance coefficient , the heuristic factor coefficient Based on the multi-objective characteristics of the container ship stowage problem, a multi-objective weight coefficient vector is constructed to satisfy... ; The second step is to construct a solution, initialize the solution and select a starting node, apply the probability transition rules, and check for constraint adjustments. If a constraint conflict is detected, the most recently added constraint is deleted. Each node, when reselected, narrows its neighborhood to a feasible subset until all containers have been assigned; The constraint checking process includes: after each node selection, checking whether the constraint is violated; if it is violated, adjusting the solution list and reselecting the node, triggering heuristic factor correction; The third step is pheromone update, which involves local and global elite updates of the pheromone matrix. The fourth step involves dynamic constraint handling, calculating constraint factors, adjusting heuristic factors, and adjusting heuristic factors based on the degree of constraint violation if a node violates a constraint. To reduce the probability of a node being selected, the constraint factor is calculated dynamically based on the current solution list and node information each time a node is selected. Determine whether a node violates a hard constraint condition; Step 5: Iteration termination determination, check the termination condition: determine whether the current iteration count has reached the maximum iteration count. Output the optimal solution: If the termination condition is met, select the optimal solution from all the solutions of the ants, which is the final loading scheme; if not, continue to the next round of iteration.
[0007] Further technical solutions include multi-target ant colony models comprising nodes. and edge ,node Indicates container Pointing to the ship's container position And the loading sequence number is ,side Represents a node To the node The edge, its weight The objective function and constraints are obtained through joint calculation:
[0008] in, As punishment for searching the box, To reduce the cost of moving the gantry crane, This represents the weight deviation.
[0009] A further technical solution, the probability transition rule includes the following steps: The first step is to select a formula based on the node probability. Calculating ants Select the next node The probability of; The second step is pheromone concentration. Heuristic factors derived from the pheromone matrix The dynamic constraint factor is calculated based on the current node's state. Used to determine whether a node is feasible; The third step is to select the next node according to the calculated probability and add it to the solution list.
[0010] Further technical solutions, for each ant The path will be selected based on the following probabilities:
[0011] pheromone concentration Initial value The dynamic update rules are described in step S3; Heuristic factor ; Dynamic constraint factor :
[0012] Ants The current set of available feasible nodes includes all nodes that meet the following criteria: containers Unassigned, ship container space Not occupied and does not violate the order rules: .
[0013] Further technical solutions include real-time adjustment for weight exceeding limits: .
[0014] Further technical solutions and adjustments to continuity conflicts include: if containers Position of already loaded containers Container satisfy ,and Then disable If they are in different heap areas, an additional movement cost penalty will be applied. .
[0015] Further technical solutions, including local updates, include: during the ant colony construction process, selecting each edge... Update the corresponding edges in the pheromone matrix according to the local update formula: ,in The pheromone evaporation coefficient, The initial pheromone concentration.
[0016] Further technical solutions, the global elite update includes: calculating the total cost of each ant solution after each iteration ; according to the global update formula, the pheromone matrix is comprehensively updated: , wherein is the number of ants, , is the total amount of pheromone release; is the total cost of the solution found by the first ant, that is, the weighted sum of the objective function.
[0017] Further technical solutions, the objective function includes: ; the number of box changes in the yard :
[0018]
[0019] wherein, represents 1 if and are in the same storage area slot, otherwise 0; total gantry crane moving cost :
[0020] wherein:
[0021] wherein is the moving cost coefficient. By calculating the difference between the current container and the previous loading sequence number container storage location yard, and then accumulating to obtain the total moving distance of the gantry crane, the number of machine movements can be minimized; weight balance degree :
[0022] wherein is the target weight limit of the ship container , represents the weight of the container .
[0023] Further technical solutions, the constraint conditions include: the uniqueness of the loading sequence, the ship container, and the in-yard container loading constraint:
[0024]
[0025]
[0026] Weight up and down limits of the container position:
[0027] Weight constraint:
[0028] Wherein:
[0029] Wherein is the global weight limit value; Used to identify the up and down relationship of the container position; Container stowage sequence constraint:
[0030] Wherein Used to identify the up and down relationship of the container slot in the storage area; Single column stowage container weight constraint:
[0031] Wherein Indicates the container The column weight limit value of the column where the container is located.
[0032] The beneficial effects of the present application are: I. In the constraint processing layer, the dynamic constraint factor (the weight, the weight constraint, etc. Hard constraints are embedded in the ant path selection process, and nodes that violate the ship stability specification are eliminated in real time. Compared with the post-repair mechanism of the prior art, risks are avoided from the source; define nodes containing berth / container position attributes And edge Integrate hard constraint rules and dynamic constraint factors to realize real-time filtering of feasible solution space.
[0033] II. In the multi-objective optimization layer, the edge weight dynamically integrates the box change penalty (the weight deviation), the cross-heap area movement cost (the weight deviation), and the weight deviation (the weight deviation). Combined with the adaptive weight distribution strategy (such as fuzzy logic dynamic adjustment ω1-ω3), the algorithm can flexibly balance efficiency and safety under complex working conditions, and balance the priority of multiple objectives through adaptive weight distribution.
[0034] III. In the algorithm mechanism layer, the dynamic pheromone update strategy uses local disturbance (random factor) and global elite stratification (the top 10% solutions double pheromone release), which maintains search diversity and strengthens high-quality paths. Local update To maintain search diversity, global updates enhance high-quality search paths. Combined with a high-quality solution retention mechanism, convergence speed is improved. Global updates update the pheromone concentration of edges to strengthen the paths corresponding to high-quality solutions.
[0035] Fourth, this invention systematically solves the shortcomings of traditional loading methods in terms of rationality, efficiency and global optimization capabilities through a complete technical link of "constraint embedding algorithm, target quantification modeling, intelligent search guidance and business process optimization". It provides an intelligent solution for container ship transportation that combines safety and economy. The strict constraints on loading order in the same slot and the cost differentiation modeling of cross-stacking area movement reduce the number of container turning times in the yard and the energy consumption of empty running equipment. Attached Figure Description
[0036] For ease of explanation, the present invention will be described in detail below with reference to specific embodiments and accompanying drawings.
[0037] Figure 1 This is a flowchart of an adaptive multi-objective container ship loading method based on an improved ant colony algorithm according to the present invention. Figure 2 for Figure 1 Flowchart of the intermediate parameter initialization module; Figure 3 for Figure 1 A flowchart of the process of constructing a solution; Figure 4 for Figure 1 Flowcharts for the pheromone update module, dynamic constraint processing, and iteration termination determination; Figure 5 for Figure 2 Flowchart of core parameter configuration; Figure 6 for Figure 3 Flowchart for load routing and constraint adjustment; Figure 7 for Figure 4 A flowchart illustrating local updates, global elite updates, and the calculation of constraint factors; Figure 8 This is a schematic diagram showing the sequence of each process step. Detailed Implementation
[0038] like Figures 1-8 As shown, the present invention will be described in detail. For ease of description, the directions mentioned below are defined as follows: the directions of up, down, left, right, front, and back mentioned below are the same as... Figure 1 Since the projection relationships are consistent in the up, down, left, right, front, and back directions, the present invention provides an adaptive multi-objective container ship loading method based on an improved ant colony algorithm, which includes the following steps: S1: Parameter initialization module; S2: The process of constructing a solution; S3: pheromone update module; S4: dynamic constraint handling; S5: iteration termination decision.
[0039] Beneficially, the parameter initialization module comprises the following steps: S100: determine the number of ants , the maximum number of iterations , according to the specific parameters of the ship (such as the number of ship bays, maximum load, size and position distribution of each ship bay, etc.) and the list information of the containers (including the number of containers, weight, size, destination, etc.); S101: initialize the pheromone concentration ; S102: set the pheromone evaporation coefficient , the pheromone importance coefficient , and the heuristic factor coefficient ; S103: construct a multi-objective weight coefficient vector according to the multi-objective characteristics of the container ship stowage problem, satisfying .
[0040] Beneficially, the process of constructing a solution comprises the following steps: S20: initialize the solution: for each ant , create an empty solution list to store the stowage path of the ant; S21: select the starting node: each ant selects a container and a ship bay as the starting node from the set of field bays and the set of ship bays using uniform distribution random; S22: probability transfer rule; S23: check the constraint condition; S24: if a constraint conflict is detected, delete the last added node, and narrow the neighborhood to the feasible subset when reselecting until all containers are assigned.
[0041] Beneficially, the probability transfer rule comprises the following steps: S220: calculate the probability of the ant selecting the next node according to the node probability selection formula ; S221: the pheromone concentration comes from the pheromone matrix, and the heuristic factor is calculated according to the state of the current node, wherein the dynamic constraint factor for determining whether a node is feasible or not; S222: select the next node according to the calculated probability and add it to the solution list.
[0042] Advantageously, wherein the checking of the constraint conditions comprises the following steps: S230: check whether the constraint conditions are violated after each node is selected, such as weight limit, stowage sequence, etc. If violated, adjust the solution list and reselect the node, triggering the heuristic factor correction.
[0043] Advantageously, wherein the pheromone updating module comprises the following steps: S30: local update; S31: global elite update.
[0044] Advantageously, wherein the local update comprises the following steps: S300: during the process of solution construction by the ants, after each edge is selected , update the corresponding edge in the pheromone matrix according to the local update formula: .
[0045] Advantageously, wherein the global elite update comprises the following steps: S310: at the end of each iteration, calculate the total cost of the solution of each ant ; S311: according to the global update formula, comprehensively update the pheromone matrix:
[0046] Advantageously, wherein the dynamic constraint processing comprises the following steps: S40: calculate the constraint factor; S41: adjust the heuristic factor: if the node violates the constraint, adjust the heuristic factor according to the degree of violation , reducing the probability of being selected.
[0047] Advantageously, wherein the calculation of the constraint factor comprises the following steps: S400: at each node selection, dynamically calculate the constraint factor according to the current solution list and node information, to determine whether the node violates the hard constraint condition.
[0048] Advantageously, wherein the iteration termination determination comprises the following steps: S50: check the termination condition: determine whether the current iteration number reaches the maximum iteration number .
[0049] S51: output the optimal solution: if the termination condition is reached, select the optimal solution from all the solutions of the ants, which is the final stowage plan. If not, continue the next round of iteration.
[0050] Beneficially, the variable definitions include: 1. Ship bay: a set of definitions Each ship bay contains attributes: a) maximum / minimum load of the ship bay: ; b) row number: , column number: , and cell number: ; c) high box identification: ; 2. Field bay: a set of definitions Each to-be-stowed container contains attributes: a) container weight: ; b) stowage sequence: ; c) slot number: , block number: , cell number: , and group number: ; d) high box identification: ; Building a multi-objective ant colony model includes: 1. Node represents a container points to a ship bay , and the stowage sequence number is ; 2. Edge represents the edge from node to node , and the weight is calculated by the objective function and constraints:
[0051] where is the rehandling penalty, is the mobile cost of the gantry crane, is the weight deviation.
[0052] Beneficially, the adaptive path selection strategy includes: Each ant selects a path with the following probability:
[0053] 1. pheromone concentration : initial value its dynamic updating rule is seen in step S3; 2. Heuristic factor ; 3. Dynamic constraint factor :
[0054] For dynamically pruning infeasible nodes to ensure the validity of the path.
[0055] 4. representing an ant the current set of feasible nodes available for selection, containing all nodes that satisfy the following conditions: the container is not assigned, the container bay is not occupied, and does not violate the order rule: .
[0056] Beneficially, wherein the local update comprises: in the process of constructing the solution by the ant, upon selecting an edge, the pheromone concentration of the corresponding edge is updated in real time according to the following local update formula:
[0057] wherein is the pheromone evaporation coefficient, is the initial pheromone concentration.
[0058] Beneficially, wherein the global update (per iteration round) comprises:
[0059] wherein is the number of ants, , is the total amount of pheromone released; is the total cost of the solution found by the ant, i.e. the weighted sum of the objective function. The global update updates the pheromone concentration of the edges, strengthening the paths corresponding to the high-quality solutions.
[0060] Beneficially, wherein the weight overrun is adjusted in real time: .
[0061] Beneficially, wherein the continuity conflict adjustment comprises: if the container satisfies , and , then disable . If in different stack areas, increase the moving cost penalty: .
[0062] Beneficially, the objective function includes:
[0063] 1. Number of times of turning in the yard :
[0064]
[0065] wherein, represents 1 if and are in the same slot of the same stack area, otherwise 0.
[0066] 2. Total moving cost of gantry crane :
[0067] wherein:
[0068] wherein is the moving cost coefficient. In the process of stowing, the invalid movement of the gantry crane should be avoided. By calculating the yard difference of the current container and the container of the previous stowage sequence number, and then accumulating to obtain the total moving distance of the gantry crane, the number of machine movements can be minimized.
[0069] 3. Degree of weight balance :
[0070] wherein is the target weight limit of the ship's container , represents the weight of the container .
[0071] Beneficially, the constraint conditions include: 1. Stowage sequence, ship's container position, and in-yard container stowage constraint uniqueness:
[0072]
[0073]
[0074] 2. Weight upper and lower limit of the ship's container position:
[0075] 3. Overweight constraint:
[0076] wherein:
[0077] where is the global weight upper limit value; Used to identify the up-down relationship of the ship's bays.
[0078] 4. Container stowage sequence constraints:
[0079] where Used to identify the up-down relationship of the slots in the container storage area.
[0080] 5. Single column stowage container weight constraints:
[0081] where represents the container column weight limit value of the column it is located in.
[0082] Container ship stowage: refers to the process of reasonably loading containers onto each bay of the ship to meet the requirements of ship balance, stability and operational efficiency, etc. The main purpose is to maximize the utilization of ship space, reduce operating costs and improve terminal operation efficiency under the premise of ensuring the safety and seaworthiness of the ship.
[0083] Ant colony algorithm: a heuristic algorithm that simulates the foraging behavior of ants, guiding the search behavior of ant colonies through pheromone released by ants and heuristic information, with strong global search ability and good robustness. In practical applications, ant colony algorithm can effectively solve various combinatorial optimization problems such as path planning, scheduling, network routing, etc.
[0084] Multi-objective optimization: the process of optimizing multiple objective functions simultaneously, usually requiring trade-offs between multiple objectives to find a set of Pareto optimal solutions; Pareto optimal solution refers to the solution in which there is no other solution that can be better in at least one objective while not being worse in other objectives.
[0085] Pheromone concentration: a mechanism used in ant colony algorithm to guide ant path selection, the higher the pheromone concentration, the greater the probability of ants choosing that path. Pheromone is updated in two ways: local update: ants release pheromone in real time during the construction of the solution; global update: after iteration, the optimal path is reinforced to accelerate convergence. The pheromone evaporation mechanism can avoid the algorithm falling into local optimum too early, and embodies the dynamic nature of group memory.
[0086] Heuristic factor: Another mechanism used in ant colony optimization to guide the path selection of ants. It is usually related to the heuristic information of the problem and can help ants find good solutions faster. The heuristic factor reflects the characteristics and laws of the problem itself and provides ants with local information about the objective function and constraint conditions, assisting ants in effective path selection.
[0087] Dynamic constraint factor: Used to check whether the node violates the constraint condition in real time and dynamically adjust the heuristic factor to ensure the effectiveness of path selection. During the execution of the algorithm, the dynamic constraint factor can eliminate infeasible nodes in real time according to the current solution status, guide ants to search within the feasible solution space, and thus guarantee the feasibility and effectiveness of the generated solution.
Claims
1. A method for container ship stowage based on improved ant colony algorithm under adaptive multi-objective, Comprising, characterized in that: The method comprises the following steps: a first step of parameter initialization, constructing a multi-objective ant colony model, determining the number of ants according to the specific parameters of the ship and the list information of the containers , the maximum number of iterations , initializing the pheromone concentration , setting the pheromone evaporation coefficient , the pheromone importance coefficient , the heuristic factor coefficient , constructing a multi-objective weight coefficient vector according to the multi-objective characteristics of the container ship stowage problem, and satisfying ; a second step of constructing a solution, initializing the solution and selecting a starting node, adjusting the solution according to a probability transition rule, and checking constraints, if a constraint conflict is detected, deleting the last added nodes, narrowing the neighborhood to a feasible subset when reselecting, and checking whether all the containers are assigned; the constraint condition checking comprises: checking whether the constraint condition is violated after each time a node is selected; if the constraint condition is violated, adjusting the solution list and reselecting the node, and triggering a heuristic factor correction; Third step, pheromone update, local update and global elite update of pheromone matrix are carried out; The fourth step involves dynamic constraint handling, calculating constraint factors, adjusting heuristic factors, and adjusting heuristic factors based on the degree of constraint violation if a node violates a constraint. To reduce the probability of a node being selected, the constraint factor is calculated dynamically based on the current solution list and node information each time a node is selected. The fifth step is to determine if a node violates a hard constraint. The step involves checking the termination condition: whether the current iteration count has reached the maximum iteration count. Output the optimal solution: If the termination condition is met, select the optimal solution from all the solutions of the ants, which is the final loading scheme; if not, continue to the next round of iteration.
2. The self-adaptive multi-objective container ship stowage method based on improved ant colony algorithm according to claim 1, characterized in that: Multi-objective ant colony model includes nodes and edges , the nodes represent containers pointing to ship bays , and the stowage sequence number is , the edges represent edges from node to node , and the weight of the edges is obtained by joint calculation of the objective function and constraints: wherein, is a flip penalty, is a gantry movement cost, is a weight deviation amount.
3. The self-adaptive multi-objective container ship stowage method based on improved ant colony algorithm according to claim 2, characterized in that: Probability transition rule Comprising the following steps: First step, select the next node according to the node probability selection formula Calculate the ant Select the next node The probability; second step, the pheromone concentration From the pheromone matrix, the heuristic factor According to the state of the current node, wherein the dynamic constraint factor Is used to determine whether the node is feasible; third step, select the next node according to the calculated probability, and add it to the solution list.
4. The adaptive multi-objective container ship stowage method based on improved ant colony algorithm according to claim 3, characterized in that: Each ant Select path with following probabilities: Pheromone concentration : initial value which is dynamically updated according to the rules of step S3; Heuristic factors ; Dynamic constraint factor : representing ants the current set of feasible nodes available for selection, containing all nodes for which the following conditions are met, container not assigned, ship slot not occupied, and does not violate the order rule: 。 5. The adaptive multi-objective based improved ant colony optimization algorithm for container ship stowage method according to claim 4, characterized in that: Real-time adjustment of weight overrun: 。 6. The adaptive multi-objective based improved ant colony algorithm for container ship stowage method according to claim 2, characterized in that: Continuity conflict resolution includes: if container is in a stowed location that satisfies , and , then disable ; if in different stack area, then increase move cost penalty: .
7. The adaptive multi-objective based improved ant colony algorithm for container ship stowage method according to claim 4, characterized in that: The local update includes: in the process of constructing the solution of the ant, after each selected edge , the corresponding edge in the pheromone matrix is updated according to the local update formula: , wherein is the pheromone evaporation coefficient, is the initial pheromone concentration.
8. The adaptive multi-objective based improved ant colony algorithm for container ship stowage method according to claim 4, characterized in that: Global elite update includes: at the end of each iteration, the total cost of each ant solution is calculated ; according to the global update formula, the pheromone matrix is updated comprehensively: , wherein is the number of ants, , is the total amount of pheromone release; is the total cost of the solution found by the th ant, that is, the weighted sum of the objective function.
9. The adaptive multi-objective based improved ant colony algorithm for container ship stowage method according to claim 2, characterized in that: The objective function includes: ; Number of times of turning over the box in the field : wherein represents if and 1 if in the same bin slot, otherwise 0; gantry crane total moving cost : Wherein: wherein is the moving cost coefficient, the total moving distance of the gantry crane is obtained by calculating the stacking location site difference between the current container and the container of the previous loading sequence number, and then accumulated to minimize the number of machine movements; weight balance : wherein is the target weight limit for the shipper's container location , represents the weight of the container .
10. The self-adapting multi-objective container ship stowage method based on improved ant colony algorithm according to any one of claims 1-9, characterized in that: Constraint conditions include: stowage sequence, container position, uniqueness of in-place container stowage constraint: Weight upper and lower limit of container position: Overweight constraint: Wherein: wherein is the global pressure weight upper limit value; for identifying the relative position of the containers on the ship Container stowage sequence constraint: wherein for identifying the up-down relationship of slots in a container yard Single-column stowed container weight constraint: wherein represents a container column weight limit value of the column in which the container is located.
Citation Information
Patent Citations
Container loading method based on improved ant colony algorithm and heuristic algorithm
CN103455841A
Automatic container wharf exit box space distribution method
CN111861205A
Ship stowage optimization method and device based on ant colony algorithm, equipment and medium
CN118657248A
Cargo loading optimization using a classical-quantum hybrid system
US20250124405A1