Search code examples
pythonjob-schedulingor-toolscp-sat

OR Tools Job Shop Scheduling for multiple machines with setup times


I am pretty new to Google OR Tools and trying to set up a job shop scheduler for multiple machines with setup times in between each job (retrieved via a dictionary). This example gives a good hint of how to integrate setup times for a single machine: https://github.com/google/or-tools/blob/a0a56698ba8fd07b7f84aee4fc45d891a8cd9828/examples/python/single_machine_scheduling_with_setup_release_due_dates_sat.py#L215

Can you please give me a hint of how to expand this example to make it work for multiple machines? In detail, each job can be processed on different machines with different processing times similar to the flexible job shop scheduling example: https://github.com/google/or-tools/blob/stable/examples/python/flexible_job_shop_sat.py

Many thanks in advance for any hints or suggestions!


Solution

  • You need to take into account the literals of the optional intervals.

    For this, you need 4 things:

    • arc i+1 -> j+1 is selected implies that both interval_i and interval_j are selected
    • arc i + 1 -> i + 1 is associated with not(interval_i is active)
    • arc 0 -> 0 is associated with a literal meaning the machine is empty
    • for all interval_i, interval_i is active implies not(machine_is_empty)

    I wrote everything down in this recipe.