[Tex/LaTex] How to make Tikz make a curved arrow from one node to another when the nodes are in a straight line

tikz-pgf

I have this code

\documentclass[10pt]{article}

\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}

\begin{tikzpicture}[->,>=stealth',auto,node distance=3cm,
  thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]

  \node[main node] (1) {a};
  \node[main node] (2) [right of=1] {b};
  \node[main node] (3) [right of=2] {c};
  \node[main node] (4) [right of=3] {d};

  \path[every node/.style={font=\sffamily\small}]
    (1) edge node [right] {} (2)
    (2) edge node [right] {} (3)
    (3) edge node [right] {} (4)
    (4) edge node [left] {} (1);
\end{tikzpicture}
\end{document}

that produces this graph:

bad graph

My goal is to produce a graph like this:

good graph

Pardon the bad drawing. I tried various combinations of (4) edge node [bend left] {} (1); and (4) edge node [loop left] {} (1); to no avail.

Best Answer

Just to show another approach, this use case is exactly what the keys bend left and bend right were created for:

\documentclass[10pt]{article}

\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}

\begin{tikzpicture}[->,>=stealth',auto,node distance=3cm,
  thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]

  \node[main node] (1) {a};
  \node[main node] (2) [right of=1] {b};
  \node[main node] (3) [right of=2] {c};
  \node[main node] (4) [right of=3] {d};

  \path[every node/.style={font=\sffamily\small}]
    (1) edge node [right] {} (2)
    (2) edge node [right] {} (3)
    (3) edge node [right] {} (4)
    (4) edge[bend right] node [left] {} (1);
\end{tikzpicture}
\end{document}

enter image description here

These keys also accept an optional <angle> value to simultaneously set the in and out keys symmetrically, so writing

(4) edge[bend right=90] node [left] {} (1);

will result in

enter image description here

If asymmetric setting of the in and out keys is required, cfr's solution is the way to go.