Dashboard/Block 2: Graph Structures/Week 5
Week 5Graph Structures

Bipartite Graphs & Coloring

We study bipartite graphs (no odd cycles) and graph coloring — assigning colors to vertices so no two adjacent vertices share a color. The chromatic number χ(G)\chi(G) is the minimum number of colors needed. We connect these to interval graphs and the greedy coloring algorithm.

Learning Objectives

Characterize bipartite graphs (no odd cycles, 2-colorable)
Compute and bound the chromatic number using clique number and Brooks' theorem
Apply greedy coloring and understand its limitations
Recognize interval graphs and their perfect coloring properties

Key Concepts

Bipartite Graphs

A graph is bipartite if its vertices can be partitioned into two sets A,BA, B such that every edge goes between AA and BB (no edges within AA or within BB).

Equivalently, GG is bipartite iff GG has no odd cycle. BFS can test bipartiteness in O(n+m)O(n+m).

  • -

    All trees are bipartite

  • -

    Even cycles C2kC_{2k} are bipartite; odd cycles C2k+1C_{2k+1} are not

  • -

    BFS detects bipartiteness: assign alternating colors by level, check for conflicts

Graph Coloring & Chromatic Number

A proper kk-coloring assigns one of kk colors to each vertex such that adjacent vertices get different colors. The chromatic number χ(G)\chi(G) is the minimum kk for which a proper kk-coloring exists.

Key bounds: χ(G)ω(G)\chi(G) \geq \omega(G) (clique number) and χ(G)Δ(G)+1\chi(G) \leq \Delta(G) + 1 (greedy bound). Brooks' theorem tightens this.

  • -

    χ(G)=1    G\chi(G) = 1 \iff G has no edges

  • -

    χ(G)=2    G\chi(G) = 2 \iff G is bipartite (and has edges)

  • -

    χ(Kn)=n\chi(K_n) = n

  • -

    ω(G)χ(G)Δ(G)+1\omega(G) \leq \chi(G) \leq \Delta(G) + 1 (basic sandwich inequality)

  • -

    Brooks: χ(G)Δ(G)\chi(G) \leq \Delta(G) unless GG is KnK_n or an odd cycle

Interval Graphs

An interval graph has vertices representing intervals on the real line, with edges between overlapping intervals. Interval graphs are perfect: χ(G)=ω(G)\chi(G) = \omega(G).

Greedy coloring on interval graphs (sorted by left endpoint) achieves the optimal coloring.

  • -

    Interval graphs are chordal and perfect

  • -

    Greedy coloring on intervals sorted by left endpoint is optimal

  • -

    Application: scheduling — minimum rooms needed = max overlap = clique number