Math 2.0

Combinatorics Proof

Proof that a graph is bipartite iff it has no odd cycle

Builds on Bipartite graphCycleCircuitWalkReachabilityConnected componentDistance in a graphStrong inductionAxiom of choice

Proof

We prove the easy direction by alternation of sides, and the converse by colouring with the parity of the distance.

  1. (⇒\Rightarrow) Let (A,B)(A, B) be a bipartition of GG, as in the definition of a bipartite graph. Let (w0,…,wk)(w_0, \dots, w_k) be a cycle, and say w0∈Aw_0 \in A; the case w0∈Bw_0 \in B is symmetric.
  2. Each edge has one end in AA and one in BB. By induction on tt, wt∈Aw_t \in A for even tt and wt∈Bw_t \in B for odd tt.
  3. Since wk=w0∈Aw_k = w_0 \in A, the length kk is even. So GG has no cycle of odd length.
  4. (⇐\Leftarrow) Lemma: if GG has a closed walk of odd length, then GG has a cycle of odd length. We use strong induction on the length kk.
  5. Let W=(w0,…,wk)W = (w_0, \dots, w_k) with wk=w0w_k = w_0 and kk odd. Since no vertex is adjacent to itself, k≠1k \ne 1. So k≥3k \ge 3.
  6. Case 1: w1,…,wkw_1, \dots, w_k are pairwise distinct. The edges are {wt−1,wt}\set{w_{t-1}, w_t} with indices modulo kk. Two of them, for s≠ts \ne t, could only agree if ws−1=wtw_{s-1} = w_t and ws=wt−1w_s = w_{t-1}.
  7. That would give t≡s−1t \equiv s - 1 and s≡t−1s \equiv t - 1 modulo kk, so k∣2k \mid 2, which is false. So the edges are distinct, WW is a circuit, and it is a cycle of odd length.
  8. Case 2: wi=wjw_i = w_j for some 1≤i<j≤k1 \le i < j \le k. Then W1=(wi,wi+1,…,wj)W_1 = (w_i, w_{i+1}, \dots, w_j) is a closed walk of length j−ij - i.
  9. Also W2=(wj,wj+1,…,wk,w1,…,wi)W_2 = (w_j, w_{j+1}, \dots, w_k, w_1, \dots, w_i) is a closed walk of length k−(j−i)k - (j - i), using wk=w0∼w1w_k = w_0 \sim w_1.
  10. Both lengths are between 11 and k−1k - 1, and they add up to the odd number kk. So one of them is odd, and the induction hypothesis gives an odd cycle. This proves the lemma.
  11. Now assume that GG has no cycle of odd length. By the axiom of choice, choose a vertex rCr_C in each connected component CC of GG. For finite GG no choice principle is needed.
  12. For a vertex vv in the component CC, the vertex vv is reachable from rCr_C. So the distance δ(v)=d(rC,v)\delta(v) = d(r_C, v) is a natural number.
  13. Let A={v:δ(v) even}A = \set{v : \delta(v) \text{ even}} and B={v:δ(v) odd}B = \set{v : \delta(v) \text{ odd}}. They are disjoint, and their union is the vertex set.
  14. Let xyxy be an edge. Then xx and yy are reachable from each other, so they lie in the same component CC. Let r=rCr = r_C.
  15. Suppose δ(x)\delta(x) and δ(y)\delta(y) have the same parity. Take a walk PP from rr to xx of length δ(x)\delta(x), and a walk QQ from rr to yy of length δ(y)\delta(y).
  16. Follow PP from rr to xx, then the edge xyxy, then QQ backwards from yy to rr. This is a closed walk of length δ(x)+1+δ(y)\delta(x) + 1 + \delta(y), which is odd.
  17. By the lemma, GG has a cycle of odd length, a contradiction. So δ(x)\delta(x) and δ(y)\delta(y) have different parities.
  18. Hence every edge has one end in AA and one end in BB, and GG is bipartite.

Idea

Along any walk the side changes at each step, so a closed walk in a bipartite graph has even length. Conversely, colour each vertex by the parity of its distance from a root. An edge inside one colour class would close an odd walk, and an odd closed walk always contains an odd cycle.

Reading path

To understand this page from the ground up, read these 40 pages in order. The foundations come first. The path takes the proof Proof of strong induction from ordinary induction.

