GraphHopper.com | Forum | GitHub | Maps | Blog

Hop-on and Drop-offs in specific order


#1

Hi,

following issue:

our software calculates the optimal route in a salesman-problem-like order. But, some points need be after some other points.

This case comes, when there are hop-on-stops of customers with their drop-off-stop.

Even if its optimal, the drop-off-stops need to be after the hop-on-ones.

How can we manage this?

thanks a lot!


#2

Can you try to use the relation in_sequence or in_direct_sequence?


#3

Awesome, thanks! “in_sequence” makes it surely.


#4

I need to ask again,

I we use the routing API over an API-quest like
https://graphhopper.com/api/1/route?point=50.82752,12.924304&point=50.983225,13.196857&point=51.020904,12.954339&point=50.81761,12.91838&point=51.089565,12.761835&vehicle=car&locale=de&optimize=true&instructions=false&calc_points=false&key=[key]

how can we tell the API, if there are waypoints which needs to placed after waypoints?

Thank you!


#5

If you want more control of the route optimization process you’ll need to use the Route Optimization API (but without calc_points) and then use the returned waypoint order to query the Routing API without optimize=true