Optimal Dynamic Routing by Iterative Methods