I have an input file with about ~5000 lines and 1 to 9 nodes per line.
Many edges are not unique and I would like to only show the unique ones.
A more simple example.
graph {
a -- b
a -- b
a -- b
}
Yields
Is there a way to make the above graph yield something like
I know I could change the sample input to
graph {
a -- b
}
But it would not be easy to do that for my real input.
There actually is a way: Use the strict
keyword:
strict graph G {
a -- b [label="First"];
a -- b [label="Second"];
a -- b [label="Third"];
}
Result:
Without strict
, all three edges would be shown. Note that it only takes the first edge's attributes, contrary to what the documentation suggests.
Try strict
:
strict graph {
a -- b
a -- b
a -- b
}
This yields
and should work for any size of graph.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With