[Tex/LaTex] Self loop in an undirected graph using TikZ

arrowsgraphstikz-pgf

How can I create a self loop without a direction on the edge?

\path[every node/.style={font=\sffamily\small}]
(3)   edge[loop] node  {$e_{1}$} (3);

creates the loop I want but has a direction.

Best Answer

For some reason, the TikZ every loop style contains an arrow. So you simple have to remove that:

\begin{tikzpicture}[every loop/.style={}]
    \node (3) {(3)};
    \path[every node/.style={font=\sffamily\small}]
        (3)   edge[loop] node  {$e_{1}$} (3);
\end{tikzpicture}

or remove it globally with

\tikzset{every loop/.style={}}

in the preamble.