2

I am trying to draw the following figure using tikz. (Apologies for the rough sketch.)

enter image description here

This is how far I have gotten:

\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}

enter image description here

I am not able to get a neat curve. The curve must look as if it is a part of a circle. Also I do not know how to place arraw head in the midway of the curved path. What is a good way to draw this?

Sâu
  • 421

1 Answers1

4

do you like the following graph?

enter image description here

\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}
Zarko
  • 296,517
  • @SoumyaSambeetMohapatra, if you liked answer and if it solve your problem, you can vote and even accept it :-) – Zarko Sep 20 '17 at 00:02
  • Apologies, I was just waiting for few more answers before I could accept it. – Sâu Sep 22 '17 at 12:03