Added graph generation algorithm using adjacency list