Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Computational Geometry
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
1 IP-Lookup and Packet Classification Advanced Algorithms & Data Structures Lecture Theme 08 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
Brute-Force Triangulation
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Klee’s Measure Problem Computational Geometry, WS 2007/08 Group Work Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
IP-Lookup and Packet Classification, II Advanced Algorithms & Data Structures Lecture Theme 8 Prof. Dr. Th. Ottmann Summer Semester 2006.
Orthogonal Range Searching-1Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.
Lecture 5: Orthogonal Range Searching Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
A Binary Tree root leaf. A Binary Tree root leaf descendent of root parent of leaf.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Persistent Data Structures Computational Geometry, WS 2007/08 Lecture 12 Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
1 Geometric Solutions for the IP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
I/O-Algorithms Lars Arge Aarhus University March 5, 2008.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 - Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part II Prof. Dr. Th. Ottmann Summer Semester 2006.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
IP-Lookup and Packet Classification Computational Geometry, WS 2007/08 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Heaps and heapsort COMP171 Fall 2005 Part 2. Sorting III / Slide 2 Heap: array implementation Is it a good idea to store arbitrary.
1 Section 9.2 Tree Applications. 2 Binary Search Trees Goal is implementation of an efficient searching algorithm Binary Search Tree: –binary tree in.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
AALG, lecture 11, © Simonas Šaltenis, Range Searching in 2D Main goals of the lecture: to understand and to be able to analyze the kd-trees and.
Orthogonal Range Searching I Range Trees. Range Searching S = set of geometric objects Q = query object Report/Count objects in S that intersect Q Query.
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
External Memory Algorithms for Geometric Problems Piotr Indyk (slides partially by Lars Arge and Jeff Vitter)
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Lecture 8COMPSCI.220.FS.T Algorithm HeapSort J. W. J. Williams (1964): a special binary tree called heap to obtain an O(n log n) worst-case sorting.
Segment Trees Basic data structure in computational geometry. Computational geometry.  Computations with geometric objects.  Points in 1-, 2-, 3-, d-space.
Queues, Stacks and Heaps. Queue List structure using the FIFO process Nodes are removed form the front and added to the back ABDC FrontBack.
CIS 068 Welcome to CIS 068 ! Lesson 12: Data Structures 3 Trees.
Interval S = [3,10]  {x | 3 ≤ x ≤ 10} Closed segment S = (3,10)  {x | 3 < x < 10} Opened segment S = [3,3]  {3} Point.
CMPS 3130/6130 Computational Geometry Spring 2015
2 Binary Heaps What if we’re mostly concerned with finding the most relevant data?  A binary heap is a binary tree (2 or fewer subtrees for each node)
1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
Priority Search Trees Keys are distinct ordered pairs (x i, y i ). Basic operations.  get(x,y) … return element whose key is (x,y).  delete(x,y) … delete.
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Segment tree and Interval Tree
Orthogonal Range Searching and Kd-Trees
Data Structures: Segment Trees, Fenwick Trees
Computational Geometry Capter:1-2.1
Segment Trees Basic data structure in computational geometry.
Priority Search Trees Modified Prof. Sahni’s notes.
CMPS 3130/6130 Computational Geometry Spring 2017
Dynamic rectangular intersection with priorities
Dynamic rectangular intersection with priorities
Presentation transcript:

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment trees 3.Interval trees 4.Priority search trees

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 2 Rectangle Intersection - Sweep a horizontal Scan-Line from top to bottom. - Store the intersection points with the rectangles in a status structure L.

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 3 Operations on L - Insertion of an interval into L - deletion of an interval from L - For a given interval I : Determine all intervals from L, which overlap themselves with I L stores a set of intervals over a discrete and well-known universe of possible end-points.

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 4 Reduction of the overlap-query xyxxxyyy abababab

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 5 Segment Trees Segment trees are a structure for storing sets of intervals, which support the following operations: - insertion of intervals - deletion of intervals - stabbing queries: For a given point A, report all intervals which contain A (which are stabbed by A) For the solution of the rectangle intersection problem semi-dynamic segment trees are sufficient.

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 6 Example An interval I is in the list of a vertex p if and only if p is the first node from the root, so that the interval of I(p) is contained in I. Insertion of an interval is possible in O(log n) steps. A B C D E F

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 7 Size of a Segment Tree I Each interval of I appears in at the most O(log n) interval lists. Construction of a segment tree with n intervals is possible in time O(n log n).

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 8 Algorithm for answering stabbing queries A B C D E F procedure report (p: node ; x: point): report all intervals of the list of p; if p is leaf then finish else { if (p has left child p l & x in I(p l )) then report(p l, x); if (p has right child p r & x in I(p r )) then report(p r, x); } Using the segment tree all intervals that contain a query point can be reported in time O(log n + k), where k is the number of reported intervals.

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 9 I I I I I I Dictionary for all intervals Deletion of Intervals

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 10 Interval Trees o- Lists u- Lists S Skeleton (complete search tree of the interval boundaries) o-Lists sorted according to descending upper end points u-Lists sorted according to ascending lower end points Interval [ l,r ] is stored in the u-/ o-list of the node s forwards if and only if s of the knots of minimum depth is, so that s lies in [ l,r ].

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 11 Insertion and deletion of intervals in an interval tree with skeleton of size O(n) and altogether O(n) intervals can be carried out in time O(log n). [1, 5], [1, 7], [3, 4] [1, 7], [1, 5], [3, 4] [5, 7], [6, 7] [1, 2] Example {[1, 2], [1, 5], [3, 4], [5, 7], [6, 7], [1, 7] }

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 12 X < p.key X X > p.key X Procedure report (p :nodes, x : points) if x = p.key then report all intervals of the u/o – lists else if x p.key) { report beginning of the o - list; report(p r, x) } Stabbing queries can be answered in O(log n + k) time, where k is the number of reported intervals. u - listso - lists

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 13 Priority Search Trees A B C D A B C D lr xy

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 14 Priority Search Trees Priority Search trees are a 1.5-dim structure for the storage of points, they support the following operations : Insertion of a point Deletion of a point South-grounded range queries

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 15 Priority Search Trees Priority search trees are - binary leaf search trees for the x-coordinates of the points. - min heaps for the y-coordinates of the points. M = { (1, 3), (2, 4), (3, 7), (4, 2), (5, 1), (6, 6), (7, 5), (8, 4) }

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 16 Insertion Insertion of a point p = (x, y) : Deposite p on the search path for x according to its y-value! I.e. if on the way down the tree, p meets a point q, with larger y-value, then deposit p there and and continue the procedure with q. Insertion of a point can be carried out in time O(log n).

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 17 Deletion Look for point p in the tree and remove it; Close the gaps (recursively) by pulling up the point, with smaller y-value. Deletion of a point is possible in time O(log n).

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 18 South-grounded range queries (x, x´, y) : Search for x and x´. Report all points with y-value < y within the range between these borders. x y x´ Executable in O(log n + k) time.

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 19 Possibilities for the full dynamization of priority search trees: No rigid skeleton, but growing or shrinking with the point set. Inserting (5,3)

Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 20 Balanced trees as skeletons  Rotation conserves the x-order and destroys in general the y-order.