Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
    • Task Scheduling
  • Platform
Start Free Trial
  • Pick-up and Delivery Routing
  • More information
  • FAQs
  • latest
    • latest
    • 1.8.x
    • 1.7.x

Pick-up and Delivery Routing

  • The basics
    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Use case guide
      • Scheduling API concepts
      • Integration
      • Constraints
      • Using the API
        • Using the OpenAPI spec
        • API tooling
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Input validation
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Maps service
      • Metrics and optimization goals
      • Score analysis
      • Visualizations
  • Feature guides
    • Driver resource constraints
      • Lunch breaks and personal appointments
      • Route optimization
      • Shift hours and overtime
      • Driver capacity
    • Job service constraints
      • Time windows and opening hours
      • Skills
      • Multi-day schedules and movable stops
      • Dependencies between stops
      • Priority jobs and optional jobs
      • Stop service level agreement (SLA)
      • Job requirements and tags
        • Job required drivers
        • Job pooling
        • Prohibit job combinations
        • Maximum time burden
        • Tags
  • Responding to change
    • Recommendations
      • Job time window recommendations
      • Stop time window recommendations
    • Real-time planning
      • Real-time planning: pinning stops
      • Real-time planning: extended stop
      • Real-time planning: reassignment
      • Real-time planning: no show
      • Real-time planning: driver ill
  • More information
    • FAQs
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

FAQs

Answers to common questions about the Pick-up and Delivery Routing model.

Constraints and weights

Which rules should be hard constraints and which should be soft?

When deciding to use hard or soft constraints, make a rule hard only when a plan that breaks it can’t be used, for instance because it breaks a law, a safety rule, or a physical limit. Make every other rule soft.

The Pick-up and Delivery Routing model will avoid breaking hard constraints. If it can’t assign work without breaking one, it leaves the work unassigned and shows it as unassigned in the output dataset. Medium constraints push the model to assign as much work as possible, and soft constraints compete with each other based on their weights. Every hard rule you add limits the options the model has, so too many hard rules lead to more unassigned work.

You don’t set the level of each constraint yourself. Each constraint in the model has a fixed level, and many rules have a required version (hard) and a preferred version (soft). You choose the level by which version you use in your input dataset.

For rules with some flexibility, use both versions together. For instance, if a driver’s shift usually ends at 17:00 but can run to 19:00, set the shift’s maxSoftEndTime to 17:00 and its maxEndTime to 19:00. The model then avoids overtime, but uses it when assigning more stops is worth the cost.

Constraints that depend on optional input only apply when your input dataset includes that data.

For more information, see Constraints.

What should my plans optimize for?

Optimize for the goals that cost your business the most when a plan gets them wrong.

The right goals depend on your business, so organizations with similar operations often optimize for different things. For instance, one organization accepts overtime to meet its service level agreements, while another limits overtime because it leads to high employee turnover.

To choose your goals:

  1. Decide which metrics matter most to your business and rank them by importance.

  2. Review the example optimization goals for the Pick-up and Delivery Routing model.

  3. Tune the constraint weights that affect those metrics, as described in How do I choose values for constraint weights?.

Your goals can change over time. For instance, some organizations allow more overtime at the end of a quarter to clear a backlog. Create a configuration profile for each set of goals, and select the profile that matches your current goals when you solve a dataset.

How do I choose values for constraint weights?

Start with the default weights, and change them only when a plan doesn’t match what your planners expect. The Pick-up and Delivery Routing model’s defaults are set to balance its optimization goals.

Weights are relative. A constraint with a weight of 0 turns the constraint off. Doubling a constraint weight doubles the impact of the constraint. Multiplying every weight by the same number doesn’t change the plan.

Doubling a weight doesn’t halve the related metric. Constraints compete with each other, so the only way to see the effect of a change is to solve datasets with the new weights and compare the results.

To tune the weights:

  1. Find the output metric that doesn’t meet expectations, for instance too much overtime.

  2. Use score analysis to find the constraints that affect that metric.

  3. Change the weights of those constraints in a new configuration profile.

  4. Solve representative datasets with the new profile.

  5. Compare the results. Use the comparison UI for out-of-the-box metrics or your own tool for custom metrics. Check that the metric improved and that no other important metric got worse.

  6. Repeat for the next metric that doesn’t meet expectations.

