答案1
有很多示例与你正在寻找的非常相似。下面是一个在节点内部命名状态的示例。
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta,automata}
\begin{document}
\begin{tikzpicture}[->,>=Stealth,shorten >=1pt,auto,node distance=3cm,semithick]
\tikzset{every state/.style={draw=black,text=black}}
\node[state] (0) {A};
\node[state] (1) [right of=0] {B};
\path (0) edge [loop left] node {a} (0)
edge [bend left] node {a} (1)
(1) edge [loop right] node {b} (1)
edge [bend left] node {b} (0);
\end{tikzpicture}
\end{document}
如果您希望您的状态是点,那就这么做吧!
\begin{tikzpicture}[->,>=Stealth,auto,shorten >=1pt,node distance=3cm,semithick]
\tikzset{
mystate/.style={fill=black,circle,inner sep=0pt,minimum width=4pt},
myloopleft/.style={out=-140,in=140,looseness=20},
myloopright/.style={out=40,in=-40,looseness=20}}
\node[mystate,label={above:A}] (0) {};
\node[mystate,label={above:B}] (1) [right of=0] {};
\path (0) edge [myloopleft] node {a} (0)
edge [bend left] node {a} (1)
(1) edge [myloopright] node {b} (1)
edge [bend left] node {b} (0);
\end{tikzpicture}