title: How to create an edge from a node to a subgraph in Graphviz Dot?
body: <p>I want to create a graph that looks like this, i. e. where an edge goes from the node <code>Manufacturer of means of production</code> to the subgraph with the same name.</p>
  
  <p><a href="https://i.stack.imgur.com/z7eCt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/z7eCt.png" alt="Expected result"></a></p>
  
  <p>I wrote the following code for this:</p>
  
  <pre><code>digraph G {
      rankdir=LR;
      compound=true;
  
      graph [fontname="Liberation Mono"];
      node [fontname="Liberation Mono"];
      edge [fontname="Liberation Mono"];
  
      subgraph cluster0 {
          label="System components";
          mmp [label="Manufacturer of means of production", shape=box];
      }
  
      subgraph cluster1 {
          t1start [label="Start of tact 1", shape=point]
          t1end [label="End of tact 1", shape=point ]
          subgraph cluster1_mmp {
              label="Manufacturer of means of production"
  
              cluster1_1 [label="Node 1", color=white]
  
  
              subgraph cluster1_1_1 {
                  label="Technological cycle 1"
  
                  cluster1_1_1 [label="Node 2", color=white]
              }
              subgraph cluster1_1_2 {
                  label="Technological cycle 2"
  
                  cluster1_1_2 [label="Node 2", color=white]
              }
          }
      }
  
      subgraph cluster2 {
          label="Такт 2"
          t2start [label="Start of tact 2", shape=point]
          t2end [label="End of tact 2", shape=point]
  
      }
      t1end -&gt; t2start
      mmp -&gt; cluster1_1 [ltail=cluster1_mmp]; 
  }
  </code></pre>
  
  <p>If I try to compile this code (<code>"C:\Program Files (x86)\Graphviz2.38\bin\"dot.exe -Tpng -ograph.png graph.dot</code> ), I get the warning <code>Warning: mmp -&gt; cluster1_1: tail not inside tail cluster cluster1_mmp</code>.</p>
  
  <p>How can I fix it and make the edge go to the subgraph?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>Below you can find the image of the expected result -- an edge that goes from a node to a subgraph (subgraph, not a node inside the subgraph). This edge is red in the image below.</p>
  
  <p><a href="https://i.stack.imgur.com/MoZyt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MoZyt.png" alt="Expected result"></a></p>
  
  <p><strong>Update 2</strong>: Changed the code like shown below.</p>
  
  <pre><code>digraph G {
      rankdir=LR;
      compound=true;
  
      graph [fontname="Liberation Mono"];
      node [fontname="Liberation Mono"];
      edge [fontname="Liberation Mono"];
  
      subgraph cluster0 {
          label="System components";
          mmp [label="Manufacturer of means of production", shape=box];
      }
  
      subgraph cluster1 {
          t1start [label="Start of tact 1", shape=point]
          t1end [label="End of tact 1", shape=point ]
          subgraph cluster1_mmp {
              label="Manufacturer of means of production"
  
              testNode [label="Node 1", color=white]
  
              subgraph cluster1_1_1 {
                  label="Technological cycle 1"
  
                  cluster1_1_1 [label="Node 2", color=white]
              }
              subgraph cluster1_1_2 {
                  label="Technological cycle 2"
  
                  cluster1_1_2 [label="Node 2", color=white]
              }
          }
      }
  
      subgraph cluster2 {
          label="Такт 2"
          t2start [label="Start of tact 2", shape=point]
          t2end [label="End of tact 2", shape=point]
  
      }
      t1end -&gt; t2start
      mmp -&gt; cluster1 [ltail=cluster0, lhead=cluster1, label="           "];
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TWMNs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TWMNs.png" alt="Second attempt"></a></p>