Hard and medium constraints always take priority over soft constraints, so a higher soft weight never causes the model to break a hard or medium constraint. If increasing a soft weight has no effect on the plan, a hard or medium constraint is probably preventing the change.

The same happens when there aren’t enough resources to assign all the work. Assigning as much work as possible leaves the model few options, so changing soft weights has little effect on the plan.

Weights have a maximum value of 1,000,000,000,000 (one trillion).

For more information, see Metrics and optimization goals and Balancing different optimization goals.

Should I create a configuration profile for each client?

Yes. A configuration profile saves a set of constraint weights, model configuration, and solve settings, so every dataset you solve with that profile uses the same settings. Create a profile for each client, site, or planning scenario that needs different settings. You can add up to 50 configuration profiles for the Pick-up and Delivery Routing model.

To add a profile, log in to Timefold Platform, select the Pick-up and Delivery Routing model, and select Configuration profiles. You can also manage profiles with the Platform API.

To use a profile, add its ID to the POST URL when you submit a dataset, for instance ?configurationId=b7eef8b5-14ca-4a45-a943-582381bd1b08. You can also select the profile in the platform UI when you create or re-solve a dataset. Datasets that don’t specify a profile use the default profile. Learn about using configuration profiles.

Use configuration overrides in the input dataset only for values that change from one dataset to the next. Overrides in the input dataset take priority over the profile.

Before you change a profile’s weights, check that your input datasets include the data needed by the related constraints. For instance, the weight of a constraint about preferences has no effect if your input datasets don’t include any preferences.

For more information, see Configuration profiles and parameters.

If I build Timefold into my own planning software, should my users be able to change constraint weights?

In most cases, no. Give your users a small number of named choices instead, and change the weights behind the scenes.

When planners can change every weight, they tend to keep adjusting the settings and re-solving the plan. Planning becomes a manual process again, and planners lose the time that automatic scheduling saves.

Instead, offer one of the following:

  • One default setting that works for most of your clients.

  • Two or three named options that match your clients' goals, for instance "Shortest travel time" and "Fewest late deliveries". Each option uses its own configuration profile.

  • A slider between two goals, for instance travel time and late deliveries, that changes several weights at once.

If your users are experienced planners who understand the trade-offs between goals, you can give them access to more of the weights. Seeing what the model takes into account can help them trust the plan.

For more information, see Constraints.

How do I handle planning rules that are inconsistent or undocumented?

Start with the rules a plan must follow to be usable, then add rules until your planners accept the plan.

Planning rules often come from different places. Some are laws or contracts, some exist only in a planner’s head, and some are habits that nobody has questioned. Try to identify different sources of rules, for instance, managers and department heads will be able to tell you the rules that are important to their teams. Treat each rule as real until you’ve tested it, but don’t assume every rule must be a hard constraint.

Before you make a rule hard, check your past schedules against it. Past schedules often break rules that planners describe as fixed. Submit one of your past schedules, with its assignments, to score analysis to see which constraints it breaks. If your past schedules regularly break a rule, use the preferred (soft) version of the rule instead of the required (hard) version.

To find out whether a rule is worth its cost, solve the same dataset with and without the rule, and compare the results with your planners. If the plan without the rule is better and still acceptable, you can relax or remove the rule.

For more information, see Which rules should be hard constraints and which should be soft?.

What if the model doesn’t support one of my rules?

First, check whether an existing constraint already covers the rule. The Pick-up and Delivery Routing model includes constraints for the most common planning rules, and many rules that seem specific to your business can be expressed with existing features. For instance, a rule about who can work at which location can often be expressed with tags.

To check, see Constraints for the constraints grouped by feature, or the full constraint list on the model’s information page in Timefold Platform. If you find the rules don’t quite fit your use case, contact us for help.

If no existing constraint covers the rule, contact us with a description of the rule, including its edge cases and why your business needs it. You can also submit or vote for a request on the feature requests board.

You can’t add your own constraints to the Pick-up and Delivery Routing model. New constraints are added by Timefold and announced in the changelog. Some new constraints are disabled by default, so check the changelog entry to see whether you need to set a weight to enable it.

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