0
$\begingroup$

I am trying to convert the job shop scheduling example of CP-SAT, which goes as;

Below is a simple example of a job shop problem, in which each task is labeled by a pair of numbers (m, p) where m is the number of the machine the task must be processed on and p is the processing time of the task — the amount of time it requires. (The numbering of jobs and machines starts at 0.)

job 0 = [(0, 3), (1, 2), (2, 2)]

job 1 = [(0, 2), (2, 1), (1, 4)]

job 2 = [(1, 4), (2, 3)]

In the example, job 0 has three tasks. The first, (0, 3), must be processed on machine 0 in 3 units of time. The second, (1, 2), must be processed on machine 1 in 2 units of time, and so on. Altogether, there are eight tasks.

The difference in what I seek is that task 0 can be placed on multiple machines (for instance, 4). The constraint is of course that it can only be assigned to one of the four. How can i best setup this? Should I for example use a list of tuples per task? e.g.

job 0 = [ [(0, 3) (1,3) (2,3) (3,2)], (1, 2), (2, 2)] # task 0 for job 0 can occur on four machines, for which the shortest duration is on machine four (2).

$\endgroup$

1 Answer 1

2
$\begingroup$

It is called flexible job shop, and there is an example called flexible_jobshop_sat.py that implements it.

https://github.com/google/or-tools/blob/stable/examples/python/flexible_job_shop_sat.py

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.