created graph using map and set.
but since no order is preserved it is very difficult to make sense out of it.
changes to preserve the index while creating the node.
added code to complete all the edges.