Sei sulla pagina 1di 5

CSN-523: Computational Geometry

(Spring 2016-2017)
Tutorial-4 Date: Feb 8, 2017
Name: Batch (B1/B2): Enrolment Number:

1. These are questions about the DCEL data structure discussed in class.

which of the following equalities are always true:


twin(twin(e)) = e
prev(e) = twin(next(twin(e))), where prev(e) should return the half-edge preceding e on the
perimeter
face(e) = face(next(e))

under what circumstances are the following always true:


face(e) = face(twin(e))
twin(e) = next(e)
Solution:
twin(twin(e)) = e
always true by definition
prev(e) = twin(next(twin(e))), where prev(e) should return the half-edge preceding e on the
perimeter
false if the origin of edge e has degree 3 or higher
face(e) = face(next(e))
because next() stays on the same face, this is always true
face(e) = face(twin(e))
if e is part of a tree thrusting within a face (not part of a cycle bounding a face)
twin(e) = next(e)
if the head of e is a vertex of degree 1 (a leaf)

2. Discuss on the data structures used in Bentley-Ottmans algorithm for line segment intersection
problem. Discuss the time and space complexities of the algorithm.
Solution:

Sweep Line (L): Keeps the total order of the stabbed line segments and supports operations like
insert, delete, transpose, next and previous. A dictionary(balanced binary tree) allows to perform each
of these operations in O(log n) time.

Event Queue(E): It keeps the total order of the events and supports operations like minimum, insert
and memberQ. A priority queue (balanced binary tree) allows to perform each of these operations in
O(log n) time.

Complexity (Time):
Initialization: Sort endpoints O(n logn)
Advance:
Step 1: Find next event O(log n)
Step 2,3,4: Process Event O(log n)
Step 5: Delete event O(log n)
Overall running time: O((n+k)log n)

Complexity (Space):
Event Queue may store all the intersection points for sometime. So space complexity must be
O(n^2). A slight modification in the algorithm allows event queue to store almost n-1intersection
events. So space complexity become O(n).

3. Show the DCEL entries (vertex, edge and face lists) for the following planar subdivision (vertices and
edges are labelled, you can label the faces at your own):

Solution:
Vertex List:

Vertex Incident Edge


v1 e1,1
v2 e2,1
v3 e2,2
v4 e3,2

Face List:
Face Outer Component Inner Components
f1 nil e1,1
f2 e8,2 e(11,1), e(18,1)
f3 e11,2 e14,1
f4 e15,2 nil
f5 e17,2 nil
Edge List:

Half Edge Origin Twin Incident Next Prev


Face
e1,1 v1 e1,2 f1 e2,1 e1,2
e2,1 v2 e2,2 f2 e3,1 e1,1
e3,1 v3 e3,2 f2 e4,1 e2,1

e3,2 v4 e3,1 f1 e2,2 e4,2
e11,1 v11 e11,2 f3 e12,1 e10,1

4. Show the execution (with the entries of data structures used) of Bentley-Ottmans algorithm for line
segment intersection problem given in the figure below. Show how you will obtain the coordinates of
intersection points.

Solution:
Initialization of event queue
Data Structures at event p2 and updation of Event queue

Data Structures at event r13

Data Structures at event q3 and updation of Line Sweep.


5. How to handle following conditions in Bentley-Ottmans Line Segment Intersection algorithm?
a) More than one point sharing same Abscissa.
b) Three or more line intersects at the same point.
Solution:

a)

b)

Potrebbero piacerti anche