A common technique for layout nodes is to use invisible edges .
In the following example, nodes n1-n8 are located vertically inside the cluster, but the edges are not displayed.
digraph g{ subgraph cluster0 { edge[style=invis]; n1->n2->n3->n4->n5->n6->n7->n8; }
source share