> **Minimization Traffic Congestion With Smart Traffic Light By Using Fuzzy Logic**

**Sharifah Fhahriyah Syed Abas<sup>1</sup>\*, Nur Qurratu’ Aini Jefrydin<sup>2</sup>**

*<sup>1,2</sup>* College of Computing, Informatics & Mathematics, Universiti Teknologi MARA

Perlis Branch, Arau Campus, 02600 Arau, Perlis, Malaysia

*  
*

*Corresponding author: \* sfhahriyah@uitm.edu.my*

Received Date: \*date

Accepted Date: \*date

Revised Date: \*date

Published Date: \*date

**HIGHLIGHTS**

  - **Fuzzy logic method used in the study able to be implemented in traffic light system at Jalan Raja Ashman, Ipoh.**

  - **It demonstrates a remarkable reduction in traffic congestion by dynamically adjusting green light durations based on real-time traffic conditions.**

  - **The system significantly improved traffic flow, minimizing waiting times and enhancing overall road efficiency.**

  - **The valuable findings contribute the potential of fuzzy logic-based traffic management systems to alleviate traffic congestion in urban areas.**

**ABSTRACT**

*Traffic congestion has become a pervasive problem in the world including Malaysia for the past few years while present indication shows that it is expected to get worse. The phenomenon of being stuck in traffic congestion for an extension period also causes stress and tiredness, Due to this, there is no denying that this problem is significantly contributes to negative social, economic, and environmental impacts. This study aims to reduce traffic congestion at Jalan Raja Ashman Shah, Ipoh by implementing an intelligent fuzzy logic traffic light system. The system aims to reduce waiting times and improve traffic flow by automatically adjusting green light durations based on real-time traffic conditions. Data on the number of vehicles and queue lengths during peak hours were collected to compare congestion levels before and after the intervention. The results of this study demonstrate the effectiveness of deploying an intelligent traffic light system with fuzzy logic in minimizing traffic congestion and reducing waiting times. By dynamically adjusting green light duration based on real-time traffic conditions, the system optimized traffic flow and improved overall congestion. A comparison of congestion levels before and after the introduction showed a significant reduction in congestion and an improvement in traffic flow. The adaptability of the intelligent traffic light system makes better use of road capacity, reducing waiting times and minimizing congestion. As a result, we found a significant reduction in waiting time compared to the previous static system. Consequently, this study gives great impact to Ipoh citizens if the fuzzy logic method is implemented in traffic light system. Due to this, improving the transportation system and the quality of life for road users. *

***Keywords:** traffic congestion, Fuzzy Logic, intelligent traffic light, minimize*

# INTRODUCTION 

Traffic congestion has significant negative effects on society, the economy, and the environment, particularly in densely populated areas (Armah et al., 2010; Wang et al., 2014). The urban traffic transportation system is impacted by the amount of delay and expense brought on by traffic congestion. Based on the Traffic Index by City on Mid Year 2022 by Numbeo, Kuala Lumpur, Malaysia is placed in the sixteenth rank possessing the worst traffic jam condition in Asia at 41.78 minutes (Numbeo, 2022). Besides that, the World Bank, Malaysia Economic Monitor, June 2015 – Transforming Urban Transport states that people in Kuala Lumpur spend more than 250 million hours a year in traffic congestion while the amounting cost of traffic in Kuala Lumpur is between the GDP of 1.1% - 2.2% in 2014. Additionally, it is also estimated that Malaysians waste around RM10 - 20 billion each year in traffic (Gil et al., 2015). In terms of time, workers in Klang approximately spend 44 hours a month in traffic congestion (Mat Hayin & Ismail, 2022).

An interviewer in The Star news stated that the distance from his house to the city centre is around 15 km however he is often stuck in traffic for at least 40 minutes. He also expressed that he experienced fatigue from waiting in traffic (Manjit & Ivan, 2022). Other interviewers from other news outlets, such as New Straits Times said that he could arrive at his workplace in approximately five minutes, but it is prolonged to an hour due to congested traffic jams (Tengku, 2022).

Due to this, traffic congestion has emerged as a pervasive and challenging issue that affects urban areas globally, exerting significant negative impacts on society, the economy, and the environment. Particularly, cities that are growing rapidly like Ipoh, Malaysia has been grappling with the adverse consequences of congestion, including prolonged waiting times, reduced productivity, increased air pollution, and heightened stress levels among road users. As cities continue to experience rapid urbanization and growth, effective strategies to alleviate traffic congestion become imperative to ensure efficient transportation systems and enhance the quality of life for residents.

