Tool to convert list of edge to adjacency list