add nodes 0 to 5
make the graph directed
node 0 is the parent of node 1
node 0 is the parent of node 4
node 1 is a parent of node 2
node 1 is a parent of node 3
node 3 is a parent of node 4
node 4 is a parent of node 5
set the edge label for the edge from 0 to 1 to 'a'
set the edge label for the edge from 0 to 4 to 'b'
set the edge label for the edge from 1 to 2 to 'b'
set the edge label for the edge from 1 to 3 to 'a'
set the edge label for the edge from 3 to 4 to 'c'
set the edge label for the edge from 4 to 5 to 'g'
add an edge from node 2 to itself with edge label 'b'
add an edge from node 3 to itself with edge label 'a'
add an edge from node 4 to itself with edge label 'c'
color node 2 green
color node 5 green
set each node's label to its name