1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Two Segments Intersect?
Polygon Triangulation
Computational Geometry
Line Segment Intersection. Balanced binary search tree Internal nodes: Rightmost leaf in its left subtree Status Structure T.
Comp 122, Spring 2004 Binary Search Trees. btrees - 2 Comp 122, Spring 2004 Binary Trees  Recursive definition 1.An empty tree is a binary tree 2.A node.
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
1 Closest Points A famous algorithmic problem... Given a set of points in the plane (cities in the U.S., transistors on a circuit board, computers on a.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
November 4, Algorithms and Data Structures Lecture XIV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Lecture 7: Voronoi Diagrams Presented by Allen Miu Computational Geometry September 27, 2001.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
17. Computational Geometry Chapter 7 Voronoi Diagrams.
CSE332: Data Abstractions Lecture 9: B Trees Dan Grossman Spring 2010.
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.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
CSE 326: Data Structures B-Trees Ben Lerner Summer 2007.
Voronoi Diagrams.
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
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.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Data Structures Trees.
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
A brief and sketchy intro to 3D Convex Hulls Rodrigo Silveira GEOC 2010/11 - Q2.
Chapter 12. Binary Search Trees. Search Trees Data structures that support many dynamic-set operations. Can be used both as a dictionary and as a priority.
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.
Binary SearchTrees [CLRS] – Chap 12. What is a binary tree ? A binary tree is a linked data structure in which each node is an object that contains following.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
Chapter 2: Basic Data Structures. Spring 2003CS 3152 Basic Data Structures Stacks Queues Vectors, Linked Lists Trees (Including Balanced Trees) Priority.
Segment Trees Basic data structure in computational geometry. Computational geometry.  Computations with geometric objects.  Points in 1-, 2-, 3-, d-space.
CMPS 3130/6130 Computational Geometry Spring 2015
D. ChristozovCOS 221 Intro to CS II AVL Trees 1 AVL Trees: Balanced BST Binary Search Trees Performance Height Balanced Trees Rotation AVL: insert, delete.
AVL trees1 AVL Trees Height of a node : The height of a leaf is 1. The height of a null pointer is zero. The height of an internal node is the maximum.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
Priority Search Trees Keys are pairs (x,y). Basic (search, insert, delete) and rectangle operations. Two varieties.  Based on a balanced binary search.
CMPS 3130/6130 Computational Geometry Spring 2015
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables II.
Line Sweep Algorithms Schalk-Willem Krüger – 2009 Training Camp 1 presentation.start();
CMPS 3130/6130 Computational Geometry Spring 2017
File Organization and Processing Week 3
CMPS 3130/6130 Computational Geometry Spring 2017
Binary Search Trees.
CMPS 3130/6130 Computational Geometry Spring 2017
Multiway search trees and the (2,4)-tree
AVL DEFINITION An AVL tree is a binary search tree in which the balance factor of every node, which is defined as the difference between the heights of.
Algorithm design techniques Dr. M. Gavrilova
CMPS 3130/6130 Computational Geometry Spring 2017
KD Tree A binary search tree where every node is a
(edited by Nadia Al-Ghreimil)
Computational Geometry Capter:1-2.1
Search Sorted Array: Binary Search Linked List: Linear Search
(edited by Nadia Al-Ghreimil)
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Algorithms and Data Structures Lecture XIV
Presentation transcript:

1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk

1/20/15CMPS 3130/6130 Computational Geometry2 Closest Pair Problem: Given P  R 2, |P|=n, find the distance between the closest pair in P

1/20/15CMPS 3130/6130 Computational Geometry3 Plane Sweep: An Algorithm Design Technique Simulate sweeping a vertical line from left to right across the plane. Maintain cleanliness property: At any point in time, to the left of sweep line everything is clean, i.e., properly processed. Sweep line status: Store information along sweep line Events: Discrete points in time when sweep line status needs to be updated

1/20/15CMPS 3130/6130 Computational Geometry4 Plane Sweep: An Algorithm Design Technique Simulate sweeping a vertical line from left to right across the plane. Maintain cleanliness property: At any point in time, to the left of sweep line everything is clean, i.e., properly processed. Sweep line status: Store information along sweep line Events: Discrete points in time when sweep line status needs to be updated Algorithm Generic_Plane_Sweep: Initialize sweep line status S at time x=-  Store initial events in event queue Q, a priority queue ordered by x-coordinate while Q ≠  // extract next event e: e = Q.extractMin(); // handle event: Update sweep line status Discover new upcoming events and insert them into Q

1/20/15CMPS 3130/6130 Computational Geometry5 Plane sweep for Closest Pair Problem: Given P  R 2, |P|=n, find the distance of the closest pair in P Sweep line status: –Store current distance Δ of closest pair of points to the left of sweep line –Store points in Δ-strip left of sweep line –Store pointer to leftmost point in strip Events: All points in P. No new events will be added during the sweep. → Presort P by x-coordinate. Cleanliness property

1/20/15CMPS 3130/6130 Computational Geometry6 Plane sweep for Closest Pair, II Presort P by x-coordinate How to store points in Δ-strip? –Store points in Δ-strip left of sweep line in a balanced binary search tree, ordered by y-coordinate → Add point, delete point, and search in O(log n) time Event handling: –New event: Sweep line advances to point p  P –Update sweep line status: Delete points outside Δ-strip from search tree by using previous leftmost point in strip and x-order on P Compute candidate points that may have distance  Δ from p: –Perform a search in the search tree to find points in Δ–strip whose y- coordinates are at most Δ away from p.y. → Δ x 2Δ rectangle –Because of the cleanliness property each pair of these points has distance ≥Δ. → A Δ x 2Δ rectangle can contain at most 6 such points. Check distance of these points to p, and possibly update Δ –No new events necessary to discover O(n log n) O(n log n) total O(n log n + 6n) total O(6n) total Total runtime: O(n log n) Δ Δ Δ 1 2 3

1/20/15CMPS 3130/6130 Computational Geometry7 Balanced Binary Search Tree -- a bit different key[x] is the maximum key of any leaf in the left subtree of x.

1/20/15CMPS 3130/6130 Computational Geometry x x  x x > x Balanced Binary Search Tree -- a bit different key[x] is the maximum key of any leaf in the left subtree of x.

1/20/15CMPS 3130/6130 Computational Geometry R ANGE -Q UERY ([7, 41]) x x  x x > x Balanced Binary Search Tree -- a bit different

1/20/15CMPS 3130/6130 Computational Geometry10 Plane Sweep: An Algorithm Design Technique Plane sweep algorithms (also called sweep line algorithms) are a special kind of incremental algorithms Their correctness follows inductively by maintaining the cleanliness property Common runtimes in the plane are O(n log n): –n events are processed –Update of sweep line status takes O(log n) –Update of event queue: O(log n) per event