Graph with bfs and dfs