If the -d flag is used, the graph is treated as directed and only forward edges are used.
By default, if the graph is disconnected, the dist attribute of nodes unreachable from sourcenode are left untouched, and maxdist is set to the maximum of any previous value and the largest distance recorded in this run. On the other hand, if the -a flag is used, the dist attribute of an unreachable node is assigned a very large value, and maxdist records the maximum distance found in the component containing sourcenode.
Any number of sourcenode file pairs may be given. If the last file is missing, stdin is used. All output is written to stdout.
In a typical application, dist and maxdist can drive a downstream calculation of color or some other attribute.