Index based subset

Problems with modeling
Post Reply
Danielo
User
User
Posts: 2
Joined: 7 years ago

Index based subset

Post by Danielo »

Hey guys,

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

I have a set of jobs /j1*j5/ and a set of modes /m1*m10/. 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
deepak.agrawal
User
User
Posts: 9
Joined: 7 years ago

Re: Index based subset

Post by deepak.agrawal »

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
Last edited by deepak.agrawal 7 years ago, edited 2 times in total.
Danielo
User
User
Posts: 2
Joined: 7 years ago

Re: Index based subset

Post by Danielo »

Thanks, deepack.agrawal! You helped me a lot it works this way :-)
Post Reply