Ask Your Question

Revision history [back]

Why does `all_graph_colorings` not generate all possible colorings?

I use all_graph_colorings to generate all possible colorings of a graph $G$ as follows:

sage: from sage.graphs.graph_coloring import all_graph_colorings
sage: G = Graph({0: [1], 1: [2], 2: [3, 5], 3: [4, 6]})
sage: D = {'#ff0000': [0, 4, 5], '#0000ff': [1, 3], '#00ff00': [6, 2]}
sage: print(D in all_graph_colorings(G, 3, hex_colors=True))
False

Is there something I did wrong? Obviously, $D$ must be a $3$-coloring of vertices of $G$, right?