0% found this document useful (0 votes)
46 views8 pages

CP2 TermProjects List of Projects PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views8 pages

CP2 TermProjects List of Projects PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CSN-523: Computational Geometry

(Spring 2016-2017)
Coding Project-2 (CP-2) Duration: Mar 23 Apr 6, 2017

General Note:
I. You can use any programming language like C, C++, Java, Python, etc., in which you are
comfortable. However, GUI (graphical user interface) of visualization of execution the
algorithm and the solution is required.
II. One from this list will be assigned to your group for working on this coding project.
III. Duration of this project is 2 weeks.
==========================================================================
List of Problem Statements for Coding Project-2:

1. Solve the Art-Gallery Problem considering the following instructions:


(a) Construct a simple polygon with n vertices. Your program should be able to take n as input (e.g.,
20) from the user, then randomly generate n distinct points with X and Y coordinates in 2D
geometry. Store the simple polygon using the required data structure DCEL.
(b) Perform Trapezoidalization of the simple polygon you obtained. Store the information in the
required data structure. Obtain Monotone Polygons from the Trapezoidalization of the simple
polygon. You can also implement the line-sweep (plane-sweep) algorithm to obtain monotone
partitions of the n-gon.
(c) For each monotone partition (polygon), perform triangulation using the line-sweep (plane-sweep)
algorithm. Store the information in the required data structure (another DCEL).
(d) Now, assume that the simple polygon you constructed is the geometry of your Art-Gallery Problem.
First, obtain the triangulated dual graph of that art-gallery. Then perform 3-coloring on the dual
graph and determine the minimum number of vertex guards required to provide security in that Art-
Gallery. Also, display the position of those vertex guards.

2. Solve the problem of finding movement of a ball over a given surface considering that an arbitrary
(random) polygonal chain is taken as input from the user. No need consider the velocity of the ball.
Show all the intermediate positions of the ball and also the final position (in case ball has fallen from
the polygon chain then indicate that). For an example:

3. Solve the problem of triangulating a polygon using Ear-Removal Algorithm considering the following
instructions:
(a) Construct a simple polygon with n vertices. Your program should be able to take n as input (e.g.,
20) from the user, then randomly generates n distinct points with X and Y coordinates in 2D
geometry. Store the simple polygon using the required data structure DCEL.
(b) Triangulate the polygon using Ear Removal method. Store the information in the required data
structure (another DCEL).
(c) Display the dual graph of the triangulated polygon. Store the information of the dual graph in the
required data structure (another DCEL).
4. Solve the problem of finding the convex hull and triangulating that using the algorithm for triangulating
monotone partitions considering the following instructions:
(a) Your program should take n as input (e.g., 20) from the user, then randomly generates n distinct
points with X and Y coordinates in 2D geometry.
(b) Draw the convex hull of these set of points using Quick Hull method. Store the information in the
required data structure DCEL.
(c) Now assume the convex hull as the given monotone polygon. Triangulate this monotone polygon
using line sweep algorithm. Store the information in the required data structure (another DCEL).

5. Solve the problem of finding the convex layers considering the following instructions:
(a) Your program should take n as input (n can be large) from the user, then randomly generates n
distinct points with x and y coordinates in 2D geometry.
(b) Draw the convex hull of these set of points using Gift Wrapping Algorithm. Store the information
in the required data structure DCEL.
(c) If after constructing convex hull some points (greater than 1) are left out of n points inside the
above convex hull. Draw convex hull again using these remaining points by Quick hull algorithm.
Repeat step 3 process to draw rings of convex hulls until less than 1 points left inside last
constructed convex hull. Store the information in the required data structure (another DCEL).

Note: Only first convex hull is constructed by Gift Wrapping Algorithm.

6. Solve the problem of finding the staircase considering the following instructions:
Let X be a set of points in the plane. A point p in X is Pareto-optimal if no other point in X is both
above and to the right of p. The Pareto-optimal points can be connected by horizontal and vertical lines
into the staircase of X, with a Pareto-optimal point at the top right corner of every step. See the figure
below.
(a) QUICKSTEP: Describe a divide-and-conquer algorithm to compute the staircase of a given set of
n points in the plane in O(n log n) time.
(b) SCANSTEP: Describe an algorithm to compute the staircase of a given set of n points in the plane,
sorted in left to right order, in O(n) time.
(c) NEXTSTEP: Describe an algorithm to compute the staircase of a given set of n points in the plane
in O(nh) time, where h is the number of Pareto-optimal points.
(d) SHATTERSTEP: Describe an algorithm to compute the staircase of a given set of n points in the
plane in O(n log h) time, where h is the number of Pareto-optimal points.
7. Solve the problem of finding the staircase layers considering the following instructions:
The staircase layers of a point set are defined by repeatedly computing the staircase and removing the
Pareto-optimal points from the set, until the set becomes empty.
(a) Describe and analyze an algorithm to compute the staircase layers of a given set of n points in O(n2)
time.
(b) Describe and analyze an algorithm to compute the staircase layers of a given set of n points in O(n
log n) time.
(c) An increasing subsequence of a point set X is a sequence of points in X such that each point is
above and to the right of its predecessor in the sequence. Describe and analyze an algorithm to
compute the longest increasing subsequence of a given set of n points in the plane in O(n log n)
time. [Can you give any solution that uses part (b)]

