Robot Motion Planning using Delaunay and Dijkstra - computational-geometry

I am trying to develop an algorithm based on delaunay triangulation, fermat point, improved dijkstra's algorithm to implement robot motion planning. Currently I have covered delaunay triangulation and fermat point. I have started my work with Dijkstra's using Fibonacci heap. Currently I am working on polygonal shaped objects. Suppose if I want to include real life curved obstacles, how can I do so? Is there a way to approximate curvy obstacles to polygonal obstacles? Also if a project based on dynamically changing surroundings is to be incorporated, what are the basic ideas required, like what should be covered?

You can aproximate a 2d curve, or reduce the number of vertices of a poly line, with the Douglas-Peucker Algorithm.

Related

How does the rotational plane sweep algorithm work?

I have the task to implement the creation of a visibility graph based on a set of simple polygons which are given by the task. The polygons have positive whole number coordinates and can be non-convex. I wanted to implement the rotational plane sweep algorithm which was mentioned in the lecture but not very well explained.
The only other source I could find about this algorithm was this page, that did not make it fully clear either: https://tanergungor.blogspot.com/2015/04/robot-navigation-rotational-sweep.html
I would appreciate it if someone could explain the rotational plane sweep algorithm to an extent which I can understand.
Here is a screenshot of an example obstacle arrangement with my attempt at a solution which is not yet working and more or less based on trial and error rather than understanding and implementing the actual algorithm. The algorithm is just using a single vertex which is not located on a polygon in this example.

Algorithm to find a best fit line for set of points using convex hull algorithm

A line is a best fit for a point set S in the plane if it minimizes the sum of the distances between the points in S and the line. Assuming a convex hull algorithm is available, find the best fit line for a given point set S in the plane. This is an exercise from book Discrete and Computational GEOMETRY. I'm trying to solve this problem for months. I know how to solve it with calculus and clever bruteforce. Analytic way to solve this problem is http://mathworld.wolfram.com/LeastSquaresFittingPerpendicularOffsets.html. I'm not interested a fast or optimal solution.
Aim instead for the best-fit Chebychev line, which minimizes the maximum distance from the points to the line. This meshes better with convex hull properties.
PDF download lecture by Ion Petre.

How to convert a polygon to a set on non-overlapping triangles?

I have a coordinate set of 2D points that form a closed polygon. I need to generate a set of 2D triangles that distribute the polygon completely.
There are no constrains as such except that the triangles should fill the area of polygon completely. It would be even more helpful if it is a standard algorithm I could implement.
The best way to triangulate general polygons is to compute the constrained Delaunay triangulation - this is a standard Delaunay triangulation of the polygon vertices with additional constraints imposed to ensure that the polygon edges appear in the triangulation explicitly. This type of approach can handle any type of polygon - convex, concave, polygons with holes, etc.
Delaunay triangulations are those that maximise the minimum angle in the mesh, meaning that such a triangulation is optimal in terms of element shape quality.
Coding a constrained Delaunay triangulation algorithm is a tricky task, but a number of good libraries exist, specifically CGAL and Triangle. Both these libraries implement an (optimally) efficient O(n*log(n)) algorithm.
As mentioned above, Delaunay triangulation is a rather complicated algorithm for this task. If you accept O(n^2) running time, you may try Ear Clipping algorithm which is much more easier to understand and to code. The basic idea is the following. Every polygon with >= 4 vertexes and no holes (i.e. its border is a single polyline without self-intersections and self-tangencies) has at least one "ear". An ear is a three consecutive vertexes such that the triangle built on them lies inside the polygon and contains no other points of the polygon inside. If you "cut an ear" (add a triangle to the answer and replace remove the middle point of these three points), you reduce the task to a polygon with less vertexes, and so on. Ears may be trivially (by definition) found in O(n^2) resulting in a O(n^3) triangulation algorithm. There is O(n) ear finding algorithm, and, though it is not very complicated, it is rather long to be described in a couple of phrases.
Furthermore, if you need faster algorithms, you should look something about monotone polygons triangulation and splitting a polygon into monotone ones. There even exists a linear-time triangulation algorithm, but its just as complicated as Delaunay triangulation is.
You may consider Wikipedia article and see an small overview of existing methods there.
If you don't require that the vertices of the triangles be vertices of the polygon, try a triangulation based on a trapezoidal decomposition, as in Fast Polygon Triangulation based on Seidel's Algorithm.

Delaunay triangulation from convex hull

I need to write some codes on computational geometry and parallelize them using openMP.So far, I have finished convex hull and closest pair of points.I need to write the delaunay triangulation divide and conquer code.But I dont have much time.I read somewhere that delaunay triangulation can be easily implemented if the convex hull can be calculated.So if anyone can provide me the serial code for DT or atleast let me know how i could generate the delaunay triangulation from convex hull, i could write the code and parallelize it as soon as possible.
I read somewhere that delaunay triangulation can be easily implemented if the convex hull can be calculated.
This is true, but the precise statement is that the 2D Delaunay triangulation can be easily constructed if a 3D convex hull implementation is available. Knowing the 2D hull does not help much with constructing the Delaunay triangulation (DT), besides giving you a few edges of the DT (each hull edge is an edge of the DT).
Assuming you have not implemented the 3D hull (which is quite tricky), then you need to attack
the Delaunay triangulation separately.
QHull is pretty much the standard library many people use: http://www.qhull.org/html/qhull.htm
Perhaps you can use it as a reference implementation, if you really want to reimplement this.

Algorithm for completing a partial triangulation (Constrained Triangulation)

Given a set of points in a plane and an incomplete triangulation of the convex hull of the points (only some edges are given), I'm looking for an algorithm to complete the triangulation (the initial given edges should remain fixed). You can assume that it's possible to complete the partial triangulation but it'd be great if you could also suggest an algorithm for checking that too.
UPDATE" You're given a convex hull of a set of points R^2, which is basically a polygon with some points inside it. We want to triangulate the set of points which is a straightforward matter on itself, but you're also given some edges that any triangulation that you come up with should use those edges."
Perhaps this is a naive answer, but can't you just use a constrained delaunay triangulation? Add the known edges as constraints.
CGAL has a nice implementation. The tool triangle has similar features and is easier to get started with, but has (perhaps) a little less flexibility.
I found out that the book "Computational Geometry: An Introduction" has a detailed treatment of the subject though it doesn't give a ready to implement pseudo-code.
The easiest algorithm is a greedy one which enumerates all the possible edges and then add them one by one avoiding intersection with previously added ages. There is a long discussion in the book about how to reduce the running time to O(n^2 log n).
Then there is a O(n log n) algorithm which first regularizes the convex hull with the given edges and then individually triangulates each monotone polygon.

Resources