## 1 Introduction
In a study on optimizing ship motion, [PERSON] and [PERSON] [14] marked areas in harsh weather conditions, including strong winds or high waves, as the alarm area as dynamic constraints. While these studies were effective in finding routes that avoided storms or high waves, they did not quantitatively discuss the effect of wind and waves according to the IMO guidelines. In this study, dangerous situations that may lead to capsizing or severe roll motions causing damage to ships are quantificationally used as constraints to plan less risky routes. Furthermore, the Dijkstra and A* algorithms are often applied to search for an optimal route which comprehensively considers the sailing time, risk, terrain, and other criteria with minimal influence. [PERSON] et al. [15] improved the Dijkstra algorithm by adding the pheromone idea of the ant colony algorithm, thus reducing the moving cost of routes. [PERSON] et al. [16] combined the information from an Automatic Identification System with the Dijkstra algorithm to plan a safe route. Ship navigation rules were added to the A* algorithm, forming the dynamic collision avoidance route planning algorithm under the circumstances of a complicated multi-ship encounter [17]. [PERSON] and [PERSON] [18] proposed an optimized A* algorithm based on a genetic algorithm to solve the problem of ship pipe route design. In terms of algorithm selection, the Dijkstra algorithm finds the optimal solution by searching all directions around the current node, while the A* algorithm, adding the heuristic function to change the direction of the search towards the target, is more efficient than the Dijkstra algorithm [19]. However, the Dijkstra algorithm searches too many useless nodes, and the A* algorithm takes up too much space, both of which will affect the efficiency of finding the optimal route in the map with too large a size or too complex an environment [20]. In recent years, the A* algorithm has been optimized; for example, the bidirectional A* algorithm [21] can concurrently search from the start node to the end node and from the end node to the start node to reduce the number of nodes that need to be searched and improve the search efficiency. In view of the wide navigation range and long timespan of the ocean route, this study applies the bidirectional A* algorithm to solve our model. Therefore, the main objectives of this study are as follows. First, the multi-layer fuzzy comprehensive evaluation method is applied to integrate the external environment of meteorological and marine factors with the vulnerability of ships so that the risk values are more accurate and comprehensive for the ships. Second, the dangerous situations which cause ships to capsize or suffer damage, as mentioned in the IMO guidelines, are quantificationally used as constraints in the algorithm. At the same time, the influence of wind, waves, and calm water on ship resistance is also considered. Then, a multi-objective nonlinear programming model is built, which comprehensively considers voyage time, voyage risk, fuel consumption, and constraints. Finally, the bidirectional A* algorithm is applied to solve the above model to obtain the optimal route. The remainder of this manuscript is organized as follows. Section 2 presents the methods of this study. The case of the capsizing of Singapore barge CB100-01 is studied to demonstrate the validity of our model in Section 3. Some discussions and conclusions are presented in Section 4.