I'm using chains to draw a simple Markov chain. I used \draw and \path to manually add arcs between nodes. But the labels and arcs overlap badly although I used auto location for labels. Is there a way to let Tikz do this automatically? Manually adjusting distances is possible but I believe Tikz is more powerful than I know.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{automata,chains}
\begin{tikzpicture}[start chain=going right]
\node[state,on chain] (-2) {-2};
\node[state,on chain] (-1) {-1};
\node[state,on chain] (0) {0};
\node[draw=red,fill=red,state,on chain] (+1) {+1};
\node[draw=red,fill=red,state,on chain] (+2) {+2};
\draw[->] (-1) to node[auto] {$P(0)$}(-2);
\path[->] (-1) edge [loop above] node[auto] {$P(1)$} ();
\draw[->] (-1) to node[auto] {$P(2)$}(0);
\draw[->] (-1) to[bend right] node[auto] {$P(3)$}(+1);
\draw[->] (-1) to[bend right] node[auto] {$P(4)$}(+2);
\draw[->] (+1) to node[above]{$1$} (0);
\draw[->] (+2) to[bend right] node[above]{$1$} (0);
\end{tikzpicture}
\end{document}






