implemented graph class. Undirected, unweighted.