Cluster Objective

A how-to guide for using the cluster objective with vehicle routing.

  • This feature is configurable via code for custom routing apps.
  • You can find a list of all available features here.

The cluster objective is used to encourage cluster compactness of routes. As the engine assigns stops to vehicles, the objective encourages 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. Note, clustered routes can be handled with either this hard constraint or with the cluster constraint.

Here is an example using the cluster objective in a custom application with a weight of 1000. You can specify the option in code before creating the model in your solver.

    options.Model.Objectives.Cluster = 1000

    model, err := factory.NewModel(input, options.Model)
    if err != nil {
        return runSchema.Output{}, err

Page last updated