Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

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.
Polygon overlay in double precision arithmetic One example of why robust geometric code is hard to write Jack Snoeyink & Andrea Mantler Computer Science,
Visibility Graph Team 10 NakWon Lee, Dongwoo Kim.
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.
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.
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.
Lecture 3 Lower envelopes Computational Geometry, 2005/06 Prof.Dr.Th.Ottmann 1 The Lower Envelope The Pointwise Minimum of a Set of Functions.
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,
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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,
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
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.
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.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
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.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Brute-Force Triangulation
Orthogonal Line Segment Intersection Given N horizontal and N vertical line segments, find all intersections. All x and y coordinates are distinct.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
2IL05 Data Structures Fall 2007 Lecture 13: Minimum Spanning Trees.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 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
1 Binomial Tree Binomial tree. n Recursive definition: B k-1 B0B0 BkBk B0B0 B1B1 B2B2 B3B3 B4B4.
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
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.
Minimum- Spanning 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.
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.
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.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry 2
Computational Geometry Capter:1-2.1
Greedy Algorithms / Dijkstra’s Algorithm Yin Tat Lee
Heap Sort CSE 2011 Winter January 2019.
Dr.Surasak Mungsing CSE 221/ICT221 Analysis and Design of Algorithms Lecture 05-2: Analysis of time Complexity of Priority.
Presentation transcript:

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several maps The Sweep-Line-Paradigm: A visibility problem Line Segment Intersection The Doubly Connected Edge List Computing boolean operations on polygons

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 2 Maps

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 3 Motivation Thematic map overlay in Geographical Information Systems road riveroverlaid maps 1. Thematic overlays provide important information. 2. Roads and rivers can both be regarded as networks of line segments.

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 4 Problem definition 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).

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 5 Naive algorithm Goal: Output sensitive algorithm!

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 6 The Sweep-Line-Paradigm: A visibility problem Input: Set of n vertcal line segments Output: All pairs of mutually visible segments A B C D E F G H Naive method : Observation: Two line segments s and s´ are mutually visible iff there is a y such that s and s´are immediate neighbors at y.

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 7 Sweep line algorithm Q is set of the start and end points of the segments in decreasing y-order T is set of the active line segments A B C D E F G H QT.H H.D D!H.A A!DH.F A!D!F!H.C A!C!DFH.E ACD!E!FH D.AC!EFH.G ACEF!G!H.B A!B!CEFGH F.ABCE!GH C.AB!EGH :: : : :

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 8 while Q   do p = Q.Min; remove p from Q; if (p start point of segment s) T = T  {s}; determine neighbors s´and s´´ of s; report (s, s´) and (s,s´´) as visible pairs else /* p is end point of segment s */ determine neighbors s´and s´´ of s; report (s´, s´´) as visible pair; T = T - {s} Initialise Q as set of start and endpoints of segments in decreasing y-order; Initialise the set of active segments T =  ; Algorithm

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 9 Sweep Line principle Imaginary line moves in y direction. Each point is an event. Input: A set of (iso-oriented objects) Output: Problem-dependent Q: object and problem-dependant queue of event points T: ordered set of the active objects /* status structure */ while Q   do select next event point from Q and remove it from Q; update(T); report problem-dependent result

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 10 Data structures: event queue Operations to be supported: Initialisation, min, deletion of points, Possible implementation: Balanced search tree of points with order p < q  p y < q y or (p y = q y and p x < q x ) Initialisation takes time O(m log m) for m items. Deletion takes time O(log m) with m items in queue. In most cases a priority queue supporting insertion and min-removal (eg. heap, O(m), O(log m), for initialisation and min-removal) is enough.

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 11 Data structures: status structure m l i j k Possible implementation: Balanced search tree, O(log n) time Node values (keys) are used for routing k m i i j l l jk Operations to be supported: Insertion, deletion, searching for neighbors

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 12 Runtime analysis while Q   do p = Q.Min; remove p from Q; if (p start point of segment s) T = T  {s}; determine neighbors s´and s´´ of s; report (s, s´) and (s,s´´) as visible pairs else /* p is end point of segment s */ determine neighbors s´and s´´ of s; report (s´, s´´) as visible pair; T = T - {s} Initialise Q as set of start and endpoints of segments in decreasing y-order; Initialise the set of active segments T =  ;

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 13 Summary Theorem: For a given set of n vertical line segments all k pairs of mutually visible segments can be reported in time O(n log n). Note: k is O(n)