itinero / optimization

Routing optimization module module for Itinero.
Apache License 2.0
51 stars 17 forks source link

There's a way to optimize a route based on time windows for specific locations? #35

Open mhosman opened 5 years ago

mhosman commented 5 years ago

The idea is to set a custom time to a specific location in order to arrive at the time specified to that specific waypoint.

xivk commented 5 years ago

There is support for timewindows in a basic TSP setting. But I don't think for this case it would work properly but it could.

The idea is that you build a 'model', that model then gets processed by all available 'solvers' and they decide if they can solver the given model or not. If there is a solver available you will get a solution in response.

It's this model that you have to build:

https://github.com/itinero/optimization/blob/develop/src/Itinero.Optimization/Models/Model.cs

An example of this is here:

https://github.com/itinero/optimization/blob/develop/src/Itinero.Optimization/Optimizer.cs#L78 https://github.com/itinero/optimization/blob/develop/src/Itinero.Optimization/Optimizer.cs#L105

You should be able to add a timewindow to the visits:

https://github.com/itinero/optimization/blob/develop/src/Itinero.Optimization/Models/Visits/Visit.cs#L42

As I said, this library is unreleased for now, I'm not sure how good the current TSP-TW code performs.

mhosman commented 5 years ago

Thank you very much for your response. My idea is to get something like https://docs.graphhopper.com/#tag/Route-Optimization-API for route optimization: Multiple vehicles, multiple waypoints and time windows.