June 12, 2003 (joint work with Umut Acar, and Guy Blelloch)

Slides:



Advertisements
Similar presentations
Garfield AP Computer Science
Advertisements

Dynamic Graph Algorithms - I
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.
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
Minimum Spanning Trees Definition Two properties of MST’s Prim and Kruskal’s Algorithm –Proofs of correctness Boruvka’s algorithm Verifying an MST Randomized.
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
CS4413 Divide-and-Conquer
Theory of Algorithms: Divide and Conquer
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Kinetic Algorithms Data Structure for Mobile Data.
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
Self-Adjusting Computation Umut Acar Carnegie Mellon University Joint work with Guy Blelloch, Robert Harper, Srinath Sridhar, Jorge Vittes, Maverick Woo.
Karger’s Min-Cut Algorithm Amihood Amir Bar-Ilan University, 2009.
Randomized Algorithms and Randomized Rounding Lecture 21: April 13 G n 2 leaves
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
Convex Hull Algorithms for Dynamic Data Kanat Tangwongsan Joint work with Guy Blelloch and Umut Acar (TTI-C)
Teaching Geometric Algorithms to Gracefully “Walk” and “Jump” Kanat Tangwongsan ALADDIN 2005 Joint work with Umut Acar, Guy Blelloch, and Jorge Vittes.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (3) Recurrence Relation 11/11 ~ 11/14/2008 Yang Song.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
TCOM 540/11 TCOM 540 Session 6. TCOM 540/12 Agenda Review Session 4 and 5 assignments Multicenter local access design.
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Self-Adjusting Computation Robert Harper Carnegie Mellon University (With Umut Acar and Guy Blelloch)
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
1 Binomial heaps, Fibonacci heaps, and applications.
1 Minimum Spanning Tree in expected linear time. Epilogue: Top-in card shuffling.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Merge Sort. What Is Sorting? To arrange a collection of items in some specified order. Numerical order Lexicographical order Input: sequence of numbers.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
CS 361 – Chapters 8-9 Sorting algorithms –Selection, insertion, bubble, “swap” –Merge, quick, stooge –Counting, bucket, radix How to select the n-th largest/smallest.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
Kinetic data structures. Goal Maintain a configuration of moving objects Each object has a posted flight plan (this is essentially a well behaved function.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
Review 1 Selection Sort Selection Sort Algorithm Time Complexity Best case Average case Worst case Examples.
MotivationKinetic Data StructuresExampleKDS Properties Networks play a central role in numerous applications, and the design of good networks is therefore.
1 Ch.19 Divide and Conquer. 2 BIRD’S-EYE VIEW Divide and conquer algorithms Decompose a problem instance into several smaller independent instances May.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
Convex hulls in 3D Maciej Kot. Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.
Advanced Sorting 7 2  9 4   2   4   7
Randomized Min-Cut Algorithm
Multiway Search Trees Data may not fit into main memory
RE-Tree: An Efficient Index Structure for Regular Expressions
Minimum Spanning Tree 8/7/2018 4:26 AM
Quick-Sort 9/12/2018 3:26 PM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Course Description Algorithms are: Recipes for solving problems.
Heaps © 2010 Goodrich, Tamassia Heaps Heaps
MST in Log-Star Rounds of Congested Clique
August 20, 2002 (joint work with Umut Acar, and Guy Blelloch)
Enumerating Distances Using Spanners of Bounded Degree
Instructor: Shengyu Zhang
Searching CLRS, Sections 9.1 – 9.3.
Quick-Sort 2/25/2019 2:22 AM Quick-Sort     2
Kinetic Collision Detection for Convex Fat Objects
Quick-Sort 4/8/ :20 AM Quick-Sort     2 9  9
Algorithms (2IL15) – Lecture 7
CSE 373 Data Structures and Algorithms
Binary Search Trees < > = Binary Search Trees
Dynamic Graph Algorithms
Quick-Sort 4/25/2019 8:10 AM Quick-Sort     2
Course Description Algorithms are: Recipes for solving problems.
Algorithm Course Algorithms Lecture 3 Sorting Algorithm-1
Efficient Aggregation over Objects with Extent
Divide-and-Conquer 7 2  9 4   2   4   7
CMPT 225 Lecture 10 – Merge Sort.
Presentation transcript:

June 12, 2003 (joint work with Umut Acar, and Guy Blelloch) Convex Hull for Dynamic Data Convex Hull and Parallel Tree Contraction Jorge L. Vittes June 12, 2003 (joint work with Umut Acar, and Guy Blelloch)

Convex Hull for Dynamic Data Motivation Application data is dynamic word processors: slowly changing text graphics: render similar images mobile phone networks: continuously moving hosts Important to handle dynamic data efficiently 4/4/2019 Convex Hull for Dynamic Data

Dynamic Algorithms: Changing Data b b c c e d d a b c e d 4/4/2019 Convex Hull for Dynamic Data

Kinetic Algorithms: Moving Data b b c c d Time = 1 d Time = 0 b a c Time = 1+e ... 1 4/4/2019 d Convex Hull for Dynamic Data

How to invent Dynamic/Kinetic Algorithms Just like any other algorithm. Think, ponder, divide, conquer... Or, use adaptivity... 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Adaptivity Makes a standard algorithm dynamic or kinetic Requires little change to the standard algorithm Can be done semi-automatically Not all algorithms yield efficient adaptive algorithms Will talk about this more 4/4/2019 Convex Hull for Dynamic Data

How does Adaptivity Work? Represent a computation with a dynamic dependency graph nodes = data, edges = dependencies Sources = input, sinks = output, The user can change the input, update the output Update: Take a changed node, Update all its children (the children are now changed) Repeat until no more changed nodes 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Adaptivity Example 1 2 3 fun f (a,b,c) = let u = a+b in if (u > 0) then g(u) else g(b+c) end a b c a+b 1+b u 3 if u>0 then g(u) else g(b+c) g(u) r 0.33 4/4/2019 Convex Hull for Dynamic Data

Adaptivity Example: Change -2 2 3 fun f (a,b,c) = let u = a+b in if (u > 0) then g(u) else g(b+c) end a b c a+b 1+b u 3 if u>0 then g(u) else g(b+c) g(u) r 0.33 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Update -2 2 3 fun f (a,b,c) = let u = a+b in if (u > 0) then g(u) else g(b+c) end a b c a+b -2+b u v 5 if u>0 then g(u) else g(b+c) g(u) g(v) r 0.5 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Update -2 2 3 fun f (a,b,c) = let u = a+b in if (u > 0) then g(u) else g(b+c) end a b c a+b -2+b b+c 2+c u v 5 g'(v) if u>0 then g(u) else g(b+c) g(v) r 0.5 4/4/2019 Convex Hull for Dynamic Data

Adaptivity and Stability Adaptivity updates the result by rerunning the parts of the computation affected by the input change It is efficient when the computation is “stable”,I.e., computations on “similar” inputs are “similar” We apply the adaptivity technique to convex hulls Result: Efficient Dynamic and Kinetic convex hulls 4/4/2019 Convex Hull for Dynamic Data

1-D Convex Hull: Max and Min Just consider upper hull: Finding the maximum Consider two algorithms: The March: March through the list The Tournament: pair up the elements and take the max of each pair 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Kinetic Maximum Numbers increase/decrease continuously in time ni(t) = ni + ci t ni n1(t) = 2+t n2(t) = 5 n3(t) = 6-t time tred = 0 tgreen = 1 tblue = 3 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Sampling n1(t) = 2+t ni n2(t) = 5 n3(t) = 6-t time tred = 0 tgreen = 1 tblue = 3 4/4/2019 Convex Hull for Dynamic Data

Internal and External Events External event: Final result changes Internal event: Final result does not change but a test fails 4/4/2019 Convex Hull for Dynamic Data

Proof Simulation via Certificates A set of comparisons that prove the current maximum Associate a certificate with each comparison certificate = comparison result + failure time Consider the times that a certificate fails We need an algorithm that updates the result as well as the certificates Use adaptivity to obtain to do the update efficiently 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Kinetic March 0.66 0.5 4 Time=0 4+t 5-t 1 7+1.5t 6 3 8 4 0.66 Time=0.5+e 4+t 5-t 1 7+1.5t 6 3 8 4 Time=0.66+e 4+t 5-t 1 7+1.5t 6 3 8 4 4/4/2019 Convex Hull for Dynamic Data

Kinetic March Performance O(n): Because an item in the beginning of the list could become the maximum and it will be compared to the rest of the list Not acceptable because computing from scratch takes O(n) 4/4/2019 Convex Hull for Dynamic Data

The Kinetic Tournament Time = 0 8 7 8 7 5-t f = 2 6 8 7 4 1+t 5-t 6 3 8 4 4/4/2019 Convex Hull for Dynamic Data

The Kinetic Tournament 8 Time=2+e 7 f=6 8 7 1+t 6 8 7 4 1+t 5-t 6 3 8 4 4/4/2019 Convex Hull for Dynamic Data

The Kinetic Tournament Time=6+e 8 f=7 1+t 8 7 1+t 6 8 7 4 1+t 5-t 6 3 8 4 4/4/2019 Convex Hull for Dynamic Data

The Kinetic Tournament Time=7+e 1+t f=7 1+t 8 7 1+t 6 8 7 4 1+t 5-t 6 3 8 4 4/4/2019 Convex Hull for Dynamic Data

Performance of Kinetic Tournament Worst case log n time per event This kinetic algorithm is an adaptive version of the standard tournament algorithm for finding maximum 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data 2-D Convex Hull Many algorithms: Quick Hull, Graham Scan, Incremental, Merge Hull, Ultimate, Improved Ultimate... We will focus on the Quick Hull algorithm Input: A list of points P Output: The boundary points on the hull of P Example: Input = [a,b,c,d] Output = [a,b,d] a b c d 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Quick Hull Example J O B F M H K P D G A L I E C N [A B C D E F G H I J K L M N O P] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Filter J O B F M H K P D G A L I E C N [ A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Maximum J O B F M H K P D G A L I E C N [A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Filter J O B F M H K P D G A L I E C N [ [A B F J ] [J O P] ] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Maximum J O B F M H K P D G A L I E C N [[A B F J] [J O P] ] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Base Case J O B F M H K P D G A L I E C N [ [A B] [B J] [J O P] ] 4/4/2019 Convex Hull for Dynamic Data

Quick Hull Example - Done J O B F M H K P D G A L I E C N [ [A B] [B J] [J O] [O P] ] 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Kinetic Quick Hull Two kinds of tests: Line-side and distance comparisons Filtering => Line Side Finding the furthest point => Distance comparisons Have certificates for these two events that is all 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Line Side Test Fails J O B F M H K P D G A L E I C N [ A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

“I” is inserted in the middle of the list J O B F M H K P D G I A L E C N [A B D F G I H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Recompute Maximum J O B F M H K P D G I A L E C N [A B D F G I H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Dynamic Tournament - Random Trees 8 7 8 7 5 6 8 7 1 6 3 8 4 7 4 4/4/2019 Convex Hull for Dynamic Data

Dynamic Tournament - Random Trees 8 7 8 7 5 6 8 7 1 6 3 8 4 7 4 6 9 4/4/2019 Convex Hull for Dynamic Data

Dynamic Tournament - Random Trees 9 7 9 7 5 9 8 7 1 3 8 4 9 7 4 6 9 4/4/2019 Convex Hull for Dynamic Data

Distance Comparison Fails - Case 1 J O B F M H K P D G A L I E C N [A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Distance Comparison Fails - Case 2 J O B F M H K P D G A L I E C N [A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data “B” is the new maximum B J O F M H K P D G A L I E C N [A B D F G H J K M O P] 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data New recursive calls B J O F M H K P D G A L I E C N [[A B] [J M O]] 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Experiments 4/4/2019 Convex Hull for Dynamic Data

Summary of ConvexHull Work Kinetic Algorithms for convex hulls using adaptivity Timothy Chan’s O(h log n) algorithm: Improved “Ultimate Convex Hull”: Have a working version QuickHull Bounce events: Can maintain convex hull of points in a box - the points bounce off of the walls of the box Streamlined library for kinetic convex hulls in the SML language A standard algorithm can be made kinetic in a few hours of work 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Parallel Tree Contraction Fundamental technique [Miller & Reif ‘85] Contraction proceeeds in rounds Each round shrinks the tree by a constant factor Expected O(logn) rounds Innovative Idea: Shrink the tree by local operations 4/4/2019 Convex Hull for Dynamic Data

Parallel Tree Contraction Start with a tree In each round: Each node flips a coin If leaf node then rake If degree=2 and flip = H, and neighbors = T then contract Expected O(logn) rounds. 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Example H H H T T H T H T 4/4/2019 Convex Hull for Dynamic Data

Contracting and Raking H H H T T H T H T 4/4/2019 Convex Hull for Dynamic Data

Contracting and Raking H T T 4/4/2019 Convex Hull for Dynamic Data

Contracting and Raking (cont.) H T T 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Done H 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Dynamic Trees Problem Given a forest of weighted trees Operations Link: edge insertion cut: edge deletion Queries Heaviest edge in a subtree? Heaviest edge on a path? 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Data Structures for Dynamic Trees Sleator Tarjan ‘85 Amortized O(logn) and worst-case O(logn) Topology Trees [Frederickson ‘93] Ternary (degree-tree) trees Worst case O(logn) Top Trees [AlstrupHoLiTh ‘97] Generalize Topology Trees for arbitrary degree Idea: Trees as paths 4/4/2019 Convex Hull for Dynamic Data

Dynamic Parallel Tree Contraction Keep a copy of each round of the initial run. Each round affects next round. The nodes that “live” to the next round copy their neighbors scars, and pointers to them. Dependencies are based on what the node reads to do its work. 4/4/2019 Convex Hull for Dynamic Data

Dynamic Parallel Tree Contraction H H T T H H H H T T T T H H T T H H T T x x T H T H T T x x x H T T x x 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Propagation If any data changes nodes whose action depend on that data are woken up. Wake-up only those nodes that get affected by a change. Run same code as in original run. Expected constant amount of nodes woken up per round. 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Change an edge H H T T H H H H T T T T H H T T H H T T x x T H T H T T x x x H T T x x 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Three nodes woken up H H T T H H H H T T T T H H T T H H T T x x T H T H T T x x x H T T x x 4/4/2019 Convex Hull for Dynamic Data

Nodes rerun code, more nodes woken up H H T T H H H H T T T T H H T T H H T T x x T H T H T T x x x H T T x x 4/4/2019 Convex Hull for Dynamic Data

Propagation continued H H T T H H H H T T T T H H T T H H T T x x T H T H T T x x x H T T x x 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Experimental Results 4/4/2019 Convex Hull for Dynamic Data

Convex Hull for Dynamic Data Work In Progress Analyzing Power of the data structure (what it can and cannot do) Different Applications Analyzing Running times for: Different changes. Unbalanced Trees. 4/4/2019 Convex Hull for Dynamic Data

Conclusion and Future Work ConvexHull Used adaptivity to solve the kinetic convex hull problem. Encouraging results. Adaptivity makes writing dynamic/kinetic algorithms a simple edition on the standard algorithm The quickhull algorithm updates based on events efficiently in the expected case. Parrallel Tree Contraction Efficient times O(log(n)) expected time for an update. Future Work: More Applications 4/4/2019 Convex Hull for Dynamic Data