remove the requirement to pass the total number of vertices in the graph, for a few functions