Force 2 nodes to be assigned to different vehicles if both are successfully assigned #4284
Replies: 2 comments 6 replies
-
|
Actually, if a node is dropped, the vehicle var is -1. I’m pretty sure that is a hard feature you can rely on, specifically because you need it for exactly these situations. JamesOn Jun 24, 2024, at 20:18, FirstPotatoOnMars ***@***.***> wrote:
I am wondering whether there is a method which can help force 2 nodes to be assigned to different vehicles if both are successfully assigned?
I tried routing.solver().Add(routing.VehicleVar(pickup_index) == routing.VehicleVar(delivery_index)), but this would fail the solver when both nodes are dropped.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I am having a similar problem, with the following constraint: I also tried using: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am wondering whether there is a method which can help force 2 nodes to be assigned to different vehicles if both are successfully assigned?
I tried
routing.solver().Add(routing.VehicleVar(index1) != routing.VehicleVar(index2)), but this would fail the solver when both nodes are dropped.Beta Was this translation helpful? Give feedback.
All reactions