Trapezoid and Chain Methods

Similar documents
Planar Point Location

Point Enclosure and the Interval Tree

GEOMETRIC SEARCHING PART 1: POINT LOCATION

Computational Geometry

1 The range query problem

January 10-12, NIT Surathkal Introduction to Graph and Geometric Algorithms

CS 532: 3D Computer Vision 14 th Set of Notes

Optimal Expected-Case Planar Point Location

Lecture 9 March 15, 2012

CS6100: Topics in Design and Analysis of Algorithms

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

Geometric Data Structures

Notes in Computational Geometry Voronoi Diagrams

c 2007 Society for Industrial and Applied Mathematics

CMSC 754 Computational Geometry 1

DISTRIBUTION-SENSITIVE POINT LOCATION IN CONVEX SUBDIVISIONS

Different geometry in the two drawings, but the ordering of the edges around each vertex is the same

Randomized incremental construction. Trapezoidal decomposition: Special sampling idea: Sample all except one item

Lecture 13 Thursday, March 18, 2010

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

Computational Geometry

Lecture 3 February 23, 2012

Level-Balanced B-Trees

Computational Geometry

Computational Geometry

Line Arrangements. Applications

Fractional Cascading

Computational Geometry

Lecture 3 February 9, 2010

Orthogonal Range Search and its Relatives

Algorithms for Memory Hierarchies Lecture 2

Trapezoidal Maps. Notes taken from CG lecture notes of Mount (pages 60 69) Course page has a copy

WINDOWING PETR FELKEL. FEL CTU PRAGUE Based on [Berg], [Mount]

(2,4) Trees. 2/22/2006 (2,4) Trees 1

Computational Geometry. Lecture 17

Lecture 6: External Interval Tree (Part II) 3 Making the external interval tree dynamic. 3.1 Dynamizing an underflow structure

Polygon Partitioning. Lecture03

Algorithms. Red-Black Trees

would be included in is small: to be exact. Thus with probability1, the same partition n+1 n+1 would be produced regardless of whether p is in the inp

CS2223: Algorithms Sorting Algorithms, Heap Sort, Linear-time sort, Median and Order Statistics

Lecture Notes: External Interval Tree. 1 External Interval Tree The Static Version

Balanced Search Trees. CS 3110 Fall 2010

Figure 4.1: The evolution of a rooted tree.

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25

Search Trees - 1 Venkatanatha Sarma Y

CS24 Week 8 Lecture 1

13.4 Deletion in red-black trees

Data Structures and Algorithms

Approximation Algorithms for Geometric Intersection Graphs

Computational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs

Range Reporting. Range Reporting. Range Reporting Problem. Applications

Polygon Triangulation. (slides partially by Daniel Vlasic )

Module 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree.

Orthogonal range searching. Range Trees. Orthogonal range searching. 1D range searching. CS Spring 2009

Hamilton paths & circuits. Gray codes. Hamilton Circuits. Planar Graphs. Hamilton circuits. 10 Nov 2015

Trapezoidal decomposition:

Multiway Search Trees. Multiway-Search Trees (cont d)

ICS 691: Advanced Data Structures Spring Lecture 3

Deterministic Communication

External-Memory Algorithms with Applications in GIS - (L. Arge) Enylton Machado Roberto Beauclair

K-structure, Separating Chain, Gap Tree, and Layered DAG

Friday Four Square! 4:15PM, Outside Gates

Line segment intersection. Family of intersection problems

Computational Geometry

Geometric Data Structures

Lecture 3 February 20, 2007

EXPECTED-CASE PLANAR POINT LOCATION

Polygon Triangulation. (slides partially by Daniel Vlasic )

Range Reporting. Range reporting problem 1D range reporting Range trees 2D range reporting Range trees Predecessor in nested sets kd trees

Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here)

Some Search Structures. Balanced Search Trees. Binary Search Trees. A Binary Search Tree. Review Binary Search Trees

Lecture 3: Art Gallery Problems and Polygon Triangulation

DISTRIBUTION-SENSITIVE POINT LOCATION IN CONVEX SUBDIVISIONS

CSE 530A. B+ Trees. Washington University Fall 2013

Properties of red-black trees

Advanced Set Representation Methods

Greedy Algorithms Part Three

1. Meshes. D7013E Lecture 14

CIS265/ Trees Red-Black Trees. Some of the following material is from:

Range Searching and Windowing

Balanced Trees Part Two

The Unified Segment Tree and its Application to the Rectangle Intersection Problem

arxiv: v1 [cs.cg] 8 Jan 2018

Λέων-Χαράλαμπος Σταματάρης

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm

CSCI Trees. Mark Redekopp David Kempe

1. Covered basics of a simple design technique (Divideand-conquer) 2. Next, more sorting algorithms.

8. Binary Search Tree

Module 8: Range-Searching in Dictionaries for Points

The Visibility Problem and Binary Space Partition. (slides by Nati Srebro)

COMP Analysis of Algorithms & Data Structures

(2,4) Trees Goodrich, Tamassia. (2,4) Trees 1

Range Searching. Data structure for a set of objects (points, rectangles, polygons) for efficient range queries.

Logarithmic-Time Point Location in General Two-Dimensional Subdivisions

Computational Geometry [csci 3250]

Approximation Algorithms for Geometric Separation Problems

Balanced Trees Part One

Average Case Analysis of Dynamic Geometric Optimization