This study focuses on addressing the problem of traffic congestion at Jalan Raja Ashman Shah which is one of the busiest roads in Ipoh. Implementation of an innovative and adaptive approach called a smart traffic light system using fuzzy logic is used. Traditional traffic light systems typically operate on fixed timings, failing to account for real-time traffic fluctuations and often exacerbating congestion. In contrast, the proposed smart traffic light system leverages fuzzy logic to dynamically adjust green light durations based on the actual traffic conditions at any given moment. By doing so, the system aims to minimize waiting times, optimize traffic flow, and consequently mitigate congestion.

The primary objectives of this study are twofold: first, to implement and evaluate the efficacy of the intelligent traffic light system using fuzzy logic in reducing traffic congestion; and second, to conduct a comparative analysis of congestion levels before and after the system's implementation. By collecting and analyzing data on vehicle numbers and queue lengths during peak hours, this study seeks to provide empirical evidence of the system's impact on congestion reduction and traffic flow improvement.

The significance of this research extends beyond its immediate application in Ipoh, offering insights that can inform traffic management strategies in urban centers facing similar challenges. By elucidating the benefits and potential of employing intelligent traffic solutions, this study contributes to the broader discourse on innovative approaches to address traffic congestion, enhance urban mobility, and create more sustainable and liveable cities.

# METHODOLOGY 

Primary data was collected in this study, which are numbers of vehicles and length of queue from observations for every 15 minutes during the peak hours. Then, Fuzzy Logic method was used to solve this problem. MATLAB software was used as a tool to obtain the results for this study. Five steps processes were being used which will be discussed later.

**FUZZY SET THEORY**

In this study, the fuzzy logic controller will improve the performance of the traffic signal controller. Triangular Fuzzy Number and Trapezoidal Fuzzy Number will be used in this study. The membership function of the triangular fuzzy number may be defined by a triplet .

The Triangular Fuzzy Number represented with three points as follows :

(1)

This representation is interpreted as membership function defined below:

(2)

Meanwhile, Trapezoidal Fuzzy Number is defined as equation (3) below.

(3)

The membership function of this fuzzy number will be interpreted as equation (4) below.

(4)

**FUZZY LOGIC**

Fuzzy logic is a method of solving ambiguous or unclear problems in a very structured and systematic way (Karyaningsih & Rizky, 2020). On top of that, it has the ability to transfer human thinking process into an algorithm using mathematical models. Fuzzy if-then rules can be used to put real rules into action that are similar to police traffic thinking to manage traffic lights (Mohanaselvi & Shanpriya, 2019). Therefore, there are five steps involved in achieving the desired outcomes or results in this method. The following are the process involve in Fuzzy Logic method.

Step 1: Setup and identify all input and output for the linguistic variables and linguistics values.

Linguistic variablea are defined for input and output. In this study, linguistic variables from Hartanti et al. (2019) were used. Linguistic variables in this study are the number of vehicles, length of queue and width of road. In addition, the Triangular Fuzzy Set and Trapezoidal Fuzzy Set will be calculated.

> Number of vehicles(t) = {quiet, normal, crowded}
> 
> Length of queue(t) = {short, normal, long, very long}

Step 2: Create membership functions for each input and output.

The equations of membership functions that will be used for this study are Equation (2) and Equation (4). The range of linguistic values and linguistic variable use is taken from Hartanti et al. (2019).

Step 3: Setup the fuzzy rule base.

Next, a set of rules were created based on IF-THEN rules.

Step 4: Implement the MATLAB fuzzy tools to build the system.

In this step, the MATLAB software will be used to obtain the results, whereas the Fuzzy Tools Designer Apps in MATLAB software will be used for this study.

Step 5: Compare the results obtained with the observation data.

After obtaining the results, the result and previous data involving data derived from observations are being compared. From the comparison, it can be determined whether the study has achieved its objectives.

**FINDINGS AND DISCUSSIONS**

By analyzing the number of vehicles and the length of the queue, the system optimizes the green light duration to facilitate a smoother flow of traffic and reduce congestion. his adjustment allows more vehicles to cross the intersection in each cycle, clearing the queue faster and minimizing time spent in traffic. The use of fuzzy logic methodology further enhances the system's adaptability, as green light durations can now vary based on real-life conditions, providing improved efficiency and reducing congestion during peak hours.

