function to export trie/automaton to graphviz