Use a adjacency map for storing edges