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

HillClimbing acceptance criterion #82

Merged
merged 23 commits into from
Jun 22, 2022
Merged

HillClimbing acceptance criterion #82

merged 23 commits into from
Jun 22, 2022

Conversation

leonlan
Copy link
Collaborator

@leonlan leonlan commented Jun 5, 2022

@codecov
Copy link

codecov bot commented Jun 5, 2022

Codecov Report

Merging #82 (a581493) into master (233743f) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #82   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        26    +1     
  Lines          548       579   +31     
=========================================
+ Hits           548       579   +31     
Impacted Files Coverage Δ
alns/accept/LateAcceptanceHillClimbing.py 100.00% <100.00%> (ø)
alns/accept/__init__.py 100.00% <100.00%> (ø)

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 233743f...a581493. Read the comment docs.

@leonlan leonlan marked this pull request as draft June 5, 2022 12:05
@leonlan
Copy link
Collaborator Author

leonlan commented Jun 6, 2022

@N-Wouda I didn't manage to finish this criterion today unfortunately. There's a subtle difference between LAHC as presented in Santini et al. (2018) and Burke and Bykov (2017) that requires more time to investigate. But the other criteria are ready to be reviewed!

@N-Wouda
Copy link
Owner

N-Wouda commented Jun 6, 2022

here's a subtle difference between LAHC as presented in Santini et al. (2018) and Burke and Bykov (2017) that requires more time to investigate.

Can you explain the difference? If it's not easy to bridge the two, we might just go with one of the two. Where possible I prefer to implement the original methods, but if not possible we just have to pick and explain what we did in the docstring.

@N-Wouda but the other criteria are ready to be reviewed!

Great, I'll have a look hopefully (late) tomorrow!

@leonlan
Copy link
Collaborator Author

leonlan commented Jun 7, 2022

here's a subtle difference between LAHC as presented in Santini et al. (2018) and Burke and Bykov (2017) that requires more time to investigate.

Can you explain the difference? If it's not easy to bridge the two, we might just go with one of the two. Where possible I prefer to implement the original methods, but if not possible we just have to pick and explain what we did in the docstring.

My understanding is not so good yet but I’ll try to explain.

The difference has to do with how the deque is updated. There are two differences: first, it seems that the original authors append the candidate to the history if it is accepted and otherwise there is no change. The second difference is how they implement the FIFO queue. They use a pre-initialized array of length L and use idx mod L to access the position in the queue. In combination with the previous, it can be that at iteration v mod L there is no change of that element. Which is not how a FIFO works.

The description of the original paper is not crystal clear on these details unfortunately I’ll be able to fix it, just need some time to tinker with it :-)

@leonlan
Copy link
Collaborator Author

leonlan commented Jun 16, 2022

I think I understand the original LAHC now. I'll probably implement this late today or early tomorrow.

@leonlan
Copy link
Collaborator Author

leonlan commented Jun 17, 2022

The most recent implementation of LAHC is based on Burke and Bykov (2017). I'm not too fond yet of the chosen input argument names, let me know if you have suggestions. Also, I couldn't get coverage to pass here, do you have any clue why?

@leonlan leonlan marked this pull request as ready for review June 17, 2022 15:40
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
@N-Wouda
Copy link
Owner

N-Wouda commented Jun 20, 2022

I understand it much better now! The differences between LAHC and HC are quite subtle, particularly wrt the greedy parameter. That took me a bit of thinking before I understood why that's different from HC.

I think we're almost there. Most of the things I've highlighted now are about documentation.

alns/accept/LateAcceptanceHillClimbing.py Outdated Show resolved Hide resolved
alns/accept/tests/test_late_acceptance_hill_climbing.py Outdated Show resolved Hide resolved
@N-Wouda
Copy link
Owner

N-Wouda commented Jun 22, 2022

Two final remarks. After this I think it's good to go!

@N-Wouda N-Wouda merged commit 078681b into N-Wouda:master Jun 22, 2022
@N-Wouda N-Wouda mentioned this pull request Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants