It has been quite a journey for me to go from 0 to understanding the job shop (js) and the flexible job shop (fjs) examples given by Google's ORTOOLS team.

Now the time has come for me to start modeling my reality which I believe is a variant of the FJS example above.

In my case :

  • Instead of having 1 resource per alternatives I need to have several resources per alternatives. For example, to perform task A I need to have Machine 1 and employee number 412 (alternative 1) or Machine 1 and employee number 516 (alternative 2) or machine 2 and machine 3 (alternative 3).

So, my take on this for now is :

  • Instead of having an alternative task described as [(3, 0), (1, 1), (5, 2)] I'm thinking of having something like [(3, List1), (1, List2), (5, List3)] where List1, List2 and List3 are sets of resources with different combinations.
  • Then having a NewBoolVar for each set of resources I have and implement it just as I saw in the example above.
  • But the enigma for me is how to force resources to be available at the same Interval ?

Before spending too much coding time in the wrong direction I wanted to ask some questions to the public :

  • Is it in your opinion the right approach to the problem (having a set of resources, a bool to toggle between the sets, and a way to have resources available in the same interval)?
  • Do you see another way of solving this?
  • Is there references/examples on this subject that I have missed (I didn't find any example with an alternative more than 1 machine/resource)?

As I said I'm in a learning process so don't hesitate to suggest learning paths.

  • $\begingroup$ Is it possible to share your mathematical model which you have tried to do? $\endgroup$
    – A.Omidi
    Sep 25, 2020 at 18:35

1 Answer 1


The sum(bool_vars) tells you each job has only one way to be executed. It does not tell you what is 'a' way.

You can reuse the bool_var from each alternative in multiple resources.


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.