How can I draw a path of nodes forming a circle with tikz?
I have tried placing the nodes manually with
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,positioning}
\begin{document}
\begin{tikzpicture}[->,node distance=2cm, auto, thick,main node/.style={circle,fill=blue!20,draw}]
\node[main node] (1) {A};
\node[main node] (2) [above left=of 1] {B};
\node[main node] (3) [above right=of 1] {C};
\node[main node] (4) [above=of 2] {D};
\node[main node] (5) [above=of 3] {E};
\path[draw, every node/.style={font=\sffamily\small}] (1) -- (2) -- (4) -- (5) -- (3) -- cycle;
\end{tikzpicture}
\end{document}
but it's very difficult to organize them properly. I think it is easily to do with only 4 nodes but I need 5 nodes. I wonder if I can draw the nodes with a path.
Edit
Sorry, I forgot to tell that I need arrows between the nodes and I want different texts in each node.
Can I still use a foreach? I can perhaps make a list of the texts and let the foreach determine which element in the list to draw?
Best Answer
Nodes on a regular polygon
It is possible to put circular nodes with various sizes on a circle and corners of a regular polygon and draw arrows between them, which are also on the circle.
Equidistant nodes
Instead of putting the nodes on the corners of a regular polygon, the nodes can be placed in such a way on the circle, that the arrows have equal lengths. The advantage is, that the main radius can be made smaller for a more compact presentation.