Replies: 2 comments 2 replies
-
You cannot. You need to recreate a model. |
Beta Was this translation helpful? Give feedback.
-
I'm not 100% sure of what you are asking. Are you saying the above script works fine with 200 nodes, but fails with 300+? Try turning on logging to see what is going on. search_parameters = pywrapcp.DefaultRoutingSearchParameters()
search_parameters.log_search = True Also, your distance matrix is incredibly inefficient. Every time the solver needs a distance, it has to run some code. One simple fix is to run all to all once and store that in a lookup matrix. But that is still terrible, because crossing from C++ to python is slow, and you are asking it to do that a lot with a large problem. Even better is to turn on caching so that the distance lookups for the dimensions are just called the minimum number of times needed from the C++. model_parameters = pywrapcp.DefaultRoutingModelParameters()
model_parameters.max_callback_cache_size = 2 * num_nodes
...
routing = pywrapcp.RoutingModel(manager, model_parameters) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a script to optimize the waste collect management, using python and OR-Tools (last version for both). The script runs in a good ways if the number of location is 200 or less, when i give it the real file with 344 locations, the script end without error or log, it stops.
It stops at this command solution = routing.SolveWithParameters(search_parameters)
I tried to incapsulate in an try except but nothing change
I tried also to change some parameter (like time_limit.seconds) but there was no change.
Did one of you encountered this problem and soleved it ?
Thanlks
Bragosso
Beta Was this translation helpful? Give feedback.
All reactions