How do you check whether a graph is bipartite, and what does bipartite mean?
A graph is bipartite if its nodes can be split into two sets such that every edge goes between the sets and never within one. Equivalently, the graph can be coloured with two colours so that no edge joins two nodes of the same colour.
The check is a breadth first search with two colours. Start any uncoloured node with colour zero, and when you reach a neighbour give it the opposite colour. If you ever find an edge whose two ends already have the same colour, the graph is not bipartite.
The mechanism is that the colouring is forced once you choose the first node's colour. Every path from the start alternates colours, so a node reachable by paths of different parity cannot be coloured consistently. An odd cycle is exactly such a conflict, and an odd cycle makes the graph non-bipartite.
The trade-off to name is that you have to start a fresh search from every uncoloured node, because the graph may be disconnected and each component is coloured independently. Forgetting that outer loop is the classic bug, since a single search only covers one component. The complexity is linear in the number of nodes and edges, and the memory is the colour map plus the queue, so it is cheap. The other detail is that the conflict check has to compare against the already assigned colour of the neighbour, and treating an already coloured neighbour as a conflict is a common mistake that would reject every graph with more than one edge.