Debian Codegraph @

cmd/tools/dijkstra.1

raw
1 .TH DIJKSTRA 1 "21 March 2001"
2 .SH NAME
3 dijkstra \- single-source distance filter for Graphviz
4 .SH SYNOPSIS
5 .B dijkstra
6 [
7 .B \-adp?
8 ]
9 [
10 .I sourcenode file
11 ]
12 .SH DESCRIPTION
13 .B dijkstra
14 reads a stream of Graphviz formatted graphs and for each computes the distance of every node from
15 .I sourcenode.
16 Edge length is given in the
17 .I len
18 attribute, and the default is 1. The
19 .I dist
20 attribute of every node is set to its distance from
21 .I sourcenode.
22 If the \fB\-p\fP flag is used, the
23 .I prev
24 attribute of each node reachable from
25 .I sourcenode
26 is set to the name of the previous node on a shortest path.
27 The graph attribute
28 .I maxdist
29 is set to the maximum
30 .I dist
31 of all nodes in the graph.
32 .P
33 If the \fB\-d\fP flag is used, the graph is treated as directed and
34 only forward edges are used.
35 .P
36 By default, if the graph is disconnected, the
37 .I dist
38 attribute of nodes unreachable from
39 .I sourcenode
40 are left untouched, and
41 .I maxdist
42 is set to the maximum of any previous value and the largest
43 distance recorded in this run. On the other hand, if
44 the \fB\-a\fP flag is used, the
45 .I dist
46 attribute of an unreachable node is assigned a very large value,
47 and
48 .I maxdist
49 records the maximum distance found in the component containing
50 .I sourcenode.
51 .P
52 Any number of
53 .I sourcenode file
54 pairs may be given.
55 If the last
56 .I file
57 is missing, \fBstdin\fP is used.
58 All output is written to \fBstdout\fP.
59 .P
60 In a typical application,
61 .I dist
62 and
63 .I maxdist
64 can drive a downstream calculation of color or some other attribute.
65 .SH "SEE ALSO"
66 gvpr(1), gvcolor(1), libgraph(3)