Refactored undirected graph al test