Added utility to generate graph for testing purposes.