Download presentation
Presentation is loading. Please wait.
1
1 1 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
2
2 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 Background for future lectures (if time allows) : Hidden Surface Removal (Static Case)
3
3 Static Case Goal: Goal: devise techniques to represent and manipulate a static collection of overlapping spheres in. Motivation: Motivation: molecular biology representation of molecular configurations (e.g. union boundary of a molecule). manipulation of molecular configurations (e.g. collision detection).
4
4 Hard Sphere Model Each atom in the molecule is represented as a sphere in Spheres can interpenetrate one another There are recommended values for: 1) 1) Radios of each sphere (e.g. van der Waals radii) 2) 2) Distance between centers of each pair of spheres Acetyl
5
5 might have complexity of Molecule Special Properties Generally, spheres in might be complex combinatorially - arrangement defined by n spheres in However, molecules have special properties: Atoms centers cannot get too close to one another (repellent forces) Atoms radii range is fairly restricted
6
6 Main Theorem - Definitions
7
7 Main Theorem
8
8 Main Theorem - Proof Every ball in M that intersects must lie completely in B For each that lies completely inside B, let are pair-wise interior-disjoint
9
9 Main Theorem - Proof By volume considerations, the total number of balls that are completely contained in B cannot exceed… (i) is proved.
10
10 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)
11
11 Main Theorem - Example max and aver. indicate the maximal and average number of balls intersecting a single ball in each molecule.
12
12 Intersection Queries Goal: Goal: devise a data structure that can answer intersection queries with either a point or with a ball whose radius is bounded by. Motivation: Motivation: molecular biology - computer aided drug design. checking whether molecules fit together. checking whether a particular position in lie inside or outside the molecule.
13
13 Intersection Queries – Solution 1 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. Preprocessing:
14
14 Intersection Queries – Solution 1 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’. Query:
15
15 Intersection Queries – Solution 1 For each of the answers, check whether the corresponding ball intersects Q. Preprocessing Space O(n · log²n) Preprocessing Time O(n · log²n) Query Time O(log²n) Performance:
16
16 Intersection Queries – Solution 2 Subdivide space 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. Preprocessing:
17
17 Intersection Queries – Solution 2 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. Preprocessing Space O(n) Preprocessing Time O(n · logn) Query Time O(logn) Query: Performance:
18
18 Intersection Queries – Solution 3 Use hash structure instead of the binary search tree. Preprocessing Space O(n) Preprocessing Time O(n) randomized. Query Time O(1) Performance:
19
19 Intersection Queries – Solution 3 Testing Results: density of the molecule is more dominant then the size of the molecule.
20
20 Computing Boundary Goal: Goal: devise an algorithm to compute the boundary of a collection of interpenetrating spheres. Motivation: Motivation: molecular biology computing van der Waals surface. computing the approximate solvent accessible surface. other surfaces…
21
21 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).
22
22 Computing Boundary – Solution Algorithm Outline: 1) 1) For each ball identify the other balls intersecting it. 2) 2) For each ball compute its contribution to the union boundary. Use the intersection query data structure. 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).
23
23 Computing Boundary – Solution 3) 3) 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.
24
24 Computing Boundary – Solution Performance: Step 1Step 2Step 3 Space O(n) Time O(n) randomized O(n · logn) deterministic O(n) Preprocessing time + Queries time
25
25 Computing Boundary – Solution Testing Results: Notice: although steps 1 and 2 theoretically take O(n), step 2 dominates the amount of time required (larger constant). SOD
26
26 Dynamic Case Goal: 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.
27
27 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).
28
28 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)).
29
29 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 ?
30
30 Graph Theoretic Problem Definition Input: Input: L – articulated linkage of n links with no closed loops. A tree T(V, E) such that Links map to vertices - Joints map to edges - joint connecting links i and j
31
31 Graph Theoretic Problem Definition Output: 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 as BROKEN ). each substructure represents the space occupied by L-elements corresponding to a sub-tree of T.
32
32 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.
33
33 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.
34
34 is: The Abstract Data Structure – cont. TOTAL cost measureThe total number of vertices that participate in the operation. MIN cost measureThe number of vertices in the smaller tree that participates in the operation. 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.
35
35 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.
36
36 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.
37
37 Initial state: Initial state: BROKEN edges are spaced regularly along the path at intervals of.Operations: - as explained. - 1. 1. 2. 2. Update the q parameter in it (and the transformation). 3. 3. (if not one of the initially BROKEN edges). Online Case for Path T
38
38 Online Case for Path – cont. Time complexity: QUERY – O( ) – since there are substructures UPDATE – O( ) – for the TOTAL and MIN cost measure. can we do better ? NO
39
39 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). can we gain more strength using randomization? NO
40
40 Online Case for Trees – MIN cost Example 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.
41
41 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 κ’ κ
42
42 Online Case for Trees – MIN cost Assume that there is a tree T with balance number κ: Initial state: Initial state: the BROKEN edges are the set of (at most κ-1) edges which gives a κ-balanced decomposition. Operations: Operations: the same as for the path case. Time complexity: Time complexity: O(κ) per operation. is this bound tight ? YES
43
43 Online Case for Trees – MIN cost 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.
44
44 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. > κ-1 Must cut one of the edges 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 If this residual sub-tree has > κ-1 vertices it must be cut. Online Case for Trees – MIN cost 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. κ-1 Can’t be any κ-heavy edges Can’t be a κ-heavy edge
45
45 Online Case for Trees – MIN cost Online Case for Trees – MIN cost Decompose Algorithm
46
46 Online Case for Trees – MIN cost Online Case for Trees – MIN cost Decompose Algorithm
47
47 1 1 3 4 11 7 1 1 1 1 1 7 11 4 11 7 1 1 1 4 5 6 1 4 3 3 3 1 2 d=1 Tree with balance number 4 m=3 / d=1 d=3 Online Case for Trees – MIN cost Online Case for Trees – MIN cost Decompose Algorithm Example
48
48 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.
49
49 There exist a choice of O( ) vertices to break such that the tree is decomposes into O( ) sub-trees, each of size O( ). Online Case for Trees – TOTAL cost The idea: 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.
50
50 operation between queries and 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.
51
51 Offline Case for Path – TOTAL cost Claim: an optimal solution for the problem corresponds to partitioning R into axis-parallel rectangles such that is minimized and no rectangle contains a point of U in its interior. cost of query is the number of rectangles (substructures) in the intersection charge the cost to the portion of the lower horizontal edge. vertical edges correspond to sub-paths that have undergone a change charge the cost to the left vertical rectangle edges.
52
52 Offline Case for Path – TOTAL cost The specified rectangle partitioning problem is harder than the TOTAL problem approximation algorithms to the rectangle partitioning also approximate the TOTAL problem. It can be proved that TOTAL problem is harder (reduction in the reverse direction) then the specified rectangle partitioning. Gonzalez et al – 1.75 approximation in time Gonzalez et al – 4 approximation in time Equivalency between the two problems. The TOTAL problem is NPC.
53
53 Offline Case for Path – MIN cost The MIN problem is NPC ? It can be shown that - approximation algorithm
54
54 Hidden Surface Removal Goal: Goal: devise an algorithm for hidden surface removal among a set of intersecting spheres. Motivation: Motivation: molecular biology – molecules display. Reminder: Static Case
55
55 Hidden Surface Removal – cont. Algorithms: Z-buffer algorithm – most implementations only handle polyhedral objects. Thus, we need to approximate the spheres by a triangular meshes large number of faces Slow. Painter’s Algorithm – define the depth order on the objects (sorting from back to front) and then draws the objects in this order on top of each other what is the depth order between intersecting objects ?
56
56 Hidden Surface Removal – cont. If the spheres do not intersect ? The depth order is acquired by sorting the spheres by the z- coordinate of their centers. And if the spheres intersect ? Lets look only on pieces of the spheres that 1. 1. constitutes the boundary of the union. And, 2. 2. are part of the visible hemisphere. and try to define a depth order on them…
57
57 Hidden Surface Removal – cont. - a collection of spheres sorted by z of their centers. - a hemisphere of facing the viewing direction. - a collection of maximal pieces that are part of the boundary of the union of spheres. Then is a valid depth order for the pieces of the boundary. i < j NO i > j
58
58 Hidden Surface Removal – cont. Algorithm: Compute the boundary of the of the union. Given a viewing direction, cut off the parts that lie outside the viewable hemisphere. Compute the depth order for the spheres and draw the pieces. Performance: O(n·log n) + O(n) + O(n·log n) = O(n·log n) deterministic
59
59 Questions…
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.