Removed condition if is a UndirectedSparseMultigraph.