There is always one unassigned node when setAmortizedCostFactorOfAllVehicles and addDisjunction are used together and the problem has one vehicle #2988
Unanswered
KeremAslan
asked this question in
Routing (and legacy CP) questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of OR-Tools and what language are you using?
Version:
JVM: v8.1.8487
Python: v8.2.8710
Language: Kotlin/Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Routing Solver
What operating system (Linux, Windows, ...) and version?
MacOS
What did you do?
When using the function
setAmortizedCostFactorOfAllVehicles
in conjunction withaddDisjunction
, I have found that there is always one node that gets unassigned. I use Kotlin in my project, but I have set up a minimal reproducible example in Python that also has the bug. Please find the project here.What did you expect to see
In my
create_simple_model()
function I have one pick-up node and one delivery node and I expect both nodes to get assigned as the penalty on unassigning them is very large. Instead, OR-Tools always unassigns one node so long there is only one vehicle. The moment you add a second vehicle, it is able to allocate both nodes to a single vehicle and the solution returned is as expected.The fact that I can reproduce this using your example makes me think there is a bug in OR-Tools where
setAmortizedCostFactorOfAllVehicles
doesn't work well when the problem has only one vehicle. Can you help check what that bug could be? Many thanks!Beta Was this translation helpful? Give feedback.
All reactions