Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(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.
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:
Solution:
Initialization of event queue
Data Structures at event p2 and updation of Event queue
a)
b)