Discover the Cluster constraint and how to use it in your operation

Manuel Sagarra avatar
Written by Manuel Sagarra
Updated over a week ago

Cluster is a "soft" constraint that will allow the optimizer to group those stops that have the same value in that field.

This means that once you have defined the clusters and click on Optimize Routes, the optimizer will try to group all stops that have the same value in the text field into the same vehicle. For example:

  • All stops with the text in cluster "cluster1" will be made by vehicle A.

  • All stops with the cluster text "group" will be made by vehicle B.

  • All stops with the cluster text "customer-6" will be performed by vehicle C.

  • ...

Why do we call it "soft"?

"Hard" constraints are those that have to be met for a solution to be valid, such as time windows, capacities, provides/requires. For these cases, a stop that does not meet these constraints will never be assigned.

With Cluster this will not happen. That is, if you have a stop in Madrid and a stop in Barcelona with the same Cluster but vehicles in both cities, two different vehicles will make them. This will happen because the optimizer will automatically prioritize time and distance over this restriction.

How to enable it

If you want to use this constraint, you must enable it as follows:

Project Settings > Planner Fields > Constraints

Did this answer your question?