Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.

Slides:



Advertisements
Similar presentations
Order-k Voronoi Diagram in the Plane
Advertisements

Two Segments Intersect?
Polygon Triangulation
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.
Line Segment Intersection. Balanced binary search tree Internal nodes: Rightmost leaf in its left subtree Status Structure T.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Brute-Force Triangulation
Computational Geometry, WS 2007/08 Lecture 17 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften.
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
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 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Overlay of Two Subdivisions
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
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.
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.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
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.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 l-Monotone Convex polygons are easy to triangulate. Unfortunately the partition.
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 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
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.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
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.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
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.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Brute-Force Triangulation
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.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
CMPS 3130/6130 Computational Geometry Spring 2015
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Presentation transcript:

Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann2 Line Segment Intersection Motivation: Computing the overlay of several maps The Sweep-Line-Paradigm: A visibility problem Line Segment Intersection Overlay of planar subdivisions

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann3 Line segment intersection Input: Set S = {s 1...,s n } of n closed line segments s i ={(x i, y i ), (x´ i, y´ i )} Output: All intersection points among the segments in S The intersection of two lines can be computed in time O(1).

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann4 Sweep line principle Event queue: upper, lower, intersection points Status structure: Ordered set of active line segments

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann5 Example: Segment Intersection A D C B E.A.C.D C..E B. A. D. QT E..B B

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann6 Data structures: Event Queue Q Operations: Initialisation (sequence of upper and lower endpoints of segments in decreasing y-order), min-delete, insertion (of intersection points) Implementation: Balanced search tree with order p < q  p y < q y or (p y = q y and p x < q x ) Space: O(n + k), k = #intersections Time:Initialisation: O(n log n) Min-delete: O(log n) Insertion: O(log n)

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann7 Data structures: Status structure T Balanced search tree k m i i j l l jk i j k l m Operations: insertion, deletion, neighbor search, (changing order) Space: O(n) Time: O(log n)

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann8 Number of operations, total time n = #segments k = #intersections Number of operations on event queue Q: ≤ 2n+k, Number of operations on status structure T: ≤ 2n+k Result: Total time required to carry out the sweep-line algorithm for computing all k intersections in a set of n line segments is O((n+k) log n). The sweep-line algorithm is output sensitive!

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann9 A simple neighborhood lemma Lemma : Let s i and s j be two non-horizontal segments intersecting in a single point p and no third segment passing through p. Then there is an event point above p where s i and s j become adjacent and are tested for intersection. L p sisi sjsj Proof : L is so close to p that s i and s j are next to each other. Since s i and s j are not yet adjacent at the beginning of the algorithm there is an event q where s i and s j become adjacent and tested for intersection.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann10 Handling special cases P L

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann11 Special cases I L(P) C(P) P L

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann12 Special cases II U(P) C(P) P L

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann13 HandleEventPoint(p) if ( L(p)  U(p)  C(p) contains more than 1 segment) then {report p as intersection; delete L(p)  C(p) from T; insert U(p)  C(p) into T;} if ( U(p)  C(p) = {} ) then {Let s l and s r be left and right neighbours of p in T FindNewEvent(s l,s r,p) else s´ = leftmost segment of U(p)  C(p) in T s l = left neighbour of s´ in T FindNewEvent(s l,s´,p) s´´ = rightmost segment of U(p)  C(p) s r = right neighbour of s´´ in T FindNewEvent(s´´,s r,p)

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann14 FindNewEvent(s,s´,p) If (s and s´ intersect below the sweep line L or on it and to the right of the current event point p) and (the intersection of s and s´is not yet present in Q) then insert the intersection point into Q;

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann15 Summary Theorem: Let S be a set of n line segments in the plane. All intersection points in S, with for each intersection point the segments involved in it, can be reported in O(n log n + k log n) time and O(n) space, where k is the size of the output.. k can be reduced to I, I = #intersections