Concentrate suggestion

Just a suggestion to expand the capabilities of the concentrate attribute. I’ve been using GraphViz for about 2 years on a single project. My graph has several hundred nodes and most nodes have at least 2 edges, and there are many parallel edges. I’d like to use the concentrate option, but it’s too aggressive. I’d like concentrate to only combine edges when the edges have the same color and arrowhead, because they have meaning. In this example, b should have 2 edges, because the arrowheads are different; c should have its own edge because it’s a different color than d and e; d and e can concentrate and edge, because they’re the same color and going to the name node, but I can still specify different arrowheads. In my limited testing, it also seems concentrate only works when one of the edges has a label; I’m not sure why that’s necessary.

digraph {
a → b [arrowhead=box]
a → c [arrowhead=dot; color=“orange”]
a → d [arrowhead=box]
a → e
a → g [label=“1”]
1 → b [arrowhead=dot]


Maybe we can create a per-edge attribute to enable concentrators, or a way of specifying sets of edges that are candidates to be concentrated.

I’m concerned whether we may be expanding the space of attributes too much as storing a value per object incurs a cost (in this case per edge) unless we have developed an efficient way to store flags on graph objects.

I’m probably not comfortable with hard coding the semantics of what edges can be considered in the same class for making concentrators. Maybe it could be done in a gvpr script instead (or someone should start to work on a similar graph processor in python.)

I think you are right about the need for the label. I assume that a label is treated internally similar to a node and hence the existence of the extra space for the label node makes it possible/meaningful to combine/concentrate the lines as there is an internal “rank”. I think that there is some room for improvement by adding that rank more purposefully. I fear however, that the decision of whether to combine or not is a hard problem and a good strategy would be needed.