Search code examples
python-3.xgraphvizdotpygraphviz

dot graph graphviz - Produce graph for nearest x branches from selected node


I am working with huge generated .dot graph file (not generated by me but by an application). Is it possible using graphviz to generate the graph showing only the nearest x branches to a node. This will make the graph more comprehensible instead of an extremely large mess.


Solution

  • There is a GVPR program named knbhd that seems to do what you want. On my Linux (fedora) system I found it here: /usr/share/graphviz/gvpr/knbhd.
    It seemed to work with this commandline:

     X=5; node="yournodename" 
     gvpr -a $X -a $node -f /usr/share/graphviz/gvpr/knbhd   yourfile.gv