The optimal path problem can be considered as a type of discrete optimization, which enables reliable and QoS-aware data dissemination in Vehicular Ad Hoc Networks (VANETs). The optimal path is of great importance in vehicular communication due to frequently disconnected network, dynamic topology, and limited bandwidth of wireless interface. In this paper, multi-valued Discrete Particle Swarm Optimization (DPSO), including encoding and decoding phase, is used to optimize the process of identification of an optimal path for efficient data dissemination in VANETs. The proposed algorithm includes link stability calculated by Euclidean distance in the polar coordinate system and the probability of occurrence of obstacles as objective. Extensive simulations are utilized to analyze the effectiveness of the proposed technique on the metrics such as packet delivery ratio, average throughput, and routing overhead. The results obtained demonstrate that the proposed algorithm is better than the other related schemes in the existing literature.