Graphviz Issue Tracker - graphviz
View Issue Details
0002599graphvizFdppublic2016-05-18 03:252016-05-19 00:17 
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 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 -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
? simple-clusters_2.38.svg (2,623) 2016-05-19 00:02
? simple-clusters_2.20.svg (2,584) 2016-05-19 00:17
Issue History
2016-05-18 Issue
2016-05-18 Added: simple-clusters.svg
2016-05-19 Added: simple-clusters_2.38.svg
2016-05-19 Added: 0001056
2016-05-19 Added: simple-clusters_2.20.svg

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"