Grundy Number Calculator

worst-case greedy colors

CalculatorsFreeNo Signup
4.4(697 reviews)
All Tools

Loading tool...

About Grundy Number Calculator

A Grundy number calculator computing Γ(G): maximum number of colors used by ANY greedy (first-fit) coloring over all vertex orderings. χ(G) ≤ Γ(G) ≤ Δ(G)+1. NP-hard to compute. Measures worst-case greedy coloring quality. Client-side.

Grundy Number Calculator Features

  • Γ(G) value
  • Worst ordering
  • χ ≤ Γ ≤ Δ+1
  • NP-hard
  • Common graphs
Grundy number Γ(G): maximum colors any greedy first-fit coloring can use. For the WORST vertex ordering, how many colors does greedy need? χ(G) ≤ Γ(G) ≤ Δ(G)+1. A graph is well-colored if Γ = χ (no bad orderings).

How to Use

Select graph:

  • Γ: Grundy number
  • Best: χ colors
  • Worst: Γ colors

Well-Colored Graphs

G is well-colored if Γ(G) = χ(G): no ordering makes greedy use extra colors. Complete graphs, cycles, trees are well-colored. Not all graphs are: some have orderings forcing many extra colors.

Computing Γ

NP-hard to compute (Zaker, 2006). Even determining Γ=k is coNP-complete. For trees: polynomial (Γ(T) is height of the tree in a specific rooting). For P_n: Γ=⌈log₂ n⌉+1.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Find Γ(G).
  3. 3Find worst order.
  4. 4Compare to χ.
  5. 5Check well-colored.

Grundy Number Calculator — Frequently Asked Questions

How does Grundy differ from chromatic?+

χ = minimum colors over ALL colorings. Γ = max colors over all GREEDY colorings. χ ≤ Γ always. The gap can be arbitrarily large: there exist graphs with χ=2 but Γ=n/2 (half the vertices)!

What's a Grundy coloring?+

A Grundy coloring using k colors: every vertex of color i has neighbors of all colors 1,...,i-1. This is exactly what greedy first-fit produces. Finding Grundy colorings is a certificate for Γ ≥ k.

Is Γ always ≤ Δ+1?+

Yes! Greedy always uses ≤ Δ+1 colors regardless of ordering (each vertex has at most Δ neighbors). So Γ ≤ Δ+1. But Γ can equal Δ+1: it does for complete graphs and odd cycles.

Share this tool: