logo-header

 
 

dijkstra OD

syntax

dijkstra_od(link_impedance, link_node1_rel, lin_node2_rel, originloc_node_rel, originloc_impedance, originloc_origin_rel, destloc_node, destloc_impedance, destloc_dest_rel)

or

dijkstra_od_maxdist(link_impedancelink_node1_rellin_node2_reloriginloc_node_reloriginloc_impedanceoriginloc_origin_rel, destloc_nodedestloc_impedance, destloc_dest_relorigin_impedance_max )

with:

  1. link_impedance: a data item with the impedance of the links of a linkset;
  2. link_node1_rel: index number of the first node of a link set;
  3. link_node2_rel: index number of the last node of a link set;
  4. originloc_node_rel: index number of the origin nodes;
  5. originloc_impedance: start impedance for each origin, from the startpoint to the startnode;
  6. originloc_origin_rel: index number of each origin;
  7. destloc_node: index number of the destination node;
  8. destloc_impedance: end impedance for each destination, from the endnode to the end point;
  9. destloc_dest_rel: index number of each destination;
  10. origin_impedance_max: maximum distance for the resulting sparse matrix of od_pairs

description

The dijkstra_od function applies the dijkstra algorithm to calculate the shortest network impedance from a set of origin points to a set of destination points.The result is an O(rigin) D(estination) matrix, in DutchHerkomst/Bestemmingsmatrix.

To apply any 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).

This variant of the dijkstra function results in a new domain unit with a subitem called Impedance. This subitem indicates the impedance from each origin point towards each destination point. The values unit of this item is the same as the values unit of the three impedance arguments. The cardinality of the new domain unit is the product of the cardinality of the origin and destination domain units.

The index numbers of the origin(originn_nr)  and destination(destination_nr) domains can be configured with the expressions presented in the example. 

applies to

impedance_link, impedance_origin and impedance_destination are data items with value type:

  • float32
  • float64

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

  • uint32

conditions:

  • Attributes impedance_link, F1 and F2 need to be match with regard to their domain unit.
  • Attributes nr_originnode, impedance_origin and indexnumber_origin need to be match with regard to their domain unit.
  • Attributes nr_destnode, impedance_destination and indexnumber_destination need to be match with regard to their domain unit.
  • Attributes impedance_link, impedance_origin and impedance_destination need to be match with regard to their values unit.

since version

5.95

example

unit<uint32> OD:
expr = "dijkstra(dist, F1, F2
,nr_OrgNode, const(0, ODomain, m), id(ODomain)
,nr_DestNode,const(0, DDomain, m), id(DDomain))"
{
attribute<ODomain> originn_nr:    expr = "id(OD) / #DDomain";
attribute<DDomain> destination_nr: expr = "mod(id(OD), #DDomain)";
}

 

distF1F2
713.44910
907.3303
1913.96319
1907.311926
......
......
Table Linkset, nr of rows = 34

 

nr_orgnode
22
17
14
29
8
Table ODomain, nr of rows = 5

 

nr_destnode
22
13
6
30
Table DDomain, nr of rows = 4

 

Impedanceorigin_nrdestination_nr
000
5093.2801
5596.2402
541003
5896.1410
1383.1711
5272.8312
5086.3913
4901.6920
3775.2121
1393.922
4091.9423
6181.5730
5055.0931
5558.2632
1457.733
5956.0340
1443.0541
5332.7142
5146.2743
Table OD, nr of rows = 20

see also

Last Updated on Friday, 20 April 2012 13:50  

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