Fixed divide by zero problem in print_graph()