title: Draw doubly linked list using graphviz
body: <p>I've drawn a doubly-linked list using Graphviz (dot) as follows but the nodes are not aligned. How can I align the nodes?</p>
  <pre><code>digraph &quot;Doubly Linked List&quot; {
          rankdir=LR;
          node [shape=record];
          e [label=&quot;nil&quot; shape=circle];
          a [label=&quot;{ &lt;ref1&gt; | &lt;data&gt; 1 | &lt;ref2&gt;  }&quot;]
          b [label=&quot;{ &lt;ref1&gt; | &lt;data&gt; 5 | &lt;ref2&gt;  }&quot;];
          c [label=&quot;{ &lt;ref1&gt; | &lt;data&gt; 7 | &lt;ref2&gt;  }&quot;];
          d [label=&quot;nil&quot; shape=circle];
          e -&gt; a:ref1:c      [arrowhead=dot, arrowtail=vee, dir=both, headclip=false];
          a:ref2:c -&gt; b:data:n [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
          b:ref2:c -&gt; c:data:n [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
          c:ref2:c -&gt; d      [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
          c:ref1:c -&gt; b:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
          b:ref1:c -&gt; a:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/78rq2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/78rq2.png" alt="enter image description here" /></a></p>