Bichromatic Line Segment Intersection Counting in O(n log n) Time

Transcription:

C.S. 252 Prof. Roberto Tamassia Computational Geometry Sem. II, 1992 1993 Lecture 05 Date: Febuary 17, 1993 Scribe: Peter C. McCluskey Trapezoid and Chain Methods 1 Trapezoid Method (continued) Continuing the discussion of the Trapezoid Method for determining the region in which a point is located: 1. Partition the planar straight-line graph (PSLG) into as many trapezoids as possible (a) Each trapezoid with one or more spanning edges (PSLG edges which cross both the upper and lower edges of the trapezoid (to be depicted as ) ) is divided by those edges into smaller trapezoids. (Figure 1) (b) Create the horizontal lines (to be depicted as ) dividing each trapezoid into two through the vertex within the trapezoid which has the median y-coordinate. (Figure 2) [ if the horizontal lines were calculated first, the algorithm would reduce to the Slab Method ] Figure 1: Spanning Edge Figure 2: Horizontal Edge 2. Query When multiple trapezoids separated by spanning edges contain only one PSLG vertex, they can be joined into a single node, and searched via a secondary binary tree. 1

It takes O(h + log n) time. Each edge is cut into 2 log n fragments. The space needed is O(n log n). Considering only the delta nodes, there are O(log n) layers if the tree is balanced locally. The height is O(log n) at each node, so the height is O(log 2 n) if the tree balanced locally, but O(log n) height can be achieved with global balancing. 2 Global Balancing Let u = T 1 l 1 T 2 l 2... T n 1 l n 1 T n where T i is a trapezoid, and l i is a line splitting the trapezoids. Define the weight w i of T i to be the number of vertices inside T i. Define W = n i=1 w i. Then the tree can be balanced by finding, at each trapezoid, an r that splits the weights as evenly as possible: r 1 i=1 w i <W/2, and ri=1 w i W/2. The balancing step at each trapezoid puts the first r 1 fragments into the right subtree of the trapezoid, and puts the remaining fragments into the left subtree. Theorem 1 Claim: height(tree(u)) 3 log 2 w + 5 where tree(u) is the tree whose base is at node u, and height(t) is the maximum number of nodes that need to be visited in order to reach a leaf of tree t. Proof: Inductive Proof: Base Case: w = 1 Figure 3: Base case, height 5 The tree for this case consists of 2 nodes of empty trapezoids, one a child of other, a node below that child, with node children on each side, and 2 children below each. Thus, the total height of this tree is 5. 2

Induction step: Assume that the claim is true for w < k. Prove for w = k: (refer to Figure 4) By inductive assumption and the fact that balancing makes each side in the lower part have weight k/2, H(lowerpart) 3 log 2 k/2 + 5 for each k/2 child of node τ. H(tree) (3 log 2 k/2 + 5) + 3 (3( log 2 k 1)) + 5 + 3 3 log 2 k + 5 If a spanning edge is found on the first try, then height(τ) = 3 log 2 n + 5, otherwise height(τ) < 3 log 2 n + 5. H(tree) w<k/2 w>=k/2 H(lower)<=3 log(k/2) +5 2 Figure 4: A tree of weight k, with subtrees of weights < k/2 3

Origins: Segment Tree Method 1986 [2] Slab Method 1976 [3] Trapezoid Method 1981 [1] 3 Preprocessing 1. Sort the vertices by their y-coordinates (O(n log n) time). 2. Create a left to right partial order of the edges using a line sweep (moving a horizontal line upwards) (n insertions of O(log n) time each for a total of O(n log n) time). 3. Sort the edges topologically (O(n) time). 4. Recursively decompose the trapezoids: a. (a) check each trapezoid for spanning edges (b) accumulate weights (c) make s b. Each τ i with no spanning edge is cut horizontally by the median y vertex. This creates O(log n) fragments. 4 Chain Method Definition: a monotone chain is a series of connected line segments with non-decreasing y-coordinates. Definition: a separator in a planar straight-line graph: a) extends from y = to y = +, b) must be a monotone chain, and c) does not cross any other separators (but may have edges in common with other separators) In order to use separators for point location, we start by creating the leftmost separator and adding new separators, with each additional one differing from the previous by using the right edges of one region which the previous separator the left edges of, until all edges have been used. Thus, the chains distinguish all the regions and can be stored in a tree which can be searched to determine which region a point is located in. The y-coordinate of the point will be used to find the correct edge in the chain associated with each node. This requires O(log n) search time at each node to find the correct interval on the chain, at O(log n) nodes, for a query time of O(log 2 n). Each chain uses O(n) storage, so with the naive approach the space required for the entire graph is O(n 2 ), although the average case should be better than this. See Figure 6 for an example where n 2 space is needed. Stay tuned for a trick to reduce the overall storage to O(n). 4

Figure 5: Examples after the first and second separator drawn References Figure 6: An example where n 2 space is used by the naive approach [1] Preparata, Franco P., A New Approach to Planar Point Location, SIAM Journal on Computing 10(3) 473-482 (1981). [2] Edelsbrunner, E, L.J. Guibas, and J Stolfi, Optimal Point Location in a Monotone Subdivision, SIAM Journal on Computing 15(2) 317-340(1986). [3] Dobkin, David and Richard Lipton, Multidimensional Searching Problems, SIAM Journal on Computing 5(2) 181-186 (1976). 5