1DIJKSTRA(1)                 General Commands Manual                DIJKSTRA(1)
2
3
4

NAME

6       dijkstra - single-source distance filter
7

SYNOPSIS

9       dijkstra [ -adp?  ] [ sourcenode file ]
10

DESCRIPTION

12       dijkstra reads a stream of graphs and for each computes the distance of
13       every node from sourcenode.  Edge length is given in the len attribute,
14       and  the  default is 1.  The dist attribute of every node is set to its
15       distance from sourcenode.  If the -p flag is used, the  prev  attribute
16       of each node reachable from sourcenode is set to the name of the previ‐
17       ous node on a shortest path.  The graph attribute maxdist is set to the
18       maximum dist of all nodes in the graph.
19
20       If  the -d flag is used, the graph is treated as directed and only for‐
21       ward edges are used.
22
23       By default, if the graph is disconnected, the dist attribute  of  nodes
24       unreachable  from  sourcenode are left untouched, and maxdist is set to
25       the maximum of any previous value and the largest distance recorded  in
26       this run. On the other hand, if the -a flag is used, the dist attribute
27       of an unreachable node is assigned a  very  large  value,  and  maxdist
28       records   the  maximum  distance  found  in  the  component  containing
29       sourcenode.
30
31       Any number of sourcenode file pairs may be given.  If the last file  is
32       missing, stdin is used.  All output is written to stdout.
33
34       In  a typical application, dist and maxdist can drive a downstream cal‐
35       culation of color or some other attribute.
36

SEE ALSO

38       gvpr(1), gvcolor(1), libgraph(3)
39
40
41
42                                 21 March 2001                     DIJKSTRA(1)
Impressum