25
Flexible Spanners: Flexible Spanners: A Proximity and Collision Detection A Proximity and Collision Detection Tool for Molecules and Other Tool for Molecules and Other Deformable Objects Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science Department Stanford University

Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Embed Size (px)

Citation preview

Page 1: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Flexible Spanners:Flexible Spanners:A Proximity and Collision Detection Tool for A Proximity and Collision Detection Tool for Molecules and Other Deformable ObjectsMolecules and Other Deformable Objects

Jie Gao, Leonidas Guibas, An Nguyen

Computer Science Department

Stanford University

Page 2: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Proximity Maintenance in Physical Proximity Maintenance in Physical SimulationsSimulations

Most forces in nature are short range: e.g.,neighbor lists in MD

Self-collision detection

Cut-offs for Lennard-Jones potentials

Page 3: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Models of Deformable ObjectsModels of Deformable Objects

Deformable objects are modeled as connected collections of small elements of comparable size

Focus mostly on “linear” objects (macromolecules, but also vines, ropes, chains)

Each atom (element) moves a small distance after each simulation time step (discrete integration)

Page 4: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

How much to know about object state?How much to know about object state?

The integrator (MD) gives us the new positions of the atoms.How can we efficiently maintain self-proximity information, after small displacements of the atoms?To do so, we want to capture and maintain information that is useful for proximity detection yet is relatively stable and easy to update at the same time.

Page 5: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Traditional: Hashed Voxel GridsTraditional: Hashed Voxel Grids

Partition space into a voxel grid and apportion the atoms of the molecule into cells of that grid

Use a hash table, since many of the cells will be emptyTo find the neighbors of a given atom, search nearby cells

Efficiency highly dependent on voxel grid size chosenFor the right size grid, performs quite well for neighbor maintenance

Usually requires re-hashing all the atoms when proximity information is desiredIncremental updating can be good for end-game in folding, when atoms move only littleBad for unfolded phases, when there are few proximities but large motions cause many atoms to change cells

Page 6: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Traditional: Bounding Volume HierarchiesTraditional: Bounding Volume Hierarchies

Bounding volume hierarchies (BVH), using spheres, bounding boxes, etc., have been successfully used for collision checking of rigid objects

Rigid bounding volume hierarchies are good for rigid objects, but

Use a fair amount of space

Collision checking requires a hierarchy traversal

Hierarchy must be updated when deformation occurs

Page 7: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

New: Molecular SpannersNew: Molecular Spanners

The graph distance is within a constant factor of the Euclidean distance.

Spanning ratio α

A notion from graph theory/communication networks

Page 8: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Graph and Geometric SpannersGraph and Geometric Spanners

Graph setting: Replace a dense graph with a sparse subgraph (the spanner), while approximately preserving shortest paths.

Geometry setting: Approximate all distances between points using shortest paths on a graph defined by a sparse set of edges (the spanner).

Page 9: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Spanners for Continuous ObjectsSpanners for Continuous Objects

Add a sparse set of shortcuts, sufficient to guarantee the spanning property

A protein example with α = 33HVT

Page 10: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Spanners for Proximity MaintenanceSpanners for Proximity Maintenance

Lightweight, sparse, combinatorial structure

Highly non-canonical

Can be chosen so as to be very stable under smooth deformations (redundancy helps)

To find all points at distance d from p, find all points within distance αd of p along the object and its shortcuts.

Before two elements p and q on a deformable object can collide, there has to be a shortcut between them.

Page 11: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Discrete Centers with Radius rDiscrete Centers with Radius r

parent-child

Page 12: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Spanner Graph ConstructionSpanner Graph Construction(step 1/2)(step 1/2)

Construct a hierarchy of levels

R0 is the original point set

Ri is a set of discrete centers of Ri-1 with radius 2i

All parent-child edgesare in the spanner

Page 13: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

c 2i

Spanner Graph ConstructionSpanner Graph Construction(step 2/2)(step 2/2)

In each level Ri, put in the spanner all edges of length · c ¢ 2i, where c, c > 4, is a parameter

Page 14: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Spanner TheoremSpanner Theorem

