use to_undirected instead