In a self-evolving network, security is an essential requirement, and ensuring it in any circumstance is the most difficult task because the network is very dynamic and lacks reliable centralised monitoring. MANETs are much more vulnerable to security attacks when compared to wired networks. There are two steps in this research: the routing stage and the wormhole detection stage. Quantum walk and reinforcement learning are used to improve the results of ad hoc on-demand multipath distance vector routing technology. Quantum walk detects the moving nodes from the area and updates it to the reinforcement learning table. The proposed model is faster since the adaptive African vulture optimization is employed for path selection. This optimization creates an ideal path from source to destination using the data obtained by the routing protocol and reinforcement learning. Round trip time and packet delivery rate are key elements in the detecting phase. This parameter establishes a threshold point for classifying suspicious and normal nodes. Depending on the type of attack, the node will either be terminated or recovered if it turns malicious. Performance indicators including the proportion of packet delivery ratio (98%), end-to-end latency (23.91 sec), packet loss (4.75%), energy consumption (57J), throughput (408/sec), and average E2E delay are examined and compared with existing models to validate the efficacy of the proposed model.