Advanced maths

Graph b chromatic number calculator with color dominating vertices

Maximize proper color classes subject to a color-dominating vertex in every class.

Your numbers

Valid JSON; preserve the shown array or object structure.

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

A b-coloring is a proper vertex coloring with an additional witness requirement. In every color class, at least one vertex must have neighbors in all the other color classes. Such a vertex certifies that its color cannot disappear through the simplest local recoloring argument.

THE FORMULAEnumerate canonical set partitions of vertices, prune any block containing an edge. For each proper k-partition, require for every color class a vertex adjacent to at least one member of each other class. Maximize k subject to k≤Delta+1; return a dominating vertex per class and all neighbor-color witnesses. Search can start at upper bound but exhaustive failure at higher k is needed. Bound canonical partition count/states, distinguish proper coloring from b-coloring, and preserve isolated vertices.

A worked example

With the prefilled inputs, bChromaticNumber = 3.

Good to know

Every class has a vertex adjacent to at least one vertex in every other class. Maximum over all proper set partitions.

Each color needs a vertex that sees every other color

A b-coloring is a proper vertex coloring with an additional witness requirement. In every color class, at least one vertex must have neighbors in all the other color classes. Such a vertex certifies that its color cannot disappear through the simplest local recoloring argument.

The b-chromatic number maximizes the number of colors in a coloring satisfying this condition. Ordinary chromatic number instead minimizes colors in any proper coloring. Reversing that optimization direction without adding the witness condition would merely assign a separate color to every vertex.

Dominating color witnesses on P5Three b-colors on a five-vertex path01234color 0color 1color 2color 0color 1Color 0 witness: vertex 3Color 1 witness: vertex 1Color 2 witness: vertex 2Maximum degree 2 ⇒ at most 3
Scroll across to see the full diagram.
Colors 0,1,2,0,1 form a proper coloring. Vertices 3,1 and 2 each see both other colors, meeting the maximum-degree upper bound of three.

Compare with the Graph achromatic number calculator with a complete proper coloring. Require each color class to contain a vertex adjacent to every other color; achromatic coloring only requires some edge for each color pair.

Specify all vertices and their simple edges

Use the prefilled input structure and preserve the declared column or index order. Enter a loopless undirected graph with a declared vertex count. The coloring table assigns every vertex a class, while the witness table selects a dominating vertex from each nonempty class. Duplicate labels and undeclared endpoints should be rejected before enumeration begins.

A color-dominating vertex need not be adjacent to every other vertex. It only needs at least one neighbor of each other color. This distinction matters in sparse examples, where a valid witness can have degree equal to the number of other colors yet cover a much larger graph.

Enumerate proper partitions before checking witnesses

Canonical set partitions avoid revisiting the same coloring under every renaming of its colors. An assignment is rejected immediately if the new vertex shares a class with an adjacent vertex. A completed proper partition then undergoes the stronger color-domination test.

If k colors are used, every required witness has degree at least k−1. Thus the maximum degree plus one is an immediate upper bound. That bound can prune the search, but the existence of one high-degree vertex does not guarantee enough witnesses across all classes.

A five-vertex path reaches three colors

Color the vertices of a five-vertex path consecutively zero, one, two, zero and one. Vertex three in color zero sees colors two and one. Vertex one in color one sees colors zero and two, and vertex two in color two sees colors one and zero.

All edges join different colors, and each class has its required witness. The path's maximum degree is two, so no b-coloring can use more than three colors. The explicit coloring and the degree upper bound meet, certifying a b-chromatic number of three.

Visualize the witness neighborhoods rather than only colors

The SVG should mark the chosen dominating vertex of each class and identify a neighbor representing every other class. Color names or numeric labels must accompany fill colors so the proof remains readable in grayscale and accessible to readers with color-vision differences.

A table of witness, required color and supporting neighbor is a compact verification certificate. It exposes missing-color errors that a visually attractive proper coloring can conceal. Checking every edge and every witness row independently is easier than trusting the optimizer's main result card.

A proper coloring can fail the b condition

Using many colors does not ensure a valid b-coloring. A unique color on a low-degree endpoint cannot witness several other colors if it has only one neighbor. The optimizer must evaluate every color class, not merely count the distinct colors appearing in the returned assignment.

Disconnected graphs require the same global definition. Neighbors cannot cross components, so a witness must see all the other colors within its own component. Color reuse across components is allowed, but simply adding their separate b-chromatic numbers is not a valid combination rule.

Maximum claims require completed exclusions

A feasible k-color witness gives a lower bound on the b-chromatic number. To claim maximum, the engine must rule out every higher feasible color count up to its mathematical upper bound, or provide another valid argument excluding them.

Set partitions grow rapidly, so the proposed nine-vertex limit still needs a state budget. A cap leaves the maximum unresolved. Regression cases should include complete graphs, isolated vertices, stars and the five-path example, because they stress witness availability rather than only edge properness. The public prefill is a triangle, which has b-chromatic number three with every vertex serving as its own color-class witness. The five-path example above is deliberately separate: it demonstrates that a sparse graph can reach the same parameter while its ordinary minimum coloring needs only two colors. Do not describe the five-path colors as the triangle prefill result. Every class has a vertex adjacent to at least one vertex in every other class. Maximum over all proper set partitions.

A few questions, answered

Is the b-chromatic number a minimum-color result?

No. It is the largest number of colors possible while every class retains a color-dominating vertex.

Does a dominating vertex need every other vertex as a neighbor?

No. It needs at least one neighbor in every other color class, not adjacency to every member of those classes.

Why is maximum degree plus one an upper bound?

A witness for k colors needs neighbors representing k−1 distinct other colors, so its degree must be at least k−1.

Can the optimizer ignore isolated vertices?

No. They must receive colors and can obstruct a unique additional color class because an isolated vertex sees no other colors.

Find your calculator

Start typing to explore the library.