# ChromaticPolynomial

ChromaticPolynomial[g,k]

gives the chromatic polynomial of the graph g.

ChromaticPolynomial[{vw,},]

uses rules vw to specify the graph g.

# Details • ChromaticPolynomial[g,k] gives the number of vertex colorings of g with k colors.
• gives a pure function representation of the chromatic polynomial of g.

# Examples

open allclose all

## Basic Examples(1)

The chromatic polynomial of a cycle graph:

Plot the polynomial:

## Scope(6)

ChromaticPolynomial works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed graphs:

Use rules to specify the graph:

Evaluate at specific value:

## Applications(3)

Compute the number of 3-colorings of the Petersen graph:

Find the chromatic number of a graph:

Chromatic polynomials for complete graphs with vertices:

Cycle graphs:

## Properties & Relations(3)

Use TuttePolynomial to compute ChromaticPolynomial:

A graph with vertices is a tree if and only if its chromatic polynomial is k(k-1)n-1:

Isomorphic graphs have the same chromatic polynomial: