graph bfs and queue are implemented