dwave.optimization.generators.flow_shop_scheduling#

flow_shop_scheduling(processing_times: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) Model[source]#

Generate a model encoding a flow-shop scheduling problem.

Flow-shop scheduling is a variant of the renowned job_shop_scheduling() optimization problem. Given n jobs to schedule on m machines, with specified processing times for each job per machine, minimize the makespan (the total length of the schedule for processing all the jobs). For every job, the i-th operation is executed on the i-th machine. No machine can perform more than one operation simultaneously.

E. Taillard provides benchmark instances compatible with this generator.

Note

There are many ways to model flow-shop scheduling. The model returned by this function may or may not give the best performance for your problem.

Parameters:

processing_times – Processing times, as an \(n \times m\) array-like of integers, where processing_times[n, m] is the time job n is on machine m.

Returns:

A model encoding the flow-shop scheduling problem.

Examples

This example creates a model for a flow-shop-scheduling problem with two jobs on three machines. For example, the second job requires processing for 20 time units on the first machine in the flow of operations.

>>> from dwave.optimization.generators import flow_shop_scheduling
...
>>> processing_times = [[10, 5, 7], [20, 10, 15]]
>>> model = flow_shop_scheduling(processing_times=processing_times)