DP on routes