Use non-strict threshold when identifying candidate move areas#512
Open
hegen008 wants to merge 1 commit intopysal:mainfrom
Open
Use non-strict threshold when identifying candidate move areas#512hegen008 wants to merge 1 commit intopysal:mainfrom
hegen008 wants to merge 1 commit intopysal:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #512 +/- ##
=====================================
Coverage 76.9% 76.9%
=====================================
Files 29 29
Lines 3700 3700
=====================================
+ Hits 2846 2847 +1
+ Misses 854 853 -1
🚀 New features to boost your workflow:
|
Member
|
thanks! yeah, i think that's right, following the original JRS paper i'll let @sjsrey weigh in to be absolutely sure though |
Author
|
Thanks for confirming that the problem definition has a non-strict threshold. To clarify to purpose of this PR, the algorithm is currently implemented with a non-strict threshold in most places, it is just this one line that uses a strict threshold instead. I think what is most important is that whichever is chosen is used consistently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The max-p-regions problem uses a non-strict threshold, requiring that regions have a spatially extensive attribute greater than or equal to a predetermined threshold. This PR replaces > with >= in the pick_move_area() function to align with the non-strict threshold definition. With this improvement, when areas are identified as candidates to be moved in the simulated annealing phase, the remaining parts of the region are required to be >= the minimum region threshold, rather than strictly greater than it. The simulated annealing algorithm works with a strict threshold as originally written, but the results will generally not be as good with a lower number of potential move candidates identified. As this improvement affects the simulated annealing algorithm path, the expected result for 2 test cases needed to be updated as well.