read in the graph with status, write final result