Intelligent ship route planning algorithm based on ADR-A*
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- DALIAN MARITIME UNIVERSITY
- Filing Date
- 2025-11-03
- Publication Date
- 2026-07-03
Smart Images

Figure 2026111504000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent ship route planning, and in particular, to an intelligent ship route planning algorithm based on ADR-A*.
Background Art
[0002] With the continuous expansion of world trade, the rapid progress of science and technology, and the further enhancement of environmental protection awareness, intelligent ships are gradually entering the process application stage as an important medium for the digital transformation of the shipping industry. Route planning is one of the core elements, which strongly guarantees the safe and efficient navigation of intelligent ships. The current route planning algorithms mainly only optimize the single characteristics of the route and lack a comprehensive navigable route that combines safety, economy, efficiency, and smoothness. In addition, the simulation experiment environment is relatively simple and cannot fully demonstrate the route planning ability of the algorithm in a complex environment. Therefore, in the process of industrialization of intelligent ships, there is an urgent need for a method that can generate a comprehensive navigable route in a complex nautical chart environment.
Summary of the Invention
[0003] In view of the above problems, the present invention discloses an intelligent ship route planning algorithm based on ADR-A*.
[0004] The technical means adopted in the present invention are as follows.
[0005] An intelligent ship route planning algorithm based on ADR-A, Step 1 of processing the obtained nautical chart based on a custom two-layer boundary expansion strategy to obtain a first-layer expanded nautical chart and a second-layer expanded nautical chart; Step 2 of performing route planning processing on the second-layer expanded nautical chart using the A* algorithm to obtain all route point data of the second-layer expanded nautical chart, wherein the child node list in the A* algorithm is obtained by processing using an adaptive direction restriction priority node search strategy; Step 3 involves calculating direction change point data based on all obtained route point data, and then calculating important route points using a route complete coverage strategy on the first layer extended chart based on the obtained direction change point data. Step 4 includes planning a route in a chart environment based on the calculated key route points.
[0006] Furthermore, the aforementioned custom two-layer boundary extension strategy is, Step 10 involves binarizing the obtained color chart to generate a binarized chart. Step 11 involves extracting the boundaries of the binarized data from the aforementioned binarized nautical chart to obtain the boundaries of obstacles. Step 12 includes the steps of obtaining a first-layer extended chart and a second-layer extended chart by performing a first-layer extended chart and a second-layer extended chart, respectively, based on the boundaries of obstacles, wherein the distance of the second-layer extended chart is greater than the distance of the first-layer extended chart.
[0007] Furthermore, the self-adaptive direction-restricted node search strategy in the A* algorithm is, Step 20 involves obtaining the current node coordinates and endpoint coordinates, Step 21 involves obtaining a search direction attribute based on the current node coordinates and endpoint coordinates, and obtaining the preferred node coordinates and next preferred node coordinates relative to the current node coordinates based on the search direction attribute, Step 22 retrieves the current next-priority node coordinates, determines whether the current next-priority node coordinates are the endpoint coordinates, and if YES, completes the path planning and ends the node search; otherwise, executes step 23. Step 23 determines whether the current next priority node coordinates are obstacle coordinates. If YES, it obtains the unreachable priority node coordinates based on the current next priority node coordinates, inputs them into the unreachable node list, and then executes step 24. If NO, it directly executes step 24. The process includes determining whether all next-priority nodes have been scanned, and if YES, obtaining the coordinates of reachable priority nodes and inputting them into the reachable node list; otherwise, returning to step 22 to determine the next next-priority node.
[0008] Furthermore, the search direction attributes include upward, downward, leftward, rightward, upper left, lower left, upper right, and lower right. The strategy for obtaining the preferred node coordinates and next preferred node coordinates relative to the current node coordinates based on the search direction attribute is as follows: When the search direction attribute is upward, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next preferred node coordinates are (x-1,y), (x-1,y-1), (x,y-1), (x+1,y), and (x+1,y-1), When the search direction attribute is downward, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y), (x-2,y+1), (x-2,y+2), (x-1,y+2), (x,y+2), (x+1,y+2), (x+2,y), (x+2,y+1), and (x+2,y+2), and the next preferred node coordinates are (x-1,y), (x-1,y+1), (x,y+1), (x+1,y), and (x+1,y+1), When the search direction attribute is left, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y+2), (x-1,y-2), (x,y+2), and (x,y-2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y+1), and (x,y-1), When the search direction attribute is to the right, the current node coordinates are (x,y), the preferred node coordinates are (x,y+2), (x,y-2), (x+1,y+2), (x+1,y-2), (x+2,y+2), (x+2,y+1), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next preferred node coordinates are (x,y+1), (x,y-1), (x+1,y+1), (x+1,y), and (x+1,y-1), When the search direction attribute is upper left, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), and (x+2,y-2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y-1), and (x+1,y-1), When the search direction attribute is left-down, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y+2), (x,y+2), (x+1,y+2), and (x+2,y+2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y+1), and (x+1,y+1), When the search direction attribute is upper right, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), (x+2,y-2), (x+2,y-1), (x+2,y), (x+2,y+1), and (x+2,y+2), and the next preferred node coordinates are (x-1,y-1), (x,y-1), (x+1,y-1), (x+1,y), and (x+1,y+1), When the search direction attribute is downward to the right, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-1,y+2), (x,y+2), (x+1,y+2), (x+2,y+2), (x+2,y+1), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next preferred node coordinates are (x-1,y+1), (x,y+1), (x+1,y+1), (x+1,y), and (x+1,y-1).
[0009] Furthermore, if the current next-priority node coordinates are obstacle coordinates, the strategy for obtaining the unreachable priority node coordinates based on the current next-priority node coordinates is, specifically, that if the connection between the current node coordinates and the priority node coordinates passes through the grid corresponding to the current next-priority node coordinates, then the priority node coordinates are unreachable priority node coordinates.
[0010] Furthermore, the step of calculating important route points using a complete route coverage strategy is: Step 300 involves obtaining two arbitrary direction change point data and setting the two aforementioned direction change point data as the starting point coordinates (Xs, Ys) and ending point coordinates (Xe, Ye), Step 301 creates a list called points to store the cover grid positions, Step 302 calculates the minimum x-coordinate value Xmin, the maximum x-coordinate value Xmax, the minimum y-coordinate value Ymin, the maximum y-coordinate value Ymax, the absolute difference between x-coordinates Dx, and the absolute difference between y-coordinates Dy, based on the starting and ending coordinates. Step 303 is a step to determine whether the absolute difference Dx of the x-axis coordinates is 0 or not. If it is YES, step 304 is performed; if it is NO, step 307 is performed. Step 304 initializes the current Y to Ymin, Step 305 involves obtaining the corresponding extended grid coordinates based on the current Y value, defining the extended grid coordinates as (Xs,Y), (Xs-1,Y), and (Xs+1,Y), and adding the extended grid coordinates (Xs,Y), (Xs-1,Y), and (Xs+1,Y) to the list points. Step 306 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 305 and performs the appropriate processing on the resulting Y value. Step 307 involves calculating the equation of a straight line passing through the starting coordinates (Xs, Ys) and ending coordinates (Xe, Ye), and obtaining the slope K and intercept b of the said equation of the straight line. Step 308 is a step to determine whether Dx is greater than Dy, where if YES, step 309 is performed, and if NO, step 313 is performed. Step 309 initializes the current X to Xmin, Step 310 calculates the Y value corresponding to the current X based on the equation of the line, Step 311 involves rounding the Y value calculated from the linear equation to obtain an integer value of Y, round(Y), obtaining the corresponding extended grid coordinates (X, round(Y)), (X, round(Y)-1), and (X, round(Y)+1) based on this integer value of Y, and adding these three extended grid coordinates to the list points. Step 312 involves adding 1 to the current X value and determining whether the resulting X value is greater than Xmax. If YES, step 317 is executed; if NO, the process returns to step 310 and performs the appropriate processing on the resulting X value. Step 313 initializes the current Y to Ymin, Step 314 calculates the X value corresponding to the current Y based on the equation of the line, Step 315 involves rounding the X value calculated from the equation of the line to obtain an integer value of X, round(X), obtaining the corresponding extended grid coordinates (round(X),Y), (round(X)-1,Y), and (round(X)+1,Y) based on this integer value of X, and adding these three extended grid coordinates to the list points. Step 316 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 314 and performs the appropriate processing on the resulting Y value. This includes step 317, which completes the calculation of points.
[0011] Furthermore, the step of performing route planning processing on the extended second layer chart using the A* algorithm and obtaining all route point data on the extended second layer chart is as follows: Step 400 initializes the OPEN table and CLOSE table based on the second layer extended chart, and adds the starting point as the current node Current to the OPEN table. Step 401 determines whether the OPEN table is empty or not. If YES, the route plan is deemed to have failed and terminated; otherwise, step 402 is executed. Step 402 determines whether the endpoint exists in the OPEN table; if YES, the route plan is considered successful, while if NO, step 403 is executed. Step 403 involves calculating the F-value of the nodes in the OPEN table based on the evaluation function of the A* algorithm, sorting them based on the F-value, defining the node with the smallest value as the current node, and adding the current node to the CLOSE table. Step 404 calculates a list of child nodes to be detected using a self-adaptive direction-restricted priority node search strategy based on the current positional relationship of the start and end points. Step 405 is a step to determine whether or not an endpoint was detected during the calculation of child nodes in step 404. If YES, the route plan is considered successful; otherwise, step 406 is executed. Step 406 is a step to determine whether the current child node exists in the CLOSE table; if YES, step 409 is executed, and if NO, step 407 is executed. A step of determining whether a child node exists in the OPEN table. If YES, step 408 is executed. If NO, the current child node is added to the OPEN table and step 409 is executed, which is step 407, A step of determining whether the current F value of the child node is smaller than the F value of the node in the OPEN table. If YES, the OPEN table data is updated, mainly updating the parent node, F value, and G value corresponding to the child node, and step 409 is executed. If NO, the OPEN table data is not changed and step 409 is directly executed, which is step 408, A step of determining whether the scanning of the child node is completed. If YES, return to step 403 and continue the calculation based on the updated OPEN table data. If NO, return to step 405 and continue the detection of the child node, which is step 409, and includes.
[0012] Furthermore, the specific process of calculating the turning point data based on all the obtained route point data is Sequentially calculate the equations of the straight lines passing through two adjacent route points. When the slopes of the equations of two adjacent straight lines change, the route point where the two straight lines intersect is taken as the turning point. The specific process of calculating important route points using the route complete coverage strategy in the first-layer extended nautical chart is A step of sequentially connecting the starting point to each turning point and determining whether each connection passes through an obstacle based on the route complete coverage strategy. If YES, step 51 is executed. If NO, determine whether the current turning point is the end point. If it is the end point, end the acquisition of important route points. If not, proceed to the connection with the next turning point, which is step 50, A step 51 that takes the previous turning point as a new starting point and an important route point and returns to step 50, and includes.
[0013] Compared to prior art, the intelligent ship route planning algorithm based on ADR-A* disclosed in this invention has the following beneficial effects. The intelligent ship route planning algorithm based on ADR-A disclosed in this invention performs a two-layer boundary extension on the nautical chart, processes the calculation of the child node list in the A* algorithm using a self-adaptive direction-restricted priority node search strategy, calculates turning points, and calculates important route points using a route complete coverage strategy, thereby realizing route planning in a nautical chart environment. As a result, the ship route planning algorithm disclosed in this invention can plan a comprehensive route that combines safety, smoothness, economy, and high efficiency in complex environments, effectively demonstrating the feasibility, rationality, and superiority of the algorithm, and providing a new solution for intelligent ship route planning in complex marine environments. [Brief explanation of the drawing]
[0014] [Figure 1] This is a flowchart of the route planning algorithm for an intelligent ship based on ADR-A disclosed in the present invention. [Figure 2] This is a flowchart of the custom two-layer boundary extension strategy disclosed in the present invention. [Figure 3] This is a schematic diagram showing the application of a two-layer boundary extension to a nautical chart using the custom two-layer boundary extension strategy disclosed in the present invention. [Figure 4] This is a schematic diagram of a nautical chart with the first layer boundary extended. [Figure 5] This is a schematic diagram of a nautical chart with the second layer boundary extended. [Figure 6] This is a flowchart showing route planning processing for a second-layer extended chart using algorithm A disclosed in the present invention. [Figure 7] This is a flowchart of the self-adaptive direction-restricted priority node search strategy in the present invention. [Figure 8] This is a distribution diagram of priority nodes and second-priority nodes corresponding to each of the eight search direction attributes in the self-adaptive direction-restricted priority node search strategy according to the present invention. [Figure 9]This is a schematic diagram illustrating the inability to reach a priority node when the next priority node in a linear direction is obstructed. [Figure 10] This is a schematic diagram illustrating the inability to reach a priority node when the next priority node in the diagonal direction is obstructed. [Figure 11] This is a schematic diagram showing the actual application of the self-adaptive direction-restricted node search strategy of the present invention when the search direction attribute is to the lower left. [Figure 12] This is a schematic diagram showing the actual application of the self-adaptive direction-restricted node search strategy of the present invention when the search direction attribute is downward. [Figure 13] This is a schematic diagram showing how to calculate turning points based on path points. [Figure 14] This is a flowchart of the complete route coverage strategy in the present invention. [Figure 15] This is a schematic diagram of the complete path coverage strategy in the present invention. [Figure 16] This is a schematic diagram of the extraction of important nodes in the present invention. [Figure 17] This diagram compares the optimization effects of route planning based on a custom two-tier extension strategy and route planning based on a conventional extension strategy. [Figure 18] This is a diagram showing the results of a simulation experiment on nautical chart 1. [Figure 19] This is a comparison chart of route data in Chart 1. [Figure 20] This is a diagram showing the simulation experiment results on nautical chart 2. [Figure 21] This is a comparison chart of route data in nautical chart 2. [Modes for carrying out the invention]
[0015] As shown in Figure 1, the flowchart of the intelligent ship route planning algorithm based on ADR-A disclosed in the present invention is: Step 1 involves processing the obtained charts based on a custom two-layer boundary extension strategy to obtain a first-layer extended chart and a second-layer extended chart. The A* algorithm is used to perform route planning on a second-layer extended chart, and all route point data of the second-layer extended chart is obtained from step 2, wherein the child node list in the A* algorithm is obtained by processing using a self-adaptive direction-restricted priority node search strategy. Step 3 involves calculating direction change point data based on all obtained route point data, and then calculating important route points using a route complete coverage strategy on the first layer extended chart based on the obtained direction change point data. Step 4 includes planning a route in a chart environment based on the calculated key route points.
[0016] The intelligent ship route planning algorithm based on ADR-A disclosed in this invention performs a two-layer boundary extension on the nautical chart, processes the child node list calculation process in the A* algorithm using an Adaptive Direction Restriction Priority-node Search Strategy (ADRPSS), calculates turning points, and calculates important route points using a route coverage strategy, thereby realizing route planning in a nautical chart environment. As a result, the ship route planning algorithm disclosed in this invention can plan a comprehensive route that combines safety, smoothness, economy, and high efficiency in complex environments, effectively demonstrating the feasibility, rationality, and superiority of the algorithm, and providing a new solution for intelligent ship route planning in complex marine environments. Furthermore, it can quickly plan a navigable route with a small number of turning points and maintaining a safe distance from obstacles, which has great safety significance and economic value.
[0017] Furthermore, as shown in Figure 2, the custom two-layer boundary extension strategy is, Step 10 involves binarizing the obtained color chart to generate a binarized chart. Step 11 involves extracting the boundaries of the binarized data from the aforementioned binarized nautical chart to obtain the boundaries of obstacles. Step 12 includes the steps of obtaining a first-layer extended chart and a second-layer extended chart by performing a first-layer extended chart and a second-layer extended chart, respectively, based on the boundaries of obstacles, wherein the distance of the second-layer extended chart is greater than the distance of the first-layer extended chart.
[0018] Specifically, current ship route planning generally uses the conventional A* algorithm, but routes planned with the conventional A* algorithm are relatively close to obstacles. To improve route safety, route points need to be moved further away from obstacles. While this problem can be solved by using expansion methods, current route planning has many turning nodes and does not satisfy smoothness and economics, thus requiring optimization. Because route points are close to obstacles, the probability of the route crossing obstacles during optimization is high, resulting in insufficient optimization effect. To address these needs, this application discloses a Customizable Double-layer Boundary Expansion Strategy (CDBES). The specific process of CDBES involves binarizing a nautical chart, i.e., binarizing the obtained color nautical chart to generate a binarized chart, extracting obstacle boundaries based on the binarized data, and performing two expansions based on those boundaries. The expansion size of each layer can be custom adjusted according to requirements, but the expansion distance of the second layer must be greater than that of the first layer. Figure 3 shows a specific example of a two-layer extension, where the white area represents navigable water, the grayish-white area represents island and reef areas, and the dark gray area outside the grayish-white area represents the boundary of obstacles. The dark gray area is the extension range of the first layer, which is defined in this application as a caution zone, and the final route must be located outside the caution zone to ensure the safety of the route. The light gray area outside the dark gray area is the range between the second layer extension and the first layer extension (the second layer extension includes the portion of the first layer extension and the portion located outside the first layer extension), which is defined in this specification as a buffer zone. The buffer zone provides a solution space for removing redundant nodes, and the final route may traverse this area. As shown in Figures 4 and 5, the custom two-layer boundary extension strategy of the present invention ultimately generates two charts, a first-layer extension chart and a second-layer extension chart, respectively. By using the custom two-layer boundary extension strategy, this application has the following advantages. Specifically, firstly, route planning is performed based on the second-layer extended chart, and an initial route is generated outside the buffer zone. Secondly, redundant nodes are removed based on the first-layer extended chart.At this point, the route points are separated from the restricted area by only one buffer zone, increasing the likelihood of finding a traversable route and allowing for thorough route optimization. Ultimately, a route is generated with fewer turning points and that does not cross the restricted area, improving the smoothness and safety of the route.
[0019] This invention applies a two-layer boundary extension process to the obtained nautical chart based on a custom two-layer boundary extension strategy, and then performs route planning processing on the resulting second-layer extended nautical chart using the A* algorithm to obtain all route point data for the second-layer extended nautical chart. The specific process is as follows:
[0020] As shown in Figure 6, the step of performing route planning processing on the extended second layer chart using the A* algorithm and obtaining all route point data on the extended second layer chart is as follows: Step 400 initializes the OPEN table and CLOSE table based on the second layer extended chart, and adds the starting point as the current node Current to the OPEN table. Step 401 determines whether the OPEN table is empty or not. If YES, the route plan is deemed to have failed and terminated; otherwise, step 402 is executed. Step 402 determines whether the endpoint exists in the OPEN table; if YES, the route plan is considered successful, while if NO, step 403 is executed. Step 403 involves calculating the F-value of the nodes in the OPEN table based on the evaluation function of the A* algorithm, sorting them based on the F-value, defining the node with the smallest value as the current node, and adding the current node to the CLOSE table. Step 404 calculates a list of child nodes to be detected using a self-adaptive direction-restricted priority node search strategy based on the current positional relationship of the start and end points. Step 405 is a step to determine whether or not an endpoint was detected during the calculation of child nodes in step 404. If YES, the route plan is considered successful; otherwise, step 406 is executed. Step 406 is a step to determine whether the current child node exists in the CLOSE table; if YES, step 409 is executed, and if NO, step 407 is executed. Step 407 is a step to determine whether a child node exists in the OPEN table; if YES, step 408 is executed, while if NO, the current child node is added to the OPEN table and step 409 is executed. Step 408 involves determining whether the current F-value of a child node is less than the F-value of that node in the OPEN table. If the result is YES, the OPEN table data is updated, primarily updating the parent node, F-value, and G-value corresponding to the child node, and step 409 is executed. If the result is NO, step 408 does not modify the OPEN table data and directly executes step 409. Step 409 includes determining whether the child node scan is complete, and if YES, returning to step 403 to continue the calculation based on the updated OPEN table data, while if NO, returning to step 405 to continue the child node discovery.
[0021] In this application, the child node list of the A* algorithm is obtained by processing using a self-adaptive direction-restricted node search strategy, and as shown in Figure 7, the specific details include the following steps.
[0022] Step 20 involves obtaining the current node coordinates and the endpoint coordinates.
[0023] In step 21, the search direction attribute is obtained based on the current node coordinates and the endpoint coordinates, and the preferred node coordinates and the next preferred node coordinates are obtained relative to the current node coordinates based on the search direction attribute.
[0024] Specifically, the search direction attributes include up, down, left, right, upper left, lower left, upper right, and lower right. That is, the endpoint can be located in various directions from the current node. Nodes are searched based on different directions, and specifically the following strategies are employed.
[0025] The strategy for obtaining preferred node coordinates and next-preferred node coordinates relative to the current node coordinates based on the search direction attribute is as follows. This application performs path planning based on a binarized image. In the computer software, the origin of image processing is the upper left corner of the image. When the search direction attribute is upward, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next-preferred node coordinates are (x-1,y), (x-1,y-1), (x,y-1), (x+1,y), and (x+1,y-1).
[0026] When the search direction attribute is downward, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y), (x-2,y+1), (x-2,y+2), (x-1,y+2), (x,y+2), (x+1,y+2), (x+2,y), (x+2,y+1), and (x+2,y+2), and the next preferred node coordinates are (x-1,y), (x-1,y+1), (x,y+1), (x+1,y), and (x+1,y+1), When the search direction attribute is left, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y+2), (x-1,y-2), (x,y+2), and (x,y-2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y+1), and (x,y-1), When the search direction attribute is to the right, the current node coordinates are (x,y), the preferred node coordinates are (x,y+2), (x,y-2), (x+1,y+2), (x+1,y-2), (x+2,y+2), (x+2,y+1), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next preferred node coordinates are (x,y+1), (x,y-1), (x+1,y+1), (x+1,y), and (x+1,y-1), When the search direction attribute is upper left, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), and (x+2,y-2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y-1), and (x+1,y-1), When the search direction attribute is left-down, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-2,y+1), (x-2,y), (x-2,y-1), (x-2,y-2), (x-1,y+2), (x,y+2), (x+1,y+2), and (x+2,y+2), and the next preferred node coordinates are (x-1,y+1), (x-1,y), (x-1,y-1), (x,y+1), and (x+1,y+1), When the search direction attribute is upper right, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y-2), (x-1,y-2), (x,y-2), (x+1,y-2), (x+2,y-2), (x+2,y-1), (x+2,y), (x+2,y+1), and (x+2,y+2), and the next preferred node coordinates are (x-1,y-1), (x,y-1), (x+1,y-1), (x+1,y), and (x+1,y+1), When the search direction attribute is downward to the right, the current node coordinates are (x,y), the preferred node coordinates are (x-2,y+2), (x-1,y+2), (x,y+2), (x+1,y+2), (x+2,y+2), (x+2,y+1), (x+2,y), (x+2,y-1), and (x+2,y-2), and the next preferred node coordinates are (x-1,y+1), (x,y+1), (x+1,y+1), (x+1,y), and (x+1,y-1).
[0027] In other words, in this application, based on the positional relationship between child nodes and parent nodes, nodes within the 8 neighborhoods directly adjacent to the parent node are defined as second-priority nodes, and nodes outside the 8 neighborhoods within the 24 neighborhoods indirectly adjacent to the parent node are defined as priority nodes. As shown in Figure 8, the cross-shaped areas represent second-priority nodes, and the diagonal-shaped areas represent priority nodes. With this strategy, the algorithm can search only for priority nodes during the pathfinding process and make adaptive adjustments according to the relative positional relationship between path points and endpoints. As a result, this search strategy improves the execution efficiency of the path planning algorithm and enhances the goal-orientedness of the search process.
[0028] In step 22, the current next-priority node coordinates are obtained, and it is determined whether the current next-priority node coordinates are the endpoint coordinates. If YES, the path planning is completed and the node search is terminated; otherwise, step 23 is executed.
[0029] In step 23, it is determined whether the current next priority node coordinates are obstacle coordinates. If YES, the unreachable priority node coordinates are obtained based on the current next priority node coordinates and entered into the unreachable node list, after which step 24 is executed. If NO, step 24 is executed directly.
[0030] Specifically, as shown in Figures 9 and 10, these are schematic diagrams for determining whether a preferred node is traversable in a custom direction-restricted preferred node search strategy. If there is an obstacle in the linear or diagonal direction of a node, all three preferred nodes corresponding to that direction are traversable. In other words, if the current next preferred node coordinate is an obstacle coordinate, the strategy for obtaining the unreachable preferred node coordinate based on the current next preferred node coordinate is that if the connection between the current node coordinate and the preferred node coordinate passes through the grid corresponding to the current next preferred node coordinate, then that preferred node coordinate is an unreachable preferred node coordinate.
[0031] Figures 11 and 12 illustrate the intent in the actual application of a custom direction-restricted preferred node search strategy. Figures 11 and 12 show the distribution of preferred nodes when the endpoint is located in two different directions and there are obstacles to the next preferred node. Due to the obstacles, in both cases, three unreachable preferred nodes are removed, and five reachable preferred nodes are retained.
[0032] The process includes determining whether all next-priority nodes have been scanned, and if YES, obtaining the coordinates of reachable priority nodes and inputting them into the reachable node list; otherwise, returning to step 22 to determine the next next-priority node.
[0033] The present invention obtains all route point data from the second layer extended chart using the ADR-A* algorithm (Adaptive Direction Restriction-A*, ADR-A*) disclosed above, then calculates direction reversal point data based on all the obtained route point data, and calculates important route points on the first layer extended chart using a route complete coverage strategy based on the obtained direction reversal point data. Here, the specific process for calculating direction reversal point data based on all the obtained route point data is to sequentially calculate the equation of a straight line passing through two adjacent route points, and when the slope of the equation of two adjacent straight lines changes, the route point where the two straight lines intersect is defined as a direction reversal point. As shown in Figure 13, points A, B, and C are all direction reversal points.
[0034] As shown in Figure 14, the step of calculating important path points using a complete path coverage strategy is: Step 300 involves obtaining two arbitrary direction change point data and setting the two aforementioned direction change point data as the starting point coordinates (Xs, Ys) and ending point coordinates (Xe, Ye), Step 301 creates a list called points to store the cover grid positions, Step 302 calculates the minimum x-coordinate value Xmin, the maximum x-coordinate value Xmax, the minimum y-coordinate value Ymin, the maximum y-coordinate value Ymax, the absolute difference between x-coordinates Dx, and the absolute difference between y-coordinates Dy, based on the starting and ending coordinates. Step 303 is a step to determine whether the absolute difference Dx of the x-axis coordinates is 0 or not. If it is YES, step 304 is performed; if it is NO, step 307 is performed. Step 304 initializes the current Y to Ymin, Step 305 involves obtaining the corresponding extended grid coordinates based on the current Y value, defining the extended grid coordinates as (Xs,Y), (Xs-1,Y), and (Xs+1,Y), and adding the extended grid coordinates (Xs,Y), (Xs-1,Y), and (Xs+1,Y) to the list points. Step 306 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 305 and performs the appropriate processing on the resulting Y value. Step 307 involves calculating the equation of a straight line passing through the starting coordinates (Xs, Ys) and ending coordinates (Xe, Ye), and obtaining the slope K and intercept b of the said equation of the straight line. Step 308 is a step to determine whether Dx is greater than Dy, where if YES, step 309 is performed, and if NO, step 313 is performed. Step 309 initializes the current X to Xmin, Step 310 calculates the Y value corresponding to the current X based on the equation of the line, Step 311 involves rounding the Y value calculated from the linear equation to obtain an integer value of Y, round(Y), obtaining the corresponding extended grid coordinates (X, round(Y)), (X, round(Y)-1), and (X, round(Y)+1) based on this integer value of Y, and adding these three extended grid coordinates to the list points. Step 312 involves adding 1 to the current X value and determining whether the resulting X value is greater than Xmax. If YES, step 317 is executed; if NO, the process returns to step 310 and performs the appropriate processing on the resulting X value. Step 313 initializes the current Y to Ymin, Step 314 calculates the X value corresponding to the current Y based on the equation of the line, Step 315 involves rounding the X value calculated from the equation of the line to obtain an integer value of X, round(X), obtaining the corresponding extended grid coordinates (round(X),Y), (round(X)-1,Y), and (round(X)+1,Y) based on this integer value of X, and adding these three extended grid coordinates to the list points. Step 316 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 314 and performs the appropriate processing on the resulting Y value. This includes step 317, which completes the calculation of points.
[0035] Figure 15 is a schematic diagram of the Path Full Coverage Strategy (PFCS). In Figure 15, the gray-filled areas indicate the grids that need to be detected when determining the safety of a path. Figure 15 shows a schematic of the grids that need to be detected when the difference in horizontal and vertical coordinates between the start and end points is equal. Conventional path planning algorithms treat the path as a line segment with no width, and when determining path safety, they only detect whether a point on the line segment collides with an obstacle. This method can lead to the problem of the path being excessively close to obstacles. Therefore, this invention proposes a Path Full Coverage Strategy, which treats the path not as a single line but as a region with a certain width, thereby performing a more comprehensive evaluation of path safety and effectively improving the safety of path planning.
[0036] In this application, the specific process for calculating important route points using a route-complete coverage strategy in the first layer extended chart is as follows:
[0037] Step 50 involves sequentially connecting the starting point to each direction change point and determining whether each connection passes through an obstacle based on a complete path coverage strategy. If YES, step 51 is executed; if NO, step 50 determines whether the current direction change point is an endpoint. If it is an endpoint, the acquisition of important path points is terminated; otherwise, the process proceeds to connecting to the next direction change point. This includes step 51, which takes the previous point of change of direction as a new starting point and important path point, and returns to step 50.
[0038] Regarding Figure 16, this figure is a schematic diagram of the extraction of important path points. The specific optimization process in Figure 16 is as follows: Connect the starting point s and the turning point p2. If the line segment does not cross an obstacle, remove the turning point p1 between the two points. Connect the starting point s and the turning point p3. If the line segment crosses an obstacle, p2 is designated as an important path point. After extracting the important path point, the optimization of the path continues using this important path point as the new starting point. Connect the turning point p2 and the endpoint e, and remove the turning point p3 between the two points. At this point, the endpoint is detected, and the path optimization is complete. The optimized path is s-p2-e, and the important path point is p2.
[0039] Figure 17 compares the optimization effects of route planning based on a custom two-layer extension strategy with route planning based on an existing extension strategy. The solid lines in the figure represent routes planned by the present invention based on a second-layer extension chart and optimized based on a first-layer extension chart, with circles indicating turning points. The dashed lines represent routes planned and optimized based on a first-layer extension chart, with circles indicating turning points. The results in Figure 17 show that the custom two-layer extension strategy moves route points away from obstacles while simultaneously eliminating redundant nodes, thereby improving the navigability and economic efficiency of the route.
[0040] Figures 18 and 20 are simulation experiment results, while Figures 19 and 21 are data comparison charts. All experiments in this application were performed using Qt simulations, with a chart size of 500x500 pixels, and each algorithm was run 20 times. The simulation experiment results are all closest to the average value, and the results displayed in the data comparison charts are the average values.
[0041] Figure 18 shows comparative experiments with the ADR-A* algorithm (Adaptive Direction Restriction-A*, A* algorithm), the Bidirectional A* algorithm (Bi-A*), and the Rapidly-exploring Random Trees Star (RRT*) algorithm, using chart 1 with a starting point of (32,7) and an ending point of (239,469). As shown in the data comparison chart in Figure 19, the number of direction change points was optimized by a minimum of 83.33%, the path length by a minimum of 3.96%, and the execution time by a minimum of 53.6%.
[0042] Figure 20 shows comparative experiments with the ADR-A* algorithm, A* algorithm, Bi-A* algorithm, and RRT* algorithm on chart 2, with the starting point at (60,10) and the ending point at (422,482). According to the data comparison chart in Figure 21, the number of direction changes was optimized by a minimum of 83.33%, the path length by a minimum of 3.96%, and the execution time by a minimum of 53.6%.
[0043] The intelligent ship route planning algorithm based on the ADR-A* algorithm disclosed in this invention proposes three innovative strategies. First, to enhance route safety, a custom two-layer boundary extension strategy is proposed. By preprocessing the chart environment, the real-world characteristics of obstacles are preserved, while route points are moved away from obstacles, leaving room for optimization for subsequent redundancy removal processing. Second, to improve the algorithm's search efficiency, a self-adaptive direction-restricted priority node search strategy is proposed. During the search process, the algorithm adaptively adjusts the position and number of search nodes according to the positional relationship between route points and endpoints and the distribution of obstacles, thereby improving the accuracy and target-direction of the search. Finally, to address the lack of route smoothness, a route complete coverage strategy is proposed. By using a method for extracting important nodes, the route is optimized based on the route complete coverage strategy, ultimately obtaining the shortest route with high smoothness.
[0044] The intelligent ship route planning algorithm based on ADR-A* disclosed in this application was subjected to comparative experiments with conventional route planning algorithms (A*, Bi-A*, RRT*) in different chart environments. The evaluation metrics for the experiments were route length, number of turning points, and execution time. The experimental results showed that the ADR-A* algorithm outperformed the other three route planning algorithms in all three evaluation metrics, demonstrating that the algorithm can plan a comprehensive route that combines safety, smoothness, economy, and high efficiency in complex environments. This effectively demonstrates the feasibility, rationality, and superiority of the algorithm, and may provide a new solution for intelligent ship route planning in complex marine environments.
[0045] The foregoing are merely preferred embodiments of the present invention, and the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art based on the technical solutions and inventive concepts of the present invention are included within the scope of protection of the present invention, provided they do not depart from the spirit of the present invention.
Claims
1. Step 1 involves processing the obtained charts based on a custom two-layer boundary extension strategy to obtain a first-layer extended chart and a second-layer extended chart. The A* algorithm is used to perform route planning processing on the second layer extended chart and to obtain all route point data of the second layer extended chart, wherein the child node list in the A* algorithm is obtained by processing using a self-adaptive direction-restricted priority node search strategy, and Step 3 involves calculating direction change point data based on all obtained route point data, and then calculating important route points using a complete route coverage strategy on the first layer extended chart based on the obtained direction change point data. An intelligent ship route planning algorithm based on ADR-A*, comprising step 4 of planning a route in a chart environment based on calculated key route points.
2. The aforementioned custom two-layer boundary extension strategy is, Step 10 involves binarizing the obtained color chart to generate a binarized chart. Step 11 involves extracting the boundaries of the binarized data from the aforementioned binarized nautical chart to obtain the boundaries of obstacles. An intelligent ship route planning algorithm for ADR-A* according to claim 1, characterized by comprising the step of obtaining a first-layer extended chart and a second-layer extended chart by performing a first-layer extended and a second-layer extended, respectively, based on the boundaries of obstacles, wherein the distance of the second-layer extended is greater than the distance of the first-layer extended.
3. The self-adaptive direction-restricted node search strategy in the A* algorithm is: Step 20 involves obtaining the current node coordinates and endpoint coordinates. Step 21: Obtain a search direction attribute based on the current node coordinates and endpoint coordinates, and obtain the preferred node coordinates and next preferred node coordinates relative to the current node coordinates based on the search direction attribute. Step 22 involves obtaining the current next-priority node coordinates, determining whether the current next-priority node coordinates are the endpoint coordinates, and if YES, completing the path planning and ending the node search; otherwise, executing step 23. Step 23 determines whether the current next priority node coordinates are obstacle coordinates. If YES, it obtains the unreachable priority node coordinates based on the current next priority node coordinates and inputs them into the unreachable node list, then executes step 24. If NO, it directly executes step 24. The intelligent ship route planning algorithm for ADR-A* according to claim 1, characterized by including a step 24 which determines whether all next-priority nodes have been scanned, and if YES, obtains the coordinates of reachable priority nodes and inputs them into the reachable node list, while if NO, returns to step 22 to determine the next next-priority node.
4. The aforementioned search direction attributes include upward, downward, leftward, rightward, upper left, lower left, upper right, and lower right. The strategy for obtaining the preferred node coordinates and next preferred node coordinates relative to the current node coordinates based on the search direction attribute is as follows: When the search direction attribute is upward, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y), (x-2, y-1), (x-2, y-2), (x-1, y-2), (x, y-2), (x+1, y-2), (x+2, y), (x+2, y-1) and (x+2, y-2), and the next preferred node coordinates are (x-1, y), (x-1, y-1), (x, y-1), (x+1, y) and (x+1, y-1), When the search direction attribute is downward, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y), (x-2, y+1), (x-2, y+2), (x-1, y+2), (x, y+2), (x+1, y+2), (x+2, y), (x+2, y+1) and (x+2, y+2), and the next preferred node coordinates are (x-1, y), (x-1, y+1), (x, y+1), (x+1, y) and (x+1, y+1), When the search direction attribute is left, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y+2), (x-2, y+1), (x-2, y), (x-2, y-1), (x-2, y-2), (x-1, y+2), (x-1, y-2), (x, y+2), and (x, y-2), and the next preferred node coordinates are (x-1, y+1), (x-1, y), (x-1, y-1), (x, y+1), and (x, y-1), When the search direction attribute is to the right, the current node coordinates are (x, y), the preferred node coordinates are (x, y+2), (x, y-2), (x+1, y+2), (x+1, y-2), (x+2, y+2), (x+2, y+1), (x+2, y), (x+2, y-1) and (x+2, y-2), and the next preferred node coordinates are (x, y+1), (x, y-1), (x+1, y+1), (x+1, y) and (x+1, y-1), When the search direction attribute is upper left, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y+2), (x-2, y+1), (x-2, y), (x-2, y-1), (x-2, y-2), (x-1, y-2), (x, y-2), (x+1, y-2) and (x+2, y-2), and the next preferred node coordinates are (x-1, y+1), (x-1, y), (x-1, y-1), (x, y-1) and (x+1, y-1), When the search direction attribute is left-down, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y+2), (x-2, y+1), (x-2, y), (x-2, y-1), (x-2, y-2), (x-1, y+2), (x, y+2), (x+1, y+2) and (x+2, y+2), and the next preferred node coordinates are (x-1, y+1), (x-1, y), (x-1, y-1), (x, y+1) and (x+1, y+1), When the search direction attribute is upper right, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y-2), (x-1, y-2), (x, y-2), (x+1, y-2), (x+2, y-2), (x+2, y-1), (x+2, y), (x+2, y+1) and (x+2, y+2), and the next preferred node coordinates are (x-1, y-1), (x, y-1), (x+1, y-1), (x+1, y) and (x+1, y+1), The intelligent ship route planning algorithm based on ADR-A* according to claim 3, characterized in that when the search direction attribute is to the lower right, the current node coordinates are (x, y), the preferred node coordinates are (x-2, y+2), (x-1, y+2), (x, y+2), (x+1, y+2), (x+2, y+2), (x+2, y+1), (x+2, y), (x+2, y-1), and (x+2, y-2), and the next preferred node coordinates are (x-1, y+1), (x, y+1), (x+1, y+1), (x+1, y), and (x+1, y-1).
5. The intelligent ship route planning algorithm for ADR-A* according to claim 4, characterized in that, when the current next-priority node coordinates are obstacle coordinates, the strategy for obtaining unreachable priority node coordinates based on the current next-priority node coordinates is, specifically, if the connection between the current node coordinates and the priority node coordinates passes through the grid corresponding to the current next-priority node coordinates, then the priority node coordinates are unreachable priority node coordinates.
6. The step of calculating important path points using a complete path coverage strategy is: Step 300 involves obtaining two arbitrary direction change point data and setting the two direction change point data as the starting point coordinates (Xs, Ys) and ending point coordinates (Xe, Ye), respectively. Step 301 creates a list called points to store the cover grid positions, Step 302 calculates the minimum x-coordinate value Xmin, the maximum x-coordinate value Xmax, the minimum y-coordinate value Ymin, the maximum y-coordinate value Ymax, the absolute difference between x-coordinates Dx, and the absolute difference between y-coordinates Dy, based on the starting and ending coordinates. Step 303 is a step to determine whether the absolute difference Dx of the horizontal coordinates is 0 or not. If it is YES, step 304 is executed; if it is NO, step 307 is executed. Step 304 initializes the current Y to Ymin, Step 305 involves obtaining the corresponding extended grid coordinates based on the current Y value, defining the extended grid coordinates as (Xs, Y), (Xs-1, Y), and (Xs+1, Y), and adding the extended grid coordinates (Xs, Y), (Xs-1, Y), and (Xs+1, Y) to the list points. Step 306 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 305 and appropriate processing is performed on the resulting Y value. Step 307 involves calculating the equation of a straight line passing through the starting coordinates (Xs, Ys) and ending coordinates (Xe, Ye), and obtaining the slope K and intercept b of the equation of the straight line. Step 308 is a step to determine whether Dx is greater than Dy, where if YES, step 309 is performed, and if NO, step 313 is performed. Step 309 initializes the current X to Xmin, Step 310 calculates the Y value corresponding to the current X based on the equation of the line, Step 311 involves rounding the Y value calculated from the linear equation to obtain an integer value of Y, round(Y), obtaining the corresponding extended grid coordinates (X, round(Y)), (X, round(Y)-1), and (X, round(Y)+1) based on the integer value of Y, round(Y), and adding these three extended grid coordinates to the list points. Step 312 involves adding 1 to the current X value and determining whether the resulting X value is greater than Xmax. If YES, step 317 is executed; if NO, the process returns to step 310 and appropriate processing is performed on the resulting X value. Step 313 initializes the current Y to Ymin, Step 314 calculates the X value corresponding to the current Y based on the equation of the line, Step 315 involves rounding the X value calculated from the linear equation to obtain the integer value of X, round(X), obtaining the corresponding extended grid coordinates (round(X), Y), (round(X)-1, Y), and (round(X)+1, Y) based on the integer value of X, round(X), and adding these three extended grid coordinates to the list points. Step 316 involves adding 1 to the current Y value and determining whether the resulting Y value is greater than Ymax. If YES, step 317 is executed; if NO, the process returns to step 314 and appropriate processing is performed on the resulting Y value. The intelligent ship route planning algorithm based on ADR-A* according to claim 1, comprising step 317, which is the step of terminating the calculation of points.
7. The step of performing route planning processing on the extended second layer chart using the A* algorithm and obtaining all route point data on the extended second layer chart is as follows: Step 400 involves initializing the OPEN table and CLOSE table based on the second layer extended chart, and adding the starting point as the current node Current to the OPEN table. Step 401 is a step to determine whether the OPEN table is empty or not. If YES, the route planning is deemed to have failed and the route planning is terminated; if NO, step 402 is executed. Step 402 is a step to determine whether the endpoint exists in the OPEN table; if YES, the route plan is considered successful, while if NO, step 403 is executed. Step 403 involves calculating the F-value of the nodes in the OPEN table based on the evaluation function of the A* algorithm, sorting them based on the F-value, defining the node with the smallest value as the current node, and adding the current node to the CLOSE table. Step 404 calculates a list of child nodes to be detected using a self-adaptive direction-restricted priority node search strategy based on the current positional relationship of the start and end points. Step 405 is a step in which it is determined whether or not an endpoint was detected during the calculation of child nodes in step 404. If the answer is YES, the route planning is considered successful; otherwise, step 406 is executed. Step 406 is a step to determine whether the current child node exists in the CLOSE table, and if YES, step 409 is executed, while if NO, step 407 is executed. Step 407 involves determining whether a child node exists in the OPEN table; if YES, step 408 is executed; otherwise, step 407 adds the current child node to the OPEN table and executes step 409. Step 408 involves determining whether the current F-value of a child node is less than the F-value of that node in the OPEN table. If the answer is YES, the OPEN table data is updated, primarily updating the parent node, F-value, and G-value corresponding to the child node, and step 409 is executed. If the answer is NO, step 408 does not change the OPEN table data and directly executes step 409. The intelligent ship route planning algorithm for ADR-A* according to claim 1, comprising: step 409, which determines whether the scanning of child nodes is complete; if YES, return to step 403 and continue the calculation based on the updated OPEN table data; otherwise, return to step 405 and continue the detection of child nodes.
8. The specific process for calculating direction change point data based on all obtained path point data is as follows: This method involves sequentially calculating the equations of lines passing through two adjacent path points, and determining the point where the two lines intersect when the slopes of the equations of the two adjacent lines change as the point of change of direction. The specific process for calculating important route points using a complete route coverage strategy in the first layer extended chart is as follows: Step 50 involves sequentially connecting the starting point to each direction change point and determining whether each connection passes through an obstacle based on a complete path coverage strategy. If the answer is YES, step 51 is executed; however, if the answer is NO, it is determined whether the current direction change point is an endpoint. If it is an endpoint, the acquisition of important path points is terminated; otherwise, the process proceeds to connecting to the next direction change point. The intelligent ship route planning algorithm for ADR-A* according to claim 1, characterized by including step 51, which sets the immediately preceding point of change of direction as a new starting point and important route point, and returns to step 50.