Arrival time input

Hi,

Is it possible to provide an arrival time and the routing would generate the route backwards and provide an estimate departure time to leave to arrive in time.

I’m looking to work the route backwards, so it provides a good estimate on when the leave to arrive on time.

Thanks,
Brandon

The normal car routing does not specify the departure (or arrival time) and only the duration of the route. With that you can easily calculate the arrival time. Or do you have this problem for public transit?

In this case we create appointments lets say 12:00, we would like to build a route from 12:00 backwards to estimate the departure time to reach the appointment on time.

We have a set of time bands per edge for historical road speed times, so the route must be traversed end to start and calculate the weight based on the historical road speed.

Unfortunately, calculating the route and then subtracting the duration to provide an estimated departure time doesn’t fit our specification and wouldn’t be accepted as a possibility.

Although we can only estimate a departure time, if we could create the route backwards, and then estimate the depature time that would be enough to satisfy the specification.

When you have historical road speed information the situation changes if you have a time-dependent algorithm. But GraphHopper does not support this (yet) and so it does not change anything if you calculate it forward (and estimate the arrival from this) or if you calculate it backward.

If you want to integrate time in the algorithm you’ll need some more changes and basically add the time as state in the algorithm.

And then if you want to run the algorithm backward you need to have a look into the backward search of DijkstraBidirectionRef, but there is no out of the box solution.

Perfect, if I were to use a time band weight during the CalcEdgeWeight function inside CustomWeighting class

The route does not change as expected based on off peak and rush hour, do you have any points as to where else may need to change to take into consideration the new weight on each edge?

Currently it’s as simple as inside CalcEdgeWeight I return the provided weight for the time band rather than calculating it based on, speed and distance.

But then the duration would not be a true reflection of the new route, I have tried incrementing the speed conv from 3.2 to 5.7 but I’m not entirely sure the use of that as it also seems to be a “fake” time rather than a true duration calculation