## 4 Results  
In this section, the functionality of the proposed multi-tiered solution is rigorously substantiated through comprehensive MATLAB-based simulation analysis, alongside the integration of real-time simulation parameters. In Figure 2, a real time simulation of a V2X communication system in a VANET is demonstrated using real-time data transmission, clustering for collision detection, and traffic management strategies. The velocity of each vehicle fluctuates within the range of 10 km/h to 100 km/h, with each vehicle designated a distinct identifier commencing from 1 and concluding at 100, as it has been posited that a total of 100 vehicles are utilized to model the proposed mechanism, wherein the communication range of each vehicle is established at 100 m. Finally, the wireless channel parameter is based on [36]. Figure 2a visualizes the vehicle's trajectory, nearby vehicles, and cluster centroids. The K-means clustering algorithm identifies these centroids, which are used to determine high-risk zones for potential collisions. When the vehicle's location falls within a critical distance of a centroid, a collision alert is triggered, demonstrating the system's ability to detect and respond to collision risks in real time. Additionally, the vehicle notifies nearby vehicles, showcasing effective V2V communication. Figure 2b shows the vehicle's speed over time, providing insight into the speed fluctuations during the simulation. This reflects how speed changes dynamically throughout the scenario, which is relevant for evaluating the real-time performance of the system. The simulation also includes continuous data transmission to a central traffic system and insurance companies, ensuring that driving data are logged and shared for further analysis and decision-making. Overall, the results showcase the system's ability to manage vehicle trajectories, detect potential collisions, and optimize communication between vehicles and infrastructure, thereby contributing to enhanced road safety and traffic efficiency in a VANET environment. Figure 2: Analysis of the proposed collision detection algorithm, where **(a)** illustrates the vehicle path and detects collisions and **(b)** illustrates the variation in vehicle speed over a given time period. Figure 3 shows the results of the simulation, which modeled a VANET scenario with 100 vehicles randomly positioned within a 1000 \(\times\) 1000 unit area, using the outputs of Algorithm 1. Using the K-means clustering algorithm, these vehicles were grouped into three distinct clusters based on their geographic locations. The base station, positioned at the center of the area, served as a reference for calculating SNR values. Additionally, edge vehicles--those furthest from their cluster centroids--were identified. These edge vehicles play a key role in the communication process by relaying information to nearby vehicles within their cluster, ensuring data dissemination across the network. The simulation shows these communication paths through blue dashed lines, illustrating how edge vehicles transmit data to neighboring nodes within their respective clusters. These results highlight the effectiveness of K-means clustering in organizing vehicles into groups based on proximity, facilitating efficient communication between vehicles within each cluster and extending the range of information dissemination through edge vehicles. In Figure 4, the results of the traffic data analysis are presented through a visual representation of a real-time vehicular network using K-means clustering. The results presented in Figure 4 use the outputs of Algorithms 1 and 2, respectively. This clustering method allows for the identification of high-density traffic zones, which are critical in detecting potential congestion. Moreover, when a cluster exceeds a predefined vehicle threshold, indicating congestion, the system triggers several actions: adjusting traffic signal timings, rerouting vehicles, or notifying nearby vehicles and emergency services.