Fast shortest-path kernel computations using approximate ...
Approximate Shortest Paths in Weighted Regions
Transcript of Approximate Shortest Paths in Weighted Regions
Approximate Shortest Paths in Weighted Regions
Siu-Wing Cheng HKUST
[Singh et al.: Intl. Conf. Robot. Auto.’00]
Use stereo vision to estimate the roll, pitch and roughness of a terrain patch. Assign a real number to the terrain patch to
represent its traversability.
Task-parallel implementation of 3D shortest path raytracing forgeophysical applications
Bernard Giroux a,n, Benoıt Larouche b
a INRS-ETE, 490, Rue de la Couronne, Quebec, QC, Canada G1K 9A9b Ecole Polytechnique de Montreal, Departement de Genie Physique, C.P. 6079, Succ. Centre-Ville, Montreal, QC, Canada H3C 3A7
a r t i c l e i n f o
Article history:Received 20 September 2012Received in revised form2 December 2012Accepted 3 December 2012Available online 19 December 2012
Keywords:ParallelShared memoryRaytracingShortest path
a b s t r a c t
This paper discusses two variants of the shortest path method and their parallel implementation ona shared-memory system. One variant is designed to perform raytracing in models with stepwisedistributions of interval velocity while the other is better suited for continuous velocity models. Bothrely on a discretization scheme where primary nodes are located at the corners of cuboid cells andwhere secondary nodes are found on the edges and sides of the cells. The parallel implementationsallow raytracing concurrently for different sources, providing an attractive framework for ray-basedtomography. The accuracy and performance of the implementations were measured by comparisonwith the analytic solution for a layered model and for a vertical gradient model. Mean relative error lessthan 0.2% was obtained with 5 secondary nodes for the layered model and 9 secondary nodes for thegradient model. Parallel performance depends on the level of discretization refinement, on the numberof threads, and on the problem size, with the most determinant variable being the level of discretizationrefinement (number of secondary nodes). The results indicate that a good trade-off between speed andaccuracy is achieved with the number of secondary nodes equal to 5. The programs are written in Cþþand rely on the Standard Template Library and OpenMP.
& 2012 Elsevier Ltd. All rights reserved.
1. Introduction
Seismic and ground-penetrating-radar tomography have pro-ven useful for a wealth of applications, from global Earth imaging(Nolet, 2008) to natural resource exploitation (Bellefleur andChouteau, 2001; Yu et al., 2008), to environmental and engineer-ing problems (Daley et al., 2004; Giroux et al., 2006). Ray-basedtomography schemes, as the name implies, rely on the rayapproximation to describe the propagation of the wave throughthe medium under study. The measured parameter can then belinked to the sought property by an integral along the raypath.After discretization, the integral becomes a summation that canbe used to build a linear system of equation than can be solvednumerically to yield the unknown earth property (Menke, 2012).In matrix notation, the system can be written
Gm¼ d, ð1Þ
where G is a sparse matrix holding ray segment lengths, m isthe unknown model vector and d is the measured data vector.To build the forward matrix G, the raypaths must be known,hence the need for raytracing schemes.
Various approaches were proposed to perform raytracing. Forinstance, Cerveny and the Seismic waves in complex 3-D struc-tures (SW3D) group have proposed many algorithms over thepast three decades to perform Complete Ray Tracing in isotropicand anisotropic media. Complete Ray Tracing involves thecomputation of the traveltime and raypath together with thecomputation of the ray propagator matrix and evaluation ofthe components of the vectorial complex-valued amplitudes(e.g. Cerveny et al., 1988, 2007; Cerveny and Soares, 1992;Bulant, 1996; Vavrycuk, 2008). For traveltime tomography, whichis perhaps the most common application, only traveltimes andraypaths are needed to solve the inverse problem. Two-pointmethods known as ray-shooting and ray-bending were firstdeveloped to compute the traveltimes and raypaths (Julian andGubbins, 1977; Um and Thurber, 1987). The latter two methodshave been categorized as geometric raytracing methods. Both canbe made very accurate, but both have convergence problems incomplex models (Moser, 1991).
To overcome the limitations of geometric raytracing, finite-difference (FD) solutions of the eikonal equation were proposed,notably by Vidale (1988, 1990) for isotropic media and by Eaton(1993) for anisotropic media. FD schemes are generally fast butonly compute first arrival times, i.e. raypaths must be deter-mined a posteriori. FD solvers can be plagued by stability issuesin complex media, and modified schemes were proposed to
Contents lists available at SciVerse ScienceDirect
journal homepage: www.elsevier.com/locate/cageo
Computers & Geosciences
0098-3004/$ - see front matter & 2012 Elsevier Ltd. All rights reserved.http://dx.doi.org/10.1016/j.cageo.2012.12.005
n Corresponding author. Tel.: þ1 418 654 2624.E-mail address: [email protected] (B. Giroux).
Computers & Geosciences 54 (2013) 130–141
Outline
Formulation and Properties
History
Our Result
Open/Related Problems
Find a shortest path from s to t among regions that have different costs per unit distance. Shortest
path means the least cost path.
Every face f has weight wf 2 [1,W ].
Every edge e has weight = min{wf , wg} among faces fand g incident to e.
1
Every face f has weight wf 2 [1,W ].
Every edge e has weight = min{wf , wg} among
faces f and g incident to e.
1
cost(P ) =
X
f
wfkP \ fk+X
e
wekP \ ek
1
Snell’s Law
wf
wg
✓f
✓g
x
(x0, y0)
(x1, y1)Min wg
px
2 + y
20 + wf
p(x1 � x)2 + y
21
wgxp
x
2 + y
20
= wfx1 � xp
(x1 � x)2 + y
21
wf sin ✓f = wg sin ✓g
1
Min wg
px
2 + y
20 + wf
p(x1 � x)2 + y
21
wgxp
x
2 + y
20
= wfx1 � xp
(x1 � x)2 + y
21
wf sin ✓f = wg sin ✓g
1
Min wg
px
2 + y
20 + wf
p(x1 � x)2 + y
21
wgxp
x
2 + y
20
= wfx1 � xp
(x1 � x)2 + y
21
wf sin ✓f = wg sin ✓g
1
Snell’s Law
History
Introduced in [Mitchell, Papadimitriou: JACM’91]
Continuous Dijkstra paradigm
W = largest region weight N = largest vertex coordinate magnitude
(1 + ")-approximate shortest path in O
✓n8
log
nNW
"
◆time
1
Why not Exact?
Proved in [Carufel et al.: CGTA’14] that it is unsolvable in the algebraic computational model over rational numbers (exact computation using )+,�,⇥,÷, k
p
1
• A path passes through a vertex between two succes-
sive critical refractions.
• If a path does not pass through any vertex in its in-
terior, it intersects every edge O(n) times and hence
the path has O(n2) complexity.
• A path has ⌦(n2) complexity in the worst case.
1
• A path passes through a vertex between two succes-
sive critical refractions.
• If a path does not pass through any vertex in its in-
terior, it intersects every edge O(n) times and hence
the path has O(n2) complexity.
• A path has ⌦(n2) complexity in the worst case.
1
Mitchell, Papadimitriou: JACM’91 (FPTAS)
Mata, Mitchell: SCG’97
Lanthier, Maheshwari, Sack: Algorithmica’01
Aleksandrov et al.: SWAT’98
Aleksandrov et al.: STOC’00
Sun, Reif: J. Alg’06
Aleksandrov et al.: JACM’05
Cheng, Jin, Vigneron: SODA’15 (FPTAS)
(1 + ")-approximate shortest path in O
✓n8
log
nNW
"
◆time
1
O
✓geom · n
"2log n log
1
"
◆
1
O(n3log n), additive error O(LW )
1
O
✓geom · n
"log
1
"
✓1p"+ log n
◆◆
1
O
✓geom · n
"
✓log
1
"+ log n
◆log
1
"
◆
1
O
✓geom · np
"log
n
"log
1
"
◆
1
O(mn3) time, 1 +O(W/(m✓min)) approx
1
O
✓kn+ k4 log(k/")
"log
2 nW
"
◆
1
geom = ⌦(1/✓min) in the worst case
= ⌦(N2)
1
Our Result
Let k be the smallest number such that the sum of the k smallest angles is at least 180 degrees.
O
✓kn+ k4 log(k/")
"log
2 nW
"
◆
1
If k = O(1), running time =
˜O(n"�1).
If k = O(n1/3), running time =
˜O(n4/3"�1).
When k = ⇥(n) in the worst case, running time =
˜O(n4"�1).
1
Edge Subdivision
s
t
s
t
Compute the shortest path in the weighted Steiner graph and return it as the desired approximate shortest path.
Edge Subdivision
s
t
s
t
Shortest pathSnapping to nearest
Steiner points
Edge Subdivision
❖ Need to ensure that the length of each edge increases by a factor
❖ Snapping to vertices is controlled by picking the right “vertex radius”
1 + "
1
�
�
��
��i
• � = O("L/n).
• � = 1 +⇥("�).
• L = Euclidean distance between s and t.
• Can assume that every triangulation edge has length at
most 2WL.
• There are O
✓1
�"log
nW
"
◆Steiner points on the edge.
1
❖ Reduce to the case where each triangle has at most one small angle through refinement.
❖ Group triangles with small angles into strips.
❖ Fat triangle can be discretized as before.
❖
Triangulation Refinement
Define ✓ = min⇢
⇡
2k,⇡
12
�. The k-th smallest angle� ⇡
k� 2✓.
1
Call an angle small if it is at most 2✓.
1
Triangulation size = O(n+ k2)
1
Define ✓ = min{ ⇡
2k,⇡
12
}.
kth smallest angle � ⇡
k� 2✓.
Each triangle has at most one angle less than ✓ ⇡ ⇡
2k.
1
Triangle Strips
Merge adjacent triangles with an angle ✓ into a strip.
Each strip has at most 2k triangles.
1
Triangle Strips
❖ Discretize the fat triangles (with ) and hence the boundaries of the triangle strips.
❖ That is, Steiner points are inserted into the boundary edges of the triangle strip,
O
✓k
"log
nW
"
◆per edge
1
� = ⇡/(2k)
1
Shortest Paths in a Strip
p
q
q
p
p
q p
q
Between two boundary Steiner points p and q, the edge sequence of the shortest path between them is
either fixed or has O(k) possibilities. The edge sequence has length O(k).
Approximating the Metric
radius = O(1/wf )
1
cost = expansion factor
Approximating the Metric
radius = O(1/wf )
1
cost = expansion factor
Cost is a 1 + " approximation.
1
Uniformly place ⇥(1/p") points on the circle
1
Convex Piecewise Linear Functions
ei
ei+1
�i = 0�i = 1
�i+1 = 1
�i+1 = 0
Convex Piecewise Linear Functions
Let (e1, e2, e3, · · · ) be the edge sequence.
Parametrize ei by �i 2 [0, 1].
Li+1(�i,�i+1) : [0, 1]2 ! R: Cost of a
segment from ei to ei+1.
Li+1 is convex and it has O(1/p") linear
pieces.
1
cost
Convex Piecewise Linear Functions
Let (e1, e2, e3, · · · ) be the edge sequence.
Fi(�1,�i) : [0, 1]2 ! R: Cost of the shortest path
from e1 to ei+1.
Inductively, Fi is convex piecewise linear, has
O(i/p") complexity, and has no vertex in its in-
terior.
1
Our Result
Let k be the smallest number such that the sum of the k smallest angles is at least 180 degrees.
O
✓kn+ k4 log(k/")
"log
2 nW
"
◆
1
Open/Related Problems
Question 1
A lower bound of ⌦(n2) is known.
Can we reduce O(k4) to O(k2) or O(k3)?
1
s
t
O
✓k
"log
nW
"
◆Steiner points per edge
O
✓k2
"log
2log
nW
"
◆Steiner points on
the boundary of a strip
1
O
✓k
"log
nW
"
◆Steiner points per edge
O
✓k2
"log
nW
"
◆Steiner points on the
boundary of a strip
1
Questions 2-4❖ Weighted region problem in 3D. A set of n tetrahedra that meet at vertices,
edges, and triangles.
❖ Aleksandrov et al.: DCG’13
K = maximum aspect ratio of tetrahedra in the worst case.
❖ C, Chiu, Jin, Vigneron: manuscript
O
✓2
2O()
n"�7log
2 W
"log
2 NW
"
◆
1
= size of largest connected component of skinny tetrahedra
1
Questions 2-4
❖ Is there a faster/polynomial-time algorithm for a larger range of ?
❖ Is there an FPTAS for the 3D weighted region problem?
❖ What properties of the shortest path or any path do we know in the 3D case?
We do not even know any bound on the number of critical refractions in a shortest path!
Question 5
Possibly distinct convex distance functions in the triangular faces of a planar subdivision.
Question 5
Question 5
[C, Na, Vigneron, Wang: SICOMP’08, SICOMP’10]
Shortest path is well-defined, but infinite spirals are possible.
Question 5
Let ⇢ be the ratio of the radius of the smallest concen-
tric enclosing circle to the radius of the largest concentric
inscribed circle.
For any polygonal path P , there exists a path Q with at
most 21⇢n2/" edges such thaat cost(P ) (1 + ")cost(P ).
1
Question 5Let ⇢ be the ratio of the radius of the smallest concen-
tric enclosing circle to the radius of the largest concentric
inscribed circle.
For any polygonal path P , there exists a path Q with at
most 21⇢n2/" edges such thaat cost(P ) (1 + ")cost(P ).
Can the dependence on ⇢ be reduced, say to polylog⇢?
1
Let ⇢ be the ratio of the radius of the smallest concen-
tric enclosing circle to the radius of the largest concentric
inscribed circle.
For any polygonal path P , there exists a path Q with at
most 21⇢n2/" edges such that cost(Q) (1 + ")cost(P ).
Can the dependence on ⇢ be reduced, say to polylog⇢?
1
Question 6
For all " 2 (0, 1), we can compute a (1+")-approximate
shortest path in O
⇢2 log ⇢
"2n3
log
⇢n
"
!
time.
Can the dependence on ⇢ be reduced?
1
Thank you!