绘制以下图表的正确方法是什么

绘制以下图表的正确方法是什么

我正在尝试使用 tikz 绘制下图。 (抱歉,草图太粗糙。)

在此处输入图片描述

这是我目前取得的进展:

\begin{document}
\begin{circuitikz}
\coordinate (o) at (2.5,-1); 
\draw (1,3)--(4,3) (4,3)--(4,0) (4,0)--(1,0) (1,0)--(1,3) (4,3)--(1,0);
\draw [-stealth](2,3)--(2.75,3);
\draw [-stealth](3,0)--(2.5,0);
\draw [-stealth](4,1)--(4,1.75); 
\draw [-stealth](1,2)--(1,1.5);
\draw [-stealth](3,2)--(2.5,1.5);
\node at (2.5,3.2) {1};
\node at (2.5,1.8) {2};
\node at (2.5,0.2) {3};
\node at (0.8,1.5) {4};
\node at (4.2,1.5) {5};
\draw (1,3) to [out=225,in=180] (2.5,-1.5);
\end{circuitikz}
\end{document}

在此处输入图片描述

我无法得到一条整齐的曲线。曲线必须看起来像是圆的一部分。另外,我不知道如何将箭头置于曲线路径的中间。有什么好方法可以绘制它?

答案1

你喜欢下面的图表吗?

在此处输入图片描述

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, automata,
                calc,
                decorations.markings,
                positioning,
                quotes}


\begin{document}
    \begin{tikzpicture}[
    node distance = 22mm and 33mm,
     state/.style = {circle, draw=cyan, fill=cyan!20,
            inner sep=1mm, outer sep=0mm},
every edge quotes/.style = {font=\footnotesize, auto},
every edge/.style = {decoration={markings, mark=at position .5 with {\arrow[cyan!60!black]{Stealth}}},
            draw=cyan!80!black, semithick,
            postaction={decorate}},
                        ]
    \begin{scope}[every node/.style={state}]
\node (n1)          {1};
\node (n2)  [right=of n1]   {2};
\node (n3)  [below=of n1]   {3};
\node (n4)  [right=of n3]   {4};
\node (n0)  [below=of $(n3)!.5!(n4)$]   {0};
    \end{scope}
\draw   (n1) edge ["1"] (n2)
        (n1) edge ["4"] (n3)
        (n1) edge [bend right=60,"6" '] (n0)
        (n2) edge ["2"] (n3)
        (n2) edge [bend  left=60,"7"]   (n0)
        (n3) edge [bend right,"8"]      (n0)
        (n4) edge ["5"] (n2)
        (n4) edge ["3"] (n3)
        (n4) edge [bend  left,"9" ']    (n0)
        ;
    \end{tikzpicture}
\end{document}

相关内容