BFS on connectivity based approach added