Code for creating Node and Edge list