dijkstra
- Details
- Last Updated on Monday, 28 January 2013 16:30
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:
- impedance: a data item with the impedance of the links in the linkset;
- F1: index number of the first node of a link set;
- F2: index number of the last node of a link set;
- nr_destnode: index 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 |
| nr_destnode |
| 14 |
| 6 |
| 2 |
| 9 |
| 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 |
| distance |
| 0 |
| 1962.96 |
| 824.54 |
| 928.43 |
| 1192.06 |