Teaching Geometric Algorithms to Gracefully “Walk” and “Jump” Kanat Tangwongsan ALADDIN 2005 Joint work with Umut Acar, Guy Blelloch, and Jorge Vittes.

Slides:



Advertisements
Similar presentations
The Future (and Past) of Quantum Lower Bounds by Polynomials Scott Aaronson UC Berkeley.
Advertisements

Two Segments Intersect?
The Volcano/Cascades Query Optimization Framework
Theory of Computing Lecture 3 MAS 714 Hartmut Klauck.
Certification of Computational Results Greg Bronevetsky.
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
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Theoretical Program Checking Greg Bronevetsky. Background The field of Program Checking is about 13 years old. Pioneered by Manuel Blum, Hal Wasserman,
Kinetic Algorithms Data Structure for Mobile Data.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Dynamic Algorithms for Planar Point Location Kanat Tangwongsan in collaboration with Guy Blelloch, Umut Acar, Srinath Sridhar. Aladdin Center - Summer.
Updated QuickSort Problem From a given set of n integers, find the missing integer from 0 to n using O(n) queries of type: “what is bit[j]
© 2004 Goodrich, Tamassia Skip Lists1  S0S0 S1S1 S2S2 S3S3    2315.
Hash Tables How well do hash tables support dynamic set operations? Implementations –Direct address –Hash functions Collision resolution methods –Universal.
Self-Adjusting Computation Umut Acar Carnegie Mellon University Joint work with Guy Blelloch, Robert Harper, Srinath Sridhar, Jorge Vittes, Maverick Woo.
11.Hash Tables Hsu, Lih-Hsing. Computer Theory Lab. Chapter 11P Directed-address tables Direct addressing is a simple technique that works well.
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.
Lower and Upper Bounds on Obtaining History Independence Niv Buchbinder and Erez Petrank Technion, Israel.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Tirgul 8 Universal Hashing Remarks on Programming Exercise 1 Solution to question 2 in theoretical homework 2.
FALL 2004CENG 3511 Hashing Reference: Chapters: 11,12.
Convex Hull Algorithms for Dynamic Data Kanat Tangwongsan Joint work with Guy Blelloch and Umut Acar (TTI-C)
An Introduction to Black-Box Complexity
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
Chapter 10 Search Structures Instructors: C. Y. Tang and J. S. Roger Jang All the material are integrated from the textbook "Fundamentals of Data Structures.
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Self-Adjusting Computation Robert Harper Carnegie Mellon University (With Umut Acar and Guy Blelloch)
1 The Greedy Method CSC401 – Analysis of Algorithms Lecture Notes 10 The Greedy Method Objectives Introduce the Greedy Method Use the greedy method to.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Randomized Algorithms - Treaps
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
Automatic Generation of Staged Geometric Predicates Aleksandar Nanevski, Guy Blelloch and Robert Harper PSCICO project
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
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.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 8 Instructor: Haifeng YU.
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs By Koen Claessen, Juhn Hughes ME: Mike Izbicki.
Kinetic data structures. Goal Maintain a configuration of moving objects Each object has a posted flight plan (this is essentially a well behaved function.
Lectures on Greedy Algorithms and Dynamic Programming
The Greedy Method. The Greedy Method Technique The greedy method is a general algorithm design paradigm, built on the following elements: configurations:
Skip Lists 二○一七年四月二十五日
CS 2133: Data Structures Quicksort. Review: Heaps l A heap is a “complete” binary tree, usually represented as an array:
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Random Interpretation Sumit Gulwani UC-Berkeley. 1 Program Analysis Applications in all aspects of software development, e.g. Program correctness Compiler.
Computational Geometry 2D Convex Hulls
2/19/2016 3:18 PMSkip Lists1  S0S0 S1S1 S2S2 S3S3    2315.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
CS6045: Advanced Algorithms Sorting Algorithms. Sorting So Far Insertion sort: –Easy to code –Fast on small inputs (less than ~50 elements) –Fast on nearly-sorted.
B+-Tree Deletion Underflow conditions B+ tree Deletion Algorithm
Certifying and Synthesizing Membership Equational Proofs Patrick Lincoln (SRI) joint work with Steven Eker (SRI), Jose Meseguer (Urbana) and Grigore Rosu.
15-121: Introduction to Data Structures
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
August 20, 2002 (joint work with Umut Acar, and Guy Blelloch)
Enumerating Distances Using Spanners of Bounded Degree
Convex Sets & Concave Sets
Kinetic Collision Detection for Convex Fat Objects
June 12, 2003 (joint work with Umut Acar, and Guy Blelloch)
Dynamic Graph Algorithms
Approximation and Load Shedding Sampling Methods
Divide and Conquer Merge sort and quick sort Binary search
Presentation transcript:

Teaching Geometric Algorithms to Gracefully “Walk” and “Jump” Kanat Tangwongsan ALADDIN 2005 Joint work with Umut Acar, Guy Blelloch, and Jorge Vittes.

A “Simple” Problem The Convex Hull Problem –Given: a set S µ R 3 –Maintain: smallest convex set containing S Input: S Output: CH(S)

A “Simple” Problem (cont.) The Kinetic Convex Hull Problem –points continuously moving Imagine making a movie!

Facts… Trivial solution: calculate the CH for every frame. Better solution? Unfortunately, no known efficient solution. To support only insertion/deletion is super complicated already. Implication: Kinetic algorithm for CH in 3D is rather HOPELESS!

...To Conserve Our Brain Cells, we chose a different approach…

In this Talk… Recap of the self-adjusting framework. Our design/implementation of a kinetic framework. –Generated the movie we see previously. Discuss a few applications of the framework. –Jumping ahead in time and its beneficial consequences. –Analysis of two algorithms. New problems for future work.

Self-Adjusting Computation main f g h km f g h km Memory Some parts of the input change Idea: Record who reads what and when Note: Some part of the computation can be re-used by applying the memoization technique.

The Kinetic Framework Static Geometric Algorithm: –Input: a set S µ R d Output: A(S) Goal: enable straight-forward methodical transformation of a static geometric algorithm: continuous motion –to handle continuous motion. insertion/deletion of points –to allow insertion/deletion of points. motion parameters update –to allow motion parameters update at any time. composition –to support composition of algorithms.

The Kinetic Framework (cont.) Idea: insert a tracking code into an existing code. Builds on the self-adjusting computation framework. –immediate dynamization Introduce certificate –test/comparison –expires when the current value is invalid. –Illustration (next slide). Self-Adjusting Computation Our Kinetic Library

The Kinetic Framework (cont.) [An Example] Given: a list of moving points in R 2. Calculate: the right-most point (assuming no tie at all time) Trivial algorithm: maintain the max so far and scan the list p 0 < L p 1 p 1 < L p 2 Y p 0 < L p 2 N p2p2 p1p1 p2p2 p0p0 Y Y N N

The Kinetic Framework (cont.) In theory: –able to kinetize every algorithm whose certificate’s expiration time can be computed. Efficiency? not always! p 0 < L p 1 p 1 < L p 2 Y p 0 < L p 2 N p2p2 p1p1 p2p2 Y Y N N p0p0 certificate = comparsion result + expiration time

Our Kinetic Library SML library (compatible with SML/NJ and MLton) ~ 700 lines of SML code Builds atop the self-adjusting library –A Library for Self-Adjusting Computation (to appear in ML 2005) Priority queue of certificate failure times. Self- adjusting computation to reflect the changes. We were able to kinetize –2d: Graham-scan, Merge Hull, QuickHull, Randomized QuickHull –3d: Incremental Hull Benchmark: Pending

Training QuickHull to “Walk” fun split (p1,p2, pts, hull) = let val l = List.filter (fn p => lineSideTest((p1,p2),p)) pts in case l of nil => bp1::hull | h::t => let fun selectMin (a,b) = if (distCmp(a, b, (p1,p2)) then a else b val max = List.foldr selectMin h t val rest = split (max,bp2,l,hull) in split (bp1,max,l,rest) end fun splitM (p1, p2, pts, hull) = letval l = filter (fn p => K.mkCert(lineSideTest((p1,p2),p)) pts in l ==> (fn cl => case cl of ML.NIL => ML.write (ML.CONS(p1,hull)) | ML.CONS(h,t) => hull ==> (fn chull => let fun select (a,b) = K.mkCert(distCmp(a,b,(vp1,vp2))) val rmax = minimum select l val rest = C.modref (rmax ==> (fn max => splitM (max,p2,l,hull))) in rmax ==> (fn max => splitM (p1,max,l,rest)) end)) end Static Kinetic

Jumping Time An Open Problem [Guibas’98]: How can one skip ahead in time? Fact: The set of “certificates” is a correctness proof wrt. running it from scratch. Theorem: By advancing the time to t +  and updating the certificates corresponding to events in the queue up to the time t + , the resulting set of certificates after propagation agrees with running it from scratch. Efficiency: no worse than processing each event one by one. Time t t + 

Jumping Time (cont.) Benefits –Interested in events up to  precision? (  can be chosen to suit one’s need/machine) –Make video more efficiently –Dealing with less floating-point round-off error New Problems –Suppose float precision up to , what should  be to avoid round-off error? –Jumping so far ahead in time? When is it faster to simply re-run it form scratch?

Introducing the Communist Model Coined by Mulmuley’91 Dynamic setting –Operations: insert/delete –Finite set U, and active set S. –Each element has an equal probability of being inserted or deleted from the active set. insert delete

Stable Randomized QuickHull QuickHull (for computing 2d convex hull) –Very Fast in practice –Worst-case: O(n 2 ) –Unstable (in self-adjusting framework) Randomize it to stabilize.

Stable Randomized QuickHull (cont.) Std-Qhull(p1,p2, s) –Eliminate points under p1p2 to get s’ –Pick max from p1p2 –Qhull (p1, max, s’) –Qhull (max, p2, s’) Idea: Randomly pair up points, and ensure that at least a fraction of points are eliminated with certain probability. Build on idea in Wenger’97 and B. Bhattacharya et al ’97, and T. Chan ’95.

Stable Randomized QuickHull (cont.) Replace the step marked in red by –Pair up points above the line p1p2 –Pick a random pair, define a line and find the maximizer above that line. –Apply elimination (as extending from Chan’s) There are n/4 pairs on expectation, and max {subproblem L, subproblem R} · 13/16 with probability ¸ 1/

Stable Randomized QuickHull (cont.) Extended Chan’s Elimination Initial Runtime: O(nlog n) is obvious. Theorem: Randomized QuickHull supports insertion/deletion in O(log 2 n) Also perform well practically in kinetic setting, but QuickHull still outperforms it. max

Convex Hull in 3D Incremental Hull –Simple and efficient –Generalizeable to arbitrary dimension Idea: insert points one by one. remove visible faces, and tent new faces.

Incremental Hull in 3D Key Requirements –Given a point p, find a face f that p sees. –Given a face f, find adjacent faces. Solutions –For each face, keep a list of points that “belongs to” it. –Keep a mapping from points to faces. –Purely functional dictionary: treap

Incremental Hull in 3D (cont.) Dynamized Treap Incremental Convex Hull in 3D Kinetic Convex Hull in 3D

Incremental Hull in 3D (cont.) Fact: In a dynamized treap with uniform distribution of keys, an insertion/deletion takes O(log n) Theorem: –O(nlog 2 n) for initial run –O(log 2 n) for each insert/delete (assuming the communist model). Also experimentally verified. Time

Experimental Evaluation

Summary Implemented a kinetic framework –Generated the movie we see previously. –Capable of skipping ahead in time. Analyzed a few Kinetized/Dynamized examples –Graham-scan, Merge Hull, QuickHull, Randomized QuickHull, IHull3D In progress –Trying to formalize the notion of “when an algorithm performs efficiently in this framework” a.k.a kinetic stability –Per event?

Questions ?

Thank You