I'm trying to build a graph with multiple loops attached to one node.
This is what I have come up with till now.
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure}
\begin{tikzpicture}[->, shorten >=2pt, shorten <=2pt, >=stealth']
\tikzstyle{every node}=[draw,circle,fill=black,minimum size=4pt,
inner sep=0pt]
\foreach \pos/\name in {{(-1,-1)/a}, {(-1,1)/b}, {(1,1)/c}, {(1,-1)/d}} {
\node (\name) at \pos {};
}
\draw[<->] (a) -- (b);
\draw[<->] (b) -- (c);
\draw[<->] (c) -- (d);
\draw[<->] (d) -- (a);
\draw[<->] (a) -- (c);
\draw[<->] (b) -- (d);
% building loops
\foreach \k in {1} {
\foreach \pos/\out in {a/below, b/above,
c/above, d/below} {
\path (\pos) edge [loop \out] (\pos);
}
}
\end{tikzpicture}
\end{figure}
\end{document}
jocom