**FUZZY LOGIC**

In the fuzzification phase, the range of linguistic variables and linguistic values are based on the findings of Hartanti et al. (2019), which will be used in this research. The data acquired from observations will be used to determine the linguistic value. Table 1 below depicts linguistic variable, values, and linguistic values.

**Table 1:** Linguistic variable, Linguistic value, and value for each input and output

<table>
<thead>
<tr class="header">
<th></th>
<th><blockquote>
<p>Linguistic Variable</p>
</blockquote></th>
<th>Values</th>
<th>Linguistic Value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Input</td>
<td>Number of Vehicle</td>
<td>(0, 10, 25)</td>
<td>Small</td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td>(20, 30, 45)</td>
<td>Normal</td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td>(40, 50)</td>
<td>Crowded</td>
</tr>
<tr class="even">
<td></td>
<td>Length of Queue</td>
<td>(0, 70, 150)</td>
<td>Short</td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td>(100, 200, 300)</td>
<td>Normal</td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td>(230, 350 450)</td>
<td>Long</td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td>(400, 550)</td>
<td>Very Long</td>
</tr>
<tr class="even">
<td>Output</td>
<td>Green Light Duration</td>
<td>[0, 20]</td>
<td>Short</td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td>[20, 40]</td>
<td>No Change</td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td>[40, 60]</td>
<td>Longer</td>
</tr>
</tbody>
</table>

Then, the membership function for the fuzzy number for two inputs, number of vehicles and length of queue and one output, green light duration was generated using trapezoidal fuzzy number or triangular fuzzy number.

Hence, seven set of rules are used to generate the output using MATLAB software. Figure 1 below shows seven rules that have been declared in MATLAB software.

![A screenshot of a computer Description automatically generated](650fcb437eb21_media/media/image7.jpeg)

**Figure 1:** The Rule’s Set

The output will be determined based on the inputs and if-then rules. Hence, the result is compared between **data obtained from observation** and data **calculated using the fuzzy logic**. F**igure 2 below shows the result of the different between green light duration.**

![A graph with blue and orange lines Description automatically generated](650fcb437eb21_media/media/image8.png)

**Figure 2: Graph of the comparison of green light periods**

**Based from Figure 2 above, it shows that the data obtained from the observation contrast from the results calculated by applying Fuzzy Logic method. The orange line is for green light durations from observations meanwhile, the blue line is for green light durations after fuzzy logic is implied. Before the study is implement, when the number of vehicles are 50 and length of queue is 300 metres, the cycle to clear the length is four cycles. After this study is implement, more vehicles can pass through the traffic smoothly in each cycle resulting in reduced of waiting time, queues, and congestion. It can be seen clearly that Fuzzy logic method can produce green lights durations that are not static.**

Furthermore, comparison of green light’s duration with the same number of vehicles, and length of queue can be seen in Table 2 below. An optimal green light that can adjust based on real-time traffic conditions help reduce the time spent in traffic congestion using smart traffic light control.

Before the smart traffic light is implement, when the number of vehicle is 70 and length of queue is 500 metres, its need four cycles to clear the queue which make the drivers need to wait in a long time to pass the traffic. The green light durations from observations were static to 30 seconds that makes many people wait in the queue for a long period of time especially during peak hours

Using smart traffic light system, the green light’s duration is increased 20 seconds when the number of vehicle is 70 vehicles for each cycle and length of queue is 500 metres so that more vehicles can cross the intersection in each cycle, which can help clear the queue faster and reduce the time spent in traffic. Besides, it can also help minimize traffic congestion. Lines with longer lines with a lot of number of vehicles can get a longer green light’s duration than other lines with fewer vehicles. The green light application must reduce the traffic congestion as many vehicles can pass through the intersection and reduce the time spent in traffic.

**Table 2:** Green Light Durations before and after fuzzy logic is implied.

| Number of Vehicle | Length of Queue (metres) | Green Light Durations Before (seconds) | Green light Durations After (seconds) |
| ----------------- | ------------------------ | -------------------------------------- | ------------------------------------- |
| 29                | 110                      | 30                                     | 14.1                                  |
| 31                | 140                      | 30                                     | 24.6                                  |
| 20                | 130                      | 30                                     | 10                                    |
| 70                | 500                      | 30                                     | 50                                    |
| 24                | 120                      | 30                                     | 17.4                                  |
| 26                | 110                      | 30                                     | 14.1                                  |
| 50                | 300                      | 30                                     | 50                                    |
| 30                | 140                      | 30                                     | 24.6                                  |
| 33                | 140                      | 30                                     | 24.6                                  |
| 31                | 140                      | 30                                     | 24.6                                  |

