1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Two Segments Intersect?
Spatial Information Systems (SIS) COMP Terrain modeling and geometric problems (part 2)
Computational Geometry
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
Lars Arge 1/43 Big Terrain Data Analysis Algorithms in the Field Workshop SoCG June 19, 2012 Lars Arge.
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.
Convex Hull obstacle start end Convex Hull Convex Hull
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
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
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
CS138A Line Segment Intersection Peter Schröder.
N Line Segments Problem Given a set of n line segments in the plane, determine whether or not any intersection exists. It is not required to output all.
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
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.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
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.
I/O-Algorithms Lars Arge Aarhus University March 9, 2006.
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.
I/O-Algorithms Lars Arge University of Aarhus March 7, 2005.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Chapter 4: Trees AVL Trees Lydia Sinapova, Simpson College Mark Allen Weiss: Data Structures and Algorithm Analysis in Java.
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Orthogonal Line Segment Intersection Given N horizontal and N vertical line segments, find all intersections. All x and y coordinates are distinct.
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.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
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.
CSCE 3110 Data Structures & Algorithm Analysis AVL Trees Reading: Chap. 4, Weiss.
Lars Arge Presented by Or Ozery. I/O Model Previously defined: N = # of elements in input M = # of elements that fit into memory B = # of elements per.
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.
CMPS 3130/6130 Computational Geometry Spring 2015
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
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.
CMPS 3130/6130 Computational Geometry Spring 2015
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
Dynamic Dictionaries Primary Operations:  get(key) => search  put(key, element) => insert  remove(key) => delete Additional operations:  ascend()
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
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.
Line Sweep Algorithms Schalk-Willem Krüger – 2009 Training Camp 1 presentation.start();
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
Algorithm design techniques Dr. M. Gavrilova
CMPS 3130/6130 Computational Geometry Spring 2017
Segment tree and Interval Tree
Computational Geometry Capter:1-2.1
Priority Search Trees Modified Prof. Sahni’s notes.
Algorithms and Data Structures Lecture XIV
Presentation transcript:

1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep Algorithm

2 Applications Integrated circuit design: Computer graphics (hidden line removal):

3 Range Searching But what if we also want to insert and delete points? We’ll need a dynamic structure. One which supports these three operations. -insert (x) -remove (x) -range_search (x 1, x 2 ) That’s right. It’s Red-Black Tree time. Given a set of points on a line, answer queries of the type: Report all points x such that x 1  x  x 2

4 On-Line Range Searching Store points in a red-black tree Query by searching for x 1 and x 2 (take both directions)

5 Example

6 Time Complexity The search reports each of the K points that lie within the search range. All of the nodes of the K points reported are visited. In addition, O(log N + K) nodes may be visited whose points are not reported. Query Time: O(log N + K)

7 Intersection of Horizontal and Vertical Segments Given: H= horizontal segments V= vertical segments S= H  V N= total number of segments Report all pairs of intersecting segments (Assuming no coincident horizontal or vertical segments.)

8 The Brute Force Algorithm This algorithm runs in time O (N H  N V ) = O (N 2 ) But the number of intersections could be << N 2. We want an output sensitive algorithm: Time = f (N, K), where K is the number of intersections.

9 Plane Sweep Technique Horizontal sweep-line L that translates from bottom to top Status(L), the set of vertical segments intersected by L, sorted from left to right A vertical segment is inserted into Status(L) when L sweeps through its bottom endpoint A vertical segment is deleted from Status(L) when L sweeps through its top endpoint

10 Evolution of Status in Plane Sweep

11 Range Query in Sweep

12 Events in Plane Sweep Bottom endpoint of v -Action: insert v into Status(L) Top endpoint of v -Action: delete v from Status(L) Horizontal segment h -Action: range query on Status(L) with x-range of h

13 Data Structures Status: -Stores vertical segments -Supports insert, delete, and range queries -Solution: AVL tree or red-black tree (key is x-coordinate) Event Schedule: -Stores y-coordinates of segment endpoints, i.e., the order in which segments are added and deleted -Supports sequential scanning -Solution: sequence realized with a sorted array or linked list

14 Example

Time Complexity Events: -vertical segment, bottom endpoint -number of occurences: N V  N -action: insertion into status -time: O( log N ) -vertical segment, top endpoint -number of occurences: N V  N -action: deletion from status -time: O( log N ) -horizontal segment h-number of occurences: N H  N -action: range searching -time: O( log N + K h ) K h = (# vertical segments intersecting h ) Total time complexity: O( N log N +  h K h ) = O( N log N + K )