Title: Design of Spatial Information Systems
1 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF
JOENSUU JOENSUU, FINLAND
- Design of Spatial Information Systems
- Lecture 11b
- Path Finding
- Alexander Kolesnikov
2Navigation in network model
3Navigation problem (1)
4Navigation problem (2)
5Problem formulation
- Input is a graph G (V, E) and the source
vertex v_src and - destination vertex v_dst.
- Here V is the set of vertices and E the set of
edges in graph G. - Further we have an edge weight function C(u,v)
for edge e(u,v)?E. - Find such sequence of edges from v_src to v_dst
that - summa of weights is minimal.
v
u
6Dijkstras algorithm Notation (1)
- The algorithm divides the vertices, V, into two
disjoint sets, V S ? Q. - The set, S, contains those vertices whose final
shortest path weights - have been determined and the set, Q V-S.
- When a vertex is moved from Q to S, we say that
it is retired.
7Dijkstras algorithm Notation (2)
- For every vertex, v, we store a currently
minimum shortest-path estimate value, Cv (or
cost function). - Since we are interested in finding the shortest
path, we will also store, for every vertex a
predecessor edge, prevv, that is the edge from
a neighbor to the vertex in the currently best
path to the vertex in question. This can then be
used to reconstruct the path by backtracking from
the destination v_dst to v_src.
8Dijkstras algorithm Main idea
- Maintain a set S of vertices whose final
shortest-path - from the source v_src have already be
determined. - Repeatedly select the vertex u ?V-S with the
minimum - shortest path Cu estimate, add u to S and
relax all - edges leaving u.
20
14
10
10
12
umin
umin
11
40
9Relaxation
// Relax (u,v) IF Cv gt Cu weight(u,v) THEN
Cv Cu weight(u,v) prevv
u ENDIF
c(u)8 c(v)14 weight(u,v)3 83 11lt
14 ?c(v)11 prev(v)u
14
8
u
v
11
10Dijkstras algorithm
function Dijkstra(Ggraph, v_src, v_dst) 2
FOR each vertex v IN VG DO
// Initialization 3 Cv ? 4
previousv undefined 5 Cv_src 0 6
S ? // Set of processed vertices
(empty so far) 7 Q VG // Set of all
vertices of G 8 WHILE (u ! v_dst) 9
DO u Extract_Min_C(Q) // Get vertex u with
min Cu 10 S S ? u // Add
vertex u to the set S 11 FOR each edge
(u,v) outgoing from u DO 12 IF
Cv gt Cu weight(u,v) // Relax
(u,v) 13 THEN Cv Cu
weight(u,v) 14 prevv
u
11Dijkstras algorithm Demo
http//www-b2.is.tokushima-u.ac.jp/ikeda/suuri/di
jkstra/DijkstraApp.shtml?demo6
12Result Tokushima ? Ikeda
13Result Suvikatu 19 ? BePop
BePop
Suvikatu
14Navigation in 2-Dimensional space
15Navigation problem
161) Construct graph on regular grid
Edge weight is defined as distance between
vertices of the edge.
172) Find the shortest path from start to dest.
18Surface properties
Weight of edge is defined by properties of the
surface.
19Result Example 2
20Navigation problem 2
21Navigation problem 2
The problem of navigation among obstacles can be
solved in two ways 1) Shortest path in graph 2)
Shortest path in road map
22Configuration space
Work space Configuration space
23Trapezoidal map
Configuration space
Trapezoidal map
24Road map construction
1) One node at the center of each trapezoid 2)
One node at the midlle of eah vertical
extension Connect two nodes iff one node is in
the center of a trapezoid and other node is on
the border of the same trapezoid.
25Road map
Find path in the road map
26Result Example
27Navigation in 3-Dimensional space
28Problem Path finding on the terrain
29Slope obstacles
Slope obstacles ? gt 22?
30Slope calculation
Slope
y(j-1)
x(i-1)
x(i1,j)
z(xi ,yj)
y(j)
y(j)
z(xi-1 ,yj)
y(j1)
x(i-1)
x(i)
Weight depends on gradient of elevation
31Result