# Traffic Light Optimization Based on Modified Webster Function

Authors: Huizhen Zhang; Hongtao Yuan; Youqing Chen; Wenlong Yu; Cheng Wang; Jing Wang; Yueer Gao
Journal: Journal of Advanced Transportation
 (2021)

---

## Abstract

Intersection traffic lights are a basic means of ensuring the normal operation of road traffic. A good signal timing scheme is essential for improving traffic congestion. To obtain the signal timing scheme of the designated intersection, the method proposed in this article is based on a modified Webster function. The method uses the signal cycle and proportion of green light duration as independent variables to establish the corresponding intersection vehicle delay function. This function is converted from a multiobjective optimization to a single-objective optimization formulation; a modified genetic algorithm is then used to find the optimal solution to this function. The experimental results show that the timing scheme optimized by the improved genetic algorithm can reduce the intersection delay by nearly 15.64%. The proposed traffic signal timing based on the modified Webster function will be of value as an important reference for the optimization of traffic lights at urban intersections.


---

## Body

## 1. Introduction

The increase in the number of cars on urban roads has made traffic congestion more serious, resulting in a national economic loss of over 100 million RMB in China [1]. Road intersections are an important part of urban roads, and relieving congestion problems is twice as effective as the targeted development of urban traffic [2, 3]. Existing research shows that optimizing the signal timing of intersections can effectively alleviate traffic jams at intersections [4]. When the traffic flow reaches a certain level, by adjusting the timing of the optimized signal, intertwined and conflicting traffic flows can be separated in time to enable vehicles to travel smoothly through the intersection, thereby reducing or avoiding intersection congestion [5, 6]. The probability of a traffic accident is then minimized.There are many studies on the optimization of traffic light timing. For instance, Zhanghui et al. [7] and Yan et al. [8] reviewed the signal intersection delay model and discussed the delay calculation model in intersection design. These papers give some guidance regarding existing signal light problems in China. Zhaoyu et al. [9] fit the delay model in the Highway Capacity Manual 2000 (HCM2000) to measured data to obtain a new intersection delay function. The experimental results show that the fitting performance is better, and the relative error is reduced from 45% to 18.5%. Liujia [10] used the vehicle delay, number of vehicle stops, and road capacity as the optimization target and constructed a multiobjective optimization function in which the weight coefficient is determined via fuzzy control. The experimental results show that the road capacity after optimization was improved by 9.43%. Moreover, the number of vehicle delays and time needed for parking are significantly reduced.Many schemes exist for solving an objective function to obtain an optimal value. The main methods include directly solving the objective optimization function to obtain the optimal value and simulation. The method for solving the optimal value is as follows: Šliupas [11] used linear regression and multiple regression to analyze the average daily traffic volume of Lithuanian highways and found that the change is exponential. This approach obtains good experimental results when compared with the forecast results of traffic experts. Wanshan and Fan [12] constructed a two-layer planning model with an upper layer to minimize passenger economic losses and a lower layer to minimize exhaust emissions and used a traditional genetic algorithm to optimize it. The experimental results show that passenger economic losses and vehicle exhaust emissions can be reduced by about 30%. Wangding and Limao [13] proposed a heuristic control strategy for traffic lights based on real-time traffic flow at an intersection. In this approach, a mathematical model for the distribution over time of single-direction green lights at the intersection was established, and a state-space model based on discrete systems was adopted. The evolutionary algorithm obtains the best signal timing results. Experiments show that his proposed model is more effective than the original fixed timing. Wang et al. [14] used the road capacity and average delay time as the optimization goals and constructed a target optimization function that was solved using a traditional genetic algorithm. The experimental results show that the scheme relieves traffic congestion pressure. Liaoshi and Wangyun [15] optimized the delay, number of stops, and capacity in a multiobjective optimization function. The weight value was empirically set and the solution method was a traditional genetic algorithm. The experimental results show that the method can reduce the delay and number of stops of the vehicle as well as improve the traffic capacity. The service level of an optimized intersection could be upgraded from D to B, which substantially alleviates the traffic congestion at urban signalized intersections.Traffic simulations to confirm the optimization of signal light timing also exist in the literature. Zhou [16] used the VISSIM simulation software to build a rule-based signal light timing optimization method and compared it with static traffic timing. Experimental results based on actual data show that evaluation methods such as travel time, delay, and queue length yield good optimization results. Using the traditional Webster delay function, Liuyi et al. [17] constructed a traffic simulation model and evaluated it using a VISSIM simulation that includes delay, average parking time, queue length, and vehicle parking times. The simulation results show that the delay of the optimized intersection is reduced by 22.3% to 21.29 s, the parking time is reduced by 24.2%, and the average queue length and average parking time are also improved.To calculate the signal light timing according to the actual road conditions, the following approach is taken in this study: (1) to obtain a target optimization model with high precision, the traditional Webster function is fit to the point sample function and (2) a modified genetic algorithm is used to solve for the optimal value of the function with constraints, and constraints of the genetic algorithm are used to initialize the chromosome parent to realize the optimal value solving the process of the function. The change in the total delay at the intersection before and after optimization is compared to evaluate the performance of the algorithm.


