Form hash from adjacency matrix file