Would somebody help me to draw the following figure in Tikz?
Asked
Active
Viewed 142 times
1 Answers
3
Not a kind of question you should ask here like this. You are supposed to do your homework by yourself, see help pages (https://stackoverflow.com/help/on-topic).
Anyway, I will give you a start:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
\node[state] (v_n) {$v_n$};
\node[state] (v_n_1) [below=of v_n] {$v_{n-1}$};
\node[state] (v_n_2) [below=of v_n_1] {$v_{n-2}$};
\node[state] (v_n_3) [below=of v_n_2] {$v_{n-3}$};
\node[state] (v_4) [below=of v_n_3] {$v_4$};
\node[state] (v_3) [below=of v_4] {$v_3$};
\node[state] (v_2) [below=of v_3] {$v_2$};
\node[state] (v_1) [below=of v_2] {$v_1$};
\node[state] (u) [below=of v_1] {$u$};
\path[-] (u) edge [bend left] (v_1)
(u) edge [bend right] (v_2)
(u) edge [bend left] (v_3)
(u) edge [bend right] (v_4)
(u) edge [bend right] (v_n_3)
(u) edge [bend left] (v_n_2)
(u) edge [bend right] (v_n_1)
(u) edge [bend left] (v_n)
(v_1) edge [bend left] (v_3)
(v_2) edge [bend right] (v_4)
(v_n_3) edge [bend right] (v_n_1)
(v_n_2) edge [bend left] (v_n)
(v_1) edge (v_2)
(v_2) edge (v_3)
(v_3) edge (v_4)
(v_n_3) edge (v_n_2)
(v_n_2) edge (v_n_1)
(v_n_1) edge (v_n);
\path[dashed] (v_4) edge (v_n_3);
\end{tikzpicture}
\end{document}

tangoal
- 724
- 1
- 9
- 28
-
Excuse me for the mistake. My problem is not the graph actually. I don't know how to mark the distance/comments between the nodes as shown in the figure. – Sudev Naduvath Feb 27 '18 at 01:31