An Optimized Car-Following Behavior in Response to a Lane-Changing Vehicle: A Bézier Curve-Based Approach

Sudden lane-changing maneuvers can disrupt the traffic flow. In this paper, we introduce an approach to optimize car-following behavior in response to a lane-changing vehicle in a connected driving environment. Our approach utilizes a quadratic Bézier curve in the time-space diagram to represent the car-following behavior. The algorithm adapts to sudden interruptions from the leading vehicle (i.e., the lane-changing vehicle on the road) while considering driving comfort, traffic impacts, and safety. We derive the acceleration term and factor in initial braking and speed reduction along the curve to generate a safe trajectory for car-following behavior. Our approach was simulated using MATLAB and tested against real-world lane-changing trajectory data collected in Chicago, IL. Results show that our approach produces a safe trajectory curve that adjusts according to the preferred driving pattern when provided with a lane-changing trajectory. This approach provides a useful means of designing safe car-following behavior while considering the impact on upstream traffic in a connected driving environment.


I. INTRODUCTION
Traffic shockwaves are fundamental phenomena in traffic flow.They often occur due to small perturbations, such as the deceleration and acceleration of a single vehicle in congested conditions, and can propagate upstream or downstream.Amplified perturbations can result in traffic oscillations (slow-and-go) or stop-and-go traffic, contributing to problems such as flow disturbances, decreased roadway capacity, increased collision probability, wasted fuel consumption, and additional emissions.Preventing small perturbations from becoming large traffic oscillations is essential.Lane-changing maneuvers are among the key contributors to traffic shockwave formation and propagation, potentially resulting in disturbances in the target lane.
Car-following behavior has been extensively studied from various aspects, including investigations of car-following behavior at intersections [1] as well as studies of different The review of this article was arranged by Associate Editor Abdulla Hussein Al-Kaff.models and headway settings for car-following behavior [2].Recently, the introduction of artificial intelligence (AI) methods has provided the opportunity to further improve the existing car-following models.For instance, Masmoudi et al. [3] introduced a computer-vision-based algorithm that captures the perception of the leader's behavior by the driver.The introduction of connected and automated vehicles (CAVs) has further shown the potential for accurate vehicle control in a connected driving environment.In particular, many strategies have been proposed to reduce the negative impacts of traffic shockwaves.Among the existing strategies, Adaptive Cruise Control (ACC), Jam Absorption Driving (JAD), and Reinforcement Learning (RL)-based approaches utilize carfollowing behavior to address the shockwave formation and propagation.ACC is known for ensuring safe vehicle interactions and string stability in response to traffic oscillations, and commercial ACC vehicles can significantly reduce driver fatigue.JAD is a driving strategy that controls a specific car to absorb traffic oscillations based on information about approaching traffic jams [4], [5].RL has recently attracted attention for its potential in car-following behavior, with multiple studies proposing frameworks for agents to learn to prevent stop-and-go waves [6], [7].The performance of these approaches is primarily evaluated based on the trajectories created by vehicles in response to shockwaves on time-space diagrams.While many approaches are effective to some degree, their outcomes can vary significantly depending on traffic conditions and lane-changing trajectories.Further research is needed to address this issue.This study proposes a robust optimization-based approach to minimize the negative impact of a lane-changing vehicle on the target lane by designing an optimized car-following profile for the vehicle directly impacted by the maneuver in a connected environment.
The key innovation of this paper is the representation of a vehicle's response to a lane-changing vehicle on a timespace diagram, converting the speed or acceleration profile optimization problem into a trajectory generation problem on a time-space diagram.There are many ways to represent a trajectory, including using different types of curves such as arcs [8], polynomials [9], splines [10], [11], clothoid [12], and Bézier curves [13], [14], [15], [16].These curves are adjusted considering many aspects of a trajectory, such as continuity, smoothness of curvature, minimal jerk, minimal length, and minimal curvature.Other studies, e.g., state lattice [17], [18], have constructed a new search space that complies with constraints.This allows edges on the space, which correspond to feasible motions, to represent a feasible trajectory.While many methods exist for representing trajectories in 2D and 3D planes (mostly for navigating in a real-world environment), relatively less effort has been devoted to trajectory generation on time-space diagrams for longitudinal control (i.e., car-following behavior).This study presents a methodology for defining a trajectory using a Bézier curve on a time-space diagram for car-following behavior.
The Bézier curve, originally used in computer graphics to generate smooth curves, has since been adopted in various fields due to its flexibility in creating diverse profiles.Key concepts associated with its use in trajectory generation include Bézier control points and the Bézier convex hull (as depicted in Fig. 1).Researchers have utilized the Bézier curve to generate trajectories for both lateral and longitudinal positions, such as lane-changing trajectories in 2D planes.Rastelli et al. [13] demonstrated the intuitiveness and low computational cost of using the Bézier curve for manipulating lane-changing trajectories.González et al. [14] generated trajectories by defining control points based on roadways and provided insights on incorporating geometric constraints.Chen et al. [15] proposed an optimization problem for a quartic Bézier curve to generate feasible profiles.Our research aims to define an optimized safe region on a time-space diagram based on desired driving patterns and generate a curve within that region.
The primary contribution of this study is the introduction of a longitudinal trajectory generation methodology based on the quadratic Bézier curve in the time-space diagram.Unlike most approaches that generate both lateral and longitudinal trajectories in 2D planes, our research focuses on creating a trajectory directly in the time-space diagram.We propose a process for determining a safe region in the time-space diagram based on the trajectory of a new leader vehicle (lanechanging vehicle).The optimization produces a collision-free and optimized trajectory that minimizes disturbances caused by the lane-changing vehicle.Specifically, the Bézier control points are first optimized, followed by the generation of a smooth and continuous curve.The resulting trajectory provides reliable speed and acceleration profiles for car-following behavior with reduced speed fluctuations in response to a new leader vehicle, thereby minimizing traffic disturbances.
The remainder of this paper is structured as follows: In Section II, we present the problem statement and introduce preliminary concepts related to the Bézier curve.We then propose a process for generating a trajectory using the quadratic Bézier curve on the time-space diagram.This is followed by an analysis of the trajectory's performance, including its ability to design trajectories based on preferred driving characteristics, in Section III.We also compare our approach with Adaptive Cruise Control (ACC) based on Constant Time Headway (CTH) to evaluate its impact on upstream traffic while ensuring safety.Finally, Section IV concludes the paper with a discussion and outlines directions for future research.

