Sorry, bad wording in the title. Problem I'm trying to solve: a CVRPTW, but want to assign an arbitrary start point (but not an arbitrary end point).
How I approached this problem: So this is basically a CVRPTW for which I'm trying to alter the code.
1) I know from the documentation you can assign arbitrary start and end points by inserting a row of 0s and column of 0 at the beginning of the distance matrix. I got this part to work fine, and the results were good.
2) I know you can assign start and end locations from the documentation using data['starts'] and data['ends']. I got this part to work as a standalone fine as well
Essentially, I tried to combine the 2 problems by adding the row + column of 0s, and specifying:
data['starts'] = 0 ; (where 0 is the row of 0s in the distance matrix)
data['ends'] = 1 ; (where 1 contains the distances from the depot and every other point)
The problem comes when I combine the 2 approaches, where Python exits without finding a solution. If I remove the following line of code, everything works fine:
Not sure what is causing this. Any help appreciated!
It sounds like you mean that all vehicles can start "anywhere" but must finish at one specific depot. Simulate this by using a depot and make it free to travel from that depot and just use a cost to that depot.
It sounds like you mean that all vehicles can start "anywhere" but must finish at one specific depot. Simulate this by using a depot and make it free to travel from that depot and just use a cost to that depot.
Sorry, yeah, that's exactly what I meant. I'll give that a go!
Thanks for that @CervEdin, that worked for me!
Most helpful comment
It sounds like you mean that all vehicles can start "anywhere" but must finish at one specific depot. Simulate this by using a depot and make it free to travel from that depot and just use a cost to that depot.