AdjacencyListUndirectedGraph functions improved