25 lines
682 B
TeX
25 lines
682 B
TeX
\documentclass{standalone}
|
|
\usepackage{tikz}
|
|
|
|
\usetikzlibrary{automata,arrows,positioning}
|
|
\usetikzlibrary{arrows.meta,chains,shapes.geometric}
|
|
\usetikzlibrary{decorations.pathreplacing}
|
|
|
|
\begin{document}
|
|
|
|
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
|
|
\node[state,initial] (q_a) {$q_a$};
|
|
\node[state,accepting] (q_b) [right=of q_a] {$q_b$};
|
|
\path[->]
|
|
(q_a) edge [loop above] node {a} ()
|
|
|
|
(q_0) edge node {0} (q_1)
|
|
edge node [swap] {1} (q_2)
|
|
(q_1) edge node {1} (q_3)
|
|
edge [loop above] node {0} ()
|
|
(q_2) edge node [swap] {0} (q_3)
|
|
edge [loop below] node {1} ();
|
|
\end{tikzpicture}
|
|
|
|
\end{document}
|