represent adjacency matrix using set of sets