単純な例

有向グラフの例(矢印があるグラフの例)

<graphviz>
digraph graph_name {
  alpha;
  beta;
  alpha -> beta;
}

</graphviz>

無向グラフの例(矢印がないグラフの例)

<graphviz>
graph graph_name {
  alpha;
  beta;
  alpha -- beta;
}

</graphviz>

色を付ける=

<graphviz>
digraph G {
  1 -> 2; 
  1 -> 3 [color="blue"];
  3  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
  2 -> 4;
  2 -> 5 [color="blue"];
  5  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
}
</graphviz>

サンプル