Re: tikz automata: splitting merged edges



Nuno J. Silva wrote:
I'm trying to draw some state machines, using the pgf tikz "automata"
library.

In some cases, the machines will have pairs of states involved in two
events, in different directions.

An example: - When in q_0, if input is "a", go to q_1;
- When in q_1, if input is "b", go to q_0.

For this, I wrote the following code:

\begin{tikzpicture}[auto]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [right=of q_0] {$q_1$};
\path[->] (q_0) edge node {a} (q_1)
(q_1) edge node {b} (q_0);
\end{tikzpicture}

But this results in a picture with only one line for the two paths,
making it impossible to understand which input does what.

Is there a way to force two distinct lines to be drawn?


is

\begin{tikzpicture}[node distance=33mm]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [right of = q_0] {$q_1$};
\path[->] (q_0) edge [bend left] node[above] {a} (q_1)
(q_1) edge [bend left] node[below] {b} (q_0);
\end{tikzpicture}

what you looking for? if not, see TikZ and PGF examples in

http://www.texample.net/tikz/examples/

maybe you find there some ideas.

regards, Zarko
.



Relevant Pages