Add undirected graph support.