## 2. Intersection Vehicle Delay Model

Traffic status can be evaluated in an objective function using metrics such as vehicle speed, traffic flow, saturation, delay, and vehicle carbon dioxide emissions. The objective function can then be minimized to achieve the goal of optimizing the intersection. In 1958, Webster published the Webster delay acquisition model [3], which is expressed as follows:(1)d=C1−λn221−xn⋅λn+xn22qn1−xn−0.65Cqn21/3xn2+5λn.The parameters of equation (1) are described in Table 1.Table 1
Required parameters of the Webster function.
ParameterParameter meaningCSignal cycle (S)λnPhase green ratioqnLane traffic (Veh)xnLane saturationEquation (1) is known as the traditional Webster delay model, but there are some differences between the theoretical delay model and the actual road intersection delay mechanisms. Therefore, to construct a new Webster delay function with high accuracy, the approach in this study fits the theoretical delay to the actual delay and uses it as the objective optimization function.The vehicle delay at an intersection generated by actual data is obtained using the point sample method. After obtaining the new intersection vehicle delay function, the actual traffic volume, saturation, and period length are used as independent variables, and the total delay of the intersection becomes the dependent variable and the target of the optimization function. The goal is to minimize the total delay of the intersection to obtain the optimal signal timing scheme. The formulation of the function form and its constraints are as follows:(2)foldCt+Δt,λ1,λ2,…,λk=Ct+Δt1−λn221−xn⋅λn+xn22qn1−xn−0.65Ct+Δtqn21/3xn2+5λn,fnewCt+Δt,λ1,λ2,…,λk=FfoldCt+Δt,λ1,λ2,…,λk,minGCt+Δt,λ1,λ2,…,λk=∑n=1kfnewCt+Δt,λ1,λ2,…,λk∗qns.t.Ct+Δt=∑n=1kCt+Δt⋅λn+k⋅ty+k⋅th,Ct+Δt⋅λn∈Z+,1≤n≤k,c≤Ct+Δt⋅λn≤d,1≤n≤k,a≤Ct+Δt≤b,Ct+Δt∈Z+,ty=2,th=3.The meanings of the constraints in equation (2) are as follows: function Fx represents the fitting function generated for calculating the actual data, where x is the average vehicle delay calculated by the traditional Webster delay function. Ct,t+Δt is defined as the duration of the signal cycle in time period t,t+Δt. The signal period is the sum of the green light duration and the yellow flashing light duration of each phase. In this study, the yellow flashing light duration ty was fixed to 2 s, and the full red light duration th was fixed to 3 s. However, if the signal period of the optimal solution is too large or too small, it is not a suitable solution for the actual situation. Therefore, the period length limit a,b is added a priori based on expert experience, where a represents the minimum signal period and b represents the longest period of the signal light cycle. Similarly, the range of the green light duration in equation (2) is set to c,d, where c represents the minimum duration of the green light phase of the signal and d represents the maximum duration of the green light phase of the signal. Because it takes time for a vehicle to pass through an intersection, from the perspective of fairness, there should be a maximum value for the green light duration, that is, a minimum value c and maximum value d of the green light duration should be set. As a result, there is not an extremely long wait for the other phase traffic.In addition, there are four directions, east, south, west, and north, in the roads around the actual intersection. In each direction, there are three options: left, straight, and right, so there are 12 directions at an intersection. In an objective optimization function for an intersection, the delay in 12 directions must be reduced, that is, it is a multiobjective optimization function. However, from an engineering perspective, to improve the efficiency of the solution, the multiobjective optimization function must be transformed into a single-objective optimization function. In response to this problem, the approach in this paper multiplies the average delay of the vehicles in each directionfnewCt,t+Δt,λ1,λ2,…,λk by the traffic flow in each direction to obtain the total delay of vehicles in each direction. It then sums the total delay of traffic in each direction to obtain the total delay of vehicles at the intersection GCt,t+Δt,λ1,λ2,…,λk. This is then solved as a single-objective optimization function.


