Adding particular edges in cluster makes the layout larger for no apparent reason

Hi,

digraph{
  graph[bgcolor="#bbbbbb"]
  nodesep=0.5
  splines=line
  margin=0
  node[shape=rect width=1]
  {node[style=filled fillcolor="#898989"] a1 b1 b3}
  subgraph cluster{  
      bgcolor="#ff2222"
    {rank=same a1 b1}
    {rank=same a2 b2}
    b2 -> b3
    a1 -> a2 
    { 
      a1 -> b1
      a2 -> b2
      a1:e -> b2:w[constraint=false]
      a2:e -> b1:w[constraint=false]
     // a1:e -> b3:w[constraint=false]      
    }  
  }  
}

greygood

I commented the last line on purpose to show the problem.
Adding an edge between a1 and b3 makes the cluster wider.
this gap is a function of the nodesep attribute (respectively 0.5 ,1, 2, 3).

grey0.51
grey-1
grey-2

Without cluster we have (nodesep 0.5 and 3)

ng0.53
ng3

If we set splines=true Then we have for nodesep =3

Maybe it’s related…I don’t know
Anyway, Is it a bug or we can reduce the width of the cluster?

Thanks

Hi,
No clue here? I really don’t understand the behavior.

Crossing avoidance unexpected behavior? Lack of coordination/optimization between topological and geometric optimization phases? Sorry.

Thanks for your feedback.

At least now we know it’s not related to the way I wrote the digraph
and there is an axis of improvement for graphviz.

That’s a kind way to put it.

Sometimes increasing mclimit helps, but this example is so simple, I doubt anything will help much.