9에서 2, 12에서 2로 화살표를 그려야 하지만 다른 노드 주변을 늘리는 데 도움이 필요합니다.
\documentclass{article}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\tikzset{
->, % makes the edges directed
%>=stealth', % makes the arrow heads bold
node distance=3cm, % specifies the minimum distance between two nodes. Change if necessary.
every state/.style={thick, fill=gray!10}, % sets the properties for each 'state' node
initial text=$ $, % sets the text that appears on the start arrow
}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2em]
\node[state, initial, accepting](1){};
\node[state, right=of 1](2){};
\node[state, above right=of 2](3){};
\node[state, right=of 3](4){};
\node[state,right=of 4](5){};
\node[state,right=of 5](6){};
\node[state,right=of 6](7){};
\node[state,right=of 7](8){};
\node[state,accepting,right=of 8](9){};
\node[state, below right =of 2](10){};
\node[state, right =of 10](11){};
\node[state, accepting, right=of 11](12){};
\end{tikzpicture}
\end{figure}
\end{document}
답변1
\documentclass{article}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\tikzset{
->, % makes the edges directed
>=stealth', % makes the arrow heads bold
node distance=3cm, % specifies the minimum distance between two nodes. Change if necessary.
every state/.style={thick, fill=gray!10}, % sets the properties for each 'state' node
initial text=$ $, % sets the text that appears on the start arrow
}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2em]
\node[state, initial, accepting](1){};
\node[state, right=of 1](2){};
\node[state, above right=of 2](3){};
\node[state, right=of 3](4){};
\node[state,right=of 4](5){};
\node[state,right=of 5](6){};
\node[state,right=of 6](7){};
\node[state,right=of 7](8){};
\node[state,accepting,right=of 8](9){};
\node[state, below right =of 2](10){};
\node[state, right =of 10](11){};
\node[state, accepting, right=of 11](12){};
\draw (9) to[out=-135,in=5,looseness=0.6] (2);
\draw (12) to[out=135,in=-5,looseness=0.6] (2);
\end{tikzpicture}
\end{figure}
\end{document}