question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add parameter to return heuristic solution only

See original GitHub issue

Title may not be expressing the issue exactly. Here is what I mean. Say, I am only interested in a greedy solution and want the algorithm terminate once the greedy solution is found. I input the following options:

prob.solve(greedy=True, cspy=False, exact= False, time_limit=60)

The output is as follows:

INFO:vrpy.vrp:new upper bound : max num stops = 44
INFO:vrpy.vrp:Clarke & Wright solution found with value 14418.517991046587 and 2 vehicles
INFO:vrpy.vrp:Greedy solution found with value 8882.48537930919 and 1 vehicles
INFO:vrpy.vrp:iteration 0, 8882.4
INFO:vrpy.vrp:time up !
INFO:vrpy.master_solve_pulp:total cost = 8882.48537930919

With the input arguments, shouldn’t it stop running right after “Greedy solution found with value…?” What is the iteration 0 for, and what does it try to solve until the time_limit is reached?

Now, also say, I am interested in a heuristic solution that the Pricing Strategy explains in 1. I run:

prob.solve(exact= False)

and receive:

INFO:vrpy.vrp:new upper bound : max num stops = 44
INFO:vrpy.vrp:Clarke & Wright solution found with value 14418.517991046587 and 2 vehicles
INFO:vrpy.vrp:Greedy solution found with value 8882.48537930919 and 1 vehicles
INFO:vrpy.vrp:iteration 0, 8882.4
INFO:vrpy.vrp:iteration 1, 8882.4
INFO:vrpy.vrp:iteration 2, 8882.4
INFO:vrpy.vrp:iteration 3, 8882.4
...

Does running the iterations mean, no heuristic solution found or would we receive an INFO if it was the case?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Kuifje02commented, Jun 5, 2021

See the docs for an example.

1reaction
torressacommented, May 13, 2021

That would work, or also setting max_iter=1 or 0 (just 1 iteration of the column generation algorithm or just return that initial heuristic solution)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add more parameters to A* heuristic than only distance?
Ideally, I would like to find a solution that allows me to easilly adjust/optimize such a relation between the cell's distance and its...
Read more >
Solving Options — VRPy 0.1.0 documentation - Read the Docs
It is possible to return the solution found by the Clarke and Wright algorithm by setting the heuristic_only argument to True.
Read more >
Binary variable fixing heuristic - IC-Unicamp
Restore the original problem by resetting all variables to their original bounds, and load the saved basis. Solve the original MIP problem, using...
Read more >
MIP Models - Gurobi Optimization
The Cutoff parameter indicates that the solver should only consider solutions whose objective values are better than the specified value, and should terminate ......
Read more >
Solver-independent Callbacks - JuMP
When a MIP solver reaches a new solution, for example with a heuristic or by ... Only add a lazy constraint if your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found