title: Graphviz: How to get fixed node positions
body: <p>I am quite new to Graphviz, sorry if my question is too naif.</p>
  
  <p>In dot, I am trying to have several images of graphs, with nodes in a fix position, but with different arcs. However, even a minor modification in the arc configuration, makes a huge difference in the layout. I found some workarounds (by keeping certain hedges as invisible, or by using "back" option). However, I am wondering if there is a more elegant way to avoid situations like this, where the only modification of one arc direction gives a totally different layout.</p>
  
  <p>For example, see this:</p>
  
  <pre><code>digraph exempleUPFM {
  label=mylab;
  ratio = 0.5;
  spline = line; forcelabels=true;
  node [shape = circle;style=filled; color=lightgrey;];
  1 [xlabel="10" fontcolor= blue group=g1];
  4 [xlabel="-6" fontcolor= red group=g1];
  2 [xlabel="4" fontcolor= blue group=g2];
  5 [xlabel="-8" fontcolor= red group=g2];
  node [shape = circle; style=""]
  {rank=same; 1 2}
  {rank=same; 4 5}
  1 -&gt; 2 [label=" 1"]
  1 -&gt; 3 [label=" 8"]
  1 -&gt; 4 [label=" 1"]
  2 -&gt; 3 [label=" 2"]
  3 -&gt; 4 [label=" 1"]
  3 -&gt; 5 [label=" 4"]
  4 -&gt; 5 [label=" 12"]
  5 -&gt; 2 [label=" -7"]
  }
  </code></pre>
  
  <p>or this</p>
  
  <pre><code>digraph exemple2UPFM {
  label=mylab;
  ratio = 0.5;
  spline = line; forcelabels=true;
  node [shape = circle;style=filled; color=lightgrey;];
  1 [xlabel="10" fontcolor= blue group=g1];
  4 [xlabel="-6" fontcolor= red group=g1];
  2 [xlabel="4" fontcolor= blue group=g2];
  5 [xlabel="-8" fontcolor= red group=g2];
  node [shape = circle; style=""];
  {rank=same; 1 2}
  {rank=same; 4 5}
  1 -&gt; 2 [label=" 1"]
  1 -&gt; 3 [label=" 8"]
  1 -&gt; 4 [label=" 1"]
  2 -&gt; 3 [label=" 2"]
  3 -&gt; 4 [label=" 1"]
  3 -&gt; 5 [label=" 4"]
  5 -&gt; 4 [label="-12"]
  5 -&gt; 2 [label=" -7"]
  }
  </code></pre>
  
  <p>In this specific case, the only difference is the direction of arc between 5 and 4. But the difference in the graph layout is brutal. In the second example, if I keep the arc 4 -> 5 and I add the "back" option, the layout comes back to the original.</p>
  
  <p>Do you have any clue why this, and if there is a way to avoid the position of the nodes to change at any minimum arc modification?</p>
  
  <p>Thank you very much for your help.</p>