Generalized Generate_Graph for reduction graph. Fixed some formatting issues.