如何在节点 (1,0) 和 (2,3) 之间绘制适当的路径?

如何在节点 (1,0) 和 (2,3) 之间绘制适当的路径?
\tikz[auto, thick] {
\node[state] (23) {$2,3$};
\node[state, right=of 23] (33) {$3,3$};
\node[state, below=of 33] (22) {$2,2$};
\node[state, below=of 23] (12) {$1,2$};
\node[state, below=of 22] (11) {$1,1$};
\node[state, below=of 12] (01) {$0,1$};
\node[state, below=of 11] (00) {$0,0$};
\node[state, right=of 00] (10) {$1,0$};
\path (23) edge[->, loop above] node {$(1-\alpha-\delta)$} ()
           edge[->, bend left] node {$\alpha$} (33)
           edge[->, bend right] node {$\delta$} (12)
      (33) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (22)
      (12) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (22)
           edge[->, bend right] node{$\delta$} (01)
      (22) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (11)  
      (01) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (11) 
      (11) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (00)  
      (00) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (10) 
      (10) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (23)                   
;}

在此处输入图片描述

答案1

你能改变状态(1,0)立场吗?

在此处输入图片描述

\documentclass[tikz]{standalone}

\usetikzlibrary{automata, positioning}

\begin{document}

\tikz[auto, thick] {
\node[state] (23) {$2,3$};
\node[state, right=of 23] (33) {$3,3$};
\node[state, below=of 33] (22) {$2,2$};
\node[state, below=of 23] (12) {$1,2$};
\node[state, below=of 22] (11) {$1,1$};
\node[state, below=of 12] (01) {$0,1$};
\node[state, below=of 11] (00) {$0,0$};
\node[state, left=of 00] (10) {$1,0$};
\path (23) edge[->, loop above] node {$(1-\alpha-\delta)$} ()
           edge[->, bend left] node {$\alpha$} (33)
           edge[->, bend right] node {$\delta$} (12)
      (33) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (22)
      (12) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (22)
           edge[->, bend right] node{$\delta$} (01)
      (22) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (11)  
      (01) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (11) 
      (11) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (00)  
      (00) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (10) 
      (10) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, out=150, in=180] node{$\alpha$} (23)                   
;}

\end{document}

答案2

如果不想改变(1,0)节点的位置,可以连接线从(10.south west)(23.west)并指定线的角度和距离,例如out=-135,in=180,distance=4cm

在此处输入图片描述

代码:

\documentclass[tikz]{standalone}

\usetikzlibrary{automata, positioning}

\begin{document}

\tikz[auto, thick] {
\node[state] (23) {$2,3$};
\node[state, right=of 23] (33) {$3,3$};
\node[state, below=of 33] (22) {$2,2$};
\node[state, below=of 23] (12) {$1,2$};
\node[state, below=of 22] (11) {$1,1$};
\node[state, below=of 12] (01) {$0,1$};
\node[state, below=of 11] (00) {$0,0$};
\node[state, right=of 00] (10) {$1,0$};
\path (23) edge[->, loop above] node {$(1-\alpha-\delta)$} ()
           edge[->, bend left] node {$\alpha$} (33)
           edge[->, bend right] node {$\delta$} (12)
      (33) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (22)
      (12) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (22)
           edge[->, bend right] node{$\delta$} (01)
      (22) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (11)  
      (01) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (11) 
      (11) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\delta$} (00)  
      (00) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
           edge[->, bend left] node{$\alpha$} (10) 
      (10) edge[->, loop above] node{$(1-\alpha-\delta)$} ()
      (10.south west)
           edge[->,red,out=-135,in=180,distance=4cm] node{$\alpha$} (23.west)     ;}

\end{document}

相关内容