Graphviz

demo

put the following lines to simple.gv

graph simple 
{
    a -- b --c;
    b -- d;
}

generate a graph using dot

$ dot -Tpng -O simple.gv
$ ls
simple.gv  simple.gv.png

Simple graph

change to directional graph:

digraph simple
{
    a -> b -> c;
    b -> d;
}

Demo: directional graph with attributes

digraph loop
{
    graph [bgcolor="#000000", label="A Loop", fontcolor="white"];

    a [color="green", label="start", fontcolor="white"];
    b [shape="circle", color="green", fontcolor="white"];
    c [shape="circle", color="green", fontcolor="white"];
    d [shape="circle", color="green", fontcolor="white"];
    e [shape="circle", color="green", fontcolor="white"];

    a -> b -> c -> d -> e [color="yellow", arrowhead="open"];
    e -> a [color="yellow", arrowhead="open", style="bold"];
}

result image:

a loop