## 3. Optimization Algorithm Model

The main heuristic optimization algorithms include the genetic algorithm, simulated annealing, hill climbing algorithm, particle swarm optimization, and ant colony optimization. The simulated annealing and particle swarm optimization algorithms have poor global search ability and are easily affected by the values of the parameters. The hill climbing algorithm deals with multiconstraint large-scale problems. This solution is too slow to converge, so the optimization algorithm in this paper is based on a genetic algorithm. However, a conventional genetic algorithm cannot solve an optimization problem with multiple constraints, and its convergence rate is also slow. Hence, we propose a simple modification can enable it to handle multiple constraints; we add a penalty coefficient and processes to delete and regenerate the individuals in the population that do not satisfy the constraint conditions. This is an easier way to obtain the globally optimal solution.Because intersection traffic is cyclical in nature, the proposed approach uses the traffic flow data of the same period of time to control the intersection traffic lights and seek the best traffic timing method. The flow of the genetic algorithm is shown in Figure1.Figure 1
Modified genetic algorithm flowchart.As shown in Figure1, there are seven main steps in the optimization solution used in this paper: the initialization of the individuals in its population, chromosome coding, selection strategy, crossover strategy, mutation strategy, fitness penalization, and individual regeneration.The overall model treats the intersection traffic signal data as constants, the intersection signal cycle and the green signal ratio are the input, and the total vehicle delay at the intersection is the output, and the following steps are performed: (1) The initial individuals in the population and various signal timing schemes are randomly generated. (2) A new individual is generated according to fixed selection, crossover, and mutation probabilities. (3) Because the signal period includes the green light duration, the yellow light duration, and the full red duration constraints, some individuals do not meet the constraints, and their fitness is set to negative, indicating that these individuals are not desirable. The number of individuals with negative fitness in the current generation is counted, and then a new set of individuals is added to the current generation to ensure that its population remains unchanged. (4) Steps 2 and 3 are repeated for the specified number of iterations until convergence and the optimal signal timing scheme is obtained.


## 4. Case Verification

The signal light at the four-way intersection of Fengze Road and Tianan South Road in Fengze District, Quanzhou City, Fujian Province, is used as an example to illustrate the method. Each approach to the intersection has multiple lanes that include lanes for turning left, turning right, and going straight. The intersection signal cycle has a period of 141 s, a yellow flashing light duration of 2 s, and a full red light duration of 3 s. Moreover, the analyzed intersection is isolated, and the traffic data follow a Poisson distribution, that is, the vehicle arrivals are random, so a Webster function may be used. A plan of the intersection is shown in Figure2. The specific flow rate and corresponding road saturation over a certain period of time for the evaluation of the signal timing scheme are given in Table 2.Figure 2
Schematic diagram of the Fengze-Tianan intersection.Table 2
Intersection traffic flow and saturation table.
From south to northFrom east to westFrom north to southFrom west to eastDirectionTurn leftStraightTurn rightTurn leftStraightTurn rightTurn leftStraightTurn rightTurn leftStraightTurn rightGreen letter ratio0.2285710.2285710.4071430.1785710.2285710.4071430.2285710.2285710.4071430.1785710.2285710.407143Maximum traffic180018001800180018001800180018001800180018001800Traffic306412162130616188206396188164582214Saturation0.170.2288890.090.0722220.3422220.1044440.1144440.220.1044440.0911110.3233330.118889The phase change of the intersection signal light consists of four phases, and the change from the first phase to the fourth phase is as follows (Figure3):(i)
First phase: traffic can go straight north to south or turn right, turn south to north, and turn right east to west for 32 s(ii)
Second phase: traffic can go straight from south to north or turn right, turn north to south, and turn right west to east for 32 s(iii)
Third phase: traffic can go straight east to west and go straight west to east for 32 s(iv)
Fourth phase: traffic can turn right from south to north, turn left from east to west or turn right, turn right from north to south, and turn left from west to east or turn right for 25 sFigure 3
Intersection phase diagram.


### 4.1. Intersection Vehicle Delay Model Construction

