[Tex/LaTex] Which package can be used to draw automata

automatadiagramspackages

I'm looking for a LaTeX package which helps drawing automata problems. I googled and found A package for drawing automata and graphs (Version 0.4). But I'm not sure is this package a standard one, or there are some better alternatives. Any suggestion?

Best Answer

TiKZ has a whole library for drawing automata:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] 
   \node[state,initial] (q_0)   {$q_0$}; 
   \node[state] (q_1) [above right=of q_0] {$q_1$}; 
   \node[state] (q_2) [below right=of q_0] {$q_2$}; 
   \node[state,accepting](q_3) [below right=of q_1] {$q_3$};
    \path[->] 
    (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}  

output of code