getting some more output from or-tools

Viewed 1110

well I'm using the or-tools example "Vehicle Routing Problem with Time Windows" [1]

I modified it to my needs and I'm fine with the solution.

But, how can I get some metadata from the solver?

  • solving time

  • used algorithm (if auto decision was enabled)

  • number of iterations

  • etc.

In the example, there is just an assignment which is returned from the solver. I didn't found any of the information listed above.

regards. theother

[1] https://developers.google.com/optimization/routing/vrptw

edit:

Part of the solution is to lokk at the search_parameters. In this var are many information.

2 Answers

in python you can first enable log search before solving:

...
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
search_parameters.log_search = True
...
# Solve the problem.
solution = routing.SolveWithParameters(search_parameters)

example of output:

$ python vrp.py
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0512 13:41:39.431615 16227 search.cc:254] Start search (memory used = 23.05 MB)
I0512 13:41:39.431676 16227 search.cc:254] Root node processed (time = 0 ms, constraints = 88, memory used = 23.09 MB)
I0512 13:41:39.433583 16227 search.cc:254] Solution #0 (18, time = 1 ms, branches = 66, failures = 9, depth = 33, memory used = 23.09 MB)
I0512 13:41:39.437201 16227 search.cc:254] Finished search tree (time = 5 ms, branches = 101, failures = 51, neighbors = 1154, filtered neighbors = 6, accepted neigbors = 0, memory used = 23.09 MB)
I0512 13:41:39.437227 16227 search.cc:254] End search (time = 5 ms, branches = 101, failures = 51, memory used = 23.09 MB, speed = 20200 branches/s)
Related