Video data from 10:00 to 11:00 am on April 22, 2019, at the example intersection was used to evaluate the approach. Here, the average delay of the theoretical intersection was calculated using the traditional Webster algorithm. The average vehicle delay is calculated using the point sample method with a data interval of 5 min. In the data processing, 70% of the data is used for training and 30% of the data is used for testing. A comparison of the delay data is shown in Figure4.Figure 4
Comparison of average vehicle delay data.The comparison in Figure4 shows that the actual vehicle delay and Webster-based vehicle delay are basically linear, but the real vehicle delay and Webster-based vehicle delay tend to cross over. In this case, we believe that the changes in the point sample data are caused by the small amount of data containing a few corrupted data. Moreover, the point samples were calculated by manually counting the vehicles in the video data. This will cause the data to contain noise and lead to a certain level of error in the real vehicle delay data. The fitting method uses a linear regression model that has been modified. A statistical linear regression model yields an R2 of around 0.4071. This value is actually relatively low, but this method can still reduce the relative error of the Webster delay from 32.17% to 20.24%. The average vehicle delay function at the example intersection is used as the optimization objective function. The objective function is as follows:(3)foldCt+Δt,λ1,λ2,λ3,λ4=Ct+Δt1−λn221−xn⋅λn+xn22qn1−xn−0.65Ct+Δtqn21/3xn2+5λn,fnewCt+Δt,λ1,λ2,λ3,λ4=FfoldCt+Δt,λ1,λ2,λ3,λ4,FX=0.7805X+10.2278,minGCt+Δt,λ1,λ2,λ3,λ4=∑n=14fnewCt+Δt,λ1,λ2,λ3,λ4∗qn,s.t.Ct+Δt=∑n=14Ct+Δt⋅λn+4⋅ty+4⋅th,Ct+Δt⋅λn∈Z+,1≤n≤4,15≤Ct+Δt⋅λn≤60,1≤n≤4,120≤Ct+Δt≤150,Ct+Δt∈Z+,ty=2,th=3.where Fx represents the fitting function.To evaluate the fitting results, the vehicle flow at the same time one week later is used as the model test set. The error between the actual vehicle delay obtained by the point sample method and the proposed Webster vehicle delay function output is found to be approximately 20.24%, and the relative error between the actual vehicle delay obtained from the point sample method and the output of the traditional Webster vehicle delay function is about 32.17%. As a result, the error of the traditional Webster delay function was reduced by 12% by fitting, indicating that this delay function is robust and has certain flexibility.


### 4.2. Solution Model Construction and Performance Comparison

The solution model was solved by the modified genetic algorithm. As equation (3) shows, the target optimization function contains some constraints. After the genetic algorithm randomly selects, performs crossover, and mutates individuals in the population, some individuals that do not satisfy the constraints will be generated. To solve this problem, the proposed method eliminates these individuals and supplements the population so that the total number of individuals in each generation remains unchanged.The parameters were set to 60 individuals and 80 iterations. The crossover rate was 0.9 and the mutation rate was 0.1; the signal period and proportion of the green light duration are the outputs. In addition, we analyzed the influence of different individual sizes, different crossover rates, and different mutation rates on the algorithm’s convergence. The aim was to select the genetic algorithm parameters to avoid low algorithm efficiency due to human factors. The algorithm convergence process is shown in Figure5.Figure 5
Algorithm convergence results. (a) Algorithm convergence with different individual sizes. (b) Algorithm convergence with different crossover rates. (c) Algorithm convergence with different mutation rates.
(a)(b)(c)The results in Figure5 show that the convergence speed of the algorithm is different for different individual sizes, crossover rates, and mutation rates. The experimental results further show that the algorithm obtains the best convergence result when the individual size is 60, the crossover rate is 0.9, and the mutation rate is 0.1.An analysis of Figure5 reveals that the total delay of the intersection begins to converge from the initial value and tends to stabilize after several generations. In Figure 6, it is found that, after the optimization, there is a 15.64% reduction in the delay in each direction relative to the delays in the original intersection, which proves that the algorithm is indeed effective.Figure 6
Comparison of delay optimization.


## 4.1. Intersection Vehicle Delay Model Construction

Video data from 10:00 to 11:00 am on April 22, 2019, at the example intersection was used to evaluate the approach. Here, the average delay of the theoretical intersection was calculated using the traditional Webster algorithm. The average vehicle delay is calculated using the point sample method with a data interval of 5 min. In the data processing, 70% of the data is used for training and 30% of the data is used for testing. A comparison of the delay data is shown in Figure4.Figure 4
Comparison of average vehicle delay data.The comparison in Figure4 shows that the actual vehicle delay and Webster-based vehicle delay are basically linear, but the real vehicle delay and Webster-based vehicle delay tend to cross over. In this case, we believe that the changes in the point sample data are caused by the small amount of data containing a few corrupted data. Moreover, the point samples were calculated by manually counting the vehicles in the video data. This will cause the data to contain noise and lead to a certain level of error in the real vehicle delay data. The fitting method uses a linear regression model that has been modified. A statistical linear regression model yields an R2 of around 0.4071. This value is actually relatively low, but this method can still reduce the relative error of the Webster delay from 32.17% to 20.24%. The average vehicle delay function at the example intersection is used as the optimization objective function. The objective function is as follows:(3)foldCt+Δt,λ1,λ2,λ3,λ4=Ct+Δt1−λn221−xn⋅λn+xn22qn1−xn−0.65Ct+Δtqn21/3xn2+5λn,fnewCt+Δt,λ1,λ2,λ3,λ4=FfoldCt+Δt,λ1,λ2,λ3,λ4,FX=0.7805X+10.2278,minGCt+Δt,λ1,λ2,λ3,λ4=∑n=14fnewCt+Δt,λ1,λ2,λ3,λ4∗qn,s.t.Ct+Δt=∑n=14Ct+Δt⋅λn+4⋅ty+4⋅th,Ct+Δt⋅λn∈Z+,1≤n≤4,15≤Ct+Δt⋅λn≤60,1≤n≤4,120≤Ct+Δt≤150,Ct+Δt∈Z+,ty=2,th=3.where Fx represents the fitting function.To evaluate the fitting results, the vehicle flow at the same time one week later is used as the model test set. The error between the actual vehicle delay obtained by the point sample method and the proposed Webster vehicle delay function output is found to be approximately 20.24%, and the relative error between the actual vehicle delay obtained from the point sample method and the output of the traditional Webster vehicle delay function is about 32.17%. As a result, the error of the traditional Webster delay function was reduced by 12% by fitting, indicating that this delay function is robust and has certain flexibility.


## 4.2. Solution Model Construction and Performance Comparison

The solution model was solved by the modified genetic algorithm. As equation (3) shows, the target optimization function contains some constraints. After the genetic algorithm randomly selects, performs crossover, and mutates individuals in the population, some individuals that do not satisfy the constraints will be generated. To solve this problem, the proposed method eliminates these individuals and supplements the population so that the total number of individuals in each generation remains unchanged.The parameters were set to 60 individuals and 80 iterations. The crossover rate was 0.9 and the mutation rate was 0.1; the signal period and proportion of the green light duration are the outputs. In addition, we analyzed the influence of different individual sizes, different crossover rates, and different mutation rates on the algorithm’s convergence. The aim was to select the genetic algorithm parameters to avoid low algorithm efficiency due to human factors. The algorithm convergence process is shown in Figure5.Figure 5
Algorithm convergence results. (a) Algorithm convergence with different individual sizes. (b) Algorithm convergence with different crossover rates. (c) Algorithm convergence with different mutation rates.
(a)(b)(c)The results in Figure5 show that the convergence speed of the algorithm is different for different individual sizes, crossover rates, and mutation rates. The experimental results further show that the algorithm obtains the best convergence result when the individual size is 60, the crossover rate is 0.9, and the mutation rate is 0.1.An analysis of Figure5 reveals that the total delay of the intersection begins to converge from the initial value and tends to stabilize after several generations. In Figure 6, it is found that, after the optimization, there is a 15.64% reduction in the delay in each direction relative to the delays in the original intersection, which proves that the algorithm is indeed effective.Figure 6
Comparison of delay optimization.


## 5. Conclusion

Most domestic urban signal timing schemes have now begun to shift from traditional fixed timing control to dynamic control. The modified Webster-based function method proposed in this paper can substantially improve the accuracy of the vehicle delay function at intersections and help calculate the corresponding signal timing scheme through a modified genetic algorithms to reduce the delay at intersections. The experimental results show that the proposed method can obtain good experimental results. In addition, we note that the data in the paper were manually obtained by video data. If computer vision and deep learning are combined to avoid introducing noise into the data, the proposed method will have the potential for a broad range of applications.



---

*Source: 3328202-2021-08-04.xml*