Graphviz Issue Tracker - graphviz
View Issue Details
0002599graphvizFdppublic2016-05-18 03:252016-05-19 00:17
bo.at.graphviz 
 
normalnormalalways
newopen 
dot - graphviz version 2.36.0 (20140111.2315)
0002599: fdp produces very stretched clusters for pinned nodes
fdp can produce very stretched layout for pinned nodes in clusters (subgraphs). Removing pin=true (or changing to pin=false) makes the issue disappear. Removing edges outside clusters makes the issue disappear. The stretching seems to be exponential in K (spring length).
1. Create a simple-clusters.dot file with the following content:

graph clusters {
  graph [K=4];

  subgraph cluster_a {
    a [pos="0,0", pin=true];
    a1 [pos="0,1", pin=true];
  }

  subgraph cluster_b {
    b [pos="0,0", pin=true];
    b1 [pos="0,1", pin=true];
  }

  a -- b;
  c -- a;
}

2. Run the following command

dot -Kfdp -Tsvg simple-clusters.dot -o/tmp/simple-clusters.svg

3. See the resulting simple-clusters.svg file and observe how large cluster_a has become (over 3000 pixels).
If you remove pin=true, the result is much more sensible, but nodes within clusters are moved. If you remove edge c--a; the layout is quite compact. Setting K=1 reduces the blowup for cluster_a. For K=1 the height of cluster_a is 293 pixels, for K=2 it is 677. For K=3 it is 2510, etc.
No tags attached.
? simple-clusters.svg (2,604) 2016-05-18 03:25
http://www.graphviz.org/mantisbt/file_download.php?file_id=507&type=bug
? simple-clusters_2.38.svg (2,623) 2016-05-19 00:02
http://www.graphviz.org/mantisbt/file_download.php?file_id=508&type=bug
? simple-clusters_2.20.svg (2,584) 2016-05-19 00:17
http://www.graphviz.org/mantisbt/file_download.php?file_id=509&type=bug
Issue History
2016-05-18 03:25bo.at.graphvizNew Issue
2016-05-18 03:25bo.at.graphvizFile Added: simple-clusters.svg
2016-05-19 00:02bo.at.graphvizFile Added: simple-clusters_2.38.svg
2016-05-19 00:06bo.at.graphvizNote Added: 0001056
2016-05-19 00:17bo.at.graphvizFile Added: simple-clusters_2.20.svg

Notes
(0001056)
bo.at.graphviz   
2016-05-19 00:06   
Version 2.38 produced taller but narrower graph: width="1029pt" height="4237pt". With version 2.36 I got width="2356pt" height="3548pt".
With version 2.20 I got width="245pt" height="861pt"