\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}

\usetikzlibrary{automata}
\usetikzlibrary{shapes.misc}

\begin{document}

\begin{tikzpicture}
\node[state,initial]   (a) at (0,0) {$A$};
\node[state,accepting] (b) at (2,0) {$B$};

\draw[->,>=stealth]
  (a) edge[loop above] node[above] {$r_1$} (a)
      edge[bend left]  node[above] {$r_2$} (b)
  (b) edge[bend left]  node[below] {$r_3$} (a)
      edge[loop above] node[above] {$r_4$} (b)
;
\end{tikzpicture}

\end{document}
