Rework link optimization method and other classes to iterate links sorted by total tons.