# B-Spline Curve Fitting of Hungry Predation Optimization on Ship Line Design
## 5 HPA Algorithm Test
### Comparison with Existing Research
The test function \(f_{4}(x)\) is a more challenging function in the field of B-spline fitting [22], and there is a sharp point at \(x=0.5\), which is a commonly used example in the B-spline curve fitting literature. Existing fitting methods based on optimization algorithm and their \begin{table}
\begin{tabular}{c c c} \hline \hline
**Function** & **Description** & **Variable Range** \\ \hline
1 & Data point [48] \\
2 & \(f_{2}(x)=\frac{10x}{(1+100x^{2})}\) & \([-2,2]\) \\
3 & \(f_{3}(x)\)\(=0.2e^{-\frac{50x}{3}}\sin{5x}+4\) & \([0,4\pi]\) \\
4 & \(f_{4}(x)=\frac{100}{e^{\frac{10x}{10x}}+(\frac{10x}{500})}\) & \([0,1]\) \\
5 & \(f_{5}(x)\)\(=\sin{x}+2\mathrm{e}^{-30x^{2}}\) & \([-2,2]\) \\
6 & \(f_{6}(x)\)\(=\sin{2x}+2\mathrm{e}^{-36x^{2}}\)\(+2\) & \([-2,2]\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Test six models mentioned in the literature. (Adapted with permission from Ref. [19]). Figure 13: Comparison of the effect of various optimization algorithms on face contour fitting. fitting results are shown in the Table 4; PESA, MOGA, FFA and some other methods cannot fit the \(f_{4}(x)\) function well. BIC is a criterion for many researchers to judge the pros and cons of an algorithm. However, each scholar has a slightly different understanding of the parameters in the BIC formula. Therefore, the BIC judgment formula in the B-spline curve fitting application is different. In the AIS [22] method, the BIC calculation method is shown in Formula (23). \[ \begin{split}\text{BIC}=N\ \times\ \text{LN}(\Omega_{1})+(\text{LN}(N) )(2N\!\omega\ -\ 3\rho^{*}+2)\\ \text{Q}_{1}=\sum\limits_{j=1}^{N}\text{(}X_{\text{ii}}-X_{\text {2i}})^{2}+(Y_{\text{ii}}-Y_{\text{2i}})^{2}\end{split}  \tag{23}\] \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Authors, Year and Reference** & **Method** & **Iteration Number** & **Knot Number** & **BIC** \\ \hline [PERSON] et al. [17] & Genetic algorithms (GA) & 200 & 5 & 1188 \\ [PERSON] and [PERSON] [18] & GA and Detection Algorithms & 120 & \(\times\) & \(\times\) \\ [PERSON] et al. [19] & Gray Wolf Optimization (GWO) & 100 & 40 & 704 \\ [PERSON] et al. [21] & Invasive Weed Optimization (IWO) & 15 & 6 & 430 \\ [PERSON] et al. [22] & Artificial Immune Systems (AIS) & 100 & 5 & 1121 \\ [PERSON] and [PERSON] [49] & Artificial Immune Systems & 500 & \(\times\) & \(\times\) \\ [PERSON] [50] & Pareto Envelope-Based Selection Algorithm (PESA) & 500 & \(\times\) & \(\times\) \\ [PERSON] et al. [51] & Multi-Objective Genetic Algorithms (MOGA) & 120 & \(\times\) & \(\times\) \\ [PERSON] and [PERSON] [52] & Firefly Algorithm (FFA) & 500 & \(\times\) & \(\times\) \\ [PERSON] et al. [53] & Adaptive Multiresolution Basis Set with Lasso & Variable & \(\times\) & \(\times\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Existing fitting methods based on optimization algorithm and their fitting results. (’\(\times\)’ means that the method can not fit the function \(f_{4}\) well). Figure 14: Comparison of GWO and HPA fitting results for six test models. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Function** & **Degree of** & **Population** & **Number of** & **Number of** & **Number of** & **Number of** & **MSE** & **MSE** \\  & **Curve** & **Size** & **Iteration** & **Point** & **Knot** & **Control Point** & **(GWO)** & **(HPA)** \\ \hline
1 & 3 & 50 & 100 & 49 & 16 & 20 & 0.024 & \(3.21\times 10^{-3}\) \\ \hline
2 & 3 & 50 & 100 & 90 & 53 & 57 & 0.010 & \(6.32\times 10^{-7}\) \\ \hline
3 & 3 & 50 & 100 & 200 & 77 & 81 & 0.008 & \(2.31\times 10^{-6}\) \\ \hline
4 & 3 & 50 & 100 & 201 & 40 & 44 & 1.395 & \(3.18\times 10^{-3}\) \\ \hline
5 & 3 & 50 & 100 & 201 & 46 & 50 & 0.032 & \(2.43\times 10^{-4}\) \\ \hline
6 & 3 & 50 & 100 & 201 & 37 & 41 & 0.026 & \(7.58\times 10^{-4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The experimental results for all functions.