tusc.graph.polynomial.Chromatic

class graph.polynomial.Chromatic(G)

For computing and evaluating the chromatic polynomial of a graph.

Methods

evaluate(x)

Evaluates the chromatic polynomial for the graph, given x, to find the number of x-colorings of the graph.

generate_polynomial([G])

Generates the chromatic polynomial for the provided graph via recursion and deletion-contraction.

evaluate(x)

Evaluates the chromatic polynomial for the graph, given x, to find the number of x-colorings of the graph.

Parameters

x (float) – coloring number

:raises ValueError : if the result is not int or float:

generate_polynomial(G=None)

Generates the chromatic polynomial for the provided graph via recursion and deletion-contraction.

Parameters

G (NetworkX graph) –