BFS-Tree(G, s): V_T = {s} E_T = {} Q = {} ENQUEUE(Q, s) while Q is not empty do u = DEQUEUE(Q) for each v in Adj[u] do if v is not in V_T then V_T = V_T + {v} E_T = E_T + {(u, v)} ENQUEUE(Q, v) return (V_T, E_T)
According to question (ii), there is no edge between and if and are both even or odd.
Also, according to the statement of question (iii), no contains a pair of adjacent vertices.
Hence no two vertices within the same set are adjacent, which implies that is a bipartite graph.
Assume that is bipartite.
Suppose that there exists two adjacent vertices and in a .
Then there must exists two vertices adjacent to and , respectively.
If , then a contradiction to the definition of bipartite graph.
Hence we assume that .
Repeat the above construction and finally we will be in the situation that , which leads to a contradiction.
Therefore, if some contains a pair of adjacent vertices then is not a bipartite graph.