PurposeWith the demographic increase, especially in big cities, heavy traffic, traffic congestion, road accidents and augmented pollution levels hamper transportation networks. Finding the optimal routes in urban scenarios is very challenging since it should consider reducing traffic jams, optimizing travel time, decreasing fuel consumption and reducing pollution levels accordingly. In this regard, the authors propose an enhanced approach based on the Ant Colony algorithm that allows vehicle drivers to search for optimal routes in urban areas from different perspectives, such as shortness and rapidness.Design/methodology/approachAn improved ant colony algorithm (ACO) is used to calculate the optimal routes in an urban road network by adopting an elitism strategy, a random search approach and a flexible pheromone deposit-evaporate mechanism. In addition, the authors make a trade-off between route length, travel time and congestion level.FindingsExperimental tests show that the routes found using the proposed algorithm improved the quality of the results by 30% in comparison with the ACO algorithm. In addition, the authors maintain a level of accuracy between 0.9 and 0.95. Therefore, the overall cost of the found solutions decreased from 67 to 40. In addition, the experimental results demonstrate that the authors’ improved algorithm outperforms not only the original ACO algorithm but also popular meta-heuristic algorithms such as the genetic algorithm (GA) and particle swarm optimization (PSO) in terms of reducing travel costs and improving overall fitness value.Originality/valueThe proposed improvements to the ACO to search for optimal paths for urban roads include incorporating multiple factors, such as travel length, time and congestion level, into the route selection process. Furthermore, random search, elitism strategy and flexible pheromone updating rules are proposed to consider the dynamic changes in road network conditions and make the proposed approach more relevant and effective. These enhancements contribute to the originality of the authors’ work, and they have the potential to advance the field of traffic routing.