I'm trying to draw a finite state diagram with Graphviz but I cannot get it like I want it. Here's what I have written so far :
digraph G {
rankdir = LR;
subgraph cluster_op1 {
subgraph cluster_0 {
1 -> 2 [label="a"]
}
subgraph cluster_1 {
3 -> {4 6} [label="ε"]
4 -> 5 [label="b"]
5 -> 4 [label="ε"]
5 -> 6 [label="ε"]
}
subgraph cluster_2 {
7 -> {8 10} [label="ε"]
8 -> 9 [label="c"]
9 -> 8 [label="ε"]
9 -> 10 [label="ε"]
}
2 -> 3 [label="ε"]
6 -> 7 [label="ε"]
}
subgraph cluster_op2 {
subgraph cluster_3 {
11 -> {12 14} [label="ε"]
12 -> 13 [label="ab"]
13 -> 12 [label="ε"]
13 -> 14 [label="ε"]
}
subgraph cluster_4 {
15 -> 16 [label="c"]
}
14->15 [label="ε"]
}
0 -> {1 11} [label="ε"]
{10 16} -> 17 [label="ε"]
}
What I want is :
- All the nodes within
cluster_op1
to be aligned horizontally (same forcluster_op2
) cluster_op2
to be centered belowcluster_op1
- The edges from node
0
tocluster_op1
andcluster_op2
to be the same length (same for the edges from those two clusters to node17
)