Add parameter to return heuristic solution only
See original GitHub issueTitle 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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
See the docs for an example.
That would work, or also setting
max_iter=1
or0
(just 1 iteration of the column generation algorithm or just return that initial heuristic solution)