Write graphviz file immediately after graph build