after printing the graph stored in vertex