**CONCLUSION AND RECOMMENDATIONS**

In conclusion, this study focused on addressing traffic congestion in Ipoh, Malaysia, particularly along Jalan Raja Ashman Shah, through the implementation of an intelligent traffic light system using fuzzy logic. The study successfully achieved its objectives of reducing congestion and improving traffic flow. By adjusting green light durations based on real-time conditions, the smart traffic light system effectively minimized waiting times and improved vehicle movement at the intersection.

The research emphasized the potential benefits of adopting such a system, highlighting the importance of dynamic adjustments in traffic light timings to accommodate varying traffic patterns. The study suggested future enhancements, including incorporating vehicle speed data to further optimize traffic light durations and prevent congestion, thereby ensuring smoother traffic flow.

Although the study encountered limitations in data collection, it provided valuable insights for future research and practical applications in reducing traffic congestion . Researchers can reference this study in control-system problems and consider applying the approach to other locations. It is suggested that more criteria to be added in the future such as, speed of vehicles to obtain more accurate result. By integrating the vehicle’s speed into an intelligent traffic light system, the system can dynamically adjust traffic light times based on the speed of vehicles approaching the intersection.

Moreover, alternative method such as machine learning can be applied for further improvement in traffic management. Machine learning algorithms can learn patterns and make predictions about traffic flow. This enables the smart traffic light to dynamically adjust their timings based on current traffic conditions.

Overall, this study contributes to the ongoing efforts to enhance transportation systems and quality of life in Ipoh through innovative traffic management solutions.

**ACKNOWLEDGMENTS**

The authors express sincere gratitude and thanks especially to the officers of Traffic Division, IPD Ipoh for their contributions and supports in giving us information during interviews to complete our study and people who helps us direct and indirectly in this study.

**REFERENCES**

Armah, F. A., Yawson, D. O., & Pappoe, A. A. N. M. (2010). “A systems dynamics approach to explore traffic congestion and air pollution link in the city of Accra, Ghana.” *Sustainability*, *2(1),* 252–265.

Gil, S., Frederico, Blancas, M., Luis, C., Reindert, & Westra. (2015). *Malaysia economic monitor: Transforming urban transport* (English). Washington, D.C.: World Bank Group. Retrieved from <http://documents.worldbank.org/curated/en/509991467998814353/Malaysia-economic-monitor-transforming-urban-transport>

Hartanti, D., Aziza, R. N., & Siswipraptini, P. C. (2019). Optimization of smart traffic lights to prevent traffic congestion using fuzzy logic. *Telkomnika (Telecommunication Computing Electronics and Control), 17(1),* 320–327.

Karyaningsih, D., & Rizky, R. (2020). Implementation of Fuzzy Mamdani Method for Traffic Lights Smart City in Rangkasbitung, Lebak Regency, Banten Province (Case Study of the Traffic Light T-junction, Cibadak, By Pas Sukarno Hatta Street). *KomTekInfo*, 7.

Manjit, K., & Ivan, L. (2022). “Stuck in traffic for too long.” *The Star*.

Mat Hayin, N.A & Ismail, M.R. (2022). “Klang Valley employees spend 44 hours a month sitting in traffic.” *New Straits Times*. Retrieved from <https://www.nst.com.my/news/nation/2022/06/809243/klang-valley-employees-spend-44-hours-month-sitting-traffic>

Mohanaselvi, S., & Shanpriya, B. (2019). Application of fuzzy logic to control traffic signals. *AIP Conference Proceedings, 2112*.

Numbeo. (2022). Asia: Traffic Index by City 2022 Mid-Year. Retrieved from <https://www.numbeo.com/traffic/region_rankings.jsp?title=2022-mid&region=142>

Tengku, Z. S. (2022) “Many late for work, stuck in traffic jams due to downpour this morning.” *New Straits Times*. Retrieved from <https://www.nst.com.my/news/nation/2022/08/818663/many-late-work-stuck-traffic-jams-due-downpour-morning>

Wang, J., Chi, L., Hu, X., & Zhou, H. (2014). Urban traffic congestion pricing model with the consideration of carbon emissions cost. *Sustainability, 6(2)*, 676–691.
