答案1
这是一个tikz-cd
解决方案
\documentclass{article}
\usepackage{tikz-cd}
\newcommand{\e}{\varepsilon}
\begin{document}
\begin{tikzcd}[column sep=1.5cm, cells={nodes={draw, circle, inner sep=.5mm}}]
|[draw=none]|\arrow[r] & q_0\arrow[r,"{a,\e\to a}"] & q_1\arrow[r,"{\e,\e\to\e}"]\arrow[<-,loop above,"{a,\e\to a}"]
& q_2\arrow[r,"{\e,\e\to\e}"]\arrow[<-,loop above,"{b,\e\to\e}"] & q_3\arrow[r,"{c,a\to\e}"]
& q_4\arrow[r,"{c,\e\to\e}"] & |[double]|q_5\arrow[ll, bend right,"{\e,\e\to\e}"']
\end{tikzcd}
\end{document}