Bipartite Graphs and 2-Colorability

College Depth 64 in the knowledge graph I know this Set as goal
Unlocks 16 downstream topics
graph-theory bipartite coloring

Core Idea

A graph is bipartite if its vertex set can be partitioned into two independent sets (no edges within each set). A graph is bipartite if and only if it contains no odd-length cycles. Bipartite graphs are 2-colorable and arise naturally in matching problems.

Explainer

A bipartite graph is one whose vertices can be split into two camps — call them "red" and "blue" — such that every edge runs between the camps, never within one. Job-applicant matchings are the classic image: one set of vertices represents jobs, the other represents applicants, and edges represent compatible pairs. No job connects directly to another job; no applicant to another applicant. The structure is clean and the two sets are the natural "sides."

The two-colorability framing is just a restatement: can you color every vertex red or blue so that no two neighbors share a color? If yes, the graph is bipartite — the two color classes are the two independent sets. This reframing is powerful because it gives you an algorithm: start at any vertex, color it red, then try to consistently color its neighbors blue, their neighbors red, and so on using BFS or DFS. If you ever encounter an edge whose both endpoints would need the same color, the graph is not bipartite.

The odd cycle theorem explains exactly when coloring fails. If you traverse a cycle of odd length, you will always return to the starting vertex needing the opposite color from what it already has — a contradiction. Even-length cycles cause no such problem: you can alternate colors around them cleanly. So odd cycles are precisely the obstruction to bipartiteness. If a graph has no odd cycle, it is bipartite; if it does, it is not. This is the graph-theoretic equivalent of "you can't properly 2-color a triangle."

Using what you know about degree sequences: in a bipartite graph with parts U and V, counting edges from the U-side and the V-side are both valid ways to count all edges — a preview of double counting ideas. The degree sequence alone does not determine bipartiteness, but understanding degree structure in each part informs matching analysis. This topic directly prepares you for Hall's theorem, which gives a precise condition for when a bipartite graph has a perfect matching: every subset S of one part has at least |S| neighbors in the other part.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineOpposites and Additive InversesAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsSystems of Equations — Graphing MethodSystems of Equations — Elimination MethodSystems of Three VariablesMatrices IntroductionGraph Representation: Matrices and ListsGraph Paths, Cycles, and ConnectivityTrees and Spanning TreesPlanar Graphs and Euler's FormulaGraph Coloring and the Chromatic NumberGraph Coloring and Chromatic NumbersBipartite Graphs and Matching ProblemsBipartite Graphs and 2-Colorability

Longest path: 65 steps · 277 total prerequisite topics

Prerequisites (2)

Leads To (1)