GraphHopper.com | Forum | GitHub | Maps | Blog

Automatic stay overs depending on savings on total route length


#1

I have one vehicle which has many customers (services) per week to serve. Some appointments are fixed, some within a time range and other are completely flexible within the week. I assume for fixed start and end location per day it’s relatively easy to implement as described here: https://www.graphhopper.com/blog/2016/05/30/how-to-solve-a-traveling-salesman-problem-with-a-week-planning-horizon/.

Now I need to optimize the routing so that n stay overs (ex sleep in a hotel anywhere on the route) are automatically added if they reduce the total length of the route of the week by at least 100 km per stay over.

Example:

  • 0 stay overs => total length of route: 1000 km
  • 1 stay overs => total length of route: 700 km
  • 2 stay overs => total length of route: 550 km
  • 3 stay overs => total length of route: 500 km (so don’t add a third stay over, stick with 2)

However I have no clue how to implement this. Is it possible with jsprit at all? Any help is greatly appreciated.