Added Code to create graph for partitioning.