Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007.

Slides:



Advertisements
Similar presentations
COL 106 Shweta Agrawal and Amit Kumar
Advertisements

CMSC 341 Binary Heaps Priority Queues. 8/3/2007 UMBC CSMC 341 PQueue 2 Priority Queues Priority: some property of an object that allows it to be prioritized.
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Advanced Data Structures
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
Kinetic Algorithms Data Structure for Mobile Data.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Algorithmic Robotics and Motion Planning Dan Halperin Tel Aviv University Fall 2006/7 Dynamic Maintenance and Self-Collision Testing for Large Kinematic.
CMPT 225 Priority Queues and Heaps. Priority Queues Items in a priority queue have a priority The priority is usually numerical value Could be lowest.
Binary Heaps CSE 373 Data Structures Lecture 11. 2/5/03Binary Heaps - Lecture 112 Readings Reading ›Sections
Bounding Volume Hierarchy “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presented by Mathieu Brédif.
Scenegraph. Scenegraph Nodes - all implement a run function Leaf/Geo Nodes - typedefs of sgNode superclass –Poly Mesh A geo node that stores a list of.
Version TCSS 342, Winter 2006 Lecture Notes Priority Queues Heaps.
Dynamic Maintenance and Self Collision Testing for Large Kinematic Chains Lotan, Schwarzer, Halperin, Latombe.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
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.
PQ, binary heaps G.Kamberova, Algorithms Priority Queue ADT Binary Heaps Gerda Kamberova Department of Computer Science Hofstra University.
Heapsort CIS 606 Spring Overview Heapsort – O(n lg n) worst case—like merge sort. – Sorts in place—like insertion sort. – Combines the best of both.
CS 326A: Motion Planning ai.stanford.edu/~latombe/cs326/2007/index.htm Collision Detection and Distance Computation.
1 CSC 427: Data Structures and Algorithm Analysis Fall 2010 transform & conquer  transform-and-conquer approach  balanced search trees o AVL, 2-3 trees,
1 Priority Queues (Heaps)  Sections 6.1 to The Priority Queue ADT  DeleteMin –log N time  Insert –log N time  Other operations –FindMin  Constant.
CPSC 335 BTrees Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Heapsort Based off slides by: David Matuszek
Compiled by: Dr. Mohammad Alhawarat BST, Priority Queue, Heaps - Heapsort CHAPTER 07.
PRIORITY QUEUES (HEAPS). Queues are a standard mechanism for ordering tasks on a first-come, first-served basis However, some tasks may be more important.
Heaps, Heapsort, Priority Queues. Sorting So Far Heap: Data structure and associated algorithms, Not garbage collection context.
AVL Trees Amanuel Lemma CS252 Algoithms Dec. 14, 2000.
The Binary Heap. Binary Heap Looks similar to a binary search tree BUT all the values stored in the subtree rooted at a node are greater than or equal.
Chapter 21 Binary Heap.
Priority Queue. Priority Queues Queue (FIFO). Priority queue. Deletion from a priority queue is determined by the element priority. Two kinds of priority.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 9.
Kinetic data structures. Goal Maintain a configuration of moving objects Each object has a posted flight plan (this is essentially a well behaved function.
CSE373: Data Structures & Algorithms Lecture 6: Priority Queues Dan Grossman Fall 2013.
CSE 250 September 29 – October 3, A NNOUNCEMENTS Homework 4 due 10/5 Project 1 posted for 10/6 Exam 2 10/8 No classes meet 10/9 Project 1 due 10/26.
Priority Queues and Heaps. October 2004John Edgar2  A queue should implement at least the first two of these operations:  insert – insert item at the.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Heapsort. What is a “heap”? Definitions of heap: 1.A large area of memory from which the programmer can allocate blocks as needed, and deallocate them.
Advanced Data Structure By Kayman 21 Jan Outline Review of some data structures Array Linked List Sorted Array New stuff 3 of the most important.
AVL Trees and Heaps. AVL Trees So far balancing the tree was done globally Basically every node was involved in the balance operation Tree balancing can.
CompSci 100e 8.1 Scoreboard l What else might we want to do with a data structure? AlgorithmInsertionDeletionSearch Unsorted Vector/array Sorted vector/array.
MotivationKinetic Data StructuresExampleKDS Properties Networks play a central role in numerous applications, and the design of good networks is therefore.
1 Chapter 6 Heapsort. 2 About this lecture Introduce Heap – Shape Property and Heap Property – Heap Operations Heapsort: Use Heap to Sort Fixing heap.
1 CSC 421: Algorithm Design Analysis Spring 2013 Transform & conquer  transform-and-conquer approach  presorting  balanced search trees, heaps  Horner's.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
Minkowski Sums and Distance Computation Eric Larsen COMP
Heaps, Heap Sort, and Priority Queues. Background: Binary Trees * Has a root at the topmost level * Each node has zero, one or two children * A node that.
Priority Queues and Heaps. John Edgar  Define the ADT priority queue  Define the partially ordered property  Define a heap  Implement a heap using.
Data Structures – LECTURE Balanced trees
Distance Computation “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presentation by Julie Letchner.
Heaps © 2010 Goodrich, Tamassia Heaps Heaps
Algorithm design techniques Dr. M. Gavrilova
Red-Black Trees Motivations
August 20, 2002 (joint work with Umut Acar, and Guy Blelloch)
Part-D1 Priority Queues
CS200: Algorithm Analysis
Ch 6: Heapsort Ming-Te Chi
Multi-Way Search Trees
Heaps © 2014 Goodrich, Tamassia, Goldwasser Heaps Heaps
Kinetic Collision Detection for Convex Fat Objects
June 12, 2003 (joint work with Umut Acar, and Guy Blelloch)
HEAPS.
Heapsort Sorting in place
CSC 380: Design and Analysis of Algorithms
Richard Anderson Spring 2016
Priority Queues & Heaps
Priority Queues (Heaps)
Presentation transcript:

Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007

Kinetic Data Structures -- COMP 7682 Motivation Convex hull –Points move with time –Recalculate hull at each point –O(n lg n) work at each time step –Instead, define convex hull based on the points used –Only update hull when necessary Kinetic Data Structures

Kinetic Data Structures -- COMP 7683 Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP 7684 Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP 7685 Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP 7686 Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP 7687 Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP 7688 Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP 7689 Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures What happens to the CH when they start moving?

Kinetic Data Structures -- COMP Motivation Simple solution –Take small time steps and recalculate the CH for each configuration of points. Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Simple solution –Take small time steps and recalculate the CH for each configuration of points. –Takes O(n log n) work at each time step. An alternative – observe the nodes that form the CH. Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Kinetic Data Structures

Kinetic Data Structures -- COMP Motivation Create a data structure that associated the convex hull directly with the vertices that form it. Use the trajectories of the nodes to determine when they enter or leave the CH list. This is a Kinetic Data Structure. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Moving objects –Continuous motion. –Could maintain some property about the set by sampling over time and modifying the data structure supporting the property. –Danger of over- or under-sampling. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Configuration Function –A collection of continuous or discrete attributes for “mobile” data. –Ex. 1 For a convex hull, it is the ordered list of points on the hull. –Ex. 2 For the closest pair, it is,simply, the pair of nodes. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Kinetization –The process of transforming an algorithm on static data into a data structure appropriate for continuously changing data. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Flight plan –Information about a moving objects current motion. –The information need not be complete – no complete a priori knowledge necessary. –Flight plans can update based on interactions within the environment or with a user. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Global Event Queue –Means through which the object’s motion is connected to the data structure. –Narrow interface. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Certificates –A set of conditions which prove the configuration function. –The configuration function can only be invalidated when certificates change. –The change of the state of certificates are the events in the queue – certificate failure. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Quality –Ultimately, a KDS is “good” if the cost of processing a certificate failure is low. –How do we quantify this? Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Responsive –A low worst-case cost for processing a certificate failure. –This could include updating the proof, the configuration function, de-scheduling events and scheduling new events. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Efficient –The ratio between total events to external events is “small”. –“External” events affect the configuration function. –“Internal” events are events required to fix KDS internal structures. –External events represent a lower-bound on the amount of work. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Compact –The maximum number of events in the queue at any one time is roughly linear in the number of moving objects. Kinetic Data Structures

Kinetic Data Structures -- COMP Concepts Localized –The maximum number of events in the queue dependent on a single object is “small”. –Being “local” implies being “compact”. Kinetic Data Structures

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line What is the right-most point? x

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line What is the right-most point? x

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line What is the right-most point? time position

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line What is the right-most point? time position Proposed KDS - Maintain sorted list. - Every time two points cross we have an event. - Swap two elements in sorted order.

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line What is the right-most point? time position Proposed KDS - Responsive! - Efficient! - Not compact! - Not localized!

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line Worst case – Not compact and not local time position

Kinetic Data Structures -- COMP Kinetic Data Structures Simple Example Points on a line Better solution would be to maintain a max-heap. An object would only create an event with its parent (when it passes its parent.) Events would cause children to swap with their parent in the binary-tree heap structure.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Apply the principles of KDS to a bounding volume hierarchy. We use this to make the cost of updating a BVH cheaper.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea (x min, y min ) (x max, y max )

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy x min y max x max y min The idea

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea x min y max x max y min

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea x min y max x max y min

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Kinetization of BVH –Configuration function – a valid BVH for a set of moving polygons. –Data structure – hierarchy of BVs where the extents of each BV by pointers to the extreme vertices.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Tree-event – Occurs when the extent of an internal node goes from being defined by a vertex of one child to a vertex of the other child.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Tree-event – Occurs when the extent of an internal node goes from being defined by a vertex of one child to a vertex of the other child.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Flightplan-update – Occurs when the flightplan of a vertex changes.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Is this a “good” KDS? –Compact? –Efficient? –Responsive? –Localized?

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Compact? –Like any other BVH, for n polygons, the BVH requires O(n) BVs. –Each BV in the tree has at most six events (leaf- or tree-events.) –So, queue size is O(n). Flightplan-change-events are more like impulse functions and would not actually occupy the queue.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Efficient? –The authors claim there are no internal events. –This would imply perfect efficiency (as the ratio between total events and external events is 1.) –However, this is not strictly true. Flightplan- change-events would not necessarily change the configuration function and should be considered “internal”.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? –This is a function on the action to be taken for each event. –Furthermore, because insertion and deletion of events from the queue may take place, queue performance plays a role. –We’ll assume that all operations on a queue with k elements are O(log k)

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Leaf-event –New events must be calculated for all of the triangles in the leaf. O(1) if number of vertices per polygon is bounded. –Change in leaf BV needs to be propagated up the tree. –If the parent tree used the supplanted vertex for its extreme value, new tree events need also be calculated.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Leaf-event –This continues up the tree until a parent is encountered which uses a different vertex for it’s extreme extent. –At each level we need to delete and create events. O( log n ). –We might need to propagate all the way up so total work for Leaf-event is O( log 2 n ).

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Tree-event –Recalculate all of the tree events for this node – O(1). –Propagate up the tree like the Leaf-event, inserting and deleting events at each level. –So, Tree-events are similarly O( log 2 n ).

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Flighpath-change-event –This is tightly coupled to the locality of the structure. –The cost of a flightpath change is directly linked to the number of events that the changing vertex is used. –Assume that the vertex forms the extent of a BV in every level of the BVH (worst case.)

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Flighpath-change-event –Assume that the degree of a vertex is bounded. –Then a vertex participates in O( log n) events. –The work done is O( log 2 n ).

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Compact? –As shown in the responsiveness of the flightpath-change-event, a single vertex is in O( log n ) events.

Kinetic Data Structures -- COMP Kinetic Data Structures Kinetic Bounding Volume Hierarchy Performance? –The proof is insanely complex. –You don’t want to see it. –Really. –Honestly. –But, the basic answer is it’s basically optimal. (The non-optimality is the difference between n and n log* n.)

Kinetic Data Structures -- COMP Kinetic Data Structures Continuous Collision Detection KDS deals with events in continuous time. Clearly amenable to continuous collision detection. Such an algorithm/KDS exists. See references.

Kinetic Data Structures -- COMP References Basch, Guibas, Hershberger: Data Structures for Mobile Data. In SODA: ACM-SIAM Symposium on Discrete Algorithms. (1997) Zachmann, Weller: Kinetic bounding volume hierarchies for deformable objects. In ACM International Conference on Virtual Reality Continuum and Its Applications. (2006) Weller, Zachmann: Kinetic Separation Lists for Continuous Collision Detection of Deformable Objects. 3 rd Workshop in Virtual Reality Interaction and Physical Simulation. (2006) Kinetic Data Structures