slides - Hong Kong Theory Day 2017

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.
Computers & Geosciences 54 (2013) 130–141
Contents lists available at SciVerse ScienceDirect
Computers & Geosciences
journal homepage: www.elsevier.com/locate/cageo
Task-parallel implementation of 3D shortest path raytracing for
geophysical applications
Bernard Giroux a,n, Benoı̂t Larouche b
a
b
INRS-ETE, 490, Rue de la Couronne, Québec, QC, Canada G1K 9A9
École Polytechnique de Montréal, Département de Génie Physique, C.P. 6079, Succ. Centre-Ville, Montréal, QC, Canada H3C 3A7
article i nfo
abstract
Article history:
Received 20 September 2012
Received in revised form
2 December 2012
Accepted 3 December 2012
Available online 19 December 2012
This paper discusses two variants of the shortest path method and their parallel implementation on
a shared-memory system. One variant is designed to perform raytracing in models with stepwise
distributions of interval velocity while the other is better suited for continuous velocity models. Both
rely on a discretization scheme where primary nodes are located at the corners of cuboid cells and
where secondary nodes are found on the edges and sides of the cells. The parallel implementations
allow raytracing concurrently for different sources, providing an attractive framework for ray-based
tomography. The accuracy and performance of the implementations were measured by comparison
with the analytic solution for a layered model and for a vertical gradient model. Mean relative error less
than 0.2% was obtained with 5 secondary nodes for the layered model and 9 secondary nodes for the
gradient model. Parallel performance depends on the level of discretization refinement, on the number
of threads, and on the problem size, with the most determinant variable being the level of discretization
refinement (number of secondary nodes). The results indicate that a good trade-off between speed and
accuracy 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.
Keywords:
Parallel
Shared memory
Raytracing
Shortest path
1. Introduction
Seismic and ground-penetrating-radar tomography have proven useful for a wealth of applications, from global Earth imaging
Various approaches were proposed to perform raytracing. For
instance, Červený and the Seismic waves in complex 3-D structures (SW3D) group have proposed many algorithms over the
past three decades to perform Complete Ray Tracing in isotropic
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 face f has weight wf 2 [1, W ].
Every edge e has weight = min{wf , wg } among faces f
Every edge e has weight = min{wf , wg } among
and g incident to e.
faces f and g incident to e.
cost(P ) =
X
f
wf kP \ f k +
X
e
we kP \ ek
Snell’s Law
(x1 , p
y1 ) 2
Min w x
g
Min wg
✓f
x
✓g
(x0 , y0 )
wg
wf
pp
p
2
2
2
2
2
wf wp
Min
y0 ++wyf 1 (x1
1 + x)
g (xx
p + y0 +
x2 + y02 + wf
(x1
x)2 + y12
x)2 + y12
x x1 x
x1
p
wg p
=
w
f
p
wg p x 2 = w
f x2x+
1 y 2x
2(x1
2
wg px + y02 = wf p (x1 0 x)2 +
y
x 2 + y0
(x1 x)2 + y12 1
x
wf sin ✓f = wg sin
w
sin
wff sin
sin ✓✓ff ==ww
sin
✓g✓g
gg
Snell’s Law
History
Introduced in [Mitchell, Papadimitriou: JACM’91]
Continuous Dijkstra paradigm
✓
nN W
(1 + ")-approximate shortest path in O n log
"
8
W = largest region weight
N = largest vertex coordinate magnitude
◆
time
Why not Exact?
Proved in [Carufel et al.: CGTA’14] that it is unsolvable in the
algebraic computational model over rational numbers (exact
p
computation using +, , ⇥, ÷, k )
• A path passes through a vertex between two successive critical refractions.
• If a path does not pass through any vertex in its interior, it intersects every edge O(n) times and hence
the path has O(n2 ) complexity.
• A path has ⌦(n2 ) complexity in the worst case.
• A path passes through a vertex between two successive critical refractions.
• If a path does not pass through any vertex in its interior, it intersects every edge O(n) times and hence
the path has O(n2 ) complexity.
• A path has ⌦(n2 ) complexity in the worst case.
✓
nN W
+ ")-approximate
shortest path in O n log
Mitchell, Papadimitriou:(1
JACM’91
(FPTAS)
"
Mata, Mitchell: SCG’97
8
◆
time
O(mn3 ) time, 1 + O(W/(m✓min )) approx
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)
geom
O(n3 log n), additive error O(LW )
=
=
◆
n
1
O geom · 2 log n log
"
"
✓
✓
◆◆
n
1
1
p + log n
O geom · log
"
"
"
✓
✓
◆
◆
n
1
1
O geom ·
log + log n log
"
"
"
✓
◆
n
n
1
O geom · p log log
"
"
"
✓
◆
4
kn + k log(k/")
2 nW
O
log
"
"
⌦(1/✓min ) in the worst case
⌦(N 2 )
Our Result
O
✓
4
kn + k log(k/")
2 nW
log
"
"
◆
Let k be the smallest number such that the sum of the k smallest
angles is at least 180 degrees.
If k = O(1), running time = Õ(n"
1
).
If k = O(n1/3 ), running time = Õ(n4/3 "
1
).
When k = ⇥(n) in the worst case, running time = Õ(n4 "
1
).
Edge Subdivision
s
s
t
t
Compute the shortest path in the weighted Steiner graph
and return it as the desired approximate shortest path.
Edge Subdivision
s
s
t
Shortest path
t
Snapping to nearest
Steiner points
Edge Subdivision
❖
Need to ensure that the length of each edge increases by a
factor 1 + "
❖
Snapping to vertices is controlled by picking the right
“vertex radius”
i
•
= O("L/n).
•
= 1 + ⇥(" ).
• L = Euclidean distance between s and t.
• Can assume that every triangulation edge has length at
most 2W L.
• There are O
✓
1
nW
log
"
"
◆
Steiner points on the edge.
Triangulation Refinement
❖
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.
❖
⇢
⇡ ⇡
Define ✓ = min
,
. The k-th smallest angle
2k 12
⇡
k
2✓.
Call an angle small if it is at most 2✓.
⇡ ⇡
Define ✓ = min{ ,
}.
2k 12
⇡
kth smallest angle
2✓.
k
Triangulation size = O(n + k 2 )
⇡
Each triangle has at most one angle less than ✓ ⇡
.
2k
Triangle Strips
Merge adjacent triangles with an angle  ✓ into a strip.
Each strip has at most 2k triangles.
Triangle Strips
❖
❖
Discretize the fat triangles (with = ⇡/(2k)) and hence
the boundaries of the triangle strips.
That is, Steiner points are inserted into the boundary
edges
strip,
✓ of the triangle
◆
k
nW
O
log
per edge
"
"
Shortest Paths in a Strip
q
q
p
p
p
q
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).
p
Approximating the Metric
radius = O(1/wf )
cost = expansion factor
Approximating the Metric
radius = O(1/wf )
cost = expansion factor
p
Cost
is a ⇥(1/
1 + " approximation.
Uniformly
place
") points on the circle
Convex Piecewise Linear Functions
i+1
=0
ei+1
i+1
=1
i
=1
ei
i
=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 .
p
Li+1 is convex and it has O(1/ ") linear
pieces.
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
p
O(i/ ") complexity, and has no vertex in its interior.
Our Result
O
✓
4
kn + k log(k/")
2 nW
log
"
"
◆
Let k be the smallest number such that the sum of the k smallest
angles is at least 180 degrees.
Open/Related Problems
Question 1
A lower bound of ⌦(n2 ) is known.
Can we reduce O(k 4 ) to O(k 2 ) or O(k 3 )?
s
O
✓
✓
nW
k
nW
log
log
"
""
◆
◆
Steinerpoints
pointsper
peredge
edge
Steiner
◆ ◆
k
2 nW nW
O
log
Steiner
points
log log
Steiner
points
on on
the
"
"
"
the boundary
a strip
boundary
of aofstrip
k 22
t
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
✓
2O()
O 2
n"
7
W
2 NW
log
log
"
"
2
◆
 = size of largest connected component of skinny tetrahedra
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 concentric 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 ).
Question 5
Let ⇢ be the ratio of the radius of the smallest concentric
thethe
largest
concentric
Letenclosing
⇢ be thecircle
ratiotoofthe
theradius
radiusof of
smallest
conceninscribed
circle.circle to the radius of the largest concentric
tric enclosing
inscribed circle.
For any polygonal path P , there exists a path Q with at
2
most
21⇢n
/" edges such
cost(Q)
 (1
")cost(P
). at
For any polygonal
path that
P , there
exists
a+
path
Q with
most 21⇢n2 /" edges such thaat cost(P )  (1 + ")cost(P ).
Can the dependence on ⇢ be reduced, say to polylog⇢?
Can the dependence on ⇢ be reduced, say to polylog⇢?
Question 6
For all " 2 (0, 1), we can compute a (1+")-approximate
!
⇢2 log ⇢ 3
⇢n
shortest path in O
n log
time.
2
"
"
Can the dependence on ⇢ be reduced?
Thank you!