Adaptive Query Algorithms for Relational Structures Based on Homomorphism Counts

Balder ten Cate, Phokion G. Kolaitis, Arnar Á. Kristjánsson

Abstract

This research explores the limits of homomorphism counting as a mechanism for identifying classes of relational structures. By distinguishing between "left" queries (mapping patterns into an input) and "right" queries (mapping an input into target structures), the authors establish a fundamental asymmetry in query power. While left queries form a strict hierarchy where adaptivity and unboundedness increase expressive power, the right-query hierarchy collapses, requiring only two adaptive queries to decide any class of structures.

Introduction

In finite model theory, the identity of a relational structure $A$ (such as a graph or database) can be captured through its relationship with other structures. A landmark result by Lovász demonstrates that the collection of homomorphism counts from all finite structures into $A$ uniquely determines $A$ up to isomorphism. However, this theoretical result assumes an infinite number of queries. This paper addresses the practical constraint: what can be decided about a structure using a finite, potentially adaptive, sequence of homomorphism-count queries?

Methodology

The authors employ a multi-disciplinary approach combining finite model theory, algebraic logic, and topology. Key techniques include:

  • Structural Analysis: Utilizing the "net length" of oriented walks and directed cycle symmetries to prove indistinguishability between structures under limited query regimes.
  • Topological Characterization: Defining a "homomorphism topology" where decidability over the Boolean semiring $\mathbb{B}$ (existence queries) corresponds to "clopen" (both closed and open) sets.
  • Adversarial Arguments: Constructing specific pairs of structures to demonstrate lower bounds on query complexity, showing that certain properties cannot be distinguished by $k$ queries.

The Asymmetry of Left and Right Queries

The most significant contribution of this work is the characterization of the "Left-Right" query divide, revealing how the direction of mapping fundamentally changes the complexity of identification.

The Left-Query Hierarchy

Left queries, denoted as $\text{hom}(F, \cdot)$, count the number of ways a pattern $F$ can be mapped into the input structure. The authors prove a strict hierarchy of expressive power:

  1. Non-adaptive: All patterns are chosen beforehand.
  2. Adaptive Bounded: Each query depends on previous results, but the total number of queries $k$ is fixed.
  3. Adaptive Unbounded: The algorithm can ask an arbitrary number of questions, provided it eventually terminates.

For any $k$, there exist classes of structures that require at least $k+1$ queries to be identified, proving that more queries—and the ability to ask them adaptively—provide strictly more information.

The Right-Query Collapse

In stark contrast, right queries, denoted as $\text{hom}(\cdot, F)$, map the input structure into a target $F$. The authors demonstrate that the right-query hierarchy is remarkably shallow. Over the natural numbers $\mathbb{N}$, any class of structures can be decided using just two adaptive right queries. This reveals that right queries are exponentially more powerful for structural identification than their left-oriented counterparts.

Logical and Topological Connections

The paper bridges query algorithms with established concepts in computer science and logic:

  • Datalog: The research links query algorithms to Datalog programs. While some Datalog-definable classes are easily queried, others remain impossible to decide with left-query algorithms, even within simple monadic linear Datalog.
  • Constraint Satisfaction Problems (CSPs): For CSPs, the authors show that decidability via adaptive unbounded algorithms is equivalent to First-Order (FO) definability.
  • Counting vs. Existence: In cases of homomorphic equivalence, the authors prove that the exact count of homomorphisms provides no more information than a simple Boolean "exists" query.

Limitations and Future Directions

Despite establishing these hierarchies, the authors note that the exact growth rate of queries relative to input size remains loosely bounded, with a significant gap between logarithmic lower bounds and exponential upper bounds. Furthermore, while an effective criterion exists for CSPs, a general "Rice-style" theorem for Datalog programs remains elusive; determining if a specific Datalog program is decidable via these query algorithms is a potentially undecidable problem. Future research into hybrid algorithms combining both left and right queries may offer more efficient paths for structural identification.

Summary updated

BibTeX
@inproceedings{cate2025adaptive,
  author = {Balder ten Cate and Phokion G. Kolaitis and Arnar Á. Kristjánsson},
  title = {{Adaptive Query Algorithms for Relational Structures Based on Homomorphism Counts}},
  booktitle = {MFCS},
  year = {2025},
  doi = {10.4230/lipics.mfcs.2025.34},
}
Figure