8. Solve the problem of finding the skylines of a city considering the following instructions:
This problem asks you to compute skylines of various cities. In each city, all the buildings have a
signature geometric shape. Describe an algorithm to compute a description of the union of n such shapes
in O(n log n) time.
(a) Manhattan: Each building is a rectangle whose bottom edge lies on the X-axis, specified by the left
and right X-coordinates and the top Y-coordinate.

(b) Giza: Each building is a right isosceles triangle whose base lies on the x-axis, specified by the (X,
Y)-coordinates of its apex.

(c) Nome: Each building is a semi-circular disk whose centre lies on the X-axis, specified by its centre
X-coordinate and radius.

Given any random inputs, demonstrate your plane-sweep algorithm to find out the respective skyline
for each of these three cities.

9. Solve the problem of finding the minimum weight triangulation of a polygon


[http://www.cs.mcgill.ca/~sqrt/mwt/mwt.html] considering the cost of the edges as the length of the
edge (Euclidian distance) and the following instructions:
(a) Construct a simple polygon with n vertices. Your program should be able to take n as input (e.g.,
20) from the user, then randomly generates n distinct points with x and y coordinates in 2D
geometry. Store the simple polygon using the required data structure DCEL.
(b) Design your algorithm to identify those diagonals which give you the minimum weight
triangulation of the polygon.

10. Solve the problem considering the following instructions:


(a) Construct n lines using 2n randomly generated X and Y coordinates in 2D geometry taken as input
from the user / a file.
(b) Apply Bentley-Ottmans algorithm to find intersection points. Store the information in the required
data structure.
(c) Using these intersection points as vertices, construct convex hull using Graham Scan method. Store
the information in the required data structure DCEL.

11. Solve the problem considering the following instructions:


(a) Your program should take c as input (c can be large) from the user, representing the number of
convex hulls required.
(b) For each convex hull, your program should take n as input (n can be large) from the user, then
randomly generates n distinct points with x and y coordinates in 2D geometry.
(c) Draw the convex hull of these set of points using gift wrapping method. Store the information in
the required data structure DCEL.
(d) Repeat steps 2 and 3 for c number of convex hulls. Convex hulls may intersect each other.
(e) Using the remaining points of all the convex hulls, draw another convex hull using quick hull
method.
Example:
Step 1: Let c = 3
Step 2: For first convex hull, let n=8.
Step 3: Draw convex hull for these points

Step 4: Similarly, draw two more convex hulls.

C1

C2 C3

Step 5: Using the remaining points of all the convex hulls, draw another convex hull
12. Solve the problem considering the following instructions:
(a) Your program should take n as input (n can be large) from the user, then randomly generates n
distinct points with x and y coordinates in 2D geometry.
(b) Draw the convex hull of these set of points using Quick Hull method. Store the information in the
required data structure DCEL.
(c) If after constructing convex hull some points (greater than 3) are left out of n points inside the
above convex hull. Draw the simple polygon using these remaining points. Store the information
in the required data structure DCEL.
(d) Triangulate the simple polygon using any method studied in the course. Store the information in
the required data structure DCEL.

13. A farmer owns a land has a shape of convex hull. One of its neighbor changes the fencing by shifting
one of the pole. So, your task is find out whether the farmer will able to know the changes in his fencing
or not.
(a) Randomly draw a convex polygon
(b) Now randomly select a pole and change its coordinates
(c) If point is still in the convex hull then John cannot detect the changes made by its neighbor

14. Solve the problem considering the following instructions:


Input: A set of n points specified by their x and y co-ordinates.
Output: The closest pair of points.
The distance between two points: (x1-x2)2 + (y1-y2)2
A naive algorithm takes O(n2) time. We, as usual, like to do better. Why do we even suspect that this
is true?
First work with the same problem in smaller dimensions. Here then the problem boils down to finding
the closest pair of points on a line. Say the x-axis. Most students at this point say sort and check
distances between adjacent points. Time is O(n log n).
Similarly, we can extend this method for higher dimension to 2-D. Time is O(n log n)

15. Solve the problem considering the following instructions:


(a) Randomly generate N RED points and M BLUE points.
(b) Test whether there exists a circle that will enclose only the BLUE points. If yes, draw the circle.

16. Solve the problem considering the following instructions:


(a) Randomly generate some N points.
(b) Find the rectilinear convex hull of that set of points.
17. Solve the problem considering the following instructions:
(a) Randomly generate some N points.
(b) Find the shortest obstacle avoiding path between a pair of points in a grid. Some grid points are
marked as obstacles which you cannot be a vertex in the computed shortest path.

18. Solve the problem considering the following instructions:


(a) Generate a random set of intervals I = {I1, I 2, , In}, where Ii = (li, ri) represent left (li) and right
(ri) endpoints.
(b) Apply the Sweep line algorithm for constructing the Overlap Graph and Interval Graph for above
randomly generated intervals.

An overlap graph GO = (V, EO), where V and EO are the vertex and edge sets, respectively.
V = {vi | vi represents interval Ii} and EO = {(vi, vj) | li <lj < ri < rj}.
An interval graph GI = (V, EI), where V and EI are the vertex and edge sets, respectively. The vertex
set V = {vi | vi represents interval Ii} and two vertices are joined by an edge if and only if their
corresponding intervals have a non-empty intersection.

Figure 1 (a) Set of Intervals A, B, C, D, E, F (b) Overlap Graph (GO) (c) Interval Graph (GI).

19. Solve the problem considering the following instructions:


(a) Generate N axis-aligned rectangles randomly. A rectangle is axis- aligned rectangle when all the
sides are parallel to either x-axis or y-axis.
(b) Implement a program to find the area of union of all N randomly generated axis-aligned rectangles
using sweep line algorithm.

This can be implemented by moving the sweep line from left to right direction while initializing
the event queue with left and right edges of the rectangles in sorted order. The main idea is to
maintain the set of active rectangles in order (y-coordinates) of the rectangles where active
rectangles are those whose left edge has been found by sweep line while right edge is still not found.
Whenever a right edge is encounter, find the area of all active rectangles and remove this rectangle
from the list.
Help: https://web.stanford.edu/class/cs97si/09-computational-geometry.pdf
20. Solve the problem considering the following instructions:
Given a maximum distance (d) between two rectangles, construct a conflict graph (CG) from N axis-
aligned randomly generated rectangles (R1, R2, , RN). A conflict graph is a graph (V, E) where V =
{vi | vi represents rectangle Ri} and E = {(vi, vj) | distance (vi, vj) < d}. The conflict graph should be
constructed using Projection method.

Figure 2 (a) Axis-aligned rectangles, (b) Projection from A, (c) Intermediate conflict graph by
considering the rectangle A from (b), (d) Final Conflict graph.

Projection Method: For a given rectangle Ri, the projection method finds all the neighbor rectangles
with the distance less than d by assuming a virtual vertical and horizontal projection from all the four
corners of Ri.
(i) If the projections intersect with other rectangles edges (as shown in figure 2(b)) then find the
distance among them and compare with the given maximum distance (d). If calculated distance is
< d then draw an edge between their corresponding vertices in conflict graph.
(ii)If k rectangles has intersection with the projection of rectangle A as shown in figure 2(b) then for
remaining (n-k-1) rectangles, draw the projections from their endpoints. If the projections intersect
with the selected rectangles (in given example, the selected rectangle is A) projection then
calculate the Euclidean distance between them and compare to d. If distance is within the threshold
(d) and there is no obstacle encountered then draw an edge between their corresponding vertices
in conflict graph.
Note: Use plane sweep to find obstacles.

21. Solve the problem considering the following instructions:


Polygon Triangulation
(a) Randomly generate an n-gon.
(b) Implement the polygon triangulation algorithm, i.e., a plane sweep to decompose an arbitrary
simple polygon into monotone pieces, followed by a linear incremental algorithm to triangulate
each piece and next step you can use either the stack-based monotone triangulation algorithm.
(c) Implement the polygon triangulation algorithm, i.e., a plane sweep to decompose an arbitrary
simple polygon into monotone pieces, followed by a linear incremental algorithm to triangulate
each piece and in the next step you can use the variation involving a second decomposition into
mountains.

Implementation steps:
Find monotone decomposition diagonals using a plane sweep.
Use diagonals to break the input list into vertex lists for the monotone pieces.
Sort the vertex list for each monotone piece by y-coordinate and triangulate.
22. Solve the problem considering the following instructions:
Convex Hull
(a) Randomly generate n number of points.
(b) Implement the convex hull using Divide and Conquer method for these n random points and store
the information using data structure DCEL.
(c) Also, implement the convex hull of the same set of points using Incremental method and store the
information using DCEL.

23. Do the following:


(a) Install CGAL in your PC with Windows OS.
(b) Demonstrate some standard algorithms using CGAL in-built functions such as:
a. Polygon Triangulation after constructing a polygon with N points. N taken as the user
input.
b. Convex Hull computation for a set of N points randomly generated. N taken as the user
input.
(c) Prepare an installation manual for successful instruction of CGAL in Windows PC. This manual
should not be just copy-paste of the manual available in CGAL site. You should be able to do
successful installation during Demo of the project. In future, for any user your user manual should
be self-sufficient.

24. Do the following:


(d) Install CGAL in your PC with Linux OS (Ubuntu).
(e) Demonstrate some standard algorithms using CGAL in-built functions such as:
a. Polygon Triangulation after constructing a polygon with N points. N taken as the user
input.
b. Convex Hull computation for a set of N points randomly generated. N taken as the user
input.
(f) Prepare an installation manual for successful instruction of CGAL in Linux PC. This manual
should not be just copy-paste of the manual available in CGAL site. You should be able to do
successful installation during Demo of the project. In future, for any user your user manual should
be self-sufficient.

You might also like