ChromaticPolynomial[g,k]
gives the chromatic polynomial of the graph g.
ChromaticPolynomial[{vw,…},…]
uses rules vw to specify the graph g.
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.
- ChromaticPolynomial[g] gives a pure function representation of the chromatic polynomial of g.
Examples
open all close allBasic Examples (1)
Scope (6)
ChromaticPolynomial works with undirected graphs:
ChromaticPolynomial[[image], k]ChromaticPolynomial[[image], k]ChromaticPolynomial[[image], k]ChromaticPolynomial[[image], k]Use rules to specify the graph:
ChromaticPolynomial[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}, k]ChromaticPolynomial[[image], 3]Applications (3)
Compute the number of 3-colorings of the Petersen graph:
ChromaticPolynomial[PetersenGraph[], 3]Find the chromatic number of a graph:
p[k] = ChromaticPolynomial[PetersenGraph[], k]MinValue[{k, k > 0 && p[k] > 0 }, k, Integers]Chromatic polynomials for complete graphs with
vertices:
Table[ChromaticPolynomial[CompleteGraph[n], k], {n, 1, 7}]FindSequenceFunction[%, n]Table[ChromaticPolynomial[CycleGraph[n], k], {n, 1, 7}]FindSequenceFunction[%, n]Properties & Relations (3)
Use TuttePolynomial to compute ChromaticPolynomial:
g = WheelGraph[5];{n, c} = {VertexCount[g], Length[ConnectedComponents[g]]};(-1)^n - ck^c * TuttePolynomial[g, {1 - k, 0}]//ExpandChromaticPolynomial[g, k]A graph with
vertices is a tree if and only if its chromatic polynomial is k(k-1)n-1:
g = KaryTree[3];TreeGraphQ[g]{ChromaticPolynomial[g, k], k(k - 1)^VertexCount[g] - 1}//ExpandIsomorphic graphs have the same chromatic polynomial:
g = [image];h = [image];IsomorphicGraphQ[g, h]ChromaticPolynomial[g, k] == ChromaticPolynomial[h, k]See Also
TuttePolynomial FlowPolynomial Graph
Function Repository: ChromaticNumber FindProperColorings VizingEdgeColoring
Related Guides
Text
Wolfram Research (2014), ChromaticPolynomial, Wolfram Language function, https://reference.wolfram.com/language/ref/ChromaticPolynomial.html (updated 2015).
CMS
Wolfram Language. 2014. "ChromaticPolynomial." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/ChromaticPolynomial.html.
APA
Wolfram Language. (2014). ChromaticPolynomial. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChromaticPolynomial.html
BibTeX
@misc{reference.wolfram_2026_chromaticpolynomial, author="Wolfram Research", title="{ChromaticPolynomial}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ChromaticPolynomial.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_chromaticpolynomial, organization={Wolfram Research}, title={ChromaticPolynomial}, year={2015}, url={https://reference.wolfram.com/language/ref/ChromaticPolynomial.html}, note=[Accessed: 13-June-2026]}