This paper proposes a density-guided ant colony optimization (DG-ACO) algorithm to address dynamic vehicle routing problems (DVRPs) involving real-time traffic fluctuations and dynamic customer demands. The algorithm integrates a grid-based spatiotemporal traffic density matrix to guide path exploration, along with a hybrid population initialization algorithm that combines uniform sampling and density-prioritized seeding to enhance convergence speed and solution diversity. To further improve adaptability, we introduce an adaptive large neighborhood search for dynamic request handling and a dynamic pheromone update mechanism that adjusts to real-time traffic conditions. Extensive experiments on 9 benchmark DVRP instances demonstrate that DG-ACO outperforms baseline algorithms, achieving up to 26.7% reduction in optimal path length and an average of 18.2% improvement in computational efficiency. The results validate the effectiveness of density-guided optimization and highlight the algorithm’s potential for real-time logistics and intelligent transportation systems.