4

I wish to add dotted line connecting two nodes and an arc line as described in the photo. enter image description here

Here is my code:

\documentclass[tikz]{standalone}
\usetikzlibrary{
    shapes.geometric,
    positioning,
    fit,
    calc
}
\usepackage{tikz}
\begin{document}

\tikzset{
 block/.style = {circle, draw,
    text width=1em,align=center,inner sep=0pt},
  line/.style = {draw,thick,->},
}
\begin{tikzpicture}
\node [block] (s1) {1};
\node [block, below = of s1](s2){2};
\path [line] (s1) -- node [right] {b} (s2);
\end{tikzpicture}
\end{document} 
0
5

How about

screenshot

I've used the calc library to shift the a path to the left a bit.

\documentclass[tikz]{standalone}
\usetikzlibrary{
    positioning,
    calc
}
\usepackage{tikz}
\begin{document}

\tikzset{
 block/.style = {circle, draw,
    text width=1em,align=center,inner sep=0pt},
  line/.style = {draw,thick,->},
}
\begin{tikzpicture}
\node [block] (s1) {1};
\node [block, below = of s1](s2){2};
\path [line] (s1) -- node [right] {b} (s2);
\draw[dashed,->]  (s1.west) to[bend right=30] (s2);
\draw[->]  ($(s1.west)+(-1,0)$) to[bend right=30] node[left,block]{a}($(s2)+(-1,0)$);
\end{tikzpicture}
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.