When I ran the .dot
file above through dot
at the command line, I got:
$ dot -Tpng queue.dot -oqueue.png
Warning: queue.dot:2: syntax error in line 2 near '('
Thus, the parenthesised numbers in the node names are not valid in dot
syntax. If you remove them, I expect the .png
file would be created successfully. If you need the parenthesised numbers in your output, I suggest looking up node labels in the GraphViz documentation.
I'd also note that toString()
does not seem like a particularly clear name for a function that creates a .png
file so changing the name of the function might be advisable.