## 3 Proposed Method
### Hybrid Protocol-Based Path Selection
The selection criteria for this objective function are rooted in the dynamic nature of the problem, where vehicles exhibit varying speeds and travel in diverse directions. To adapt to these dynamics, the objective function assesses the distance between each vehicle and a stationary reference point, usually the origin. This distance assessment occurs in two dimensions, effectively capturing the Cartesian distance between each vehicle's current location and the stationary reference point. By considering both horizontal and vertical separations, the algorithm can gauge how effectively each vehicle is positioned within the problem space. The central aim is to optimize the objective function value for each vehicle. Given the ever-changing positions of vehicles in relation to one another, this objective function provides a dynamic measure of how well each vehicle is situated. The reason for adopting the IFO algorithm is to solve complex tasks simply, leading to easy adaptability, robustness, and scalability. Figure 3 presents the improved firefly optimization architecture. ### DRL-Based Emergency Message Dissemination

After path selection, the destination area is selected to disseminate the emergency message using the improved twin delay deep deterministic policy gradient algorithm (IT3 DPG) based on the direction, number of vehicles per lane, number of vehicles crossings, and packet transmission. In these situations, the IT3 DPG algorithm tackles the issues of slow convergence and poor training efficiency, offering significant benefits in continuous control problems. #### 3.4.1 Delay Deep Deterministic Policy Gradient Algorithm

In this section, we present the adaptation of the delay deep deterministic policy gradient algorithm for path selection in VANETs to facilitate the efficient dissemination of Ems. Our two-stage system uses twin-actor networks for policy learning to improve decision accuracy. The agent first interacts with a VANET simulation to acquire the optimal route selection technique and train twin-actor and critic networks offline and online. Subsequently, during the online phase, these networks are adapted, providing a warm startup that improves operations, including EM dissemination, aiming to enhance communication safety and effectiveness in vehicular networks. This process begins with pre-trained message actor and critic models that have learned from historical data encompassing past emergency message transmissions. The historical data serve as repositories, containing sender vehicle information, message type, urgency, and subsequent vehicle states. When a vehicle node sends an emergency message, message actor networks generate and transmit a message action, triggering state changes and potential responses from other vehicles. Transmitted messages are recorded as transitions during the experience replay memory. During the EM process within the network, the message actor networks operate in a closed-loop manner. They start by receiving the current state (\(C_{s}\)) from the vehicle's communication system and then determine the appropriate action (A) to take. This action is subsequently sent out via the communication network, leading to a change in the system's state (\(S_{s}\)) and the reception of a reward (R) associated with the action taken. Each message transition is recorded and added to our experience replay memory (\(E_{2}\)). To enhance the reliability of message delivery, we periodically extract a random batch of these message transitions (consisting of the state, action, reward, and subsequent state) from our experience replay memory. These subsequent states (\(S_{s}\)) are provided as inputs to target message actor networks, which predict the best possible actions (\(P_{A}\)) based on these states. Furthermore, the predicted target actions and corresponding states (\(CR_{S}\)) are forwarded to target message critic networks to estimate their quality and evaluate how likely they are to effectively reach the intended recipients.