Design of ship route through waterway based on dynamic programming

Aiming at the problem that the traditional route selection of ships is difficult to meet the requirements of precision and rapidness, based on the two-dimensional structure space of the grid sea area, a route planning model of ships passing through waterways is established, and a method to realize the optimal route based on the dynamic programming algorithm is presented. The simulation results show that the algorithm is an optimization algorithm for the local route planning of ships.


Introduction
The navigable width of the channel in the First Island chain strait is limited, the hydrometeorological environment is changeable, and the foreign military situation is complex, which is usually the focus of ship route planning. The traditional selection of ship route based on qualitative analysis has been difficult to meet the requirements of precision. At present, there are many models and algorithms of ship route planning. This paper presents a method of ship route planning based on dynamic programming algorithm.

Mechanism of dynamic route planning for ships
Dynamic programming is one of the basic methods to solve the problem of multi-stage decisionmaking process, which has been widely applied in the field of air route planning [1]. The basic idea of dynamic programming is to choose a decision at each stage that minimizes the sum of the costs of the current stage and that can be expected to be the best for the future stage.
Route planning can divide the whole route into several sections according to the order of starting point to ending point, and each section is a stage. Here we use the phase variable k to describe n phases.

Waypoint status
The route of a ship is the connection of each section composed of several route points. There are many waypoints to choose from in each stage, which are both the starting point of the next stage and the end point of the previous stage. When using dynamic programming algorithm, each waypoint can be called state, and the sequence number of chart grid corresponding to waypoint can be taken as state variable. Then the state set of state variable in the stage is: Where r is the number of states in the first stage k.
can be selected and represented by the decision variable. If a ship is in the k phase i state and a decision is to be made to the j state of the phase k+1, then the decision variable can be expressed as . Generally, the easy-going value changes and the state transfer equation can be further expressed as: The state set of the decision variable k u in stage k is:

Route strategy
Route strategy is a set of decisions in each stage arranged in a certain order. For the decision problem of n stages, the whole process strategy consisting of the decision function p . The sequence of decision functions composed of each decision segment starting from the k stage is called a sub-strategy, denoted as n , k p , and represents a series of decision sequences taken from the K stage to the N stage,

Route indicator function Denoted as the index function of stage
, the index function of stage n in the whole process is: The minimum index value is required by the ship route planning, that is

Route planning model for ships passing through waterways
According to the general principle of safety, concealment and timeliness required by ship route planning, the target expectation of ship route planning can be translated into the minimum comprehensive cost of total voyage and total voyage, under the premise that the ship's navigation safety is guaranteed and the threat of concealment is minimized. The main threats to a ship during its passage through a waterway include enemy situation, obstructing objects, strong winds, visibility, surging waves and moving targets. Of course, appropriate control methods and rational use of the Marine environment can greatly reduce the threat of the enemy.

The navigation area of ships is gridded
In order to facilitate quantitative analysis and simplify calculation, the possible sea area of ships can be gridded [3]. The navigation sea area of a ship is supposed as a two-dimensional structured space and denoted as RS . And the position range of the threat area is known. For the convenience of calculation, the grid is divided along the latitude and longitude lines. The size of the grid should be determined comprehensively according to the navigable width of the sea area and the navigation ability of ships, and the range should be moderate. If the grid area is too large, the navigability of local sea area may be limited. If the grid scope is too small, it will increase the calculation amount of the planning process. As shown in figure 1, supposing that the navigation task of A ship is from point A to Point B, the longitude difference and latitude difference between point A and Point B, and there are some threat zones. Now A is taken as the origin of coordinates, the east direction of latitude is the X-axis, and the north direction of longitude is the Y-axis.
If the longitude difference between A and B is equaled by m , the line segment  In the two-dimensional structured space in the navigation sea area of a ship, if there is no threat within the size range of a certain grid, the grid is called free grid. Otherwise known as a hazard grid, the area is unnavigable. Both free and dangerous grids can be represented as a collection of grid blocks.

Based on the sea area grid ship route model
The route of a ship from Point A to point B can be expressed as:

Route simulation based on dynamic programming algorithm
The dynamic route planning of ships can be done by the inverse method from the end point to the starting point, and the dynamic threat area is added in the simulation.

Algorithmic structure
Step1: Initializes, setting num as the total number of stages, whose value is determined by the position of start and stop and the number of sea area grids. To ensure that at least one set of optimal solutions is produced and unnecessary iterations are reduced is the latitude and longitude difference of the starting and stopping points, and a is the length of the grid side. For , determine the minimum value corresponding to the waypoint as the m state, that is ) ( Step 3: Let , go to step 2.
Step 4: From all routes , after the reverse sequence is the planned route.

Case Simulation
As an example, the grid environment of a ship passing through a strait is shown in figure 2(a) , in which the grid grid represents the dynamic threat area and the black grid represents the fixed threat area. The simulation process is shown in figure 2 (a) , figure 2(b) , and figure 2(c) . The above simulation shows that, using dynamic programming algorithm to plan ship route through waterway with narrow navigable width and dynamic threat (such as enemy situation) can meet the general requirements of safety, concealment and timeliness.

Conclusion
There are many basic algorithms for ship route planning. In a certain range, the dynamic programming algorithm has high efficiency. Besides it does not have the defect of local convergence that other equivalent algorithms may appear. In addition its operation speed is not inferior to other equivalent algorithms. Furthermore it is more suitable to solve the local route planning problem. However, the global search efficiency of this algorithm is not high. Therefore, when planning the global route of ship, we should combine the advantages of other algorithms, such as ant colony algorithm, and improve the algorithm to get the ideal route.