From list of edges to adjacency matrix#4763