Added methods for undirected graphs