You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understood it when implementing it, the minimum bounding circle in Skyum's algorithm is found by removing boundary points on the convex hull. Specifically, we start with the largest circle formed by adjacent triples and remove the middle of the triple when it subtends an obtuse angle, recalculate angles/radii for the left and right part of the triple, and continue. A similar strategy focused on acute triples leads to my pointset paring algorithm in #155.
It has been a while since I read the original article, but given my comment about "confusing as hell defaults", I think #75 stems from what "lexicographic order" means in the algorithm:
I remember finding this confusing at the time---what is meant by "lexicographic" over the two keys? Do we sort first by angle, then radius? or radius, then angle?
Eleven years ago, I ordered them in the way they appear in the paper. However, as #75 notes, this can lead to cases where the radii of the MBC is too small when the termination criteria is hit on the angle.
Rereading the original paper, I think the proof for Lemma 2 implies a sort on radius, then angle:
the only way radius(a,b,c) is certainly maximal in this case is if we sort on radius first. When this is done, we're picking the largest radius triple that subtends an acute angle. In the case of tied radii/circle size, we pick the largest acute circle. This is guaranteed to contain the input points, so the MBC won't be sometimes too small anymore.
We can either fix our implementation in this way or pass everything onto shapely as discussed in #75. Might be worth merging this before doing the switch so there's at least in git history a reference implementation of Skyum that is correct.
❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.5%. Comparing base (a798e9e) to head (194b654). ⚠️ Report is 5 commits behind head on main.
Between minimum_bounding_circle and minimum_bounding_radius in shapely, we have everything we need at an acceptable performance. I will prepare that PR after this.
We could keep it as a separate skyum() function if helpful, but I am wary of "keeping things around" just for the sake of it. What do other maintainers think?
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
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.
As I understood it when implementing it, the minimum bounding circle in Skyum's algorithm is found by removing boundary points on the convex hull. Specifically, we start with the largest circle formed by adjacent triples and remove the middle of the triple when it subtends an obtuse angle, recalculate angles/radii for the left and right part of the triple, and continue. A similar strategy focused on acute triples leads to my pointset paring algorithm in #155.
It has been a while since I read the original article, but given my comment about "confusing as hell defaults", I think #75 stems from what "lexicographic order" means in the algorithm:
I remember finding this confusing at the time---what is meant by "lexicographic" over the two keys? Do we sort first by angle, then radius? or radius, then angle?
Eleven years ago, I ordered them in the way they appear in the paper. However, as #75 notes, this can lead to cases where the radii of the MBC is too small when the termination criteria is hit on the angle.
Rereading the original paper, I think the proof for Lemma 2 implies a sort on radius, then angle:
the only way
radius(a,b,c)is certainly maximal in this case is if we sort on radius first. When this is done, we're picking the largest radius triple that subtends an acute angle. In the case of tied radii/circle size, we pick the largest acute circle. This is guaranteed to contain the input points, so the MBC won't be sometimes too small anymore.