How this calculation works
Find the fewest colors needed to color graph vertices and edges together, respecting every adjacency and incidence conflict.
χ″(G)=χ(T(G)); for a graph with edges,χ″(G)≥Δ(G)+1.A worked example
The default triangle has a three-color total coloring: its three vertices differ, and each edge uses the color of its opposite vertex.
Good to know
Simple undirected graph on 1–8 vertices and at most 12 edges. Exact coloring of the total conflict graph with 2,000,000 partial-state cap. Zero-based color labels have no numeric significance; resource exhaustion gives no optimum.
Reference: Isobe, Zhou and Nishizeki: total coloring definition (opens in a new tab) ↗
One palette for two kinds of elements
A total coloring assigns colors to both vertices and edges using one common palette. Adjacent vertices must differ, edges sharing an endpoint must differ, and every edge must differ from both of its own endpoints. Satisfying just vertex coloring or just edge coloring is not enough.
Colors are symbolic labels rather than numerical measurements. Replacing every color zero by a new name does not change validity or the number of colors. The output therefore uses compact zero-based color indices and explicitly lists which palette entry belongs to every vertex and edge.
Compare this with the Minimum edge coloring calculator from a graph edge list. Color vertices and edges together so adjacent or incident elements differ; coloring only edges omits vertex-edge incidence constraints.
The incidence restrictions matter
At a vertex of degree d, its d incident edges all need different colors. The vertex itself must use another color, giving a lower bound of d plus one. Taking the largest degree supplies a useful starting bound, but does not by itself prove that a coloring with that many colors exists.
There are additional conflicts between adjacent vertices and between edges incident elsewhere in the graph. The implementation checks the entire conflict relation instead of treating each vertex's local palette independently. Local assignments that each look valid can still contradict one another along the same shared edge.
A triangle with three colors
The default triangle has three mutually adjacent vertices, so their colors must all differ. Assign vertex colors zero, one and two. Give each edge the color of the vertex opposite it: that edge then differs from both endpoints, and adjacent edges also receive distinct colors.
This provides a valid three-color total coloring. The maximum degree is two, so the degree lower bound is also three. A feasible coloring meeting that lower bound is automatically optimal, making this a small example whose minimum can be verified without trusting the search implementation.
Constructing the total conflict graph
The algorithm creates a new graph with one node for each original vertex and one node for each original edge. Two of these nodes are joined precisely when their corresponding elements cannot share a color. Ordinary proper coloring of this conflict graph is equivalent to the original total-coloring problem.
This transformation includes all three conflict types and is directly inspectable. In particular, treating only the edge nodes would produce a line-graph edge-coloring calculation and omit the vertex elements. The total conflict graph can therefore be substantially harder to color than the original graph alone.
Searching and proving the minimum
Starting at the degree lower bound, the solver tests palette sizes in increasing order. Within a test it selects an uncolored element with many already-forbidden colors, breaking ties by conflict degree. Unused color names are introduced in a canonical order so equivalent palette permutations are not repeatedly searched.
A successful assignment is checked against every conflict before it is returned. When smaller palette sizes have all been exhausted, the first successful size is the exact optimum for the bounded input. If the search cap is reached, neither the tested size's impossibility nor a global minimum is claimed.
Special cases and limitations
For an edgeless nonempty graph, one color is sufficient because no elements conflict. A single ordinary edge requires three colors: one for each endpoint and a third for the edge. Adding isolated vertices cannot require more colors when an existing nonempty palette is already available.
This page does not implement list coloring, prescribed colors, edge weights or distinguishing conditions on the sets of incident colors. Those restrictions lead to other variants of total coloring. The displayed optimum belongs only to the simple graph and the unrestricted shared palette specified here.
Checking a returned assignment
First compare colors at every pair of adjacent vertices. Then compare every pair of edges sharing an endpoint. Finally compare each edge with both endpoints. These three independent passes provide a complete feasibility check, and the table is organized so none of those element types is hidden.
When comparing another result, normalize only the number of distinct palette labels, not their numeric values. Two different assignments can both be optimal. A theorem or heuristic that supplies an upper bound also need not equal this exact minimum, so check what kind of statement the other source actually provides.
A few questions, answered
Is this only edge coloring?
No. Vertices and edges share a palette, and their incidence conflicts are included.
Why are color numbers arbitrary?
They are names for palette entries; permuting those names preserves the same coloring.
DoesΔ+1 always give the answer?
It is a lower bound for graphs with edges, not a universal equality.
What if the search stops early?
The resource-cap error leaves the minimum unresolved rather than reporting an unfinished palette test as proof.