congyu711 / k-level Goto Github PK
View Code? Open in Web Editor NEWk-level algorithm and kinetic heap data structure described in Timothy M. Chan's paper 'Remarks on k-Level Algorithms in the Plane'.
k-level algorithm and kinetic heap data structure described in Timothy M. Chan's paper 'Remarks on k-Level Algorithms in the Plane'.
The output of k-level algorithm is an ordered sequence of breakpoints which the k-level meets from -1e10 to 1e10.
Tested with millions of instances
The sequence of lines that appears on the k-level is correct. But in rare cases the x_coord of some breakpoints is slightly wrong.
-1e+10
-1242.69
-1104.51
-795.628
-444.492
-438.347
-504.167
-390.544
-373.945
-233.431
-218.397
see line 7 -504.167 is smaller than the x_coord of the previous breakpoint. This is supposed to be a nondecreasing sequence.
I guess this is caused by a late update of kineticPriorityQueue::t
while updating the datastructure.
The k-level algorithm maintains two kinetic heap consisting of the top k and the rest lines. The implementation of kinetic heap in kpq.cc
can not be empty. So the upper and lower envelope( 1-level and n-level if there are n lines) need to computed separately.
However finding upper or lower envelope is equivalent to computing the convex hull. maybe fix later
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.