Originally posted by: Blestoy
Dear CPLEX community,
I am writing a mTSP model in which every caregiver have multiple service types.
acs: caregiver c that is able to perform service type s
ris: service requirement s that is required for patient i in p
Currently, the model works fine if every patient requires 1 service type and every caregiver can provide 1 service type I used the following constraint for this:
forall(i in 2..p, s in S)
sum(j in 1..p, c in C) a[c][s] * x[j][i][c][s] == r[i][s];
this will look like this in the dat file:
a = [
[1 0]
[0 1]];
r = [
[ 0 1 ]
[ 0 1 ]
[ 1 0 ]
[ 1 0 ]];
I now want to add syncrhonization to the model and thus some patient are required to need multple service types of different caregivers. so the dat file will look something like this:
a = [
[1 1 0 0]
[0 0 1 1]];
r = [
[ 0 0 1 0 ]
[ 0 1 1 0 ]
[ 1 1 0 0 ]
[ 1 0 0 0 ]];
To solve this I thought I have to implement the following constraint:
In cplex i wrote the following:
forall(i,j in 1..p, c in C, s in S)
(x[i][j][c][s] == 1) => (a[c][s] * r[j][s] == 1);
It is still not working and I have been trying for the past days to make it work. Maybe I am doing something wrong or is the constraint not the one I should use. I am not using CP and I am very new to using cplex.
#DecisionOptimization#OPLusingCPLEXOptimizer