-
Notifications
You must be signed in to change notification settings - Fork 94
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
Time Complexity Question #48
Comments
What is the actual question? ;) I think you have a good point here. I was inspired by many implementations, and one is of course original reference implementation by Steven Fortune. His page is down currently, but I found this version (with well documented changes), and here it uses a linked list as well. Yes, the linked list is usually the part that takes the most time currently. My main concerns though are that it will lose too much speed for the smaller, average case with random points (which is why I wrote this library). I'll try your test example later, and also compare it with the other frameworks I usually test against (e.g. boost) |
Oh, I can't believe that Steven Fortune's implementation is O(n^2) with a linked list. If it is true, then this must be the reason that Steven Fortune's code is unavailable. The question is that I want to check performance when input is generated by my code. |
Well, check the link I posted. (And no, it's not the reason why his site is down)
Hmm, not sure what you mean here? Edit: Stevens site seems to be up again: |
Yes. I want to see the Voronoi Diagram code's running time of implementations (including yours). It can be helpful to know the time complexity of these implementations. Additionally, If you run with that input, your code run in almost 10~100 thousand seconds. But O(n log n) implementation with BBST will run in few seconds. The average-case analysis versus the worst-case analysis is one of the hot topics in real-world algorithms. IMO, mentioning that this code is using a linked list since it can take lots of time in specific cases will be helpful for users. |
Yeah, it's a good idea to mention it in the readme. Do you happen to have any links to other implementations that use BST's? |
I found 4 implementations that use BST.
|
In my knowledge, the time complexity of Fortune's Sweepline algorithm is O(n log n). This algorithm uses a balanced binary search tree(BBST) to insert/delete parabola and to do a binary search in O(log n).
I found that this code uses a linked list, instead of BBST. The linked list makes this code O(n^2), and it means this code will take lots of time to calculate Voronoi Diagram in specific inputs.
Generator of test input is here.
You can check that your program is almost stopped at this part or this part.
Actually, an implementation used linked list will work well in the average case.
The text was updated successfully, but these errors were encountered: