Skip to content

Need Help : Constraint on Max Travel Time in CVRP-TW #4291

Discussion options

You must be logged in to vote

My Gist based on your but using main branch (so pywrapcp has been replaced by pywraprouting etc..)
https://gist.github.com/Mizux/36a87040af87eb9c5324d49224f709ac

I also updated the print function to have more data display...

However, one error spotted: distance callback

    def distance_callback(from_index, to_index):
         from_node = manager.IndexToNode(from_index)
-        to_node = manager.IndexToNode(to_node)
+        to_node = manager.IndexToNode(to_index)
         if from_node in range(data["duplicate_nodes"], data["num_Locations"]):
             from_node = 0
         if to_node in range(data["duplicate_nodes"], data["num_Locations"]):

Also you can use the AddDisjunction([picku…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@abhijitdarekar
Comment options

@Mizux
Comment options

Mizux Jul 3, 2024
Maintainer

@abhijitdarekar
Comment options

@Mizux
Comment options

Mizux Jul 4, 2024
Maintainer

Answer selected by abhijitdarekar
Comment options

You must be logged in to vote
1 reply
@abhijitdarekar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #4290 on June 28, 2024 13:40.