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

Ivan Balaban's Optimal Algorithm in O(n log n + k) #8

Open
HansBrende opened this issue Dec 6, 2022 · 1 comment
Open

Ivan Balaban's Optimal Algorithm in O(n log n + k) #8

HansBrende opened this issue Dec 6, 2022 · 1 comment

Comments

@HansBrende
Copy link

It would be worth adding Ivan Balaban's "Optimal Algorithm" which hits the theoretical lower bound for segment intersection time and space complexity of O(n log n + k) and O(n), respectively.

Here is a link to his paper: https://www2.cs.sfu.ca/~binay/813.2011/Balaban.pdf

Also, he seems to have created a C++ implementation here: https://github.com/ivvaan/balaban-segments-intersections

Some additional work would need to be done to handle degenerate cases.

@anvaka
Copy link
Owner

anvaka commented Dec 11, 2022

thank you for the tip! If anyone wants to implement it - I'd be happy to take a pull request!

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

No branches or pull requests

2 participants