II. THE TRAJECTORY PLANNING ALGORITHM A. PROBLEM STATEMENT
We examine scenarios where a vehicle in the target lane must decelerate to accept a lane-changing vehicle as its new leader.The vehicle immediately behind the merging gap must promptly adapt.We assume connectivity and that the longitudinal trajectory of the lane-changing vehicle can be represented using an m-th order polynomial as shown below, providing flexibility in trajectory description.
where t and α i ∀i = 0, . . ., m. represent time and polynomial coefficients.Based on the pre-planned trajectory described as ( 1), the immediate follower can plan a collision-free trajectory that considers driving comfort and minimizes the impact on upstream traffic.

B. TRAJECTORY GENERATION BASED ON THE BÉZIER CURVE
In this subsection, we present the generation of a trajectory for safe car-following behavior.Based on the driving pattern of the leader vehicle determined by (1), the follower identifies a safe region and optimizes its trajectory on the time-space diagram.Prior to formulating this process, we introduce the properties of Bézier curves.

1) PRELIMINARY IDEAS
The Bézier curve of degree n in Fig. 1 can be described as follows: where u ∈ [0, 1] is the control parameter, and B j = (B x j , B y j ) ∀j = 0, . . ., n. is a set of Bézier control points.
Here, (n + 1) determines the number of discrete control points.These (n + 1) control points define a continuous and smooth Bézier curve according to (2).Additionally, the derivative of the Bézier curve with respect to u can be expressed as follows: 2) A QUADRATIC BÉZIER CURVE ON TIME-SPACE DIAGRAM In the research, we implement the quadratic Bézier curve (i.e., n = 2) on a time-space diagram.The coordinate of B(u) is defined as follows: On the time-space diagram, B x (u) and B y (u) represent time and longitudinal position as functions of the parameter u.We also explore several properties of the quadratic Bézier curve relevant to the trajectory generation, as described by ( 4).
• The Bézier curve does not touch the Bézier convex hull except at the end points, B 0 and B 2 : (1) .
• B 0 B 1 and B 1 B 2 that determine the Bézier convex hull are aligned with tangent lines on the Bézier curve at B 0 and B 2 .In our analysis, we first identify a safe region on the timespace diagram that does not intersect with the lane-changing trajectory.This region is defined as the Bézier convex hull.
Based on the first property, the Bézier curve within the convex hull, as described by (4) at 0 < u < 1, represents a collision-free trajectory.Additionally, based on the second property, the Bézier curve inherently meets the criteria for speed and location at points B 0 and B 2 as specified by the convex hull.To ensure safety and feasibility, we propose a process for obtaining control points that are equivalent to the Bézier convex hull.Subsequently, we introduce a formulation for finding optimal control points based on specific criteria and planning a smooth and continuous curve.
We derive the term for longitudinal acceleration, represented as This term is subsequently used in our formulation.Based on (3), the partial derivatives of the quadratic Bézier curve are as follows: By applying the chain rule and the reciprocal rule of the derivatives, we can derive the acceleration term for the Bézier curve, as shown below.
3) FORMULATION The formulation assumes a connected environment in which a lane-changing trajectory (i.e., (1)) is available to the following vehicle in the target lane.( 1) is both flexible and easily represents lane-changing trajectories.When the lanechanging maneuver is initiated, the following vehicle accepts a new leader and decelerates to adapt to its speed.The trajectory is designed to minimize fluctuations in speed and driving discomfort until the follower can safely maintain its speed.This driving pattern can be realized using a quadratic Bézier curve on the time-space diagram.By determining feasible Bézier control points, the formulation optimizes the Bézier convex hull from which the Bézier curve can be derived.The lane-changing trajectory and the target lane speed, denoted as v target , determine the values of B 0 , B 1 , and B 2 .At B 0 , the follower begins to adapt to the lane-changing vehicle.In the time-space diagram, B 0 is set as the origin: B 0 = (0 (sec), 0 (m)).With respect to B 0 , B 1 and B 2 form a convex hull that represents the area that is safe and accessible for the follower.The maximum value of B x 1 , denoted as B x 1 ,max , is identified to ensure safety.This value is determined by a hypothetical collision that occurs when the follower maintains its speed at v target .In Fig. 2, B 1,max is the intersection of the lane-changing trajectory and the dotted line (i.e., B 0 B 1,max ) with a slope corresponding to v target (i.e., a speed at B 0 ).B 0 B 1,max represents a trajectory where the follower does not reduce its speed and collides with the lane-changing vehicle at B 1,max .The hypothetical collision at B 1,max is defined as follows: By setting B 1 on the line B 0 B 1,max , the resulting curve satisfies the dynamic constraint of the follower's speed at B 0 and ensures safety from a collision with the lane-changing trajectory x(t) up to B x 1 .The range of B 2 is also determined based on B 1 , specifically the minimum value of B x 2 , denoted as B x 2 ,min .This value determines the final speed of the follower, v final .To find this value, a tangent line is drawn from B 1 to the lane-changing trajectory x(t), defined as B 1 B 2,min .Thus, B 2,min is defined as follows: At B 2,min , we know that The angle of the tangent line at B 2,min with respect to time axis, denoted as ∠B 1 B 2,min , represents the final speed of the follower, v final , after adapting to the lane-changing vehicle to avoid collision.By defining B 2 along the tangent line B 1 B 2,min for a given B 1 , the resulting trajectory guarantees collision avoidance until and after the follower reaches and maintains a specific final speed at B 2 (for a specific time period of interests.).To avoid collision at B x 2 ,min , B x 2 only needs to be greater than B x 2 ,min when B 2 is defined on a line aligned with B 1 B 2,min .For instance, in Fig. 2, the quadratic Bézier curve derived from the Bézier convex hull B 0 B 1 B 2,min intersects with the lane-changing trajectory x(t) at B 2,min .Additionally, by setting B 2 on the tangent line, unnecessary front gaps are avoided and v final is maximized.This process automatically minimizes the necessary decrease in speed to ensure safety from the lane-changing trajectory.Ultimately, based on the process of obtaining the range of B 1 and B 2 , ∠B 0 B 1 and ∠B 1 B 2 represent the speeds at B 0 and B 2 on the time-space diagram: v target and v final .The resulting curve not only avoids collision but also considers the speed adjustment from v target to v final .
We propose a formulation that optimizes the Bézier curve, specifically B 1 and B 2 , based on the feasible range of these values as defined in (7) and (8).By incorporating the acceleration term derived in (6), the formulation takes into account the follower's reaction to the lane-changing vehicle.The formulation is as follows: The cost function considers both the total speed reduction from B 0 to B 2 and the initial braking at B 0 .The total speed reduction along the curve is affected by the rapidity of the follower's initial braking.Specifically, the greater the initial braking, the smaller the total speed reduction that needs to be achieved.The trajectory generation goal can be adjusted using parameters α and β to reflect the desired driving pattern.
The constraint on the acceleration at u=1 (i.e., B 2 ), denoted as κ, takes into account scenarios where the follower has to maintain its speed after the curve.A large deceleration at the end of the curve can make it difficult for the follower to maintain its speed.The remaining two constraints limit the values of B x 1 and B x 2 based on their range as shown in Fig. 2. A margin for B x 2 , denoted as B x 2 ,margin , is introduced to ensure that the resulting curve does not intersect with the lane-changing trajectory at B x 2 .A value of B x 2 equal to B x 2 ,min indicates a collision at the end of the curve, B 2 .Any margin value greater than 0 guarantees collision avoidance based on the properties of the Bézier curve and the process of defining the safe region in Fig. 2. A sufficiently large value for B x 2 ,margin max is chosen considering both the constraint κ and the lane-changing duration.In general, a larger value for B x 2 (i.e., a longer curve) facilitates convergence to v final with smaller acceleration.However, the appropriate range depends on the lane-changing duration.The value of B x 2 ,margin max prevents B x 2 from becoming too large and allowing a curve that is too long compared to the lane-changing trajectory.

III. RESULTS
In this section, we assess the performance of the Bézier curve by testing the formulation (9) with varying α and β.We simulated the car-following behavior of both the immediate follower, which is directly behind the lane-changing vehicle in the target lane, and the upstream traffic of the immediate follower (multiple vehicles).We compare the resulting trajectories, created in response to a longitudinal trajectory of the leader, and evaluate their performance by analyzing the driving patterns and their impact on traffic flow.Additionally, we conduct a benchmark test of our approach against a well-established ACC-based method.

A. REAL-WORLD TRAJECTORY DATA
We validate our trajectory generation approach by testing it against actual lane-changing trajectory data.The University of Illinois Urbana-Champaign conducted video recordings of vehicles on I-90/I-94 in Chicago, IL, USA.The footage was captured using a RED camera at 30 frames per second at 8K resolution from the bird's-eye view via helicopter.To better observe vehicle interactions, the data collection was executed during the afternoon peak period when lane-changing maneuvers can significantly impact the car-following behavior of surrounding vehicles (due to small time headways between vehicles).Using a sequence of aerial images from the video, we extracted trajectories and lane IDs of vehicles on a road section of interest.From the extracted trajectories, a rapidly executed lane-changing trajectory was selected for testing the performance of our approach.Fig. 3 depicts the trajectory data in a time-space diagram.

