test on undirected graph