Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimality tolerance depending on the algorithm #395

Merged
merged 5 commits into from
Oct 14, 2020
Merged

Optimality tolerance depending on the algorithm #395

merged 5 commits into from
Oct 14, 2020

Conversation

guimarqu
Copy link
Contributor

@guimarqu guimarqu commented Oct 10, 2020

Fix #370

  • Conquer algorithm returns OPTIMAL if the node is pruned, OTHER_LIMIT otherwise.
  • Add absolute & relative optimality tolerances in ColumnGeneration
  • New methods lp_gap_closed and ip_gap_closed to check convergence with opt tolerances as kw arguments.

@guimarqu guimarqu added bug Something isn't working enhancement New feature or request Algo labels Oct 10, 2020
@codecov
Copy link

codecov bot commented Oct 10, 2020

Codecov Report

Merging #395 into master will decrease coverage by 0.18%.
The diff coverage is 84.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
- Coverage   76.75%   76.57%   -0.19%     
==========================================
  Files          52       52              
  Lines        4122     4145      +23     
==========================================
+ Hits         3164     3174      +10     
- Misses        958      971      +13     
Impacted Files Coverage Δ
src/Algorithm/Algorithm.jl 100.00% <ø> (ø)
src/Algorithm/benders.jl 85.35% <ø> (ø)
src/Algorithm/branching/branchingalgo.jl 93.02% <0.00%> (ø)
src/Coluna.jl 100.00% <ø> (ø)
src/ColunaBase/ColunaBase.jl 100.00% <ø> (ø)
src/MathProg/MathProg.jl 100.00% <ø> (ø)
src/ColunaBase/solsandbounds.jl 68.00% <25.00%> (+0.43%) ⬆️
src/Algorithm/conquer.jl 75.90% <87.50%> (+2.29%) ⬆️
src/Algorithm/treesearch.jl 79.86% <88.23%> (-9.03%) ⬇️
src/Algorithm/colgen.jl 95.83% <88.88%> (+0.04%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50b2f4e...42ee8f0. Read the comment docs.

@guimarqu guimarqu marked this pull request as ready for review October 14, 2020 09:28
@guimarqu guimarqu requested a review from rrsadykov October 14, 2020 09:29
"IP Gap is non-positive: ", ip_gap(getincumbents(node)), ". Abort treatment."
)
else
if ip_gap_closed(nodestate)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a warning for me. It is totally ok to have no gap here, as the best primal solution may be improved between creation of a node and its treatment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I put it as info

@@ -150,7 +150,10 @@ function run!(algo::ColCutGenConquer, data::ReformData, input::ConquerInput)
colgen_output = run!(algo.colgen, data, OptimizationInput(nodestate))
update!(nodestate, getoptstate(colgen_output))

while !to_be_pruned(node) && nb_tightening_rounds < algo.max_nb_cut_rounds
subproblem_pruned = getterminationstatus(nodestate) == INFEASIBLE ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name subproblem_pruned is not good for me, it should be node_pruned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -150,7 +150,10 @@ function run!(algo::ColCutGenConquer, data::ReformData, input::ConquerInput)
colgen_output = run!(algo.colgen, data, OptimizationInput(nodestate))
update!(nodestate, getoptstate(colgen_output))

while !to_be_pruned(node) && nb_tightening_rounds < algo.max_nb_cut_rounds
subproblem_pruned = getterminationstatus(nodestate) == INFEASIBLE ||
ip_gap_closed(nodestate, atol = algo.colgen.opt_atol, rtol = algo.colgen.opt_rtol)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you use algo.colgen.opt_atol and algo.colgen.opt_rtol if you defined opt_atol and opt_rtol for ColCutGenConquer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because if ColCutGenConquer has a smaller tolerance than ColumnGeneration, the node will be considered as not pruned whereas the ColumnGeneration will. So we'll have an infinite loop. In the future, I'll create a method init for algorithms that prepare storages and adjust tolerances if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed like you said and I put a TODO comment in the parameters of the algorithm.

end

updatedualbound!(tsdata)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dual bound calculation of the tree search algorithm should be corrected: the dual bound cannot be better than the worst dual bound of pruned nodes. The latter value should be stored and updated in the tree search data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@guimarqu guimarqu requested a review from rrsadykov October 14, 2020 13:50
@guimarqu guimarqu merged commit 61d91e1 into master Oct 14, 2020
@guimarqu guimarqu deleted the opt_tol branch October 14, 2020 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algo bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with low optimality tolerance
2 participants