Optimizing Traffic Signals in Smart Cities Based on Genetic Algorithm

Current traffic signals in Jordan suffer from severe congestion due to many factors, such as the considerable increase in the number of vehicles and the use of fixed timers, which still control existing traffic signals. This condition affects travel demand on the streets of Jordan. This study aims to improve an intelligent road traffic management system (IRTMS) derived from the human community-based genetic algorithm (HCBGA) to mitigate traffic signal congestion in Amman, Jordan’s capital city. The parameters considered for IRTMS are total time and waiting time, and fixed timers are still used for control. By contrast, the enhanced system, called enhanced-IRTMS (E-IRTMS), considers additional important parameters, namely, the speed performance index (SPI), speed reduction index (SRI), road congestion index (Ri), and congestion period, to enhance IRTMS decision. A significant reduction in congestion period was measured using E-IRTMS, improving by 13% compared with that measured using IRTMS. Meanwhile, the IRTMS result surpasses that of the current traffic signal system by approximately 83%. This finding demonstrates that the E-IRTMS based on HCBGA and with unfixed timers achieves shorter congestion period in terms of SPI, SRI, and Ri compared with IRTMS.


Introduction
The concept of a smart city started in the early 1990s with the introduction of emerging technologies [1], such as mobile phones, wireless networks, the Global Positioning System (GPS), and the Internet of things [2]. These technologies are also examples of the core principles of an intelligent city. They were introduced to companies and government agencies to improve quality of life and ensure the effective mobility of people and goods.
traffic incidents [24]. Fixed timers are still used in existing traffic signal networks in Jordan. In particular, traffic problems and congestions are worsening on the streets of its capital, Amman. Drivers can get stuck in traffic for a long period [25]. As this problem worsens, serious measures must be implemented to address the underlying issues. The following parameters are considered in the current study.

Speed
The speed reduction index (SRI), which refers to the relative speed ratio, varies between congested and free-flow conditions. It is given by Eq. (1) [14].
SRI denotes the proportion of speed decreases from free flow conditions. In general, free-flow speed refers to the average speed during the off-peak period.
The SRI ratio is multiplied by 10 to keep the SRI value within the range of 0 to 10. Congestion occurs when the index value exceeds 4 to 5. Values less than 4 indicate a non-congested condition. This measure represents the ratio of decline in speed from free-flow conditions. It provides an approach for comparing congestion amount in different transportation facilities. This process is achieved using a continuous scale to differentiate among different congestion levels. Under peak conditions, an index can be applied to entire roads, entire metropolitan areas, or individual highway segments.
The speed performance index (SPI) assesses a smart city route and measures traffic conditions in intelligent cities. It is the ratio of vehicle speed to the maximum allowable speed as indicated in Eq. (2) [26].
where SPI indicates speed, v avg specifies the average speed of a journey, and v max indicates the maximum allowable speed of a lane.
To quantify the degree of traffic congestion on the basis of this indicator, the level of traffic congestion can be defined as SPI values ranging from 0 to 100 [14] with three threshold values (25,50, and 75). The criteria for urban traffic congestion classification are listed in Tab. 1.

Road Congestion Indices
Congestion indices have two categories: the road congestion index and the congestion index of a highway segment (R i ). Hnaif et al. [16] considered the congestion index for a road segment (R i ).
Traffic wherein SPI is above 50 is classified under non-congestion state. The value of R i ranges from 0 to 1. The smaller the value of R i , the more congested a road segment [26].  [27]. Speeds below 90% of the weekday free-flow rate are considered congested for a weekday (06:00 to 22:00). For example, when free-flow speed is 60 mph and most vehicles drive at an average of 54 mph, then the state is considered congested [24].

