Now, to bring down the state q3, I have used subgraph cluster, which works. If you try the same subgraph cluster technique for your graph, you may need to try to tweak few times.
digraph finite_state_machine {
rankdir=LR;
ranksep=0.5;
node [shape = point, color=white, fontcolor=white]; start;
node [shape = doublecircle, color=black, fontcolor=black]; q3;
node [shape = circle]; q1;
subgraph cluster0 {
start -> q1;
q1 -> q2 [ label = "a" ];
q2 -> q1 [ label = "a" ];
q1 -> q3 [ label = "b" ];
q2 -> q2 [ label = "b" ];
}
subgraph cluster1 {
q3;
}
q3 -> q2 [ label = "a" ];
q3 -> q1 [ label = "b" ];
}
digraph finite_state_machine {
rankdir=LR;
ranksep=0.5;
node [shape = point, color=white, fontcolor=white]; start;
node [shape = doublecircle, color=black, fontcolor=black]; q3;
node [shape = circle]; q1;
subgraph cluster0 {
start -> q1;
q1 -> q2 [ label = "a" ];
q2 -> q1 [ label = "a" ];
q1 -> q3 [ label = "b" ];
q2 -> q2 [ label = "b" ];
}
subgraph cluster1 {
q3;
}
q3 -> q2 [ label = "a" ];
q3 -> q1 [ label = "b" ];
}