[Tex/LaTex] Drawing this directed graph in Latex


I am trying to draw a picture like the following in a Latex document file.

I have tried to use Xfig, but when I want to draw a line it does not stop. I mean, there is no end point for the line (I use mac).

My question is that is there a program, which is compatible with mac and the pictures can be be exported to a Latex file, to draw a pictures like the following?

Or is there any way to draw it in xfig?

Any Picture like this

Best Answer

This is a solution using automata library that one can plot finite state showing signals/state changes. Here a style is defined for states.

enter image description here




\tikzset{state/.style = {
        inner sep=0pt,
        outer sep=0pt,
        minimum size=2pt
\begin{tikzpicture}[thick,->,>=stealth', node distance=2cm,semithick]
\node[state] (1) {};
\node[state] (2) [right =2cm of 1] {};
\node[state] (3) [right =2cm of 2] {};
\node[state] (4) [below of =3] {};
\node[state] (5) [left =3cm of 4] {};

\draw[-] (1) -- (2) -- (3)  -- ++(1,0) |- (4) -- (5) -- ++(-2,0) |- (1);
\path    (1) edge [bend left]  node[]{}(4) 
         (4) edge [bend left]  node[]{}(1)
         (3) edge [bend left]  node[]{}(2) 
         (3) edge [loop below] node[]{}(3)
         (5) edge [loop above] node[]{}(5);
Related Question