Color Refinement for Relational Structures
Benjamin Scheidt, Nicole Schweikardt
TL;DR
The paper generalizes Color Refinement to Relational Color Refinement (RCR), extending vertex-classification ideas from graphs to arbitrary finite relational structures. It establishes equivalent characterizations of RCR in terms of homomorphism counts from acyclic structures and in logical terms via the guarded fragment GF(C) and associated Guarded-Game, mirroring the classical CR story for graphs. It proves that, for any finite signature, RCR distinguishes two structures exactly when there exists an acyclic connected C with differing hom(C, A) vs. hom(C, B), or when GF(C) separates them, or when Spoiler wins the Guarded-Game. Computationally, RCR can be implemented in O(||A|| log ||A||) time for fixed signatures, using a refined multigraph representation to avoid combinatorial blow-ups, with a hidden factor depending on the maximum relation arity. Together, these results extend the foundational link between logical definability, combinatorial structure counts, and efficient structure refinement from graphs to arbitrary relational structures, with potential impact on isomorphism testing, query evaluation, and graph/network learning.
Abstract
Color Refinement, also known as Naive Vertex Classification, is a classical method to distinguish graphs by iteratively computing a coloring of their vertices. While it is mainly used as an imperfect way to test for isomorphism, the algorithm permeated many other, seemingly unrelated, areas of computer science. The method is algorithmically simple, and it has a well-understood distinguishing power: It is logically characterized by Cai, Fürer and Immerman (1992), who showed that it distinguishes precisely those graphs that can be distinguished by a sentence of first-order logic with counting quantifiers and only two variables. A combinatorial characterization is given by Dvořák (2010), who shows that it distinguishes precisely those graphs that can be distinguished by the number of homomorphisms from some tree. In this paper, we introduce Relational Color Refinement (RCR, for short), a generalization of the Color Refinement method from graphs to arbitrary relational structures, whose distinguishing power admits the equivalent combinatorial and logical characterizations as Color Refinement has on graphs: We show that RCR distinguishes precisely those structures that can be distinguished by the number of homomorphisms from an acyclic relational structure. Further, we show that RCR distinguishes precisely those structures that can be distinguished by a sentence of the guarded fragment of first-order logic with counting quantifiers. Additionally, we show that for every fixed finite relational signature, RCR can be implemented to run on structures of that signature in time $O(N\cdot \log N)$, where $N$ denotes the number of tuples present in the structure.
