0% found this document useful (0 votes)
7 views

Module 5

Delaunay triangulation is a method of connecting a set of points such that no point lies inside the circumcircle of any triangle formed, and it is the dual graph of Voronoi diagrams, which partition space based on proximity to points. The process involves sorting points by polar angle, creating a stack to maintain the convex hull, and ensuring counterclockwise orientation. Additionally, K-D trees are binary search trees for organizing points in K-dimensional space, facilitating nearest neighbor and range searches.

Uploaded by

Good Luck
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Module 5

Delaunay triangulation is a method of connecting a set of points such that no point lies inside the circumcircle of any triangle formed, and it is the dual graph of Voronoi diagrams, which partition space based on proximity to points. The process involves sorting points by polar angle, creating a stack to maintain the convex hull, and ensuring counterclockwise orientation. Additionally, K-D trees are binary search trees for organizing points in K-dimensional space, facilitating nearest neighbor and range searches.

Uploaded by

Good Luck
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Define Delaunay triangulation and explain how it relates to Voronoi diagrams.

Describe
the process of constructing a Delaunay triangulation from a given set of points.

Consider a collection of shops in a town, all of which are equally good in terms of quality and
quantity of supplies. They only differ in terms of their location, and it is reasonable to assume
that a customer would prefer a shop over another on basis of proximity information only.

The figure above is what we call a Voronoi diagram. The black dots represent the shops, and the

entire rectangle represents the town. On basis of proximity to shops, the town is divided into

colorful cells! Such diagrams that encode proximity information, help us (quickly) answer

questions like, “Which shop is nearest to point A?”.

How would you, as a person in the town, measure the distance between yourself and a shop (or

anything else for that matter)? There are several distance metrics you could use, the simplest and

most familiar of all being the Euclidean distance.

Euclidean distance between two points


Manhattan distance between two points

Alternatively, you could use the Manhattan distance (defined above), and come up with a

different Voronoi diagram!

Definition of Voronoi diagram

Formally, a Voronoi diagram is a planar graph where every vertex has degree three. Its
complexity is linear, i.e. for n sites, there are n faces, at most 2n-5 vertices, and at most 3n-
6 edges.

Definition of Delaunay triangulation

For a given set P of discrete points in a plane, a Delaunay triangulation DT(P) is a


triangulation such that no point in P is inside the circumcircle of any triangle in DT(P).
Interestingly enough, it turns out that DT(P) corresponds to the dual graph of the Voronoi
diagram for P.
A Delaunay Triangulation

Shown above is a Delaunay triangulation with all the circumcircles (and their centers colored red).

Connecting the circumcenters produces the Voronoi diagram in the next image! In particular, if

two triangles share an edge in the Delaunay triangulation, their circumcenters are connected with

a (red) edge in the Voronoi diagram.


Voronoi Diagram produced by joining the circumcenters (with red edges)

Explain Graham’s Scan Convex Hull algorithm

The convex hull is a ubiquitous structure in computational geometry. Even though it is a useful tool
in its own right, it is also helpful in constructing other structures like Voronoi diagrams, and in
applications like unsupervised image analysis.

We can visualize what the convex hull looks like by a thought experiment. Imagine that the points
are nails sticking out of the plane, take an elastic rubber band, stretch it around the nails and let it go.
It will snap around the nails and assume a shape that minimizes its length. The area enclosed by the
rubber band is called the convex hull of P. This leads to an alternative definition of the convex hull
of a finite set P of points in the plane: it is the unique convex polygon whose vertices are points
from P and which contains all points of P.
The set of green nails are the convex hull of the collection of the points.

The convex hull of a set of points SS is the intersection of all half-spaces that contain S. A
half space in two dimensions is the set of points on or to one side of a line. This notion
generalizes to higher dimensions. A half-space is the set of points on or to one side of a
plane and so on.

Graham's Algorithm

