Route optimization
By default, Timefold optimizes routes to minimize the amount of time drivers spend driving between stops. This lowers costs, reduces emissions, and makes drivers more productive as they spend less time driving.
1. Minimize travel time
The Minimize travel time soft constraint adds a soft score penalty to the dataset score for every second of travel in a route plan.
Timefold is incentivized to use the route plan with the lowest score.
By default, every constraint has a weight of 1, meaning that all constraints are equally important.
Use the constraint configuration’s minimizeTravelTimeWeight attribute to update the weight of the constraint and make it more or less important comparatively to other constraints.
{
"config":
{
"model":
{
"overrides":
{
"minimizeTravelTimeWeight": "10"
}
}
}
}
0 disables the constraint.
A constraint weight of 10, means the constraint is 10 times more important than a constraint with a weight of 1.
Next
-
See the full API spec or try the online API.