Module 5
Module 5
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
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
Alternatively, you could use the Manhattan distance (defined above), and come up with a
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.
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
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 .
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).
• 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
The bottleneck of the algorithm is sorting the points by polar angles. This operation as we have
seen requires O(nlogn) time.
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
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.