i am trying to model vrp with multiple time windowsy model works but its slow and in many cases it gives no solution
How can i put the time windows constraint in a better way ? In order to make it faster
tuple timewin {
key int l1;
key int l2;
key int l3;
key int l4;
key int l5;
key int l6;
key int l7;
key int l8;
key int l9;
//key int l10;}
timewin lowerbound[d in Demands]=...;
(where l1,l2,l3,,,, is the lower bound of the time windows )
tuple timewin2 {
key int u1;
key int u2;
key int u3;
key int u4;
key int u5;
key int u6;
key int u7;
key int u8;
key int u9;
//key int u10;}
timewin2 upperbound[d in Demands]=...;
(where u1,u2,u3,,,, is the upper bound of the time windows )
and i added the constraint:
upperbound[d].u1 >=startOf(visit[d])>= lowerbound[d].l1 || upperbound[d].u2>=startOf(visit[d])>= lowerbound[d].l2 || upperbound[d].u3>=startOf(visit[d])>=lowerbound[d].l3||upperbound[d].u4 >=startOf(visit[d])>= lowerbound[d].l4 || upperbound[d].u5>=startOf(visit[d])>= lowerbound[d].l5 || upperbound[d].u6>=startOf(visit[d])>=lowerbound[d].l6||upperbound[d].u7>=startOf(visit[d])>=lowerbound[d].l7|| upperbound[d].u8>=startOf(visit[d])>=lowerbound[d].l8|| upperbound[d].u9>=startOf(visit[d])>=lowerbound[d].l9;
Note: not all the clients have 9 time windows ; but i duplicated the last time window for all of those who dont have 9 time windows so that i can write the tuple in the data file.