I have a hard constraint which verifies that the load at any moment of the route does not go below zero.
The constraint worked well most times but some edge cases started to appear where the solution would contain invalid routes which do contain only one activity with a negative load.
I started to check the iterations that lead to such result and there was never a FULFILLED iteration with such route. That specific combination would always appear as NOT_FULFILLED or NOT_FULFILLED_BREAK.
My question is, how are routes marked as invalid appearing in the final solution?
There is not enough info to tell anything for sure, but I had very similar experience once.
I tell you my story, it may give you some hints, where to find the problem.
My story was about simple problem to solve: there were two shipments which had to be done with the same vehicle and the delivery of the first had to be immediatly before the pick up of the second. I made the constraint and found that it had been violated in the solution. Then I learnt that with constraints, also the insertation and ruin strategy had to be rewritten to match the criteria.The reason was that even when insertaion ensured the constraint, ruin didn’t honor it. I made the changes to the strategies, but then the solution had become sub optimal, because when the ruin removed only one of the activities, it were forced to put it back exactly where it were, literally freezing the initial solution.
The solution for the problem would have been to alter ruin to remove both jobs or none. (Instead of doing it, I redefined the meaning of job to handle the three activities as one. It is on an unofficial, yet unpublished branch.)
I’m not completely sure if your situation matches my case, but it may give you some lead. Stefan may give you better explanation, though.
I understand, I think, the ruin phase takes valid solutions, breaks them up and merges between them to provide new possible solutions. How do I apply my constraints such that only valid solutions are passed to the final solution?