G is a (1+)-spanner [expansion factor α = 1+, where = 16/(c-4).

· 2i

p q

· 2i

· 2i

· 2i> c ¢2i-1

path(p,q) · |pq| + 8 2i

|pq| > (c - 4) 2i-1

Level i

Level i-1

Level 0

Page 15: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

More Spanner ObservationsMore Spanner Observations

In level Ri

Nodes are at least 2i apart

Edges have length at most c ¢2i

Number of nodes is O(n/2i)

Each node is incident to at most O(1) edges

Number of edges is O(n/2i)

Total length of all edges is O(n)

Page 16: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Spanner QualitySpanner Quality

Linear size: O(n) edges

Total length of all edges: O(n log n)

Maximum degree of a node: O(log n)

Page 17: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Maintenance under DeformationMaintenance under Deformation

The correctness of the spanner can be certified by O(n) KDS-style certificates. These are all simple distance inequalities on the lengths of spanner edges.

After each integration step we must verify and update the spanner – may need to deal with multiple certificate failures:

Verify and update the hierarchy

Verify and update spanner edges

We can exploit conservative bounds on failure times of certificates derived from prior node velocity bounds to avoid checking all certificates at each step.

Page 18: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Updating the HierarchyUpdating the Hierarchy

In Ri

If two nodes come within 2i, remove one of the two nodes from Ri [node demotion]

If a node is not covered by any of the centers in Ri+1, add the node to Ri+1 [node promotion]

??

?

Page 19: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Updating Edges: Which Node Pairs Moved Near or Updating Edges: Which Node Pairs Moved Near or Apart?Apart?

In Ri

If an edge has length > c ¢2i, remove it [easy]

Find new pairs of nodes within c ¢ 2i [interesting]Sufficient to consider only “cousin” pairs

???

Distant pairs coming close

are always the issue

Page 20: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Molecular DynamicsMolecular Dynamics

Each frame corresponds to a hundred actual MD steps (Tinker data) Only 2-4% of spanner edges change between framesSpanner is quite stable, except for bottom-level edges (high frequency atomic vibrations)

Nodes Edges Time frames

Ave. promotions

Ave. demotions

Ave. add edge/

Ave. drop edge

Clone0 50 159-214 249 .22 .23 5.42 5.24

R7C27 110 376-506 33 .38 .59 17.7 13.7

green = edge birth, red = edge death, gray = steady state

Page 21: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

More Data (Erik Lindahl) More Data (Erik Lindahl)

Nodes Edges Time frames

Ave. promotions Ave. demotions Ave. add edge/

Ave. drop edge

Villin

All atoms

596 4,855-5,922 1001 2.8 2.8 141 140

Long

All atoms

1619 13,284-15,539 1001 7 7 353 351

10 MD steps between frames

Page 22: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Additional Spanner Properties, IAdditional Spanner Properties, I

Can be used to compute neighbor lists within any distance constraint, in an output-sensitive manner

Number of pairs of atoms examined is proportional to the number of pairs reported

Page 23: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Additional Spanner Properties, IIAdditional Spanner Properties, II

Our spanner defines a well-separated pair decomposition for the atoms

Electrostatic interactions can be modeled as dipole-dipole

Provides an n-body style approximation, but with a structure attached to the molecule and not to the ambient space

Page 24: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Well Separated Pair Decomposition Well Separated Pair Decomposition TheoremTheorem

G induces a s-WSPD, where s = c/4 - 1.

· 2i

p q

· 2i

> c ¢2i-1

|PQ| > (c - 4) 2i-1

Diam(P) < 2¢2i

Level i

Level i-1

Level 0

P Q

Page 25: Flexible Spanners: A Proximity and Collision Detection Tool for Molecules and Other Deformable Objects Jie Gao, Leonidas Guibas, An Nguyen Computer Science

Final RemarksFinal Remarks

Unlike bounding volume hierarchies, the spanner is a lightweight, combinatorial structure

Unlike voxel grids, the spanner is essentially unchanged for mostly rigid molecular motions

We are also using it for macro-level simulations (rope, chain, filament)

A Cosserat rope