add bipartite graph solution based on BFS