Related Work
This section introduces recent studies on solving the traffic signal congestion problem.
The key objective of a traffic monitoring signal is the transition from competing sources of traffic with an acceptable output [14]. Various experiments have presented different results in reducing traffic signal congestion.
In Rao et al. [28], the authors compared the performance metrics with the main case and selected a simulation approach to test congestion mitigation policies and improvements. Five mitigation scenarios, namely, base cases, traffic control, high road building, bus transportation, and dedicated bus lanes, were developed. To measure these scenarios, traffic levels, average speed, network efficiency of individual connections, delayed travel, congestion index changes, and travel time were included in the selected performance metrics. The results suggested that traffic management option works better than other solutions.
In Gao et al. [29], the authors proposed a substantial reinforcement algorithm. This algorithm extracts all necessary characteristics from raw real-time traffic data (machine-created features) and identifies the ideal policy for adjustable signal control. The authors retrieved knowledge and targeted network stability mechanisms. The simulation result indicated that the longest queue algorithm and the fixed time control algorithm were reduced by up to 47% and 86%, respectively, compared with two common algorithms.
A survey on congestion initiatives in the field of road transport was conducted on a sustainable and resilient transport system [7]. Historical data sets for the daily and weekly traffic of current indicators were compared by implementing them on daily and weekly bases. The findings of this previous study indicated major improvements in congestion conditions and a related trend in congestion. The authors offered a positive insight into creating a sustainable and resilient traffic management system. In addition, they proposed an effective model for deepening the learning of traffic signal control. The approach was evaluated on large-scale real traffic data from sensors.
Hnaif et al. [15] introduced a smart road traffic management framework, called IRTMS, which was derived from the human community-based genetic algorithm (HCBGA). Total time and waiting time were shorter in IRTMS compared with those in the existing traffic system in Jordan.
A smart traffic light management system (TLBH) and a decision support system based on the Hamiltonian routing technique were developed in Hnaif et al. [16]. This previous research developed a system that minimizes waiting time for vehicle traffic signals, which, in turn, can reduce vehicle congestion.
Several scenarios were established. Three of these scenarios were implemented on MATLAB programming language and applied to the framework on the basis of particular rules. The simulation results showed substantive changes in TLBH relative to the existing traffic system on the basis of sufficient testing scenarios. Compared with the current traffic structure, the proposed methodology achieves minimum total time and waiting time in all the scenarios [25].
In Hanbali et al. [27], examples of current practices were presented to provide a consistent system of traffic signal installations in Jordan. Traffic signals and their indications should obtain the obedience of most, if not all of the drivers, as one of the results of implementing this uniform system. That is, drivers' compliance with traffic signal controls is achieved; moreover, the uniform system will provide a solid basis for the sound and effective enforcement of traffic signal monitoring.
A simple system was proposed for Jordan to count the number of vehicles on each traffic signal intersection by using an infrared sensor and to consider the length of vehicles. The proposed system aims to provide statistics and obtain the number of vehicles and their directions on a traffic signal [30].

Proposed Methodology
Current traffic signals in Jordan are insufficient for dealing with the issue of congestion at intersections because fixed timers are still used. Moreover, a road is divided into three lanes. This condition is inflexible, and it triggers traffic problems when it is combined with the use of fixed timers. Therefore, enhanced-IRTMS (E-IRTMS), is proposed in the current study to deal with the congestion of traffic signals in Amman, Jordan.
Various parameters have been used to calculate congestion level in accordance with the result requirements. E-IRTMS is improved by considering three major parameters: SRI, SPI, and R i . The steps of E-IRTMS are described as follows.
A sensor collects the following parameters at each intersection: intersection ID, number of vehicles, congestion time, average speed, and the time of each vehicle observed. The collected data for a traffic signal are forwarded to HCBGA, which accepts the input and measures SRI, SPI, and R i .
Subsequently, the population's chromosome initialization will begin. Each chromosome comprises an intersection ID, a vehicle number, SRI, SPI, R i , and a measured individual fitness value.
Then, HCBGA changes a traffic signal between intersections from red to green on the basis of the previous criteria. If SRI > 6, SPI < 50, or R i > 0, then a traffic signal intersection remains congested. Therefore, the decision is to keep this crossroad green until one of the previous constraints varies.

Test Data Sets
As previously stated, measures were evaluated using real-time traffic data sets to determine the robustness and accuracy of each measure in a traffic situation.

E-IRTMS steps
Step 1: Traffic data are collected using sensors.
Step 2: HCBGA receives the collected data Step 3: HCBGA calculates SRI, SPI, and R i .
Step 4: SRI, SPI, and R i are added to the following parameters: intersection ID and vehicle number to the chromosome. if (SRI ≤ 6) or (SPI ≥ 50) or (R i reaches 1) fitness value = "RED" Return to Step 1.

Data Set Description
A congestion assessment that included SRI, SPI, and R i was conducted. The current study observed and documented vehicles at the Al-Assaf traffic signal intersection/Khalda from December 1, 2020 to December 31, 2020.

Benchmark
To assess the efficiency of E-IRTMS, various tests were conducted in comparison with IRTMS to measure the processing time required to change the traffic light to green for vehicles.

