590 likes | 755 Views
Static & Dynamic Maintenance of Kinematic Structures. Spheres, Molecules, and Hidden Surface Removal D. Halperin and M-H. Overmars Dynamic Maintenance of Kinematic Structures D. Halperin, J-C. Latombe and R. Motwani. Presented by Iftah Gamzu. Agenda. Static case: Hard Sphere Model
E N D
Static & Dynamic Maintenance of Kinematic Structures Spheres, Molecules, and Hidden Surface Removal D. Halperin and M-H. Overmars Dynamic Maintenance of Kinematic Structures D. Halperin, J-C. Latombe and R. Motwani Presented by Iftah Gamzu
Agenda • Static case: • Hard Sphere Model • Molecules Special Properties • Data Structures for Answering Intersection Queries • Computing the Boundary of a Molecule • Dynamic case: • Graph Theoretic Definition • Abstract Data Structure for Answering Intersection Queries • Online Maintenance Case for Path / Trees • Offline Maintenance Case • Background for future lectures(if time allows): • Hidden Surface Removal (Static Case)
Static Case • Goal: devise techniques to represent and manipulate a static collection of overlapping spheres in . • Motivation: molecular biology • representation of molecular configurations (e.g. union boundary of a molecule). • manipulation of molecular configurations (e.g. collision detection).
Hard Sphere Model • Each atom in the molecule is represented as a sphere in • Spheres can interpenetrate one another • There are recommendedvalues for: • Radios of each sphere (e.g. van der Waals radii) • Distance between centers of each pair of spheres Acetyl
Molecule Special Properties Generally, spheres in might be complex combinatorially - arrangement defined by n spheres in might have complexity of • However, molecules have special properties: • Atoms centers cannot get too close to one another (repellent forces) • Atoms radii range is fairly restricted
Main Theorem - Proof • Every ball in M that intersectsmust lie completely in B • For each that lies completely inside B, let • are pair-wise interior-disjoint
Main Theorem - Proof By volume considerations, the total number of balls that are completely contained in B cannot exceed… (i) is proved.
Main Theorem - Proof Immediately follows from (i) since the number of features involving on the union boundary is bounded by the number of balls intersecting it, which is a constant (O(1)) . The complexity of the union boundary of M is O(n)
Main Theorem - Example max and aver. indicate the maximal and average number of balls intersecting a single ball in each molecule.
Intersection Queries • Goal: devise a data structure that can answer intersection queries with either a point or with a ball whose radius is bounded by . • Motivation:molecular biology - computer aided drug design. • checking whether molecules fit together. • checking whether a particular position in lie inside or outside the molecule.
Intersection Queries – Solution 1 Preprocessing: Store C (the set of centers of the balls in M) in a three dimensional range tree suitable for answering: Given a query axis-parallel box, report the points in C contained in this box.
Intersection Queries – Solution 1 Query: • Given a query ball Q (with radius ), construct a ball Q’ with radius and concentric with Q. • B’ is the axis-parallel bounding box of Q’. • Query the range search structure on C with the box B’.
Intersection Queries – Solution 1 • For each of the answers, check whether the corresponding ball intersects Q. Performance:
Intersection Queries – Solution 2 Preprocessing: • Subdividespace into cubes whose side is long. • For each ball in M compute the grid cubes that it intersects (at most 8 cubes). • Arrange C (the set of non-empty grid cubes) in a balanced binary search tree and attach to each cube a list (of constant number) of balls in M that intersect it.
Intersection Queries – Solution 2 Query: • Given a query ball Q, compute the grid cubes it intersects (at most 8 cubes). • For each grid cube, find it in the binary search tree and (if it exists) check the balls in its list for intersection with Q. Performance:
Intersection Queries – Solution 3 Use hash structure instead of the binary search tree. Performance:
Intersection Queries – Solution 3 Testing Results: density of the molecule is more dominant then the size of the molecule.
Computing Boundary • Goal: devise an algorithm to compute the boundary of a collection of interpenetrating spheres. • Motivation:molecular biology • computing van der Waals surface. • computing the approximate solvent accessible surface. • other surfaces…
Computing Boundary – cont. The algorithm also solves the problem of computing the approximate solvent accessible surface. • Reduction: • New instance with different constants ( ) on which we need to compute the union boundary. Increase the radius of each ball in M by r` (the radius of the solvent sphere).
Computing Boundary – Solution Algorithm Outline: For each ball identify the other balls intersecting it. Use the intersection query data structure. For each ball compute its contribution to the union boundary. • Each pair of intersecting balls (which none contains the other) defines a circle that partitions each ball into two parts. • For each ball, calculate all the circles on it (a 2D arrangement on the ball) and decide which faces are on the boundary (using brute force).
Computing Boundary – Solution Transform the local information into global structures describing the union boundary. • We start with a face (f) that must be on the boundary (e.g. the face that has the largest z-coordinate on its boundary). • Recursively, traverse the neighboring faces (f `) of (f) that haven’t been visited yet.
Computing Boundary – Solution Performance: Preprocessing time + Queries time
Computing Boundary – Solution Testing Results: SOD Notice: although steps 1 and 2 theoretically take O(n), step 2 dominates the amount of time required (larger constant).
Dynamic Case • Goal: devise a data structure that allows us to answer intersection queries on a moving collection of bodies connected by joints in . • Motivation: • conformational search in molecular biology. • collision detection. • simulation of hyper-redundant robots.
Dynamic Case – cont. • Concept: • Assumption: we know how to solve the problem for the static case – e.g. if the collection represents a molecule then we can use the previously discussed hash structure. • Goal: we would like to devise a data structure that will maintain a collection of static substructures and will be able to (efficiently) support dynamic operations (e.g. update of the joint parameter).
Dynamic Case – cont. • Example 1: • for each link there is a substructure (e.g. hash structure representing a grid occupancy by a link). • (joint parameter) update operation update the coordinate system transformation (O(1)). • query operation each substructure must be queried (O(n)).
Dynamic Case – cont. • Example 2: • Suppose we knew that the sequence of update and query operations would have the special feature that all the update operations modify the same joint. What would be a decent strategy ?
Graph Theoretic Problem Definition • Input:L – articulated linkage of n links with no closed loops. • A treeT(V, E) such that • Links map to vertices - • Joints map to edges - joint connecting links i and j
Graph Theoretic Problem Definition • Output:D – a dynamic collection of substructures that supports two operations: • - change joint (edge) parameter to q. • - query some region for intersections. • Notes: • the substructures in D can be viewed as a decomposition of T(into sub-trees)induced by the removal of a set of edges in E (marked asBROKEN). • each substructure represents the space occupied by L-elements corresponding to a sub-tree of T.
Graph Theoretic Problem Definition • Example: • T is decomposed into 2 sub-trees (i.e. D is made of 2 substructures). • Each sub-tree’s corresponding L-elements are maintained in a substructure that represents the space occupied by them.
The Abstract Data Structure • Primitive operations: • - breaks the edge (this results in a partition of the substructure that held into two substructures). Cost: O(1) if the edge is already BROKEN. if the edge is MARGED. • - merges the edge (this results in a union of the corresponding substructures). Cost: O(1) if the edge is already MARGED. if the edge is BROKEN.
The Abstract Data Structure – cont. is: • The TOTAL cost measure corresponds to a situation where each operation destroys the old structure(s) and then re-computes new structure(s) from sketch • The MIN cost measure corresponds to a situation where new structure(s) can be re-computed by inserting/deleting of elements.
The Abstract Data Structure – cont. • How QUERY is performed ? • For simplicity, assume that T is a serial linkage. • Let denote the static structure that holds the link , be the next static structure along the path and so on. • Each static structure has a coordinate frame attached to it in which the links in this structure are described ( has the universal frame).
The Abstract Data Structure – cont. • For every pair of successive static structures and we maintain a rigid transformation which transforms points described in the frame of to the frame of . • Given a query region Q, we query with Q. The we query with Q’ = (Q)… and so on.
T Online Case for Path Initial state:BROKEN edges are spaced regularly along the path at intervals of . Operations: • - as explained. • - • Update the q parameter in it (and the transformation). • (if not one of the initially BROKEN edges).
Online Case for Path – cont. Time complexity: QUERY – O( ) – since there are substructures UPDATE – O( ) – for the TOTAL and MIN cost measure. NO can we do better ?
Online Case for Path – Lower Bound Adversary Approach: • If the number of BROKEN edges exceeds , it request a query operation (takes ). • Else (the number of BROKEN edges is fewer then ) , then there exists a sub path with more then vertices and the adversary inputs operation which involves breaking the middle most edge in this sub path (takes for both TOTAL and MIN cost measures). NO can we gain more strength using randomization?
Online Case for Trees – MIN cost Example (T is a star): • For the TOTAL cost measure, it is impossible to find a small number of edges that will decompose the star into small sub-trees for each operation. • For the MIN cost measure, do not break any edge for each operation.
Online Case for Trees – MIN cost Definitions: • Heaviness of an edge • Heaviness of a tree • Balance number κ of a tree – the smallest integer κ such that the removal of κ-1 edges decomposes it to κ sub-trees, none of which is κ-heavy. Note: κ-heavy κ’-heavy κ’κ
Online Case for Trees – MIN cost Assume that there is a tree T with balance number κ: Initial state: the BROKEN edges are the set of (at most κ-1) edges which gives a κ-balanced decomposition. Operations: the same as for the path case. Time complexity:O(κ) per operation. YES is this bound tight ?
Online Case for Trees – MIN cost How to find a balanced decomposition of T ? Principles: • κ is known – if κ is unknown, a binary search for its value can be performed at the cost of increasing the running time by a factor of O(log(n)). • The algorithm: • Based on DFS, thus takes O(n) time. • Invariant:on final return to vertex u, the residual sub-tree rooted at u does not contain any κ-heavy edges.
If this residual sub-tree has > κ-1 vertices it must be cut. Must cut one of the edges Can’t be a κ-heavy edge If each of the sub-trees rooted at u’s children have at most κ - 1 vertices then the sub-tree rooted at u does not contain any κ-heavy edges. If r (r > 1) of u’s children have in their sub-trees more then κ - 1 vertices then (at least) r - 1 of them must be cut. If one of u’s children has in its sub-tree more then κ - 1 vertices then the decision whether to cut it depends on the remainder of the sub-tree under u. > κ-1 κ-1 κ-1 > κ-1 κ-1 > κ-1 Can’t be any κ-heavy edges Online Case for Trees – MIN cost
2 1 3 3 m=3 / d=1 3 d=1 d=3 d=1 Online Case for Trees – MIN cost DecomposeAlgorithm Example 6 7 5 1 4 7 4 1 4 7 1 1 1 1 1 1 1 1 1 1 1 1 1 4 3 Tree with balance number 4 1 1
Online Case for Trees – MIN cost Conclusion: Algorithm DFS-Decompose runs in O(n) on an input tree T with n nodes, and for any given integer κ, it returns a κ-balanced decomposition of T if it has balance number κ, and returns failure otherwise.
Online Case for Trees – TOTAL cost The idea:“breaking a vertex” Add another primitive that breaks a vertex: • replace a vertex v by two copies of itself and , with an edge between them. • each edge incident to v is assigned to one of its copies. There exist a choice of O( ) vertices to break such that the tree is decomposes into O( ) sub-trees, each of size O( ).
Offline Case for Path – TOTAL cost The TOTAL problem is NPC • - ordered sequence of queries. • - ordered sequence of vertices in the path. • update operations translate into grid points . operation between queries and