\begin{figure}[H]
\centering
\begin{tikzpicture}[
C/.style = {circle, draw}, % C: circle
every edge quotes/.style = {auto, font=\footnotesize, inner sep=2pt, pos=0.8}
]
\begin{scope}[nodes={C}]
\node (a1) at (0,0) {$v_2$};
\node (a3) at (5,0) {$v_4$};
\node (a2) at (3,1) {$v_3$};
\node (a0) at (2,-2) {$v_1$};
\node (a4) at (3,-1) {$v_5$};
\node (a6) at (2,2) {$v_6$};
\end{scope}
%
\path
(a1) edge ["\hspace{40mm} $e_{23}$"] (a2)
(a1) edge ["$e_{24}$"] (a3)
(a1) edge ["$e_{25}$"] (a4)
(a1) edge ["$e_{26}$"] (a6)
(a1) edge ["$e_{21}$"] (a0);
\end{tikzpicture}
\end{figure}
Why cant I add edges between the vertices $3$ and $4$ in this tikz picture? I dont know why when I add an edge between vertices $v_3$ and $v_4$ with a edge label $e_{34}$, the new edge does not show up and the entire graph gets disturbed.
Where am I doing wrong here? Can someone please help me out here.
(a1) edge node[below, pos=.75] {$e_{24}$} (a3)
. You can useabove
instead ofbelow
to shift the label above the edge and withpos
, you can shift the label to the left and right (or up and down, depending on the orientation of the edge).