- This feature is configurable via code for custom routing apps.
- You can find a list of all available features here.
- This how-to guide assumes you already completed the get started with vehicle routing tutorial.
The cluster constraint is used to enforce cluster compactness of routes. As the engine assigns stops to vehicles, the objective limits assignment to vehicles whose centroid is closer to a stop cluster than other vehicles. This can be useful if drivers have preferences to stay within a certain neighborhood/region after leaving the depot and are willing to drive longer distances if it means they can stick to a cluster of stops.
Here is an example using the cluster constraint in a custom application. You can specify the option in code before creating the model in your solver. Note, clustered routes can be handled with either this hard constraint or with the cluster objective.