logo-header

 
 

dijkstra

syntax

  • dijkstra(impedance, F1, F2, nr_destnode)

definition

The dijkstra(impedance, F1, F2, nr_destnode) function applies the dijkstra algorithm to calculate the shortest impedance from a set of origin points to the instance with the shortest distance in a set of destination points.

To apply the dijkstra function, first configure a nodeset (based on the origin and destination points) and a linkset (based on the segments in an arc set, usually with roads). The accessiblity demo shows an example on how to configure these sets and how to apply the dijkstra function.

The dijkstra function requests four arguments:

  1. impedance: a data item with the impedance of the links in the linkset;
  2. F1: index number of the first node of a link set;
  3. F2: index number of the last node of a link set;
  4. nr_destnodeindex number of the destination node in the destination domain.

description

The function results a impedance for the nodes in the nodeset. Use the lookup function to relate these impedances to the origin locations (see example). The dijkstra function als results in a traceback subitem, which van be used to calculate the flow. Use the trace_back function for this purpose. 

The dijkstra function is used to apply the dijkstra algorithm in a undirected graph. All links can be travelled in both directions. Use the dijkstra_directed function for directed graphs.

applies to

impedence is a data item with value type:

  • float32
  • float64

F1, F2 and nr_destnode are data items with value type:

  • uint32

conditions

Attributes impedence, F1 and F2 need to be match with regard to their domain unit.

since version

5.15

example

attribute<m> dist_nodeset (network/NodeSet)
: expr = "dijkstra(dist, F1, F2, nr_DestNode)"
attribute<m> distance (ODomain)
: expr = "dist_nodeset[network/nr_OrgNode]";
dist F1 F2
92.66 8 7
88.72 1 4
190.76 16 15
79.42 2 3
131.01 5 4
63.08 6 7
56.50 9 10
119.52 12 11
220.47 14 15
180.79 18 20
610.39 19 17
18.67 3 0
782.38 4 11
909.26 7 1
688.6 10 3
26.78 11 13
2161.49 13 17
2048.6 15 10
41.71 20 21
137.24 17 20
Table Linkset, nr of rows = 19

nr_destnode
14
6
2
9
Table DDomain, nr of rows = 4

dist_nodeset
98.09
972.34
0
79.43
1061.05
1192.06
0
63.08
155.74
824.54
768.03
1843.44
1962.96
1870.21
0
220.47
411.23
610.39
928.43
0
747.63
789.34
Table Nodeset, nr of rows = 21

distance
0
1962.96
824.54
928.43
1192.06
Table ODomain, nr of rows = 5

see also


OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904



Recent Wiki Changes