Recently, the Internet of Things (IoT) is widely considered in vehicular ad-hoc networks (VANETs) for use in intelligent transportation systems. In particular, the pervasive deployment of different sensors in modern vehicles has unlocked interesting possibilities for improving routing performance in VANETs. Nevertheless, the discovery of short single loop-free routes for effective and efficient information dissemination in VANETs remains a challenge. This challenge proves more difficult to solve since it reduces to the case of finding the shortest Hamiltonian path for effective routing in VANETs. Consequently, in this paper, we propose two discretized variants of the cuckoo search optimization (CSO) algorithm, namely, the Lévy flight-based discrete CSO (LF-DCSO) and the random walk-based discrete CSO (RW-DCSO) for effective route discovery in VANETs. In addition, we investigated the inverse mutation operator gleaned from genetic algorithm (GA) in order to improve the exploration properties of our DCSO variants. We describe a new objective function that effectively models the reliability of individual links between nodes that comprise a single route. A detailed report of the routing protocol that controls the routing process is presented. Our proposed methods were compared against the roulette wheel-based GA and the improved k-means-based GA termed IGAROT. Specifically, our findings reveal that there was no significant difference in the performance of the different methods in the low vehicle density scenario, however, in the medium vehicle density scenario, the RW-DCSO algorithm achieved 2.56%, 100%, and 128.57% percentage increment in its route reliability score over the LF-DCSO, RW-GA, and IGAROT algorithms, respectively. Whereas in the high vehicle density scenario, the LF-DCSO algorithm achieved a percentage increment of 42.85%, 525%, and 733.33% in the route reliability score obtained over the RW-DCSO, IGAROT, and RW-GA algorithms, respectively. Such results suggest that our methods are able to guarantee effective routing in VANETs.