Google OR-Tools Set Fixed Start Location and Allow Arbitrary End Location

Viewed 655

For a VRP in or-tools, is there a way to have vehicles start at some fixed locations, but allow for arbitrary end locations?

The documentation https://developers.google.com/optimization/routing/routing_tasks#setting-start-and-end-locations-for-routes and https://developers.google.com/optimization/routing/routing_tasks#allowing-arbitrary-start-and-end-locations show present how to set custom or arbitrary start/end locations respectively.

My question is can we combine them both? i.e. custom start location and arbitrary end location(and vice-versa)?

Thank you

1 Answers

You just need to tweak your distance matrix to have a zero length from any normal node to the end nodes, and ignore this last arc when reading the solution.

Related