graphs-bfs and dfs to be polished