Out-of-the-box tool to ignore certain edges?


is there another way to have dot ignore reflexive edges (i.e. those with same head and tail) other than setting the edge style to 'invis' with gvpr?

I played around a bit with gvpr to see that edges can be filtered, but then the result is placed into a subgraph and the re-composition of the original graph begins.

The invisible edges might have an impact on the graph, thus I would prefer simply ignoring the reflexive edges. Is there anything out there close to an out-of-the-box solution?

Any help appreciated!

Many thanks,

This layout programs

This layout programs basically draw the graph given, without trying to modify it (mostly true). The assumption is that you have done whatever modification you want before hand. (This assumption is fairly important in order to pipeline graphs.) You should be able to use gvpr to get what you want. Have you tried

  gvpr -c 'E[$.head==$.tail]{delete($G,$)}' in.gv

? If this doesn't work, please let me know.

This is really great! Many

This is really great! Many thanks. Today my first time to play around with gvpr, so need to dig deeper in here.

Short follow-up [using Win7]: Pasting the your original code into cmd produces an error saying: 

  • gvpr -c 'E[$.head==$.tail]{delete($G,$)}' ReflexiveEdge.gv
  • gvpr: expected keyword BEGIN/END/N/E...; found ''', line 1

However  replacing ' by " does the trick. I am asking this since running the code in a .bat file, I could not figure out (yet) how to overcome the quote issue other than having gvpr call another file with the code above (without any quotes) invoking the -f flag.

Many thanks again - acknowledging that this question above does not really refer to the great graphviz stuff, but I always bump into this with (g)awk, as well


Right, I forgot you would be

Right, I forgot you would be using the dos shell, which has different quoting conventions than Unix shells. gvpr is nice for one-liners, but you have to make sure the gvpr program given in-line is left untouched by the shell. As you note, you can always put the script into a file and use the -f flag. This avoids any quoting problems.

Recent comments