The core check happens when you visit a neighbor. Two cases:
Neighbor is uncolored (): assign the opposite color, add to queue.
Neighbor is already colored: check if it has the opposite color.
If the neighbor has the same color as the current node, you have found a conflict. Two adjacent nodes are the same color, which means an odd cycle exists. Return false immediately. If colors are opposite, no problem. Continue processing.