Google ORTools - Nodes that can't share the same route

落花浮王杯 提交于 2021-01-29 04:01:13

问题


I need to solve this routing problem: two nodes cannot share the same route.

I.e.: if vehicle stop at node A, it shouldn't be allowed to stop also at node B, that means that node A and node B cannot be on the same route.

Any ideas? Thanks in advance for your help.

Fabio


回答1:


Did you try:

routing.solver().Add(routing.VehicleVar(index_a) != routing.VehicleVar(index_b))


来源:https://stackoverflow.com/questions/61405089/google-ortools-nodes-that-cant-share-the-same-route

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!