Mathematical formulation in operations research

456 Views Asked by At

enter image description here

Does anyone know how I would enforce the following constraints using a mathematical formulation? Any help or feedback is appreciated.

a) If person A is given project 1, then person D must be given project 4 (but not vice versa).

b) Either person B is given project 2, or person E is given project 3, but not both.

2

There are 2 best solutions below

1
On

Have you come across 0-1 variables in your operations research studies? Could you combine 0-1 variables in some way to turn these condition into formal constraints?

So for example if Person A is given project 1, you could assign a value of 1. How would you constrain this to then always equal 0?

I'll add to the answer in a bit, but can you maybe get it from there?

EDIT 1: Ok, so I'll presume you have some knowledge of how 0-1 variables work. So if you have a variable $X_{A1}$ that equals 1 if A gets project 1, how can you ensure that means that D gets project 4? Well, you need another 0-1 variable say $X_{A1D4}$ that equals 1 only if D gets 4 and A gets one and then you need to set the constraint $X_{A1}-X_{A1D4}=0$.

This will ensure your first constraint is met. Can you get the second one yourself now?

0
On

Let $x_{i,j}$ the boolean variable which takes value 1 if project j-th is assigned to i-th person, zero otherwise.

We wish to translate the following statement

a) If person A is given project 1, then person D must be given project 4 (but not vice versa)

into a constraint mathematical formulation: if $x_{A,1}=1$ then $x_{D,4}=1 $. The constraint can be written as

$x_{D,4} \ge x_{A,1}$

With regard to the second question

b) Either person B is given project 2, or person E is given project 3, but not both

The constraint can be written as:

$x_{B,2} + x_{E,3} \le 1$

It is worth to mentionate two futher constraints which garantee that "every project is assigned to only one person":

$x_{A,1} + x_{B,1} + x_{C,1} + x_{D,1} + x_{E,1} + x_{F,1} = 1$ for 1st project

...

$x_{A,5} + x_{B,5} + x_{C,5} + x_{D,5} + x_{E,5} + x_{F,5} = 1$ for 5th project

and that "every person is assigned to no more than b projects":

$x_{A,1} + x_{A,2} + x_{A,3} + x_{A,4} + x_{A,5} \le b$ for 1st person

...

$x_{F,1} + x_{F,2} + x_{F,3} + x_{F,4} + x_{F,5} \le b$ for 6th person

where $ 1 \le b \le 5$