B. IMPLEMENTATION OF THE FORMULATION
To formulate the trajectory planning, we used the polynomial curve-fitting in MATLAB on the trajectory data depicted in Fig. 3.The resulting polynomial for the time interval [0,10] (sec) is given by: +0.2811 t 4 − 1.3120 t 3 + 30 t + 9, for 0 ≤ t ≤ 10 (sec).(10) The start and the end of the lane-changing maneuver were estimated based on the speed change of the vehicle before and after reaching constant speeds during the maneuver.In Fig. 3, the goodness of the polynomial fit is evaluated using the sum of squared error (SSE) and root mean squared error (RMSE).The residuals along the polynomial are also negligible, with a maximum magnitude of around 0.1 (m).Therefore, the formulation (9) was applied to the polynomial (10).

TABLE 1. Tested values in the formulation.
In line with our research goal, we simulated scenarios where the follower in the target lane must react to the lanechanging vehicle to avoid collisions.Note that we assumed that complex scenarios such as any errors and road geometry do not impact the longitudinal behavior of the follower in our study and that only the lane-changing behavior impacts the follower's response.Following the initiation of the actual lane-changing maneuver at t = 0 (sec), the follower at 0 (m) was simulated to accept the lane-changing vehicle as its new leader and decelerate for its safety.Table 1 lists the parameter values used in the formulation to test its ability to generate feasible curves.We used a negligible value for κ as the allowable deceleration at the end of the curve and small values for B x 2 ,margin to test the concept of the safety at B 2 .For B x 2 ,margin max , we considered the time duration of the trajectory data and selected a value that was sufficient to enable feasible trajectory generation without imposing restrictions.The resulting trajectory is evaluated in terms of safety, speed, and acceleration.Fig. 4 illustrates the key concepts for trajectory generation, including Bézier control points, Bézier convex hull, and Bézier curve.For the same lane-changing trajectory (10), different values of α and β (as shown in Table 1) were used in the formulation (9), resulting in adjusted curves for the immediate follower.Black dotted lines represent the remaining followers.According to the control point generation process depicted in Fig. 2, all the curves are collision-free.The Bézier convex hull touches the lane-changing trajectory at B 2,min , however B x 2 comes after B 2,min , ensuring the safety.Moreover, by obtaining the Bézier convex hull first for a given lane-changing trajectory in a connected environment, it is possible to create a trajectory that maximizes the use of the front gap on the timespace diagram.Fig. 4 confirms that our formulation outputs an optimized trajectory that significantly reduces the gap to the lane-changing vehicle based on mathematical concepts, minimizing deterioration of driving comfort from efforts to maintain a certain front gap under uncertainty.

C. BENCHMARK TEST
This section presents an analysis of the findings from a benchmark test.For the comparison, we simulated carfollowing behavior according to ACC based on a CTH policy investigated by Swaroop et al. [19], [20]: where λ and h are a control parameter and desired time headway (sec). is the following distance, meaning = x − x f where x and x f indicate the position of the leader (i.e., (10)) and the follower with ACC.The immediate follower responds to the lane-changing trajectory (10) according to ACC (i.e., (11)).The resulting trajectory is compared to trajectories in Fig. 4 (i.e., B y (u) based on the formulation ( 9)).For all the remaining followers (blackdotted lines in Fig. 4), we implemented the same ACC model to investigate later how they are impacted by different trajectories.Here, ACC was tuned such that it is less responsive (λ = 0.01 and h = 1.5(sec)), creating a small front gap only sufficient enough to avoid a collision.
The test makes several assumptions.After following a Bézier curve-based trajectory, the immediate follower maintains v final .This behavior continues until ACC is initiated because collision-free is guaranteed.The same ACC control law (λ = 0.1 and h = 1.5(sec)) applies to the speed recovery part (i.e., after B 2 ) of the trajectories in Fig. 4.However, this begins only when ACC-based profiles (11) generate acceleration bigger than zero.

1) SPEED AND ACCELERATION PROFILES
In Fig. 5, we compare the speed and the acceleration profiles of the curves in Fig. 4 and ACC-based profiles (11).The figure shows that Bézier curve-based trajectory generates continuous and smooth reference profiles that are feasible to keep track of regardless of its leader's trajectory (10) unlike ACC based on a CTH which fluctuates significantly.From a driving pattern perspective, the overall acceleration according to the Bézier curve is less impacted by the lane-changing vehicle.By implementing different parameter values, α and β, the formulation outputs different profiles in terms of the total speed reduction and the initial acceleration.Smaller α contributes to a smaller initial acceleration for the sudden appearance of the lane-changing vehicle.This improves the driving comfort of the follower.However, this comes at the price of a bigger speed reduction, which can impact the upstream traffic of the follower.On the contrary, the follower with bigger α absorbs the impact by applying a relatively large initial deceleration and finishing a small amount of speed adjustment early, which can reduce the shockwave to vehicles upstream.

2) SHOCKWAVE VISUALIZATION ON TIME-SPACE DIAGRAM: ACC VS BÉZIER CURVE
This section focuses on the impact of the response to the lane-changing trajectory.Fig. 6 visualizes the traffic shockwave created on the follower and the traffic upstream (λ = 0.1 and h = 1.5(sec) in ( 11)) on the time-space diagram.The color code represents traffic speed, which is used for the identification of traffic shockwave creation and dissipation.The result proves that the trajectory that fully takes advantage of the front gap based on the Bézier convex hull has an advantage over ACC; Bézier curves create less intense shockwaves in response to the lane-changing vehicle.In addition, we can observe that while minimizing the fluctuation of reference profiles in Fig. 5, this formulation also reduces control efforts (i.e., acceleration and deceleration) that occur under ACC implementation and impact the upstream traffic flow.Moreover, the smallest speed reduction based on α = 5 reduces the impact most because speed adjustment finishes early according to rapid deceleration at the beginning in Fig. 5.
We conclude that the formulation (9) can be adopted according to the desired driving pattern for car-following behavior and its impact on traffic.Specifically, the formulation balances two advantages: driving comfort from smaller initial acceleration and smaller traffic shockwave.

IV. CONCLUSION
This study presents an optimized car-following trajectory generation approach in response to a lane-changing vehicle.When the lane-changing vehicle joins the merging gap, the immediate follower may need to react rapidly to create an additional gap.Assuming the availability of the lane-changing trajectory, we suggest a Bézier curve-based trajectory in the time-space diagram.The presented approach successfully adjusts the trajectory according to important factors in responding to the lane-changing vehicle (including ensuring safety and comfort).This approach assumes that a pre-defined trajectory of a leader is available, which is feasible in a connected driving environment.There are no other particular requirements for its implementation.Although the algorithm is specified for a lane-changing scenario, it can potentially be utilized for any type of car-following scenario where a follower tries to avoid rear-end collision with its leader.
Further enhancements can be implemented to improve usability in situations where the pre-determined trajectory is not available.Moreover, the formulation can be refined to account for the controller's capabilities, such as the ability to produce the required jerk.Further analysis can be performed by comparing this approach to various methods known for their reliable car-following behavior or traffic jam dissipation ability, such as the Intelligent Driver Model, JAD, and other RL-based methods.The potential benefits of the algorithm can also be better understood through simulations that consider multiple lane-changing maneuvers and different penetration rates of vehicles.

FIGURE 2 .
FIGURE 2. Safe region defined by Bézier control points on the time-space diagram.

FIGURE 3 .
FIGURE 3. Lane-changing trajectory data and the 8th order polynomial fit with residuals (small figure).

FIGURE 4 .
FIGURE 4. Lane-changing trajectory (thick black line) and the upstream traffic on the time-space diagram: Bézier curve (red dotted line) and other followers (black dotted line).

FIGURE 6 .
FIGURE 6. Shockwave visualized using a color code that represents the speed of traffic: ACC vs. Bézier Curves in Fig. 4.