---
title: Gallai Similarity Numbers in Grid Colorings
url: https://www.emergentmind.com/topics/gallai-similarity-numbers
type: topic
---

# Gallai Similarity Numbers in Grid Colorings

The Gallai similarity number is a grid Ramsey-type invariant quantifying, for a fixed pattern $A\subset\mathbb Z^n$ and coloring parameter $c\ge2$, the minimal integer $m$ such that every $c$-coloring of the $n$-dimensional grid $[m]^n=\{0,1,\dots,m-1\}^n$ necessarily contains a monochromatic set similar to $A$. This notion generalizes the classical Gallai number—originally formulated for homothetic patterns—by considering similarity transformations, and thus broadens the scope of combinatorial geometry in finite grid colorings. Recent work by Deuber, Nešetřil, and Rödl, as well as computational advances, has refined bounds and methods for determining these numbers for specific geometric configurations, notably via SAT-solving frameworks [2512.23303].

## 1. Formal Definition and Properties

For any finite $A\subset\mathbb Z^n$ and $c\ge2$, the Gallai similarity number is

$$
S_{\rm sim}(A,c) = \min \Bigl\{\,m\in\mathbb N:\,\text{every $c$-coloring of }[m]^n\text{ contains a monochromatic set similar to }A \Bigr\}.
$$

Here, "similar to $A$" refers to the image of $A$ under similarity transformations (compositions of scaling, rotation, and translation). The related homothety-Gallai number is given by

$$
\Gamma(A,c) = \min \{\ m\in\mathbb N:\,\text{every $c$-coloring of }[m]^n\text{ contains a monochromatic homothetic copy of }A\,\}.
$$

By inclusion of homotheties within similarities, the inequality $S_{\rm sim}(A,c) \le \Gamma(A,c)$ always holds. The determination of these numbers is a central combinatorial problem with connections to Ramsey theory and geometric extremal combinatorics.

## 2. Computed Gallai Similarity Numbers for Key Patterns

The article presents sharp results for several canonical planar and spatial patterns (all for $2$-colorings, $c=2$). Specifically:

| Pattern                   | $S_{\rm sim}(A,2)$ | $\Gamma(A,2)$ |
|---------------------------|--------------------|---------------|
| Equilateral triangle $\triangle$ | $4$ | $5$         |
| Axis-parallel unit-square $\square$ | $7$ | $15$         |
| Rectangle $1\times2$ ($R_2$)    | $8$ | —           |
| Rectangle $1\times3$ ($R_3$)    | $13$| —           |
| Rectangle $1\times4$ ($R_4$)    | $15$| —           |

For rectangles $R_k=\{(0,0),(1,0),(0,k),(1,k)\}\subset\mathbb Z^2$, the similarity numbers in all orientations are computed as above, confirming that for $m\ge S_{\rm sim}(R_k,2)$, every 2-coloring of $[m]^2$ contains a monochromatic rectangle similar to $R_k$, with bounds being tight [2512.23303].

For regular hexagons in the triangular lattice, it is established for side-lengths up to $\lfloor(m-1)/2\rfloor$ that $H_{94}$ is satisfiable (no monochromatic hexagon found), implying Gallai number for hexagons $\ge 95$. For axes-parallel unit-cubes in $\mathbb Z^3$, a coloring is constructed of $[0,179]^3$ with no monochromatic cube, so $\Gamma(\{0,1\}^3,2) \ge 181$.

## 3. From Homothety to Similarity Transformations

Gallai's classical theorem states existence of a minimal $m$ for monochromatic homothetic images of $A$ in any $c$-coloring of $[m]^n$. The extension from homothety (scaling and translation) to general similarity (allowing arbitrary scaling, rotation, translation) reduces the minimal grid size required. For example, in the case of equilateral triangles and axis-parallel unit squares, the similarity numbers are strictly less than the homothety numbers.

This suggests that accommodating additional geometric symmetries increases the prevalence of unavoidable monochromatic configurations under grid colorings, a plausible implication for general Ramsey-type phenomena.

## 4. SAT-Solver Framework for Computation

The determination of Gallai similarity numbers for nontrivial instances utilizes the Satisfiability Problem in Propositional Logic (SAT). Each 2-coloring of a finite grid $S$ is encoded by variables $\{ x_p : p \in S \}$, with $x_p=1$ if $p$ is colored black, $0$ otherwise.

To preclude a monochromatic copy of $A\subset S$, the clauses

$$
\bigl(\,\bigvee_{p\in A} x_p \bigr) \quad\text{and}\quad \bigl(\,\bigvee_{p\in A} \neg x_p \bigr)
$$

are imposed, jointly prohibiting $A$ being all black or all white. Aggregating constraints over all placements (and orientations, if relevant) of similar copies of $A$ leads to a CNF formula $\Upsilon(S,\mathcal A)$. The workflow is:

1. Increment $m$, generate the coloring instance for $[m]^n$.
2. Check satisfiability with CDCL-based SAT solvers (CaDiCaL, Kissat via PySAT).
3. The smallest $m$ for which the formula is UNSAT is the Gallai similarity number.

Symmetry breaking is essential for computational efficiency:

- **Global color-flip**: Imposing $\neg x_{(0,0)}$ eliminates color inversion symmetry.
- **Lattice dihedral symmetry**: Static symmetry breaking via BreakID is applied under $D_8$ (for squares) and $D_6$ (for triangles).

This methodology enables the exact computation of Gallai numbers for large configurations, notably pushing axis-parallel squares up to $15\times15$ grids and efficiently solving rectangle instances.

## 5. Bounds for Higher-Dimensional and Complex Configurations

While planar configurations such as triangles, squares, and rectangles admit sharp similarity number computations, in higher dimensions and for more complex lattice figures, only bounds or lower estimates are currently known. For regular hexagons in the triangular lattice, the satisfiability threshold in size $m=94$ provides a lower bound for the Gallai number of hexagons. Similarly, construction for the cube in $\mathbb Z^3$ prohibits any monochromatic unit-cube up to grids of size $180$ per axis, implying $\Gamma(\{0,1\}^3,2) \ge 181$, with no matching upper bound established.

A plausible implication is that the computational complexity and symmetry structure of the underlying geometric pattern heavily influence the tractability and sharpness of Gallai similarity number determination.

## 6. Significance and Applications

The computation of Gallai similarity numbers provides quantitative constraints in Ramsey-type combinatorics, characterizing the threshold grid sizes guaranteeing monochromatic similarities. These results have implications in finite geometry, coloring theory, and combinatorial search spaces. The extension from homothety to similarity tightly links combinatorial invariants with group-theoretic symmetry and geometric transformations. The SAT-encoding approach demonstrates an effective methodology for exact determination, especially in settings with high symmetry and computational complexity [2512.23303].

The calculation of these numbers for unit squares, triangles, rectangles, and select higher-dimensional figures establishes benchmarks and sharp thresholds that inform both theoretical development and computational investigations in discrete mathematics.

Source: https://www.emergentmind.com/topics/gallai-similarity-numbers