uses the igraph library.