Show the path as a graph
Bipartite graph, definition, no evidence levelBipartite graphdefinitionDefinition by recursion, concept, no evidence levelDefinition by recursi…conceptElement, definition, no evidence levelElementdefinitionGraph, definition, no evidence levelGraphdefinitionMathematical induction, concept, no evidence levelMathematical inductionconceptNatural numbers, object, no evidence levelNatural numbersobjectPeano axioms, concept, no evidence levelPeano axiomsconceptProposition, concept, no evidence levelPropositionconceptSet, definition, no evidence levelSetdefinitionWalk, definition, no evidence levelWalkdefinitionSuccessor function, definition, no evidence levelSuccessor functiondefinitionDisjunction, definition, no evidence levelDisjunctiondefinitionImplication, definition, no evidence levelImplicationdefinitionPredicate, definition, no evidence levelPredicatedefinitionFamily of sets, definition, no evidence levelFamily of setsdefinitionOrdered pair, definition, no evidence levelOrdered pairdefinitionReachability, definition, no evidence levelReachabilitydefinitionTrail, definition, no evidence levelTraildefinitionUnion, definition, no evidence levelUniondefinitionAddition of natural numbers, definition, no evidence levelAddition of natural n…definitionThe successor function is injective, statement, no evidence levelThe successor functio…statementZero is not a successor, statement, no evidence levelZero is not a success…statementExistential quantifier, definition, no evidence levelExistential quantifierdefinitionUniversal quantifier, definition, no evidence levelUniversal quantifierdefinitionCartesian product, definition, no evidence levelCartesian productdefinitionDistance in a graph, definition, no evidence levelDistance in a graphdefinitionConnected component, definition, no evidence levelConnected componentdefinitionCircuit, definition, no evidence levelCircuitdefinitionSubset, definition, no evidence levelSubsetdefinitionUnion of a family of sets, definition, no evidence levelUnion of a family of …definitionOrder on the natural numbers, definition, no evidence levelOrder on the natural …definitionUniqueness quantifier, definition, no evidence levelUniqueness quantifierdefinitionBinary relation, definition, no evidence levelBinary relationdefinitionCycle, definition, no evidence levelCycledefinitionProof of strong induction from ordinary induction, proof, no evidence levelProof of strong induc…proofFunction, definition, no evidence levelFunctiondefinitionStrong induction, statement, no evidence levelStrong inductionstatementChoice function, definition, no evidence levelChoice functiondefinitionAxiom of choice, statement, no evidence levelAxiom of choicestatementProof that a graph is bipartite iff it has no odd cycle, proof, no evidence levelProof that a graph is…proof
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Bipartite graph definition
  2. Definition by recursion concept
  3. Element definition
  4. Graph definition
  5. Mathematical induction concept
  6. Natural numbers object
  7. Peano axioms concept
  8. Proposition concept
  9. Set definition
  10. Walk definition
  11. Successor function definition
  12. Disjunction definition
  13. Implication definition
  14. Predicate definition
  15. Family of sets definition
  16. Ordered pair definition
  17. Reachability definition
  18. Trail definition
  19. Union definition
  20. Addition of natural numbers definition
  21. The successor function is injective statement
  22. Zero is not a successor statement
  23. Existential quantifier definition
  24. Universal quantifier definition
  25. Cartesian product definition
  26. Distance in a graph definition
  27. Connected component definition
  28. Circuit definition
  29. Subset definition
  30. Union of a family of sets definition
  31. Order on the natural numbers definition
  32. Uniqueness quantifier definition
  33. Binary relation definition
  34. Cycle definition
  35. Proof of strong induction from ordinary induction proof
  36. Function definition
  37. Strong induction statement
  38. Choice function definition
  39. Axiom of choice statement
  40. Proof that a graph is bipartite iff it has no odd cycle proof

Where this leads

3 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Bipartite_graph, Characterization
About this page
Tag9S6P7S0NWY
URIm2://9S6P7S0NWY
Kindproof
WritingW0 stub
MSC05C75
ProvesA graph is bipartite iff it has no odd cycle
UsesBipartite graph, Cycle, Circuit, Walk, Reachability, Connected component, Distance in a graph, Strong induction, Axiom of choice
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.