getAmat function

Extract adjacency matrix from the map