# Junction Selection Based on Optimal-Weighted Multiple Attributes for VANETs
## 2 System Model
The most effective weight can be obtained from the infinite simulations. We simulated a variety of weight values in a variety of scenarios. Through repetitive simulations, we found out that 0.2, 0.7, 0.1 for distance, traffic density, and angle are the most optimal weight values. \[Z= \begin{bmatrix}w_{1}\alpha_{1}^{*}&w_{2}\beta_{1}^{*}&w_{3}\gamma_{1}^{*}\\ w_{1}\alpha_{2}^{*}&w_{2}\beta_{2}^{*}&w_{3}\gamma_{2}^{*}\\...&...&...\\ w_{1}\alpha_{m}^{*}&w_{2}\beta_{m}^{*}&w_{3}\gamma_{m}^{*}\end{bmatrix}  \tag{5}\]  
Therefore, instead of the default weight in TOPSIS, this optimal weight value will be used in TOPSIS for junction selection. We also show the efficiency of this weight in the simulation section. Figure 3 shows the negative and positive situations to selecting the junction. _Step 4: Calculate the ideal situation._  
\(I-\) represents the worse junction selection value, whereas \(I+\) represent the optimal junction selection value for packet forwarding. The following Equations (6) and (7) are used to calculate the ideal solution. While \(\epsilon\) shows the membership of candidate junction with all provided junctions J.  
\[I^{+}=[(\min_{i\leftarrow}z_{ij}|je\rangle)]=[p_{1}^{*},p_{2}^{*},p_{3}^{*}],i =1,2,3 \tag{6}\]  
\[I^{-}=[(\min_{i\leftarrow}z_{ij}|je\rangle)]=[p_{1}^{*},p_{2}^{*},p_{3}^{*}],i =1,2,3 \tag{7}\]  
Figure 3: Negative and positive situation. _Step 5: The distance between positive and negative ideal situations is computed._  
The distance between a positive situation and a negative situation helps in finding the rank of every available junction. \(d_{i}^{+}\) and \(d_{i}^{-}\) represent the distance between optimal and worse junction selection values from each parameter. \(z_{ik}\) represents the attribute in normalized matrix Z, as shown in the following Equations (8) and (9). \(p_{k}^{*}\) represents the normalized values of optimal attributes, whereas \(p_{k}^{0}\) represents the normalized values of worse attributes. \[d_{i}^{+}=\sqrt{\sum_{k=1}^{3}(z_{ik}-p_{k}^{*})^{2}},i=1,2,3 \tag{8}\]  
\[d_{i}^{-}=\sqrt{\sum_{k=1}^{3}(z_{ik}-p_{k}^{\circ})^{2}},i=1,2,3 \tag{9}\]  
The principle of Equations (8) and (9) is clearly shown in Figure 3.  
_Step 6: The Relative Approach Degree (RAD) is calculated in the last step._  
RAD is very helpful in finding the ideal situation for junction selection. The calculation process of the rank result of available junctions is explained in follow equation. R is used to rank the result of each junction as shown in Equation (10). \(R_{i}^{*}=\frac{d_{i}^{-}}{d_{i}^{+}-d_{i}^{-}}\), a set of alternatives, can now be preference-ranked according to the descending order of \(R_{i}^{*}\). By arranging all of the ranked results, we can obtain the best junction. The process of junction selection based on TOPSIS is described in Algorithm 1. ```
1:Input: Three Parameters (Distance, Traffic Density, Angle) of each Junction. 2:Output: The Optimal Candidate Junction. 3:while\(M\
eq NULL\)do
4: Create a Decision Matrix D
5:for\(P_{ij}\gets D\)do
6:\(\overline{X_{ij}}=\frac{x_{ij}}{\sqrt{\sum_{j=1}^{n}x_{ij}^{2}}}\)
7:endfor
8:\(v_{ij}=w_{ij}*r_{ij}\)
9:ifje()then
10:\(I^{*}=\max(X_{ij}):I^{-}=\min(X_{ij})\)
11:else
12:ifj &fthen
13:\(I^{*}=\min(X_{ij}):I^{-}=\max(X_{ij})\)
14:endif
15:endif
16:for/je(C_{j}\)do
17:\(d_{i}^{*}=\sqrt{\sum_{j=1}^{n}(v_{ij}-v_{j}^{+})^{2}}\)
18:\(d_{i}^{*}=\sqrt{\sum_{j=1}^{n}(v_{ij}-v_{j}^{-})^{2}}\)
19:endfor
20:for each\(X_{ij}intD\)do
21:\(R_{i}^{*}=\frac{d_{i}^{*}}{d_{i}^{+}+d_{i}^{-}}\)
22:endfor\(\triangleright\) Rank the solutions and return the solution with maximum \(R_{i}\)
23:endwhile
```  
**Algorithm 1** Junction Selection-based TOPSIS\[R_{i}^{*}=\frac{d_{i}^{-}}{d_{i}^{+}+d_{i}^{-}} \tag{10}\]  
After junction selection, greedy forwarding is used in road segment mode. The source vehicle transmits the packet to the next vehicle, which is closest to the destination in its communication range [19].