This feature is configurable via options for both custom and marketplace routing applications. 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 stop balancing objective is used to encourage stop balancing of routes. This objective penalizes the longest route in the solution while during search it tries to not make the longest route any longer.
To enable the stop balancing objective and set the penalty to, say 1000, you can run with the following option model.objectives.stopbalancing 1000.0
. See options for specifying options for both remote and local runs. The higher the penalty, the more the solver will try to balance the stops between vehicles.
For custom apps, you can enable the option in code as follows: