DIJKSTRA(1)
π DIJKSTRA(1) π β the single-source distance filter, bestie edition
okay so real talk: this is a page from the General Commands Manual, and the star of the show is dijkstra, a single-source distance filter for Graphviz. She's giving main character energy and she is so good at her job. Let's get into it. β¨
πΈ NAME πΈ
dijkstra β single-source distance filter for Graphviz π
π SYNOPSIS π
dijkstra [ -adp? ] [ sourcenode file ]
π¦ DESCRIPTION π¦
dijkstra reads a stream of Graphviz formatted graphs, and for each one she computes the distance of every single node from sourcenode. No node left behind, periodt. π
Edge length? That lives in the len attribute, and if you don't say anything, the default is 1. Then the dist attribute of every node gets set to its distance from sourcenode. Iconic behavior, honestly.
If the -p flag is in the chat, the prev attribute of each node reachable from sourcenode gets set to the name of the previous node on a shortest path. Like, the receipts of how you got there. π«Ά
And the graph attribute maxdist gets set to the maximum dist of all nodes in the graph. She's keeping score. π
If the -d flag is used, the graph is treated as directed and only forward edges are used. One-way streets only, bestie. π¦
Now here's the part where the drama lives β what happens when the graph is disconnected:
- By default, the
distattribute of nodes that are unreachable from sourcenode is left untouched (no touchy π), andmaxdistis set to the maximum of any previous value and the largest distance recorded in this run. - But if you use the
-aflag, thedistattribute of an unreachable node gets assigned a very large value, andmaxdistrecords the maximum distance found in the component containing sourcenode. So she stops ignoring the stragglers and starts pointing at them dramatically. π
Any number of sourcenode file pairs may be given. Yes, ANY number. Go off. π If the last file is missing, stdin is used. And all output is written to stdout β every bit of it, no cap. π―
In a typical application, dist and maxdist can drive a downstream calculation of color or some other attribute. So she's out here setting the whole vibe for your graph's aesthetic. π
π SEE ALSO π
gvpr(1), gvcolor(1), libgraph(3)
okay and for the cute sign-off: this little baddie comes to you from the General Commands Manual, dated 21 March 2001 β yes, she's an elder icon and she ate that. π β¨ π¦
π¦ where this page comes from
- alpine 3.22: graphviz-doc 12.2.1-r0 Β· EPL-1.0
- alpine 3.23: graphviz-doc 12.2.1-r0 Β· EPL-1.0
- alpine 3.24: graphviz-doc 12.2.1-r3 Β· EPL-1.0
- arch rolling: graphviz 16.1.0-2 Β· EPL
- fedora 43: graphviz 13.1.1-3.fc43 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 43: graphviz 13.1.1-3.fc43 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 43: graphviz 13.1.2-3.fc43 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 43: graphviz 13.1.2-3.fc43 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 44: graphviz 14.1.2-2.fc44 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 44: graphviz 14.1.2-2.fc44 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 44: graphviz 14.1.4-2.fc44 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- fedora 44: graphviz 14.1.4-2.fc44 Β· epl-1.0 AND cpl-1.0 AND bsd-3-clause AND mit AND gpl-3.0-or-later WITH bison-exception-2.2 AND apache-1.1 AND lgpl-2.0-or-later WITH libtool-exception AND smlnj AND hpnd-uc
- nixos 26.05: graphviz 12.2.1
- nixpkgs unstable: graphviz 15.1.1
- opensuse-leap 16.0: graphviz 12.2.1-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: graphviz 12.2.1-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: graphviz 12.2.1-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: graphviz 12.2.1-160000.1.1 Β· EPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms