Added BFS implementation for graphs