Implement rerouting optimization methods. They are not tested yet.