Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.

Slides:



Advertisements
Similar presentations
Computational Geometry
Advertisements

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.
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 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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.
The Half-Edge Data Structure Computational Geometry, WS 2007/08 Lecture 3, Part III Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part IV Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
The Half-Edge Data Structure
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
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.
The Lower Envelope: The Pointwise Minimum of a Set of Functions Computational Geometry, WS 2006/07 Lecture 4 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
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.
Computational Geometry, WS 2007/08 Lecture 15 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften.
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,
Voronoi Diagrams Computational Geometry, WS 2006/07 Lecture 10 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Introduction to Computational Geometry Computational Geometry, WS 2007/08 Lecture 1 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
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.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
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.
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.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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.
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part II 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.
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
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.
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.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Segment Trees Basic data structure in computational geometry. Computational geometry.  Computations with geometric objects.  Points in 1-, 2-, 3-, d-space.
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
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.
Geometric Data Structures
Segment tree and Interval Tree
Orthogonal Range Searching and Kd-Trees
Segment Trees Basic data structure in computational geometry.
CMPS 3130/6130 Computational Geometry Spring 2017
Presentation transcript:

Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann2 Overview Motivation: Rectangle Intersection Segment trees Interval trees Priority search trees

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann3 - Sweep a horizontal Scan-Line from top to bottom. - Store the intersection points with the rectangles in a status structure L. Rectangle Intersection

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann4 - 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. Operations on L

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann5 xyxxxyyy abababab Reduction of the overlap-query

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann6 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. Segment Trees

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann7 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 Example

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann8 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). Size of a Segment Tree

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann9 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. Algorithm for answering stabbing queries

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann10 I I I I I I Dictionary for all intervals Deletion of intervals

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann11 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 ]. Interval Trees

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann12 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] {[1, 2], [1, 5], [3, 4], [5, 7], [6, 7], [1, 7] } Example

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann13 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. X < p.key X X > p.key X u - listso - lists Answering stabbing queries

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann14 A B C D A B C D lr xy Priority Search Trees

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann15 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 Priority Search Trees

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann16 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, 2), (2, 4), (3, 8), (4, 5), (5, 4), (6, 9), (8, 3) } Priority Search Trees 8 3, , 4 1 4, 5 3 6, , 2 2 5, 4 6 8, 3 4

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann17 8 3, , 4 1 4, 5 3 6, , 2 2 5, 4 6 8, 3 4 Priority Search Tree: Insertion Insert (7, 1)

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann18 Insertion Algorithm 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). Observation: For any given set P of n points in the plane, there exists a uniquely defined PST storing P; it can be constructed in time O(n log n) and space O(n)

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann19 8 3, , , 4 1 4, 5 3 5, , 2 2 8, 3 6 7, 1 4 Priority Search Tree: Deletion

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann20 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). Deletion 8 3, , , 4 1 4, 5 3 5, , 2 2 8, 3 6 7, 1 4

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann21 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. Answering range queries

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann , , , 4 1 4, , , , , 1 4 Full dynamic PST No rigid skeleton, but growing or shrinking with the point set.

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann23 p x, p y ab q x, q y b a Rotation preserves the x-order, but may destroy the y-order of points. Balanced trees as skeletons of PSTs