the beachline of the sweepline algorithm for voronoi diagram - computational-geometry

I am implementing Fortune's sweepline algorithm for computing Voronoi diagrams. My primary reference is "Computational Geometry: Algorithms and Applications" by de Berg. I want to use a avl tree to store beachline. The breakpoint would be stored with a pair of sites.
The arc would be stored with a site.
When I handle the new site, I want to find the arc which above of the new site. I do not know how to do it.
Thanks in advance.

Related

On-line Ball tree Algorithm

I need a method to construct a ball tree in an on-line manner for Nearest Neighbour search. Before this I have been using Scikit-learn's implementation of the Ball Tree Nearest Neighbour module to carry out my scientific calculations but it is not feasible when I have new data arriving and the entire Ball Tree has to be reconstructed every time. I have not found much literature on implementing an on-line algorithm, the wikipedia article here suggests an off-line method, so I wanted to pose the question to the SO community.
You can try a space-filling-curve. Translate the co-ordinate to a binary and interleave it. Maybe treat it as a base-4 number.

How do borderlines works in strategy/RTS games?

I'm curious what kind of algorithm can calculate the country's borderline, according to it's cities, buildings, and of course nearby city's and building's radius?
Picture from the game "Rise of Nations":
And how can one render this shape with lines or triangle strips (With 5m width for example)? How to get the points's coordinates from the borderline in good order? How it works in games?
Thanks.
One way to do this is to use all the points of interest on the map and generate a Voronoi diagram.
http://en.wikipedia.org/wiki/Voronoi_diagram
There are some different algorithms to chose from, such as Fortune's algorithm.
http://en.wikipedia.org/wiki/Fortune%27s_algorithm
There are also other posts regarding this on SO.
Easiest algorithm of Voronoi diagram to implement?

one-pass force-directed graph drawing algorithm

I'm looking for a one-pass algorithm (or ideas of how to write it myself) that can calculate the two or three dimensional coordinates for a directed, unweighted graph.
The only metadata the vertices have are title and category.
I need to implement this algorithm in a way that vertices can be added/removed without recalculating the entire graph structure.
This algorithm has to be applied to a large (5gb) dataset which is constantly changing.
My Google skills have led me to n-pass algorithms which are not what what I am looking for.
I guess your question might still be an open issue. I know a research project called Tulip (http://tulip.labri.fr/TulipDrupal/) which is a (large-scale) graph viewer. A paper on the method is available at http://dept-info.labri.fr/~auber/documents/publi/auberChapterTulipGDSBook.pdf and surely you can find more algorithms browsing the personal web page of D. Auber and his colleagues.
There is a related question here:
https://cstheory.stackexchange.com/questions/11889/an-algorithm-to-efficiently-draw-a-extremely-large-graph-in-real-time
The top answer has a number of papers that might be of interest. I think one of the keys to the problem is to try and recompute the location of a reduced amount of nodes in your graph.

reference algorithm for weighted voronoi diagrams?

Can someone point me to a reference implementation on how to construct a (multiplicatively and/or additively) weighted voronoi diagram, which is preferably based on Fortune's voronoi algorithm?
My goal:
Given a set of points(each point has a weight) and a set of boundary edges(usually a rectangle) I want to construct a weighted voronoi diagram using either python or the processing.org-framework. Here is an example.
What I have worked on so far:
So far I have implemented Fortune's algorithm as well as the "centroidal voronoi tessellation" presented in Michael Balzer's paper. Algorithm 3 states how the weights need to be adjusted, however, when I implement this my geometry does not work anymore. To fix this the sweep-line algorithm has to be updated to take weights into account, but I have been unable to do this so far.
Hence I would like to see how other people solved this problem.
For additively weighted Voronoi Diagram: Remember that a power diagram in dimension n is only a(n unweighted) Voronoi diagram in dimension n+1.
For that, just recall that the Voronoi diagram of a point set is invariant if you add any constant to the coordinates, and that the weighted Voronoi diagram can thus be written as a non weighted Voronoi diagram using the coordinates, for example in 2D lifted to 3D:
(x_i, y_i, sqrt(C - w_i))
where w_i is the weight of the seed, and C is any arbitrarily large constant (in practice, one just small enough such that C-w_i is positive).
Once your diagram is computed, just discard the last component.
So, basically, you only need to find a library that is able to handle Voronoi diagrams in dimension n+1 compared to your problem. CGAL can do that. This also makes the implementation extremely easy.
This computation is not easy, but it is available in CGAL. See the manual pages here.
See also the Effective Computational Geometry project, which employs and
supports CGAL:
There is little `off-the-shelf' open source code out there, for the case where distances to the centers are weighted with a multiplicative factor.
To my knowledge, none of the current CGAL packages covers this case.
Takashi Ohyama's beautifully colorful website provides java implementations
http://www.nirarebakun.com/voro/emwvoro.html
for up to 100 points with a SIMPLE algorithm (Euclidean and Manhattan distances).
There is also a paper describing this simple intersection algorithm and an approximate implementation within O(n^3) time, as a plugin to TerraView.
However, I cannot find the source of this plugin in the TerraView / TerraLib repository:
http://www.geoinfo.info/geoinfo2011/papers/mauricio1.pdf
Aurenhammer and Edelsbrunner describe an optimal n^2 time algorithm, but I'm unaware of available code of that.
If you are comfortable digging into Octave, you could reference the code provided in their library.

Voronoi diagram, Delaunay triangulation - data structures

I want to compute Voronoi and its dual, Delaunay triangulation. I am using Watson Bowyer algorithm. My goal afterwards is to compute alpha-shapes (concave hulls). So I will need to rapidly access the voronoi cell for a given point, the neighbors...
Which data structures did you use for your Voronoi/Delaunay algorithm? I have thought of using a disjoint set data structure with union-find operations, so that I can 'bind' to one parent, the point p in original data set, the set of point in Vp. However, one point in Voronoi diagram 'belongs' to several Voronoi cells.
What is your advice, or could you hint at some good reference?
Regards.
I suggest that you take a look at the half-edge data structure:
http://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml
Half-edge data structure is used in many applications and frameworks. One implementation of it is found in the GEL framework:
http://www2.imm.dtu.dk/projects/GEL/

Resources