Chromatic Polynomial Calculator

P(G,k) = proper k-colorings

CalculatorsFreeNo Signup
4.8(433 reviews)
All Tools

Loading tool...

About Chromatic Polynomial Calculator

A chromatic polynomial calculator computing P(G,k): the number of ways to properly color G with k colors. For K_n: P=k(k-1)...(k-n+1). For trees: P=k(k-1)^{n-1}. Uses deletion-contraction. P(G,χ)>0 gives chromatic number. Client-side.

Chromatic Polynomial Calculator Features

  • P(G,k) formula
  • Evaluate at k
  • Common graphs
  • Deletion-contraction
  • Roots
Chromatic polynomial P(G,k): number of proper k-colorings. P(K_n,k)=k^{(n)} (falling factorial). P(tree,k)=k(k-1)^{n-1}. P(C_n,k)=(k-1)^n+(-1)^n(k-1). The chromatic number χ(G) is the smallest k with P(G,k)>0.

How to Use

Select graph:

  • P(G,k): Polynomial formula
  • Evaluate: P at specific k
  • Roots: Chromatic roots

Deletion-Contraction

P(G,k) = P(G-e,k) - P(G/e,k). Delete edge e: P(G-e). Contract edge e: P(G/e). Recursion reduces to edgeless graphs where P(E_n,k)=k^n. This gives both the formula and a computation method.

Properties

P(G,k) is always a polynomial of degree n (vertices). Leading coefficient is 1. Coefficient of k^{n-1} is -|E|. The coefficients alternate in sign. Chromatic roots can be complex.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Compute P(G,k).
  3. 3Evaluate at k.
  4. 4Find χ(G).
  5. 5Study roots.

Chromatic Polynomial Calculator — Frequently Asked Questions

Is P(G,k) always a polynomial?+

Yes! Despite being defined as a count, P(G,k) is polynomial in k of degree |V|. This is proven by deletion-contraction induction. The base case P(E_n,k)=k^n is polynomial, and polynomial operations preserve polynomiality.

What are chromatic roots?+

Complex numbers z where P(G,z)=0. Always include 0 and 1 (for connected G). The real roots are ≤n-1. The distribution of chromatic roots is studied in algebraic graph theory. No root has real part >n.

How does this relate to the Tutte polynomial?+

P(G,k) = (-1)^{|V|-c}·k^c·T(G, 1-k, 0) where c=components, T=Tutte polynomial. The chromatic polynomial is a specialization of the Tutte polynomial, which encodes much more information about the graph.

Share this tool: