Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Pick-up and Delivery Routing
  • Driver resource constraints
  • Route optimization

Pick-up and Delivery Routing

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terms
      • Planning AI concepts
      • Demo datasets
      • Validation
      • Routing with Timefold’s maps service
      • Metrics and optimization goals
    • Driver resource constraints
      • Lunch breaks and personal appointments
      • Route optimization
      • Shift hours and overtime
    • Job service constraints
      • Time windows and opening hours
      • Skills
      • Movable stops and multi-day schedules
      • Dependencies between stops
      • Priority stops and optional stops
      • Job requirements and tags
        • Job required drivers
        • Job pooling
        • Prohibit job combinations
        • Maximum time burden
        • Driver capacity
        • Tags
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

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.

  • © 2025 Timefold BV
  • Timefold.ai
  • Documentation
  • Changelog
  • Send feedback
  • Privacy
  • Legal
    • Light mode
    • Dark mode
    • System default