## 3 Path Generation and Optimization Scheme
### Creation of Lane Change Solution Space Based on B-Spline Curve  
The B-spline curve offers several advantages suitable for vehicle lane-changing paths [37]. Firstly, it has good smoothness, and the curvature of each point on the path changes continuously. This property can satisfy the demands of the vehicle lane changes. Secondly, in the case of the quasi-uniform B-spline curve, both the initial and final points have a curvature of zero. In addition, the B-spline curve has a mature calculation algorithm  
Figure 4: Allowed distance of lane changing.  
and strict mathematical definition, which is more efficient in calculation and analysis. The formula for calculating the B-spline curve is presented below:  
\[P(u)=\sum_{i=0}^{n}P_{i}\cdot N_{i,k}(u) \tag{8}\]  
where \(P(u)\) represents the position of a point on the B-spline curve at the parameter \(u\), and \(u\in[0,1]\) traverses the curve from start to end. \(P_{i}(i=0,1,\ldots,n)\) are the control points that define the shape and boundary of the curve. These points act as \"magnets\" to guide the curve's trajectory without necessarily lying on the curve itself. \(N_{i,k}(u)\) are the B-spline basis functions of order \(k\). These functions determine the influence of each control point \(P_{i}\) on the curve at parameter \(u\). \(k\) is the order of the B-spline, which defines its smoothness. \(u\) is a parameter that varies along the curve. \(n+1\) represents the number of control points. For the lane-changing paths of vehicles, the cubic B-spline curve can usually achieve a better balance between smoothness and computational efficiency. Therefore, \(k\) is set as four. The basic functions \(N_{i,k}(u)\) are computed recursively using the Cox-deBoor formula:  
\[Ni,k(u)=\left\{\begin{array}{c}\left\{\begin{array}{c}1,u_{i}\leq u<u_{i+1} \\ 0,otherwise\\ \frac{u-u_{i}}{u_{i+k-1}-u_{i}}N_{i,k-1}(u)+\frac{u_{i+k}-u}{u_{i+k}-u_{i+1}} N_{i+1,k-1}(u),k\geq 2\end{array}\right.\\ \end{array}\right. \tag{9}\]  
As illustrated in Figure 5, the B-spline curve is constructed with six control points (A, B, C, D, E, and F). Point A marks the lane change initiation determined by the decision system. More control points are not conducive to subsequent path optimization. To enhance the efficiency and practicality of path generation, the following settings will be set for the control points: (1) The line ABC and the line DEF are parallel to the road centerline. (2) Set AB = BC = DE = DF and O as the midpoint of the path. Then, the degree of freedom of the B-spline reduces to two. The distance between points A and C is denoted as \(k_{1}\) and the distance between point C and point D is denoted as \(k_{2}\).  
The B-spline trajectory is designed to align with the center of the tractor's rear axle of the semi-trailer. This choice ensures that the planned path accounts for the vehicle's kinematic constraints and simplifies the tracking control logic. Specifically, each point \(P(u)\) on the B-spline curve (Equation (8)) corresponds to the projected position of the rear axle center during lane-changing maneuvers. This alignment allows the control system to directly map the generated path to the vehicle's steering dynamics while maintaining roll stability.  
Figure 5: Path generation based on B-spline curve.