## 4 Congestion-Avoidance and Vehicle-Detection Modules of ACO-PT for Vehicles
### Congestion-Avoidance Module  
In urban areas, road congestion has become a serious problem. Many researchers have started to use VANET techniques to detect potential congestion on roads. Nevertheless, these techniques have many limitations, such as channel-competition problems and delays [31].  
Moreover, to enhance the efficiency of our approach in the search for the optimal path, a congestion-avoidance module was implemented. The purpose of this module is to effectively reduce vehicle fuel and energy consumption, decrease carbon emissions, and protect the environment. The combination of our ACO-PT algorithm with the avoidance-congestion module helps to avoid peak-hour traffic jams and temporal traffic blockages. The module consists of handling the congestion problem in the vehicle environment. To do so, we start by calculating the average speed of road movement, which depends on the density of vehicles. The latter reflects the number of vehicles per unit of road length. Additionally, the density of vehicles is inversely proportional to the speed of the movement of vehicles. The resultant linear relationship between density R and traffic velocity \(v\) is assumed as:  
\[R(v)=-av+R_{0} \tag{13}\]  
where \(a\) is an arbitrary constant.  
Definition 1: The movement of vehicles ordered by the transport network is called traffic flow. Indeed, the flow \(F\) is determined by the flow of vehicles per unit time as the product of \(R\):  
\[F(v)=-av^{2}+R_{0} \tag{14}\]  
where \(a\) is an arbitrary constant and \(v\) is the traffic velocity.  
Corollary 1: Traffic jams are formed in sections of the road where there is a high density of slow-moving vehicles with large traffic flow.  
Proof: It is assumed that the flow of vehicles along street A (\(Flow_{(A)}\)) is greater than that along street B (\(Flow_{(B)}\)) in a certain time interval. \(\square\)  
**Hypothesis 1**.: _If the switching time is the same between all vehicles, then the occupancy of street A by transport depends on the outgoing \(Flow_{O(A)}\) and incoming \(Flow_{I(A)}\) traffic flow to the intersection of the streets within a green light._  
**Proof 1**.: Suppose that the waiting time for the vehicle is \(t_{w}\) and the time for the green traffic light is \(t_{g}\). Assume that \(M\) number of cars manage to cross the intersection in time \(t_{g}\). At the same time, including waiting time for the green light \(t_{w}\), \(V_{n}\) is the number of vehicles arriving at this section of the street. Therefore, if for time \(t_{w}+t_{g}\) the following expression is true: \(M<N\), then the street is occupied by a high density of vehicles; otherwise, the traffic flow is considered free. \(\square\)  
Figure 6 illustrates the situation at the intersection of streets A and B.  
**Corollary 2**.: _At the intersection of two streets where traffic is controlled by the traffic system, the street with more traffic flow should receive more green-traffic-light time than the street with fewer vehicles. This expression is one of the conditions for avoiding traffic jams at street intersections._  
**Proof**.: \(V_{at}\) be the average travel time for the vehicle on link \(V_{pa}\). Thus, \(T_{f}\) can be the free-flow time required on the given link \(V_{pa}\) for the number of vehicles \(V_{n}\). Therefore, congestion avoidance for the number of vehicles \(V_{tn}(c)\) can be calculated as follows:  
\[V_{tn}(c)=T_{f}\Bigg{(}1+\frac{\gamma}{\dot{\eta}}\bigg{(}\frac{V_{n}}{C_{rv}} \bigg{)}^{\dot{\eta}}\Bigg{)} \tag{15}\]  
where \(\gamma\) is the allocated route, \(\dot{\eta}\) is the set of routes, and \(C_{rv}\) is the congestion rate for the vehicles. \(\square\)  
Therefore, the flow of traffic \(V_{tn}\) should be less than the congestion rate for the vehicles \(C_{rv}\). Therefore, \(\frac{V_{tn}}{C_{rv}}\) can be small. Thus, the average travel time for the vehicle is equal to the free-flow time, which can be expressed as \(V_{tn}(c)\approx T_{f}\). For the number of vehicles \(V_{n}\), the impacts of congestion begin to be observed.