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

Added Manhattan MST #138

Merged

Conversation

Chillee
Copy link
Collaborator

@Chillee Chillee commented Nov 3, 2019

The main API decision to make here is whether we want to include MST within the implementation or to just return the set of candidate edges.

If we want to include the MST within the implementation, then I think we should include the MST code inside the notebook elsewhere and call it from here.

Copy link
Member

@simonlindholm simonlindholm left a comment

Choose a reason for hiding this comment

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

Looks great!

content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
fuzz-tests/geometry/ManhattanMST.cpp Outdated Show resolved Hide resolved
@Chillee
Copy link
Collaborator Author

Chillee commented Nov 8, 2019

I actually switched back to integers so no floats necessary :^)

Besides, the only floats that would be used are absolute differences in the floating point values and adding them together, so I don't think we need to worry about it much.

@simonlindholm
Copy link
Member

Well, there's still a note in the description about floats. If you remove that note I can remove the scary-looking label. :)

(My worries re floats here are if float imprecision caused segments to be skipped based on a "there are better candidates" argument, and those skip-in-favor-of ended up circular. I'd need to understand the algorithm to determine whether that can actually be the case.)

content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
content/geometry/ManhattanMST.h Outdated Show resolved Hide resolved
@Chillee
Copy link
Collaborator Author

Chillee commented Nov 12, 2019

Alright, shortened the documentation.

Technically I removed the reference to floats :^). If you still wanna check it out for float correctness, feel free. I'm pretty sure it'll be fine though - the points are never modified and the only operation made to them that could introduce FPE in the algorithm is auto d = ps[j] - ps[i].

@simonlindholm simonlindholm merged commit bb735ac into kth-competitive-programming:master Nov 12, 2019
@Chillee Chillee mentioned this pull request Nov 14, 2019
hockyy pushed a commit to hockyy/kactl that referenced this pull request Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants