Implemented adding vertices into the HashMap in the bfs and dfs