Algorithms for Traffic Engineering