I want to draw an automata in TikZ, and I have the following code segment:
\usepackage{tikz}
\usetikzlibrary{automata,arrows}
\begin{document}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=5 cm, scale = 1, transform shape]
\node[initial,state] (B) {$B$};
\node[state] (AB) [below of=B] {$A,B$};
\node[state] (ABD) [right of=AB] {$A,B,D$};
\node[state,accepting] (BC) [right of=B] {$B,C$};
\node[state,accepting] (ABCD) [right of=BC] {$A,B,C,D$};
\path[->] (B) edge [above] node [align=center] {$a$} (BC)
(B) edge [left] node [align=center] {$b$} (AB)
(AB) edge [left] node [align=center] {$a$} (BC)
(AB) edge [above] node [align=center] {$b$} (ABD)
(BC) edge [loop above] node [align=center] {$a$} (BC)
(BC) edge [above] node [align=center] {$b$} (ABCD)
(ABD) edge [right] node [align=center] {$a$} (BC)
(ABD) edge [loop below] node [align=center] {$b$} (ABD)
(ABCD) edge [below] node [align=center] {$a$} (BC)
(ABCD) edge [loop above] node [align=center] {$b$} (ABCD);
\end{tikzpicture}
\end{document}
Now, I have two problems with the output of this one, first of all at the initial state it has the arrow and additionally it writes start
, how can I remove that start
text? Secondly, As can be seen I have parallel edges, like:
(BC) edge [above] node [align=center] {$b$} (ABCD)
(ABCD) edge [below] node [align=center] {$a$} (BC)
But when they are drawn it looks like one thick line, how can I give some space between them so that it is clear that I have parallel connection?