# Constraint to state the relation between 2 binary variables

I'm trying to deal with a process planning and machine layout allocation simultaneously.

I have the following variables:

• $$X_p{_w}_{cj}=1$$ if an operation $$p$$ is done by a machine $$w$$ with a configuration $$c$$ at process plan position $$j$$, and zero otherwise

• $$T_w{_{w'}}_{,jj+1}=1$$ if there is a change of machine $$w$$ between position $$j$$ and $$j+1$$, and zero otherwise.

• $$C_w{_{cc'}}_{,jj+1}=1$$ if for a given machine $$w$$ there is a change of configuration between position $$j$$ and $$j+1$$, and zero otherwise.

Since the variable $$X_p{_w}_{cj}$$ gives me the position of each machine and configuration on the process plan, I think I must establish a relation between this variable and $$T_w{_{w'}}_{,jj+1}$$ and $$C_w{_{cc'}}_{,jj+1}$$, respectively.

In order to do that, I created the following constraint:

$$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leqslant T_w{_{w'}}_{,jj+1} + 1$$

With this constraint I would like to state that for 2 followed positions on the process plan, the sum of variables $$X_p{_w}_{cj}$$ must be equal or less than the variable $$T_w{_{w'}}_{,jj+1}+1$$. In other words, this constraint states if there is a change of machine between $$j$$ and $$j+1$$.

Similarly, the following constraint states if there is a change of configuration for the same machine between $$j$$ and $$j+1$$.

$$X_p{_w}_{cj}+X_{p+1}{_w}_{{c'}j+1}\leqslant C_w{_{cc'}}_{,jj+1} + 1$$

I would like to know if it is correct or if there is a better way to express these relations. Could someone help me?

The following constraint should be correct:

$$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leq T_w{_{w'}}_{,jj+1} +1 \ \ \ \forall w,w',p,p+1,j,j+1$$

Because if in your machine layout allocation, the process flows from machine $$w$$ to machine $$w'$$ then $$X_{pwcj}$$ and $$X_{p+1w'cj+1}$$ both should be $$1$$. Otherwise, either $$T_{ww',jj+1}=0$$ that means one of the following situations:

1. your process is $$\{...,w,...,w',...\}$$ ($$w$$ is in position $$j$$ but $$w'$$ is not in position $$j+1$$)

2. your process is $$\{...,w,...,w',...\}$$ ($$w$$ is not in position $$j$$ but $$w'$$ is in position $$j+1$$)

3. your process is $$\{...,w,...,w',...\}$$ (neither $$w$$ is in position $$j$$ nor $$w'$$ is in position $$j+1$$)

The same logic procedure can be seen in your second constraint.

• thanks for your reply! It is not clear what you suggested to me "... so the model can then cover the situation in which operation p and p+1 can be done in the same machine but maybe with a change in configuration". With this constraint I want to state if there is a change of configuration in the same machine, so I fixed the machine and I try to evaluate just the changes in configuration. I am assuming that each operation is done once and j is the position on the process plan, so if I change the process position, operation also change. Oct 8, 2019 at 17:04
• @campioni, Now I understand the process so I modify my answer. But you did a good job in the modeling of this fairly complicated situation. Oct 8, 2019 at 17:04
• thank you for your feedback! :) Oct 9, 2019 at 7:05