System Requirements
The subsequent section presents the setting of the experiment of the proposed E-IRTMS and its implementation. All the experiments were performed on an HP laptop with Intel ® Core™ i5 (2.40 GHz).

Experimental Results and Analysis
The genetic algorithm chooses the fittest (best) chromosome from a randomly generated population [31,32]. The most suitable option for moving between intersections from red to green is the best priority in accordance with traffic signal congestion. That is, HCBGA [33] determines the green period during which traffic signals are provided.
The representation of chromosomes includes intersection ID, SRI, SPI, traffic density, R i , congestion time, and fitness value [34]. During off-peak hours, a driver generally takes only 2 min to cross the road [35]. In peak hours, however, a driver is estimated to require 4-5 min to travel the same road section depending on the congestion level [36][37][38]. Various comparisons were made to demonstrate the effect of the improved E-IRTMS on the reduction of road signals.
The SRI results for IRTMS and E-IRTMS are presented in Fig. 2. The SRI of E-IRTMS is better than that of IRTMS. The former is less than that of the latter, and thus, traffic congestion is less in E-IRTMS than in IRTMS.
As shown in Fig. 3, the SPI of E-IRTMS decreases more than that of IRTMS. The results obtained indicate that E-IRTMS is more competitive than IRTMS. Peak time congestion in E-IRTMS occurs during weekdays from 06:00 to 08:00 and from 18:00 to 20:00. As mentioned in Afrin et al. [7], SPI is calculated on the basis of three threshold values (25, 50, and 75). The lower the threshold value, the higher the level of traffic signal congestion [37].
As shown in Fig. 4, the R i of E-IRTMS is higher than that of IRTMS, leading to lower congestion in E-IRTMS than that in IRTMS. Furthermore, the R i of E-IRTMS reaches approximately 1 in this case, indicating less traffic signal congestion than that of IRTMS, whose R i reaches approximately 0 (Fig. 4). As suggested in Afrin et al. [7], traffic congestion increases when R i reaches approximately 0 [38].
Accordingly, a conclusion can be drawn that E-IRTMS is better than IRTMS. R i has higher values, resulting in less E-IRTMS traffic congestion. By contrast, the R i of IRTMS reaches the minimum value. During weekends from 12:00 to 14:00, peak time congestion reaches a high value in E-IRTMS. This finding can be attributed to people coming out of mosques after attending Friday prayers.  In addition to the R i of IRTMS, the peak value of working time is between 16:00 and 18:00. Other congestion rates reach the highest value over the period of 12:00-14:00 because various businesses end their working hours.
The relation of congestion time between E-IRTMS and IRTMS is illustrated in Fig. 5. The peak times of E-IRTMS and IRTMS are nearly the same. This finding is attributed to people going to school, university, and work at 16:00-18:00. Meanwhile, the time when people leave school, university, and work is known as rush hour.
During weekends, peak times differ from 12:00 to 14:00 due to the time when Friday prayers end in mosques. Another peak time is from 14:00 to 20:00 because most people go on holidays, visit relatives and friends, go shopping, or hang out at coffee shops or restaurants. In addition, the period of 22:00-00:00 is another peak time because people are coming back home.
Despite the peak times being nearly the same in E-IRTMS and IRTMS, the E-IRTMS period is less congested than the IRTMS period. This finding indicates that the performance of E-IRTMS is better than that of IRTMS in mitigating traffic congestion by approximately 23%.

Conclusions
The contribution of the E-IRTMS based on HCBGA is the use of traffic signals with unfixed timers. E-IRTMS also substantially reduces congested traffic signals compared with IRTMS. Data are passed on to a genetic algorithm, which transmits the parameters to a chromosome. HCBGA determines the priority for changing to green light between intersections in accordance with the chromosome's fittest value. The results obtained via E-IRTMS are more effective than those obtained via IRTMS by approximately 23%.
This study also determines that in addition to R i being approximately 1, E-IRTMS exhibits the highest SPI, with an SRI of less than 4. Furthermore, E-IRTMS is essential for an actual traffic system. E-IRMS is more successful than IRTMS. On the basis of the aforementioned findings, E-IRTMS can help drivers mitigate traffic signal congestion.
Acknowledgement: The authors would like to thank AL-Zaytoonah University of Jordan for its support to this research.
Funding Statement: The author(s) received no specific funding for this study.