Allow empty services and shipments

A request containing a single vehicle with both start- and end_address, but with no or empty services or shipments results in a Bad Request from the route-optimization api.

Of course there’s nothing to optimize in that case, but it would be convenient if this endpoint would just return a route between the points.

IMO is indicates that there is something wrong. Why move the vehicle if there is no service to do?

I’d say that is heavily dependent on which (user) interface your api is implemented to back. In our case our goal is to aid the user in his/her routing needs, whichever they may be. So the user can enter a start and end destination, as well as a number of assignments along the way.
I’d say that the existence of all the world’s routing services (without optimisation) indicates there may be lots of reasons to request a route from A to B, without something in between :slightly_smiling_face: .

A specific example would be “the vehicle is here now. It needs to be picked up there tomorrow”.

I do realise that we could switch to the routing api, if no services were chosen by the user, it’s just more stuff to implement and less convenient.

Also, there are already valid calls to the api, that doesn’t make sense from an optimisation perspective. E.g. a vehicle having a start an end and a single service. My request could even be hacked by moving the end location to a service location.

1 Like

Thanks - this makes sense. See the progress in https://github.com/graphhopper/jsprit/issues/449

1 Like