Index based subset

Hey guys,

I’m implementing a mixed integer programming problem which are causing some troubles:

I have a set of jobs /j1j5/ and a set of modes /m1m10/. But not each job can be done in each mode, so I’m need a mapping such as AllowedModes of job3 = {m3, m4, m5} or AllowedModes of job5 = {m1, m4}. Finally I need a binary variable, e.g. z, which tells me, which job is done in which mode with the constraint that each job can only be done in one mode.

Can you help me?

Cheers,
Danielo

Which mods can do which jobs, is this a parameter?
I am assuming it is. P(j,m) a binary matrix saying if job j can be done by mode m or not. You can import it using csv file etc.

Assume a binary variable z(j,m) which is 1 if job j is done by mode m or else 0.
your constraint can be sum(m, z(j,m)) <= 1 for all j
another constraint will be z(j,m) <= P(j,m) for all j,m

Thanks, deepack.agrawal! You helped me a lot it works this way :slight_smile: