Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
    • Task Scheduling
  • Platform
Try models
  • Task Scheduling
  • User guide
  • Constraints

Task Scheduling

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Scheduling API concepts
      • Integration
      • Constraints
      • Using the API
        • Using the OpenAPI spec
        • API tooling
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Job types and machine types
      • Resource-specific durations
      • Freeze jobs until
      • Metrics and optimization goals
      • Score analysis
      • Validation
    • Machine and employee resource constraints
      • Machine unavailability
      • Resource transitions
      • Employee resources
    • Job service constraints
      • Time windows
      • Time management
      • Job dependencies
      • Priority jobs
      • Tags and specific resources
    • Real-time planning
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

Constraints

Overview

Constraints can be considered hard, medium, or soft.

Hard constraints represent rules and limitations of the real world that any planning solution has to respect. For instance, there are only 24 hours in a day and people can only be in one place at a time. Hard constraints also include rules that must be adhered to, for instance, a job must be scheduled after its minimum start time.

Breaking hard constraints results in infeasible plans.

Medium constraints help manage plans when resources are limited, for instance, minimize the number of unassigned jobs. Medium constraints incentivize Timefold Platform to assign as many jobs as possible.

Soft constraints help optimize plans based on the business goals, for instance, minimizing the makespan of the schedule.

To help determine the quality of solutions, plans are assigned a score with values for hard, medium, and soft constraints.

0hard/-257medium/-6119520soft

Timefold examines many solutions during solving and is incentivized to use the solution with the highest score.

From the example score above, you can see zero hard constraints were broken, while both the medium and soft scores have negative values (the scores do not show how many constraints were broken, but values associated with those constraints).

Because breaking hard constraints would result in an infeasible solution, a solution that breaks zero hard constraints and has a soft constraint score of -1,000,000 is better than a solution that breaks 1 hard constraint but has a soft constraint score of 0.

It’s important to note that constraints have competing goals, for instance, a constraint that is concerned with fairness or load balancing may result in a solution that takes longer to execute, whereas constraints concerned with shortening the overall solution time may result in a solution that isn’t fairly disrupted among the available resources.

Timefold balances the competing priorities of constraints to arrive at solutions with the best overall score.

Task Scheduling constraint groups and constraints

Constraints are grouped together with similar constraints into constraint groups. The following constraint groups are available in Task Scheduling.

Job service constraints

  • Time windows

  • Time management

  • Job dependencies

  • Priority jobs

  • Tags and specific resources

Machine and employee resource constraints

  • Machine unavailability

  • Resource transitions

  • Employee resources

Constraint weights

Every constraint has a weight and a match score that will be applied to the dataset score every time the constraint is matched.

The final score for an instance of a constraint being matched is calculated by multiplying the constraint weight by the match score.

Active soft constraints have a default weight of 1, meaning that all soft constraints are equally weighted. Constraint weights can be changed to make some constraints more important than others.

A constraint with a weight of 10, increases the impact of the score by a factor of 10 (10 * match score).

When a constraint has a weight of 0, the constraint score has no impact.

The match score is derived from the penalty or reward constraints apply when they are matched.

Constraint weights have a maximum value of 1,000,000,000,000 (one trillion). This limit is enforced when saving a configuration profile and when submitting a dataset. The limit is imposed to prevent score overflow.

For instance, the Minimize makespan constraint adds a soft penalty that is derived from the total makespan of the job in minutes. If the makespan of the job is 12 hours, the match score is -720.

If the minimizeMakespanWeight (which sets the weight of the Minimize makespan constraint) is set to 1, the final soft score for this instance of the constraint matching will be -720. If the minimizeMakespanWeight is set to 2, the final soft score for this instance of the constraint matching will be -1440.

Constraint weight configuration

Constraint weights can be configured in individual input datasets or as part of a configuration profile that can be reused with future input datasets.

You can access the list of available constraint weights in the configuration profiles.

Configure a configuration profile

Constraint weights can be configured in Timefold Platform by creating a configuration profile and setting the weight in the configuration profile.

Setting the constraint weights in a configuration profile ensures the same weights are used whenever the configuration profile is applied to a dataset.

To configure constraint weights:

  1. Log in to Timefold Platform: app.timefold.ai

  2. Select the Task Scheduling tile.

  3. Select Configuration profiles.

  4. Add a new configuration profile (or modify an existing profile) and configure the constraint weights.

The configuration profile can be specified when you submit a new dataset by appending a query parameter with the configuration profile ID to the POST URL.

For instance: ?configurationId=b7eef8b5-14ca-4a45-a943-582381bd1b08

The profile name can be used instead of the ID, but we recommended using the ID: if the profile is renamed, the query parameter will no longer match the intended profile.

Alternatively, the profile can be selected in the platform UI when creating or re-solving a dataset.

Learn more about configuration parameters and profiles.

Configure constraint weights in an input dataset

Constraint weights can be configured per JSON input dataset.

For instance, to set the exampleWeight to 10 add the following:

{
  "config": {
    "model": {
      "overrides": {
        "exampleWeight": 10
      }
    }
  }
}

Next

  • See the full API spec or try the online API.

  • Learn about balancing different optimization goals.

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