# Urban Congestion Avoidance Methodology Based on Vehicular Traffic Thresholding
## 3 Vehicular Traffic Congestion Avoidance Methodology
```
1:\(\rho


```
1:procedureComputeRoute (\(p_{s}\), \(p_{d}\))
2:\(init(queue)\)
3:\(segment_{s}\gets getSegment\) (\(p_{s}\))
4:\(segment_{d}\gets getSegment\) (\(p_{d}\))
5:\(node\gets segment_{s}\)
6:queue.push (\(node\))
7:\(t_{s}\gets t_{0}\)
8:\(ETT\gets t_{0}\)
9:whilequeue is not empty do
10:\(node\gets queue.pop\) ()
11:if\(node==segment_{d}\)then
12:for each segment in route do (\(p_{s}\), \(p_{d}\))
13:\(speed\leftarrow ComputeSpeed\) (\(t_{s}\), \(segment\))
14:\(d\leftarrow ComputeDelay\) (\(t_{s}\), \(\delta\), \(segment\))
15:\(t_{e}\gets t_{s}\) + \(L_{segment}\) / \(speed\) + \(d\)
16:\(segment\).Update (\(t_{s}\), \(t_{e}\))
17:\(t_{s}\gets t_{e}\)
18:endfor
19:endif
20:\(ETT\gets getTravelTime\) (\(node\))
21:for each segment in N (node) do
22:\(effort\leftarrow computeEffort\) (\(ETT\), \(segment\))
23:if\(effort<\)\(E_{segment}\)then
24:\(E_{segment}\leftarrow effort\)
25:endif
26:endfor
27:endwhile
28:endprocedure
```
**Algorithm 1** Route computation algorithm
```
1:functionComputeEffort (\(t\), \(segment\))
2:\(p\leftarrow ComputeDensity\) (\(t\), \(segment\))
3:\(effort\gets E_{segment}+\delta\)
4:\(F_{e}\leftarrow\{1,5,10,15,20,25,30,35,40\}\)
5:\(E_{max}\gets 50\)
6:for each i in T.size () do
7:if\(p<T[i]\)then
8:return\(effort\times F_{e}[i]\)
9:endif
10:endfor
11:return\(effort\times E_{max}\)
12:endfunction
```
**Algorithm 2** Compute density
```
1:functionComputeEffort (\(t\), \(segment\))
2:\(p\leftarrow ComputeDensity\) (\(t\), \(segment\))
3:\(effort\gets E_{segment}+\delta\)
4:\(F_{e}\leftarrow\{1,5,10,15,20,25,30,35,40\}\)
5:\(E_{max}\gets 50\)
6:for each i in T.size () do
7:if\(p<T[i]\)then
8:return\(effort\times F_{e}[i]\)
9:endif
10:endfor
11:return\(effort\times E_{max}\)
12:endfunction
```
**Algorithm 3** Compute Effort
```
1:functionComputeEffort (\(t\), \(segment\))
2:\(p\leftarrow ComputeDensity\) (\(t\), \(segment\))
3:\(effort\leftarrow E_{segment}+\delta\)
4:\(F_{e}\leftarrow\{1,5,10,15,20,25,30,35,40\}\)
5:\(E_{max}\gets 50\)
6:for each i in T.size () do
7:if\(p<T[i]\)then
8:return\(effort\times F_{e}[i]\)
9:endif
10:endfor
11:return\(effort\times E_{max}\)
12:endfunction
```
**Algorithm 4**
```
1:functionComputeSpeed(\(t\), segment)
2:\(\rho\leftarrow ComputeDensity\)(\(t\), segment)
3:\(F_{s}\leftarrow\{1,0.97,0.87,0.64,0.42,0.25,0.17,0.11,0.07\}\)
4:\(S_{min}\gets 0.02\)
5:for each \(i\) in T.size () do
6:if\(\rho<T[i]\)then
7:return\(speedLimit_{segment}\times F_{s}[i]\)
8:endif
9:endfor
10:return\(speedLimit_{segment}\times S_{min}\)
11:endfunction
```

**Algorithm 4** Compute Speed

## 4 Urban Traffic Scenarios' Evaluation and Discussion

### Implementation Framework

The framework used to implement the CAVTTM solution is shown in Figure 3 and reflects the steps of the flow that correspond to the vehicular traffic congestion avoidance solution presented in Figure 2, as follows:

* S1 is implemented using a stand-alone routine that generates GPS positions for the start and destination points on a real urban map data region from Open Street Map (OSM), which fulfills the proposed road network topology requirements;
* For the implementation of S2, we adapted the existing route computation algorithm from SUMO to use the proposed traffic thresholding mechanism and KEP tree data structure in order to reduce or avoid congestion;
* The S3 step implementation is mostly achieved using SUMO components, and for the computed routes, we run vehicle simulations on the selected road network region from OSM using the SUMO simulator. Specific vehicular traffic data obtained during the simulation were logged by using a customized SUMO traffic logger. We adapted a customized traffic logger from SUMO to fulfill our requirements;
* Finally, the generated logs are parsed in order to obtain data for the CAVTTM evaluation in terms of congestion reduction and avoidance.