I want to draw the following Markov chain using tikz, but I have a few problems that I do not know how to handle: I want the transition grid to look exactly like the picture. All outgoing edges are parallel and so are all the incoming edges. At each intersection, there must be an arrow as depicted in the picture and the labels appear above the intersections. Also, some edges are not continuous and have dots in the middle.
Below is what I have worked out so far, but it is very incomplete with lots of problems that I do not know how to fix.
\documentclass[12pt]{article}
\usepackage[landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,node
distance=2cm,looseness=2,bend right=40]
\draw[help lines] (-1,-3) grid (16,1);
\tikzset{every state/.style={minimum size=35pt,scale=0.6}}
\node [state] (0) {$0$};
\node [state] (1) [right of = 0] {$1$};
\node [state] (2) [right of = 1] {$2$};
\node (d1) [right of = 2] {$\cdots$};
\node [state] (km1) [right of = d1] {$k-1$};
\node [state] (k) [right of = km1] {$k$};
\node [state] (kp1) [right of = k] {$k+1$};
\node (d2) [right of = kp1] {$\cdots$};
\node [state] (mmk) [right of = d2] {$m-k$};
\node (d3) [right of = mmk] {$\cdots$};
\node [state] (mm2) [right of = d3] {$m-2$};
\node [state] (mm1) [right of = mm2] {$m-1$};
\path (0) edge (1)
edge (2)
edge (km1)
edge [loop above] node {$\mu_0$} (0);
\path (1) edge (2)
edge (km1)
edge (k)
edge [loop above] node {$\mu_0$} (1);
\path (2) edge (km1)
edge (k)
edge (kp1)
edge [loop above] node {$\mu_0$} (2);
\path (km1) edge (k)
edge (kp1)
edge [loop above] node {$\mu_0$} (km1);
\path (k) edge (kp1)
edge [loop above] node {$\mu_0$} (k);
\path (mmk) edge (mm2)
edge (mm1)
edge [loop above] node {$0$} (mmk);
\path (mm2) edge (mm1)
edge [loop above] node {$0$} (mm2);
\path (mm1) edge [loop above] node {$1$} (mm1);
\end{tikzpicture}
\end{document}
Best Answer
The trick of my solution is to use a
scope
withrotate=45
and then to make all links with|-
. I also define three commands to factorize code.Now, you have just to complete with some links...