—Ant colony optimization (ACO) is a probabilistic technique used for solving complex computational problems, such as finding optimal routes in networks. It has been proved to perform better than simulated annealing and genetic algorithm approaches for solving dynamic problems. ACO algorithms can quickly adapt to real-time changes in the system. In this paper, we propose an ACO-based algorithm to solve the dynamic anycast routing and wavelength assignment (RWA) problem in wavelength-routed optical networks. Using extensive simulations, we show that ACO-based anycast RWA significantly reduces blocking probability compared to the fixed shortest-path first (SPF) and other load-balancing and dynamic algorithms.