The Lower Envelope: The Pointwise Minimum of a Set of Functions Computational Geometry, WS 2006/07 Lecture 4 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,

Slides:



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

Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lower Envelopes Yuval Suede. What’s on the menu? Lower Envelopes Davenport-Schinzel Sequences Trivial upper bound Super linear complexity* Tight upper.
Computational Geometry
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Lecture 3: Parallel Algorithm Design
Recursive Definitions and Structural Induction
Computational Geometry, WS 2007/08 Lecture 17 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften.
Sharp Bounds on Davenport-Schinzel Sequences of Every Order Seth Pettie University of Michigan.
Convex Hulls Computational Geometry, WS 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
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.
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.
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lower Envelopes (Cont.) Yuval Suede. Reminder Lower Envelope is the graph of the pointwise minimum of the (partially defined) functions. Letbe the maximum.
Computational Geometry, WS 2007/08 Lecture 15 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften.
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.
On the Union of Cylinders in Esther Ezra Duke University On the Union of Cylinders in  3 Esther Ezra Duke University.
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.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 2: Divide and Conquer I: Merge-Sort and Master Theorem Shang-Hua Teng.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
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 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.
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.
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
On the union of cylinders in 3-space Esther Ezra Duke University.
CMPT 438 Algorithms. Why Study Algorithms? Necessary in any computer programming problem ▫Improve algorithm efficiency: run faster, process more data,
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Lecture 5 Today, how to solve recurrences We learned “guess and proved by induction” We also learned “substitution” method Today, we learn the “master.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Lecture 14 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Divide and Conquer Faculty Name: Ruhi Fatima Topics Covered Divide and Conquer Matrix multiplication Recurrence.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Lecture # 6 1 Advance Analysis of Algorithms. Divide-and-Conquer Divide the problem into a number of subproblems Similar sub-problems of smaller size.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Advanced Algorithms Analysis and Design
CMPT 438 Algorithms.
Modeling with Recurrence Relations
Computing Connected Components on Parallel Computers
Minimum Spanning Tree 8/7/2018 4:26 AM
Algorithm design techniques Dr. M. Gavrilova
COSC 320 Advanced Data Structures and Algorithm Analysis
Presentation transcript:

The Lower Envelope: The Pointwise Minimum of a Set of Functions Computational Geometry, WS 2006/07 Lecture 4 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 Overview Definition of the Lower Envelope. Functions: Non-linear, x-monotone. Techniques: Divide & conquer, Sweep-line. Definition: s (n). Davenport-Schinzel Sequences (DSS). Lower Envelope of n line segments.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann3 Definition of the Lower Envelope Given n real-valued functions, all defined on a common interval I, then the minimum is : f(x) = min 1≤i≤n f i (x) The graph of f(x) is called the lower envelope of the fi’s. y =-∞

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann4 Special Case If all the functions f i are linear, then their graphs are line segments. The lower envelope can be calculated with the help of sweep algorithm. A B C D CuCu I

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann5 Non-Linear Functions Question: Could the sweep line method also be used to find the lower envelope of graphs of non-linear functions?

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann6 X-Monotone Functions A curve c is x-monotone if any vertical line either does not intersect c, or it intersects c at a single point. Assumptions –All functions are x-monotone. –Function evaluation and determination of intersection points take time O(1). –The space complexity of the description of a function f i is also constant. Theorem 1: With the sweep technique, the k intersection points of n different x-monotone curves can be computed in O((n+k) logn) time and O(n) space.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann7 The Sweep Technique If any two curves intersect in at most s points, (this would be satisfied when the functions of all n curves are polynomials that have degree at most s), then the total number of intersection points k is k ≤ s*n(n-1)/2 Consequence: The total time complexity of the sweep line algorithm for computing the lower envelope of n x-monotone functions is O(s n2 logn) (from the O((n+k) logn) bound for computing all k intersection points). Note: This is NOT an output-sensitive algorithm.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann8 Example S=3,n=4 Maximum k=18 Only 8 intersection points needed for lower envelope!

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann9 New: Divide & Conquer, Sweep-line If n =1, do nothing, otherwise: 1. Divide: the set S of n functions into two disjoint sets S 1 and S 2 of size n/2. 2. Conquer: Compute the lower envelopes L 1 and L 2 for the two sets S 1 and S 2 of smaller size. 3. Merge: Use a sweep-line algorithm for merging the lower envelopes L 1 and L 2 of S 1 and S 2 into the lower envelope L of the set S.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann10 Example: Divide & Conquer Lower envelope of curves A and D Lower envelope of curves C and B

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann11 Sweep-line: Merging 2 Lower Envelopes Sweep over L 1 and L 2 from left to right: Event points: All vertices of L 1 and L 2, all intersection points of L 1 and L 2 At each instance of time, the event queue contains only 3 points: 1 (the next) right endpoint of a segment of L 1 1 (the next) right endpoint of a segment of L 2 The next intersection point of L 1 and L 2, if it exists. Sweep status structure: Contains two segments in y-order

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann12 Example: Sweep-line L1L1 L2L2 Event queue: SSS: Output L:

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann13 Time Complexity L1L1 L2L2 The lower envelope can be computed in time proportional to the number of events (halting points of the sweep line). At each event point, a constant amount of work is sufficient to update the SSS and to output the result. Total runtime of the merge step: O(#events). How large is this number?

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann14 Definition: s (n) The maximum number of segments of the lower envelope of an arrangement of n different x-monotone curves over a common interval such that every two curves have at most s intersection points λ s (n) is finite and grows monotonously with n. L1L1 L2L2 2λ s (n/2)≤2 λ s (n) Lower envelope of a set of n/2 x-monotone curves Lower envelope of a set of n/2 x-monotone curves

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann15 Analysis If n =1, do nothing, otherwise: 1. Divide: the set S of n functions into two disjoint sets S 1 and S 2 of size n/2. 2. Conquer: Compute the lower envelopes L 1 and L 2 for the two sets S 1 and S 2 of smaller size. 3. Merge: Use a sweep-line algorithm for merging the lower envelopes L 1 and L 2 of S 1 and S 2 into the lower envelope L of the set S. Time complexity T(n) of the D&C/Sweep algorithm for a set of n x-monotone curves, s.t. each pair of curves intersects in at most s points: T(1) = C T(n) ≤ 2 T(n/2) + C λ s (n)

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann16 Analysis Using the Lemma : For all s, n ≥ 1, 2λ s (n) ≤ λ s (2n), and the recurrence relation T(1) = C, T(n) ≤ 2 T(n/2) + C λ s (n) yields: Theorem: To calculate the lower envelope of n different x-monotone curves on the same interval, with the property that any two curves intersect in at most s points can be computed in time O(λ s (n) log n ).

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann17 Recursion Tree Back-substitution The root has cost of Cλ s (n) each subtree has cost of Cλ s (n/2) By induction…. each subtree has cost of Cλ s (n/4) Marking each node with the cost of the divide and conquer step T(n) T(n/2) T(n/2) T(n/4) T(n/4)

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann18 Davenport-Schinzel Sequences (DSS) Consider words (strings) over an alphabet {A, B, C,…} of n letters. A DSS of order s is a word such that no letter occurs more than once on any two consecutive positions the order in which any two letters occur in the word changes at most s times. Examples: ABBA is no DSS, ABDCAEBAC is DSS of order 4, What about ABRAKADABRA?

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann19 Davenport-Schinzel Sequences (DSS) Theorem: The maximal length of a DSS of order s over an alphabet of n letters is λ s (n). Proof part 1: Show that for each lower envelope of n x-monotone curves, s.t. any two of them intersect in at most s points, there is a DSS over an n-letter alphabet which has the same length (# segments) as the lower envelope. Proof part 2: Show that for each DSS of length n and order s there is a set of n x-monotone curves which has the property that any two curves intersect in at most s points and which have a lower envelope of n segments.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann20 DSS: Proof (Part 1) A A C D C B B D C Lower envelope contains the segments ABACDCBCD in this order. It obviously has the same length as the l.e. Is this also a DSS?

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann21 Example: DSS A B C A A A B B C C C Example: Davenport-Schinzel-Sequence: ABACACBC

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann22 DSS: Proof (Part 2) Proof part 2: Given a DSS w of order s over an alphabet of n letters, construct an arrangement of n curves with the property that each pair of curves intersects in at most s point which has w as its lower envelope. Generic example: ABCABACBA, DSS of order 5 A B C

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann23 Lemma Lemma: For all s,n ≥ 1: 2 λs(n) ≤ λs(2n) Proof: Given a DSS over an n-element alphabet of order s and length l; construct a DSS of length 2l over an alphabet of 2n letters by concatenating two copies of the given DSS and choosing new letters for the second copy. Example: n = 2, that is, choose alphabet {A,B}, s = 3, DSS 3 = ABAB n= 4, that is, choose alphabet {A,B,C,D} ABABCDCD is a DSS of order 3 and double length.

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann24 Properties of s (n) 1.λ 1 (n) = n 2.λ 2 (n) = 2n -1 3.λ s (n) ≤ s (n – 1) n / λ s (n)  O(n log* n), where log*n is the smallest integer m, s.t. the m-th iteration of the logarithm of n log 2 (log 2 (...(log 2 (n))...)) yields a value ≤ 1: Note: For realistic values of n, the value log*n can be considered as constant! Example: For all n ≤ , log*n ≤5

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann25 Lower Envelope of n Line-Segments A B C D CuCu Theorem: The lower envelope of n line segments over a common interval can be computed in time O(n log n) and linear space. Proof: λ 1 (n) = n

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann26 Line-Segments in General Position A B C D A A B B D Theorem: The lower envelope of n linesegments in general position has O(λ 3 (n))many segments. It can be computed in time O(λ 3 (n) log n).

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann27 Reduction to X-Monotone Curves A B C D A AB B D Any two curves may Intersect at most 3 times!

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann28 Reduction to X-Monotone Curves Any two curves may Intersect at most 3 times!

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann29 Analysis Because the outer segments are parallel to each other, any two x- monotone curves can intersect in at most three points. Therefore, the lower envelope has at most O(λ 3 (n) log n) segments. It is known that λ 3 (n)  Θ(n α(n)). Here, α is the functional inverse of the Ackermann function A defined by: A(1, n) = 2n, if n ≥ 1 A(k, 1) = A(k – 1, 1), if k ≥ 2 A(k, n) = A(k – 1, A(k, n – 1)), if k ≥ 2, n ≥ 2 Define a(n) = A(n, n), then α is defined by α(m) = min{ n; a(n) ≥ m} The function α(m) grows almost linear in m (but is not linear).

Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann30 References 1.R. Klein. Algorithmische Geometrie, Kap Addison Wesley, M. Sharir and P. K. Agarwal. Davenport-Schinzel Sequences and their Geometric Applications, Cambridge University Press, 1995.