Implemented the test output generation code for graphs.