Graham's scan algorithm is a method of computing the convex hull of a finite set of points in the
plane with time complexity O(n log n).The algorithm finds all vertices of the convex hull
ordered along its boundary .

The procedure in Graham's scan is as follows:

 Find the point with the lowest y coordinate. If there are two points with same y value,
then the point with smaller x coordinate value is considered. Put the bottom-most point at
first position.
 Consider the remaining n−1 points and sort them by polar angle in counterclockwise
order around points[0]. If polar angle of two points is same, then put the nearest point
first.
 Create an empty stack S and push points[0], points[1] and points[2] toS.
 Process remaining n−3 points one by one. Do the following for every point ‘points[i]’

 Keep removing points from stack while orientation of following 3 points is not
counterclockwise (or they don’t make a left turn).

 Point next to top in stack


 Point at the top of stack
 Points[i]
 Push points[i] to S
A pseudocode implementation of the above procedure is:

Runtime of the graham's scan

• Step 1: O(n)+O(nlogn) for setting up and sorting

• Step 2: O(1) constant time for pushing items into the stack

• Step 3: O(n) each point gets pushed once within the for loop

• Step 4 O(n) for popping within the loop , each point gets popped once at most

• Total running time: O(nlogn)

The bottleneck of the algorithm is sorting the points by polar angles. This operation as we have
seen requires O(nlogn) time.

Check the video https://www.youtube.com/watch?v=IV-gD8VGVr4

Construct a KD tree for the following set of points in a 2-Dplane: (5, 10) (2, 3) (8, 7) (1, 2)
(4, 6) (7, 5) (9, 4) (6, 8). After constructing the KD tree, search for the point (3, 4) in the
space. Describe the steps taken

What is K dimension tree?


A K-D Tree(also called as K-Dimensional Tree) is a binary search tree where data in each node
is a K-Dimensional point in space. In short, it is a space partitioning (details below) data
structure for organizing points in a K-Dimensional space. A non-leaf node in K-D tree divides
the space into two parts, called as half-spaces. Points to the left of this space are represented by
the left subtree of that node and points to the right of the space are represented by the right
subtree.
How to determine if a point will lie in the left subtree or in right subtree?
If the root node is aligned in planeA, then the left subtree will contain all points whose
coordinates in that plane are smaller than that of root node. Similarly, the right subtree will
contain all points whose coordinates in that plane are greater-equal to that of root node.
Creation of a 2-D Tree: Consider following points in a 2-D plane: (3, 6), (17, 15), (13, 15),
(6, 12), (9, 1), (2, 7), (10, 19)
1. Insert (3, 6): Since tree is empty, make it the root node.
2. Insert (17, 15): Compare it with root node point. Since root node is X-aligned, the X-
coordinate value will be compared to determine if it lies in the right subtree or in the left
subtree. This point will be Y-aligned.
3. Insert (13, 15): X-value of this point is greater than X-value of point in root node. So, this
will lie in the right subtree of (3, 6). Again Compare Y-value of this point with the Y-value
of point (17, 15) (Why?). Since, they are equal, this point will lie in the right subtree of (17,
15). This point will be X-aligned.
4. Insert (6, 12): X-value of this point is greater than X-value of point in root node. So, this
will lie in the right subtree of (3, 6). Again Compare Y-value of this point with the Y-value
of point (17, 15) (Why?). Since, 12 < 15, this point will lie in the left subtree of (17, 15).
This point will be X-aligned.
5. Insert (9, 1):Similarly, this point will lie in the right of (6, 12).
6. Insert (2, 7):Similarly, this point will lie in the left of (3, 6).
7. Insert (10, 19): Similarly, this point will lie in the left of (13, 15).
Nearest Neighbor Search, Range Search

Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem
of finding the point in a given set that is closest (or most similar) to a given point.

With a range search, you match terms that are between the lower and upper bounds
specified by the query. Range searches can be inclusive or exclusive of the upper and lower
bounds.

You might also like