# B-Spline Curve Fitting of Hungry Predation Optimization on Ship Line Design
## 1 Introduction  
B-spline curve approximation has been a hot research topic in the field of computer-aided geometric design in recent years. With the development of computer-aided design (CAD) and the rise of advanced manufacturing technology, B-spline is widely used in the design and manufacturing industry of free curves and surfaces [1, 2, 3, 4, 5]. In the field of shipbuilding, the design of ship lines is the basis of shipbuilding [6]. The ship lines are closely related to the dynamic characteristics and resistance characteristics of the ship. Improving the design level of ship lines and then improving the design quality of ships has become a hot research topic in the field of shipbuilding industry [7, 8]. However, due to the error in the design of the ship lines or the modification in the local smoothing process, the coordinates of the corresponding points of the three views may not correspond, resulting in the reduction of the accuracy of the ship line diagram [9]. In addition, the data points in the ship line diagram are discrete, and two adjacent discrete points are connected by straight line segments, resulting in poor smoothness, which brings trouble to the subsequent ship line setting out and processing and affects the quality and efficiency of shipbuilding. Due to the locality of B-spline, it can be more convenient to modify the curve locally. The parameter continuity of B-spline can ensure that the fitting curve has good smoothness. If the continuous B-spline method is used in the ship line design to replace the discrete offset table method, the accuracy of ship line design will be greatly improved, and the subsequent multi-disciplinary collaborative optimization and manufacturing will be facilitated. Compared with interpolation, B-spline curve approximation can better reflect the shape of curve, but the placement of knot vector is still an urgent problem to be solved. Unreasonable knot vector arrangement may lead to unacceptable shapes [10]. Researchers put higher fitting accuracy at the same knot number [11, 12], fewer knot number under the same accuracy requirements [13, 14] and faster operating efficiency [15, 16] as the main pursuit goals of B-spline curve fitting. This paper develops a B-spline curve fitting of hunger predation optimization on ship line design (HPA). In the previous dynamic knot method [17; 18; 19; 20; 21; 22], the initial knots are randomly selected from the interval [0, 1], so there are many unreasonable knot vectors. Therefore, large population size and iteration number are required, which leads to low efficiency of the algorithm. The knot guidance technology is designed to add knots in the area with complex model shape at the initial knot selection stage. The premature loss of population diversity in optimization algorithm leads to slow convergence and is easy to fall into local optimality. A hunger search strategy is developed to make the hungry individuals in the population approach the optimal solution more quickly, and the influence of neighbors on the position adjustment is further considered. Aiming at the problem that the previous dynamic knot method requires manual adjustment of key input parameters, such as population size and iteration number, which is troublesome and time consuming. An adaptive adjustment of key input parameters in the HPA algorithm is proposed, which can quickly adapt to the replacement of model and fitting accuracy. HPA achieves the goal of B-spline curve fitting with higher fitting accuracy at the same control points, less control points under the same accuracy requirements, faster operation efficiency and better universality; it can better solve practical engineering problems. The rest of the paper is organized as follows. Section 2 introduces the basic B-spline theory used in HPA algorithm and research on existing B-spline curve fitting. Section 3 proposes the HPA method, including a new knot guidance technology, a hungry predation optimization technology, fitness function selection and the dimension calculation rule.