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

update_all_ip_primal_solutions! reverse loop #397

Closed
guimarqu opened this issue Oct 14, 2020 · 5 comments
Closed

update_all_ip_primal_solutions! reverse loop #397

guimarqu opened this issue Oct 14, 2020 · 5 comments
Labels
discussion Further information is requested documentation Need or contain documentation
Milestone

Comments

@guimarqu
Copy link
Contributor

function update_all_ip_primal_solutions!(
dest_state::OptimizationState, orig_state::OptimizationState
)
# we do it in reverse order in order not to store the same solution several times
if nb_ip_primal_sols(orig_state) > 0
for ip_primal_sol in reverse(get_ip_primal_sols(orig_state))
update_ip_primal_sol!(dest_state, ip_primal_sol)
end
end

@rrsadykov what does it change if you loop in reverse or normal mode ? I don't understand the comment.

@guimarqu guimarqu added the discussion Further information is requested label Oct 14, 2020
@guimarqu
Copy link
Contributor Author

guimarqu commented Oct 14, 2020

Because you want to store all of them and if you start by the beginning you'll only store the best one ?
We should use add_ip_primal_sol! in that case.

@rrsadykov
Copy link
Collaborator

Yes, this is the idea: we use update_ip_primal_sol!() to store only improving solutions. Otherwise the same solution may be stored several times (orig_state is usually initialized by dest_state in the code), or we would need to compare all solutions one-by-one which takes time.
Because we use update_ip_primal_sol!(), we need to call it for new solutions in the reverse order, otherwise only the best improving solution would be stored.

@guimarqu guimarqu added the documentation Need or contain documentation label Oct 14, 2020
@guimarqu
Copy link
Contributor Author

Ok nice

@guimarqu
Copy link
Contributor Author

I leave the issue open, I would like to try things later to see if we can avoid having too many extra methods to handle solutions

@guimarqu guimarqu reopened this Oct 14, 2020
@guimarqu guimarqu added this to the v0.5 milestone Aug 31, 2021
@guimarqu guimarqu modified the milestones: v0.5, 2022T1 Dec 16, 2021
@guimarqu
Copy link
Contributor Author

guimarqu commented Jun 5, 2023

This method does not exist anymore.

@guimarqu guimarqu closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Further information is requested documentation Need or contain documentation
Projects
None yet
Development

No branches or pull requests

2 participants