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