title: How do I create clusters in dot?
body: <p>Suppose, I want to make a subcluster between a few nodes in a graph (to somehow denote that these nodes go together for one reason or another for example):</p>
  
  <pre><code>digraph G {
    A [group=g1]
    {rank = same; B[group=g2]; C[group=g3]}
    D [group=g1]
    {rank = same; E[group=g2]; F[group=g3]}
  
    A -&gt; B [label="2", weight=2]
    A -&gt; C [label="0", style=dashed, weight=2]
    B -&gt; C [label="0", style=dashed, weight=2]
    B -&gt; D [label="2", style=dashed, weight=2]
    C -&gt; D [label="0", weight=2]
    D -&gt; E [label="1", style=dashed, weight=2]
    D -&gt; F [label="0", weight=2]
    E -&gt; F [label="0", weight=2]
    F -&gt; A
  
    edge[style=invis];
    A -&gt; D
    B -&gt; E
    C -&gt; F
  
    subgraph cluster_0 {
      label = "I want this in its own sub-square"
      B-&gt;E
      B-&gt;Asti
  
      style=filled;
      color=lightgrey;
      node [style=filled,color=white];
      edge[style=invis];
    }
  
  }
  </code></pre>
  
  <p>As you can see, I'm only partially successful. That is, <code>asti</code> is in its own greyed-out cluster but the nodes <code>B</code> and <code>E</code> are not. </p>
  
  <p>Can someone please point out how do I place all three nodes <code>E</code>, <code>B</code> and <code>asti</code> in that greyed-out cluster?</p>
  
  <p>Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/tVV8o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tVV8o.png" alt="enter image description here"></a></p>