Advanced maths

List coloring calculator with allowed colors at each vertex

Count proper graph colorings when each vertex has its own allowed list of color labels.

Your numbers

Rows on separate lines; comma-separated values within each row.
One row per vertex; use - for an empty allowed-color list.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Count proper graph colorings when each vertex has its own allowed list of color labels. The result includes an exact count and one feasible assignment, or a completed zero result when no list coloring exists. Unlike ordinary k-coloring, an allowed color at one vertex may be forbidden at another even if both lists have the same length.

THE FORMULAChoose c(v)∈L(v), with c(u)≠c(v) for every edge uv.

A worked example

For path 0–1–2, allowed lists are {0},{1,2},{0,1}. If the middle color is one, the last vertex must be zero. If the middle is two, the last vertex can be zero or one. Exactly three allowed proper colorings exist.

Good to know

≤12 vertices and six named colors 0–5; complete search capped at 2,000,000 states. Empty lists are infeasible. Counts keep color names distinct, with no symmetry quotient or chromatic-number optimization.

Lists contain identities, not capacities

A list such as zero and two permits precisely those labels; it does not mean any two interchangeable colors. Two adjacent vertices with lists zero and one can choose different colors, while lists containing only zero at both ends cannot.

Colors are globally identified across the graph. Enter each vertex’s list in its matching row, and use the documented empty-list notation when no color is available. Repeated labels inside a list do not create extra choices.

Allowed vertex lists leave exactly three path colorings012{0}{1,2}{0,1}Middle 1: one choiceMiddle 2: two choicesTotal: 3
For path 0–1–2, allowed lists are {0},{1,2},{0,1}. If the middle color is one, the last vertex must be zero. If the middle is two, the last vertex can be zero or one. Exactly three allowed proper colorings exist. Static schematic; numerical labels define the example.

Allowed colors differ by vertex; a uniform chromatic polynomial does not encode those restrictions. The Two colorable hypergraph calculator with a coloring witness offers a complementary calculation under its own stated assumptions.

Two independent feasibility conditions

Every assigned color must belong to that vertex’s list, and the endpoints of every edge must receive different colors. Satisfying either condition alone is insufficient.

An isolated vertex still needs an allowed color, so a single empty list makes the entire instance impossible. Disconnected components can be solved independently and their counts multiplied. The graph is simple and undirected; edge direction and numerical edge weights do not enter this coloring model.

Worked example and mathematical rule

For path 0–1–2, allowed lists are {0},{1,2},{0,1}. If the middle color is one, the last vertex must be zero. If the middle is two, the last vertex can be zero or one. Exactly three allowed proper colorings exist.

Choose c(v)∈L(v), with c(u)≠c(v) for every edge uv.

Backtracking with constrained choices

The search considers allowed labels and rejects conflicts with already colored neighbors. A restricted vertex can be much more informative than a high-degree vertex with many options.

The tool counts complete assignments using exact integers and retains a witness. Exponential behavior remains possible, so a state limit is part of the supported scope. A capped search does not certify impossibility or a complete count, even if it found some assignments before stopping.

Labeled counts and apparent symmetry

Swapping two color names can produce another counted solution if all lists remain compatible with the swap. This is intentional: lists make color identities meaningful.

Do not divide the count by the factorial of the number of colors, because some swaps are forbidden and others leave assignments unchanged. Reordering each list should preserve the total count, although the selected witness can change. Relabeling colors consistently everywhere should preserve feasibility and count.

Scheduling interpretations need care

A vertex can represent a task, with its list naming permitted time slots; an edge then forbids two tasks from sharing a slot. This model has no slot capacities, task durations, travel times or precedence unless those restrictions have been translated into the graph and lists appropriately.

A valid coloring is therefore not automatically a complete operational schedule. Avoid encoding a directional precedence as a simple conflict edge when ordering, rather than mere inequality, is required.

Auditing a proposed assignment

Check every vertex against its original list and then check each original edge once. A zero result can arise from an empty list, a tightly constrained clique or a less obvious global conflict.

The tool does not return a minimum unsatisfiable subset of lists and edges. To investigate a failure, relax a clearly identified constraint and recalculate, keeping a record of the changed problem. Adding allowed colors cannot remove existing valid colorings, which gives a useful monotonicity check.

A few questions, answered

Does a list length specify how many colors I may choose?

No. It lists the exact allowed global color labels.

Can an isolated vertex have an empty list?

That makes the full instance infeasible because every vertex must receive a color.

Are equivalent color permutations removed?

No. The count distinguishes labeled assignments.

Does this optimize the number of colors?

No. It counts assignments from the entered allowed lists.

Find your calculator

Start typing to explore the library.