{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $G$ be a [[graph|0JD5C82QMB]].\nThen $G$ is [[bipartite|07DVHJ8N0A]] if and only if $G$ has no [[cycle|07CT9RDY7Q]] of odd length.\n\n## Remarks\n\nOne direction is easy. A cycle in a bipartite graph alternates between the two parts, so its length is even.\nFor the converse, work in each component. Colour a vertex by the parity of its distance to a fixed vertex. An edge between two vertices of the same colour would give an odd closed walk, and then an odd cycle.\nA graph is also bipartite if and only if its chromatic number is at most $2$.\n\n## Explanations\n\n### L1 human\n\nWalking around a cycle in a bipartite graph, you switch sides at every step.\nTo come back to the start you need an even number of steps, so odd cycles are impossible.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "kind": "statement",
    "msc": [
      "05C75"
    ],
    "name": "A graph is bipartite iff it has no odd cycle",
    "role": "theorem",
    "sources": [
      {
        "locator": "Characterization",
        "url": "https://en.wikipedia.org/wiki/Bipartite_graph"
      }
    ],
    "tag": "01R1HPEK6S",
    "uses": [
      "07CT9RDY7Q",
      "07DVHJ8N0A"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/01R1HPEK6S/",
  "links": [
    {
      "field": "uses",
      "target": "07CT9RDY7Q"
    },
    {
      "field": "uses",
      "target": "07DVHJ8N0A"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/01R1HPEK6S.md",
  "msc": [
    "05C75"
  ],
  "name": "A graph is bipartite iff it has no odd cycle",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/01R/01R1HPEK6S.md",
  "status": null,
  "tag": "01R1HPEK6S",
  "uri": "m2://01R1HPEK6S",
  "url": "https://math2.tamnd.com/wiki/a-graph-is-bipartite-iff-it-has-no-odd-cycle/",
  "writing": {
    "tag": "01R1HPEK6S",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
