change input for bfs as general graph input