This study aims to determine the best route using Artificial Intelligence (AI) based on the Particle Swarm Optimization algorithm under road conditions in Palembang City. This research employs You Only Look Once version 8 (YOLOv8) to develop a detection system and count the number of vehicles based on CCTV video recordings, achieving a model with mAP accuracy values of 84% for training and 83% …