Hi,

I’m working on a problem where waiting time at any depot can not be greater than X hours.

I can implement this hard constraint using HardActivityConstraint where during each insertion it will check waiting time.

But I suspect this is not the correct way to do it as it will reject the insertions which could give feasible solution after next set of insertions.

e.g: Consider a situation with empty route with only two nodes Start (S) and end (E).

Now let us consider if A is inserted in the route waiting time at A is more than X hours, hence the insertion will be rejected. But in the next insertion if we add node B between S and A waiting time at A will decrease, and it is possible it may become less than X hence giving a feasible solution. But as we already rejected insertion of A this situation will never occur.

Is this a valid doubt? or should I go ahead with HardActivityConstraint?

If not is there any other way to implement this?

Thanks in advance.