add print-to-file for graph