We are given a Voronoi diagram in a form of DCEL (Doubly Connected Edge List), but without the actual sites for which the Voronoi diagram is built (just Voronoi vertexs, edges and faces).
The question is under what conditions can we (re)construct the set of points for which the given diagram was build and give the algorithm that does this.
What i know so far:
If we would figure out just one site, we could find all the others by drawing circles (we know that each Voronoi vertex is a center of an empty disc that has three sites on its circle)
I know how Fortunes (sweep) algorithm for constructing the Voronoi diagram works if we are given the sites
This problem is homework, so I am looking only for hints and tips to push me in the right direction.
Found the solution for finding the first two sites. Not sure about correctnes but the idea seems sound. Getting the rest of the sites is as stated trivial.
http://tylerneylon.com/blog/2008/06/turning-convex-partition-into-voronoi.html
I think you can solve the next linear program:
min 0
s.t. (ai*xj+bi*yj+c_i)/(a^2+b^2)=-(ai*xk+bi*yk+c_i)/(a^2+b^2), where ai*x+bi*y+c=0 is equation of line separating between cells j and k
Using some O(n log n) worst case or O(n) expected algorithm for 2D LP.
And than if there is feasible solution these are sites (xi, yi) found by it, and if there is no - this was not Voronoi diagram
Related
I'm working on my bachelor thesis (on Computer Science) and right now I'm having a problem about finding shortest path between two points on 3D triangular mesh that is manifold. I already read about MMP, but which computes distance function $d(x)$ between given point and vertex $x$ on mesh.
I got to know that the problem I'm solving is named Geodesics but What I really couldn't find is some good algorithm which uses A* for finding shortest path between two given points on two given vertices.
I 'invented' also algorithm which uses A* by using Euclidian Distance Heuristics and correction after finding new Point on any Edge..
I also have edges saved in half-edge structure.
So my main idea is this:
We will find closest edge by A* algorithm and find on this edge point with minimalizing function $f(x) + g(x)$ where $f$ is our current distance and $g$ is heuristics(euclidean distance)
Everytime we find new edge, we will unfold current mesh and find closest path to our starting point
So now my questions:
Do you know some research paper which talks about this problem ??
Why nobody wrote about algorithm that uses A* ??
What are your opinions about algorithm I proposed ?
Here are some papers and tools related to finding geodesics (or approximations) on a surface mesh:
A Survey of Algorithms for Geodesic Paths and Distances
You Can Find Geodesic Paths in Triangle Meshes by Just Flipping Edges (code)
The Vector Heat Method
(code)
You can find more papers in the survey paper.
I implemented the algorithm you mentionned (MMP) a long time ago and it's quite difficult to get it right and quite time consuming since the number of splits along an edge grows quite fast.
I am no expert in the matter so read with prejudice. Also sorry this is more of a comment than answer...
First You should clarify some things:
the mesh is convex or concave?
are the path always on surface or can fly between faces on the outside (if concave) but never inside?
are the start/end points on edges of faces or can be inside?
Assuming concave, points on edges and only surface paths...
I think the graph A* approach is unusable as there is infinite possible paths between point and any edge of the same face so how you test all of them?
If you really want A* then you can do something similar to raster A*
so resample all your edges to more points
so either n points or use some density like 10 points per average edge length or some detail size.
use graph A* on resampled points (do not handle them as edges anymore)
However this will produce only close to shortest path so in order to improve the accuracy you should recursively resample the edges near used point with higher and higher density until the distance between resampled points get smaller than accuracy.
Another option would be using something similar to CCD (cyclic coordinate descent) so:
create plane that goes through your 2 points and center of your mesh
create path that goes through all intersection of plane and faces between the 2 points (use the shorter on from the 2 options)
iterativelly move intersections back and forward and use greedy approach to get the result
However this might get stuck in local minima... You could use search/fitting approaches instead but those will get very slow with increasing number of faces
I got the feeling you might also do this using RANSAC ...
From my point of view I think the first A* approach is the most promising, you just need linked list of points per each edge and one cost counter per each its point from this you can simply encode even the recursive improvement of accuracy. It can be done even in-place so no reallocation needed in the recursion ... And also the algo is not complicated so you should have no problems implementing it, and the result is guaranteed which is not the case with other approaches I mention... Another pros is that it can be used even if start/endpoint does not belong to edge...
I'm trying to link points in the plane, ie draw a graph, but using only axis-aligned lines. I found the KDTree algorithm
to be quite promising and close to what I need
but it does not make sure the segments are as small as possible.
The result I'm looking for is closer to
I have also read up on
https://en.wikipedia.org/wiki/Delaunay_triangulation
because initially, I thought that would be it;
but it turns out its way off:
- based on circles and triangles
- traces a perimeter
- nodes have multiple connections (>=3)
Can you point me towards an algorithm that already exists?
or can you help me with drafting a new algorithm?
PS: Only 1000-1100 points so efficiency is not super important.
In terms of Goals and Costs, reaching all nodes is the Goal
and the length of all segments is the Cost.
Thanks to MBo, I now know that this is known as 'The Steiner Tree Problem'. This is the subject of a 1992 book (of the same name) demonstrating that it is an NP-hard problem.
This is the Rectilinear variant of that. There are a few approximate algorithms or heuristic algorithms known to (help) solve it.
( HAN, HAN4, LBH, HWAB, HWAD, BEA are listed inside
https://www.sciencedirect.com/science/article/pii/0166218X9390010L )
I haven't found anything yet that a "practitioner" might be able to actually use. Still looking.
It seems like a 'good' way forward is:
Compute edges using Delaunay triangulation.
Label each edge with its length or rectilinear distance.
Find the minimum spanning tree (with algorithms such as Borůvka's, Prim's, or Kruskal's).
Add Steiner points restricted to the Hanan grid.
Move edges to the grid.
Still unclear about that last step. How?
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.
I'm working on a problem which is to find the closest trio of neighbours for a set of arbitrarily placed non-intersecting ellipses. As a new user I'm not allowed to include image tags but I've included the URL at the bottom of the page as I always think I'm better able to explain myself with visual aids. The picture demonstrates what I mean with Apollonius circles connecting the 3 nearest ellipses to one another.
So far I have tried using the minimum distances between the ellipses and modifying Delaunay Triangulation, via incremental and sweepline methods, used various techniques involving in circles of triangles formed between every 3 ellipse configuration etc, and attempted to estimate the neighbours with bounding boxes, and have completely run out of ideas of how to actually get this working efficiently
Although I have worked out a solution it involves exhaustively searching and comparing every trio of ellipses with every other ellipse and has a time complexity of n(n-1)(n-2)/3!. And on top of that each calculation is done iteratively rather than algebraically.
Would anyone even have an idea of how to go about this that could be done algebraically and at lower then a n^2 time complexity?
Even a suggestion of a technique would suit me to have a try at, because right now I've been working at it for nearly 3 weeks and really am no closer to a decent answer.
If you calculate a Voronoi diagram for your ellipses, then your circles center points would be placed at the intersection of the diagrams.
http://ima.umn.edu/nuggets/voronoi.html
You could pack your ellipses into an R-tree based on their bounding boxes. The R-tree is a binary-tree-like data structure for spatial objects, and supports efficient nearest-neighbour and kth nearsest neighbour queries via traversal.
For large data sets with many ellipses, use of an R-tree should reduce the number of distance tests significantly, only scanning a subset of the tree in the neighbourhood of the query.
Hope this helps.
I'm stuck on this: Have a square. Put n points into this square so the minimal distance (not necessary the average distance) is the highest possible.
I'm looking for an algorithm which would be able to generate the coordinates of all points given the count of them.
Example results for n=4;5;6:
Please don't mention computing-power based stuff such as trying a lot of combination and then nitpicking the right one and similar ideas.
This is the circles in square packing problem.
It is discussed as problem D1 in Unsolved problems in geometry, by Hallard T. Croft, Kenneth J. Falconer, and Richard K. Guy, page 108.
Pages 109 and 110 contain a list of references.
You could do an N body simulation where the points repel each other, perhaps with a 1/r^2 force. The movement of the points would obviously be constrained by the square. Start with all the points approximately in the centre of the square.
Mikulas, I found a page full of image examples of possibly optiimal, or currently best known solutions. It's not mine, so use it with your own risk.
See
http://www.ime.usp.br/~egbirgin/packing/packing_by_nlp/numerical.php?table=csq-mina&title=Packing%20of%20unitary-radius%20circles%20in%20a%20square
Source:
http://www.ime.usp.br/~egbirgin/packing/packing_by_nlp/