Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Trees Chapter 11.
Polygon Triangulation
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
INTERVAL TREE & SEGMENTATION TREE
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
Chapter 4: Trees Part II - AVL Tree
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Greedy Algorithms Greed is good. (Some of the time)
Brute-Force Triangulation
Discrete Structure Li Tak Sing( 李德成 ) Lectures
Incidences and Many Faces via cuttings Sivanne Goldfarb
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
Constant-Time LCA Retrieval
External Memory Geometric Data Structures
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Persistent Data Structures Computational Geometry, WS 2007/08 Lecture 12 Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
B + -Trees (Part 1) Lecture 20 COMP171 Fall 2006.
B + -Trees (Part 1). Motivation AVL tree with N nodes is an excellent data structure for searching, indexing, etc. –The Big-Oh analysis shows most operations.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Trees.
B + -Trees COMP171 Fall AVL Trees / Slide 2 Dictionary for Secondary storage * The AVL tree is an excellent dictionary structure when the entire.
Tirgul 6 B-Trees – Another kind of balanced trees.
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
IntroductionIntroduction  Definition of B-trees  Properties  Specialization  Examples  2-3 trees  Insertion of B-tree  Remove items from B-tree.
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.
1 B Trees - Motivation Recall our discussion on AVL-trees –The maximum height of an AVL-tree with n-nodes is log 2 (n) since the branching factor (degree,
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
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.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Trevor Brown – University of Toronto B-slack trees: Space efficient B-trees.
CSIT 402 Data Structures II
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
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.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
1 Trees 4: AVL Trees Section 4.4. Motivation When building a binary search tree, what type of trees would we like? Example: 3, 5, 8, 20, 18, 13, 22 2.
Open Problem: Dynamic Planar Nearest Neighbors CSCE 620 Problem 63 from the Open Problems Project
Lecture 11COMPSCI.220.FS.T Balancing an AVLTree Two mirror-symmetric pairs of cases to rebalance the tree if after the insertion of a new key to.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
1 Binary Search Trees  Average case and worst case Big O for –insertion –deletion –access  Balance is important. Unbalanced trees give worse than log.
1 Schematization of Networks Rida Sadek. 2 This talk discusses: An algorithm that is studied in the following papers:  S. Cabello, M. de Berg, and M.
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
Computational Geometry
Advanced Algorithms Analysis and Design
Introduction to Trees Section 11.1.
B+ Tree.
Orthogonal Range Searching and Kd-Trees
Computational Geometry Capter:1-2.1
Multi-Way Search Trees
Bart M. P. Jansen June 3rd 2016, Algorithms for Optimization Problems
Dynamic Data Structures for Simplicial Thickness Queries
CMPS 3130/6130 Computational Geometry Spring 2017
General Trees A general tree T is a finite set of one or more nodes such that there is one designated node r, called the root of T, and the remaining nodes.
Presentation transcript:

Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN

Among the earliest proposed methods for dynamic hull maintenance in the plane. The worst-case update time is O(log 2 n) and all the usual query operations (see below) can be carried out in O(log n) time.

In this paper, we present the first general method to break the log 2 n barrier: an O(n)-space data structure that can be maintained in O(n log 1+  n) time over any n on-line updates.

Our data structure can handle the following types of query operations in O(log n) time: (i) decide whether a given line intersects the convex hull; (ii) decide whether a given point is inside the convex hull; (iii) find the hull vertex that is extreme in a given direction (iv) find the two vertices adjacent to a given hull vertex (gift- wrapping); and (v) find the two tangent hull vertices from a given exterior point.

We first restrict ourselves to the simplest kind of queries—finding the hull vertex extreme in a given direction—so as to illustrate the main ideas. This search problem is nice to work with because it is decomposable, that is, the answer to a query on input set P 1  P 2 can be inferred in constant time from the answer on P 1 and the answer on P 2.

We actually examine an equivalent problem in the dual setting transforming upper hulls of points into upper envelopes of lines in the plane. Let L be the current set of lines and ℰ (L) denote the upper envelope of L. The goal now is to design a data structure that allows insertions and deletions on L and supports vertical line queries (or vertical ray shooting): intersect ℰ (L) with a given vertical line q, that is, find the highest line of L at q.

Suppose that there is already a preliminary method for this problem with the following performance: total update time is O(mU 0 (n)), query time is O(log n), and space is O(n).

Our starting point is a restricted data structure that does not allow insertions. maintaining the upper envelope of n lines through n deletions optimally in O(n log n) time and O(n) space.

To incorporate insertions, we employ a general dynamization technique for decomposable search problems. This technique uses a simple binary-counting trick and usually slows down update time by a logarithmic factor. To lower the effect of the slow-down, we actually apply a b-ary variant of the counting trick for a suitably chosen parameter b.

We maintain a partition of L into a collection ℂ of subsets, where the only operations on a subset are creation and deletion. For each subset C  ℂ, we maintain the subenvelope ℂ (C) by the above deletion-only data structure. Each subset is assigned an integer depth value.

We will ensure the invariant that at most b-1 subsets reside at each depth. To insert an element, to L, we create a new singleton subset {ℓ} and put it in ℂ at depth 0. To ensure the invariant, we apply the following rule: whenever there are b subsets C 1,..., C b at a depth i, remove C 1,..., C b from ℂ, create a new subset C 1 ...  C b, and put it in  at depth i +1. To delete an element ℓ from L, we identify the subset C  ℂ containing, and delete ℓ from C.

By induction, there are at most m/b i depth- i subsets created over a lifetime of m updates on L. Hence, depth values range from 0 to log b m. So, the number of subsets at any given time is O(b log b m).

Over time, the depth value of the subset containing a fixed element can only increase. Thus, each element belongs to at most O(log b m) subsets over time, so the sum of the sizes of all subsets created is O(m log b m). It follows that the total cost of maintaining the deletion-only data structures over all subsets created is O(m log b m log m). Furthermore, the total amount of changes to all subenvelopes over time is O(m log b m).

We can then answer a vertical line query in O(b log b m logm) time, which unfortunately is suboptimal by a logarithmic factor or worse, regardless of the choice of b. To speed up the process, we need additional structures to search in all subenvelopes simultaneously.

Define a set of line segments S, consisting of the edges of all current subenvelopes { ℰ (C) | C  ℂ }. We know the following properties about this set S: (a) Over time, S undergoes M insertions and deletions of line segments, where M = O(m log b m). (b) Any vertical line crosses a maximum of B line segments of S, where B = O(b log b m). (c) The upper envelope of S coincides with ℰ (L). We have therefore reduced our problem to one of searching in the upper envelope of S.

To solve this new problem, we can use a traditional data structure on line the interval. We also need a B-ary version of the tree instead of the usual binary form.

Each node of our interval tree T represents a slab, that is, a region enclosed by two vertical lines (walls), where the leaf slabs are disjoint and cover the entire plane, and the slab at a node is the union of the slabs at its children. At each node, we can maintain the order of the children slabs by a “mini-tree” (an O(B)-sized standard balanced search tree). We store a segment s  S in the lowest node whose slab contains s. Let S v be the resulting canonical subset of all segments stored in node v. We maintain a base data structure for each S v.

We will ensure the following invariants for balance: To insert a new endpoint to the tree T, we find the leaf whose slab contains the endpoint, and split it into two new leaves; its parent now has one more child. To maintain the invariants, we apply the following rule: whenever a node v has 2B children w 1,..., w 2B (from left to right), we split v into two new nodes v 1 and v 2, where w 1,..., w B become the children of v 1 and w B+1,..., w 2B become the children of v 2 ; the parent u of v now has v 1 and v 2 as children. To readjust the canonical subsets, we examine all segments in S v, put those contained in the slab at v 1 into S v1, put those contained in the slab at v 2 into S v2, and insert the remaining ones into S u. When the root is split, we make a new root. To insert a segment s to S, we first insert its two endpoints to the tree as described above. Then we find the lowest node v whose slab contains s and insert s to S v.

To delete a segment s from S, we identify the node v that stores s and delete s from S v (retaining lazily the endpoints in the tree). To answer a vertical line query on L, we find the leaf v whose slab contains the given vertical line q. Say v 1,..., v H are the ancestors of v. Since each segment of S intersecting q belongs to one of the canonical subsets S v1,..., S vH, the line that defines the answer belongs to one of S v1,..., S vH. Querying the base data structure for each S vi yields the answer.

Note that the maximum size of each canonical subset S v is O(B 2 ) by property (b), because each segment in S v must cross one of the O(B) walls at the children of v.

The total amount of changes caused by endpoint insertions is O((M/B) B +(M/B 2 ) B 2 + (M/B 3 ) B ) = O(M). In addition, we have M changes caused by insertions and deletions of segments. Thus, the total cost of maintaining all the base data structures is O(MU 0 (B 2 )).

In a top-down fashion, we can find a leaf slab containing a given point by H mini- tree searches in O(H log B) = O(log M) time. For an insertion, we need to find the lowest slab containing a segment, which can similarly be done in O(log M) time. We conclude that the total cost of updates over time is O(M(log M + U 0 (B 2 ))).

A query on L requires queries on H canonical subsets. With the base data structures available, the query time is O(H log(B 2 )) = O(log M).

Since we know S has maximum size n, by a standard trick of rebuilding the tree T after every n updates on S, we can reduce the total update time to O((M/n)  n(log M + U 0 (B 2 ))) = O(m log b m  n(log n + U 0 ((blog b m) 2 ))). query time to O(log n) and space to O(n).

Furthermore, since we know L has maximum size n, by rebuilding the entire data structure after every n updates on L, the total update time becomes O((m/n)  n  log b n (log n + U 0 ((blog b n) 2 ))). Choosing b so that log b  log 1/  n yields a total update time of O(m log 2-1/  n).

THEOREM 2.1. For any fixed  > 0, we can maintain an O(n)-space data structure that allows insertions and deletions of lines in the plane in O(log 1+  n) amortized update time and answers a vertical line query in O(log n) time, where n is an upper bound on the number of lines.

Note. Although we have assumed that the value of n is known, we can remove this assumption by a standard “guessing” trick: whenever L is full, double the value of n and rebuild the data structure. It is easy to see that the amortized update time is unchanged.