Non-fulfilled routes appear as solution

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?

Thanks in advance

1 Like

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. :wink: 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.

one possible reason: the hard constraints control the insertion phase, but the ruin phase could break them.

like what we discussed in one of your earlier posts:

What are the downsides of providing a custom Ruin Strategy? Is there an example available?

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?

I’m really at a loss here.

hey @aj310 did you figure this out yet? I’m having the same problem.