# A Cross-Layer Approach MAC/NET with Updated-GA (MNUG-CLA)-Based Routing Protocol for VANET Network
## 4 MAC/NET with Updated Genetic Algorithm--A Cross-Layer Approach (MNUG-CLA)
### Updated Genetic Algorithm (UGA) for GPSR Protocol  
The suggested system employs a meta-heuristic approach to discover the best pathways between both the source and the destination, from the basic elements using the table if the communication network is low. The routes chosen should meet all road regulatory standards, including an appropriate end-to-end latency and sufficient throughput. Even though the only route to the target needs periodic transferring of data over a larger mathematical range from the endpoint, this technique is done to all VANET configurations. Whenever the user's communication range is exceeded, this scenario happens, prompting the route to follow a different route through neighbor node, resulting in a greater mathematical distance. As an outcome, the met heuristic technique determines the best path for transmitting packets with the shortest geometric distance between source and destination. We chose to employ the Genetic one. We should highlight that every VANET station uses a GPS system to maintain the network nodes' geographical information on a regular basis. The flowchart of UGA is shown in Figure 4.  
Figure 4: Flowchart of Updated GA.  
Figure 3: Multichannel MAC Model. Here, we will look at how UGA can be used to find the best path between a transmitter and a receiver in a VANET. The depictions of individuals and populations are presented initially. The UGA setup and fitness value are then presented. Following that, the parents' choice, crossover, and mutation regulators are discussed, accompanied by the iterative terminating factor. The UGA's pseudo-code is discussed below. The depiction of individuals and populations follows a linear path from the origin to the destination, through a series of intermediary nodes that represent an instance of UGA. The route is represented by a string based on node route identifiers. As a result, the population is expressed with an N-dimensional vector. Functions of initialization and fitness: Every component, as previously stated, keeps a locations table lined with a mix of elements. Using a GPS, every element provides the location of all nodes in the network. As a result, the source may choose a unique entity to construct an initial path to a destination. A set of individuals can be produced as a new population based on their resemblance. An objective function is used to analyze an individual, with the lowest path from source to destination to the goal being hailed as the best. In other words, the fitness \(fit_{i}\) of the individual '\(i\)' is the sum of the distance (dis) between the two adjacent nodes '\(a_{j^{\prime}}\)' and '\(a_{j+1}\)'; the path from the source node '\(s\)' to the destination node '\(d\)' is calculated by the following formula:  
\[fit_{i}=\sum_{j=s}^{d}dist*a_{j}+a_{j+1} \tag{1}\]  
Hence, the fitness values for the whole population '\(popu(h)\)' can be given by the summation of all individuals, which is given as follows:  
\[popu(h)=\sum_{i=0}^{n}fit_{i} \tag{2}\]  
While doing so, the parameters, such as latency, bandwidth, and throughput, must be considered for maintaining the road safety issues by fixing the two types of strict constraints as indicated in Algorithm 2. ```
1. Initialize the set of population in random manner
2: Evaluate the fitness parameter for each population
3: While analyzing the stopping criteria
4: update the selection process
5: generate the offspring from the parents
6: maintain the crossover and mutation process
7: initialize the replacement process
8: End while
```  
**Algorithm 2** Pseudo-Code for Updated Genetic Algorithm  
Selection, Crossover and mutation process: to find the two types of parents by assuming K/2 parameter, a selection process was chosen with the addition of N number of individuals. For doing so, the Roulette Wheel Selection (RWS) method can be carried out, which was formulated by [PERSON] and [PERSON], where \(i\) is based on the selection of the parent, based on probability \(w_{i}\) with the fitness range of \(fit_{i}\).