The Network Satisfaction Problem for Relation Algebras with at Most 4 Atoms
Abstract
Andréka and Maddux classified the relation algebras with at most 3 atoms, and in particular they showed that all of them are representable [1]. Hirsch and Cristiani showed that the network satisfaction problem (NSP) for each of these algebras is in or -hard [26]. The literature contains many results on representations of relation algebras; in particular, some relation algebras with four atoms are not representable. We extend the result of Cristiani and Hirsch to relation algebras with at most 4 atoms: the NSP is always either in or -hard. To this end, we construct universal, fully universal, or even normal representations for these algebras, whenever possible.
Keywords and phrases:
Constraint Satisfaction, Computational Complexity, Relation Algebras, Network Satisfaction, Normal Representations, Polynomial-Time AlgorithmsCategory:
Track B: Automata, Logic, Semantics, and Theory of ProgrammingCopyright and License:
2012 ACM Subject Classification:
Theory of computation ; Theory of computation Constraint and logic programming ; Theory of computation Problems, reductions and completenessSupplementary Material:
Software (Source Code): https://github.com/paulwinkler1/RelationAlgebrasWith4Atomsarchived at
swh:1:dir:49ad37df7cfccfe236d65a17a248eacb9dfd1557
Funding:
Manuel Bodirsky, Moritz Jahn, Matěj Konečný, and Paul Winkler received funding from the ERC (Grant Agreement no. 101071674, POCOCOP). Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency.Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Relation algebras are algebraic structures that can be used to abstractly reason about binary relations. They are certain expansions of Boolean algebras; besides the operations for union, intersection, and complement of binary relations, we also have a binary operation for composition of relations, and a unary operation for reversing the arguments of a binary relation. These operations need to satisfy certain natural identities; e.g., we require that holds for all elements and of the relation algebra.
Similarly to the fundamental facts that every group is isomorphic to a permutation group, and every Boolean algebra is isomorphic to an algebra of sets, the initial hope was that every relation algebra has a representation, which consists of a set of binary relations on some set that behave as prescribed by the relation algebra [39].
Example 1.
We first look at a concrete structure from which a small relation algebra can be obtained. Consider the structure , where is the set of rational numbers and is the usual strict linear order on . For any two rational numbers , exactly one of the following holds: , , or . Thus, the relations , , and form a partition of . Moreover, , where denotes the usual converse operation on binary relations, defined by .
This partition gives rise to a relation algebra with three atoms, denoted by , , and . Its domain consists of all formal unions of these atoms, i.e., . The other Boolean operations are defined in the usual way.
Let denote the usual composition of binary relations, i.e.,
In , for example, we have and . Accordingly, has a binary operation, also denoted by , satisfying, for example, and .
Note that is a Boolean algebra with elements, together with a binary operation and a unary operation . Instead of obtaining from concrete relations on , one may also start with the abstract algebra and ask whether it has a “representation”, similarly as above. Formally, we ask whether there exists a set and an injective homomorphism preserving the Boolean operations, converse, and composition. In particular, distinct atoms are mapped to disjoint binary relations, while formal unions such as are mapped to the corresponding unions. In the present example, the ordered set provides such a representation: take and map , , and to the relations , , and , respectively. The value of on all other elements of is then determined by preservation of the Boolean operations; for example, .
1.1 Network Satisfaction Problems and CSP Complexity
Starting in the 90s, another generation of researchers investigated relation algebras motivated by applications in theoretical computer science, particularly for the theory of constraint satisfaction. In a constraint satisfaction problem, we are given a finite set of variables and a finite set of constraints, and the task is to determine whether there exists an assignment to the variables that satisfies all the constraints. Constraint satisfaction problems have been studied intensively if the variables take values from a fixed finite domain. Relation algebras allow one to formalize interesting constraint satisfaction problems where the variables may take values from an infinite domain.
Concretely, to every finite relation algebra , we may associate the so-called network satisfaction problem, which is a computational problem where the input consists of a “constraint network”, i.e., a finite set of nodes and a function labeling pairs of nodes with elements from the relation algebra, and the task is to decide whether there exists a representation of where this network is satisfiable. Under certain representability conditions, e.g., if has a square representation ([7, Section 1.5]; definitions may be found in Section 2), the network satisfaction problem for is a constraint satisfaction problem as described above, but not necessarily for values from a finite set (the values rather come from the elements of the representation, which might be infinite).
If there is a so-called fully universal representation, then the network satisfaction problem is in . However, the complexity sometimes even drops to (polynomial time). The computational complexity of the NSP has been shown to be (-complete) or for each relation algebra with at most elements by Cristiani and Hirsch [26] (such relation algebras are called “small relation algebras”).
Example 2.
Let be the relation algebra from Example 1. An -network consists of finitely many nodes and a function mapping each ordered pair to some element of the relation algebra. Under the representation over , the label specifies the allowed relative position of the values assigned to and .
For instance, consider a network with nodes and function such that , , and , and such that all other pairs are labeled by . Under the representation over , these constraints mean , , and , respectively. This network is satisfiable, for example by assigning , , and .
On the other hand, if , , and , then the network is not satisfiable in this representation, since it would require .
In fact, the representation over is normal, in particular fully universal; see Section 2 for the definitions. The fact that the representation is fully universal implies that the network satisfaction problem for amounts to deciding whether a finite system of constraints over the signature can be satisfied over the rational numbers.
Hirsch [30] asked whether the computational complexity of the network satisfaction problem can be classified for all finite relation algebras. Bodirsky and Knäuer [12] proved that the problem of deciding whether a given finite relation algebra has an NSP which is in is undecidable, which can be interpreted as a negative answer to Hirsch’s question. The proof of the undecidability result relies on two earlier results, namely that there are finite relation algebras whose NSP is undecidable [31], and that the question whether a finite relation algebra has a representation is undecidable [29]. The classification for relation algebras with a fully universal representation, however, remains wide open.
A particularly interesting subclass are the relation algebras that have a normal representation, i.e., a representation which is fully universal, square, and homogeneous [30]. While this combination of assumptions still captures a rich class of relation algebras, it has a wide range of strong and useful consequences, as we will see below. A relational structure is homogeneous if every isomorphism between finite substructures can be extended to an automorphism of the structure. If a relation algebra has a normal representation, then has a countable normal representation , and this representation is unique up to isomorphism. Moreover, one can express important properties of the automorphism group of using , and conversely, properties of are reflected in this group. It is known that the question whether a given finite relation algebra has a normal representation is decidable [6].
The NSPs for relation algebras with a normal representation fall into the scope of the so-called tractability conjecture in constraint satisfaction, which implies that CSPs of reducts of finitely bounded homogeneous structures are in or -complete [16]. In particular, the subclasses of that properly lie between and and were constructed by Ladner [34] (conditionally on ) do not show up when classifying such NSPs. Such a dichotomy statement has been established for CSPs of finite structures [42] (announced independently by Bulatov [18] and by Zhuk [43]). One of the motivations for the more general conjecture from [16] is that many of the universal-algebraic methods used by both Bulatov and Zhuk can be applied for the more general class. And indeed, there exists a universal-algebraic condition which is a candidate for separating polynomial-time tractable from -complete CSPs for reducts of finitely bounded homogeneous structures, and this condition has numerous equivalent characterisations [16, 4, 3, 5, 7]. If this condition applies, the CSP is provably -hard; if not, then the conjecture states that the CSP is in . In our case, the tractability conjecture can be formulated as follows (for the definition of pp-constructability, see Section 2). Let be the ternary Boolean not-all-equal relation.
Conjecture 2.
Let be a normal representation of a finite relation algebra . If does not pp-construct , then and are in .111In the case where is a normal representation of , and are the same computational problem up to the translation between -networks and -structures.
We mention that the scope of the tractability conjecture from [16] for NSPs of relation algebras is larger than just the relation algebras with a normal representation: e.g., if a relation algebra has a representation which is homogenizable in the sense that we can add finitely many first-order definable relations to make it homogeneous, then its NSP is covered as well.
Homogeneous structures are also of central interest in model theory; via Fraïssé’s theorem, they are particularly easy to construct and provide a rich source of examples and counterexamples. It is conceivable that the class of homogeneous structures with a finite relational signature can be classified in some sense. There are uncountably many [28], but the uncountable families usually have a particularly simple shape [23]. One of the approaches in the study of homogeneous structures is to fix some (often binary) relational signature (e.g., the signature of graphs [33], digraphs [23], permutations [21], metric spaces [22], etc.) and to then classify the homogeneous structures with this signature. One of the motivations for this research program is its success story of producing beautiful and interesting mathematical structures that have inspired research in the areas mentioned above. Systematically listing finite relation algebras and then testing for the existence of a normal representation is another approach that can produce interesting new examples of homogeneous (or homogeneizable) structures.
There are potentially further well-behaved subclasses of representable relation algebras beyond those admitting homogenizable or even normal representations. To identify such classes, it is natural to consider families of relation algebras that are both sufficiently representative and sufficiently small to allow for a detailed analysis. Restricting the number of atoms provides such a family.
1.2 Contributions
We extend the mentioned result of Hirsch and Cristiani on small relation algebras, and systematically study all relation algebras with at most elements. An exhaustive list of the building blocks for such relation algebras has been computed by Maddux [37], confirming results of Comer [25], namely a list for the integral symmetric relation algebras with four atoms (numbered – by Maddux) and a list for the integral relation algebras with an asymmetric atom among its four atoms (numbered – by Maddux).
We prove that the NSPs for these not so small relation algebras are in or -hard. In the case where the algebra has a normal representation, our results confirm the mentioned tractability conjecture from [16]. More formally, we obtain the following results.
Theorem 3.
Let be a finite relation algebra with at most four atoms. Then is in or -hard.
Theorem 4.
Let be a normal representation of a finite relation algebra with at most four atoms. If does not pp-construct , then and are in .
For all but one of these algebras we also prove the containment of the NSP in ; the one exceptional case is . Actually, its NSP is also contained in , but the proof requires substantially different techniques and is published separately (see [8]).
In addition to our classification of NSP complexity, we revisit representability for all finite relation algebras with at most 4 atoms. Several of the algebras in the list do not have a representation (in which case the NSP is trivial and in ). We determine for each of the representable algebras whether has a normal representation, and if not, whether at least it has a fully universal (or even fully universal square) representation. This result is of independent interest in the theory of relation algebras; representations for all relation algebras with at most 3 atoms have been found in 1994 [1]. For this purpose, we present a combinatorial characterization for the existence of a fully universal square representation.
We think of this paper as exploratory work towards more general classifications of the complexity of NSPs, or representability questions, of suitable subclasses of relation algebras. Maddux’s list of relation algebras with at most four atoms is at the same time rich enough to display diverse behaviour, while remaining small enough for detailed analysis, including computer-assisted inspection.
We verified that in many cases, the existing methods apply (e.g. [12, 11, 10]). At the same time, we also needed to develop new methods (such as proving -hardness of the NSPs by reductions from the approximate graph coloring problem [19]; a so-called promise constraint satisfaction problem), as well as several ad hoc arguments for concrete cases. Several of these deserve explicit mention.
-
; this algebra is related to the class of 3-edge-coloured cliques with no rainbow triangle, which exhibits some nice combinatorics, and has a fully universal representation. Our structural insights are then the basis for a polynomial-time algorithm for its NSP; see Section 5.1 for details.
-
; this algebra is related to the class of quasi-transitive oriented graphs, which has been studied in graph theory [2]. There is no fully universal representation and we identify an atomic network with 4 vertices which is consistent but unsatisfiable. By working with the class of consistent atomic networks that exclude this 4-element network, we can construct a universal representation for . Our structural insights in combination with results from [2] are then also useful for a polynomial-time algorithm for the NSP of .
-
; this algebra contains exactly one non-trivial equivalence relation, and in every representation, the equivalence relation can have at most 3 classes. Our representability results for this algebra follow a similar pattern as our results for : while there is no fully universal representation, we can identify four atomic networks that are consistent but unsatisfiable. Excluding those, we can construct a universal representation; it follows that the NSP is in , and in fact it is -complete.
-
; this relation algebra is similar to the previous one, but allows one extra triple compared to . It has a representation, but not a fully universal one. Its NSP is -hard.
There are already several thousand relation algebras with five atoms [37], making a direct extension of the present classification substantially more challenging. The four-atom examples are expected to correspond to large subclasses of the five-atom list, and analysing these subclasses will help to identify useful generalisations by methods developed in this article.
1.3 Significance for Constraint Satisfaction
We believe that network satisfaction problems for relation algebras with a normal representation are an important class on which to test the mentioned tractability conjecture. The reason is that this approach can lead to CSPs with different behaviour, challenging the current methods. Previously, the tractability conjecture has mainly been tested on structures obtained as follows: fix a homogeneous finitely bounded “base” structure of fundamental interest (such as or the Rado graph), and study the CSP of all first-order reducts of it (see, e.g., [9, 15]). The advantage of this approach is that the model-theoretic properties of the entire class of structures obtained like this are inherited from the base structure, and the remaining task is mostly universal-algebraic. This advantage is at the same time a disadvantage, because by fixing a base structure we might overlook some phenomena that only appear for other base structures. The approach of the present article avoids this; and indeed, our study shows that new structures with different behaviour and interesting polynomial-time CSPs may show up.
2 Preliminaries
In the following, we will introduce some concepts from universal algebra and constraint satisfaction, as well as formal definitions of relation algebras and representations.
2.1 Constraint Satisfaction
Our basic terminology and notation (relational structures, homomorphisms, etc.) is standard; see e.g., [32], or the long version of the article. Let be a structure with a finite relational signature . Then the constraint satisfaction problem is the problem of deciding for a given finite -structure whether there exists a homomorphism to .
Example 5.
is the positive not-all-equal 3-SAT problem, which is -complete [27].
A more refined tool than many-one reductions to determine the computational complexity of a CSP are pp-interpretations and pp-constructions. The advantage of these kinds of reductions is that they have an algebraic characterization and hence open up ways of solving complexity questions by means of universal algebra. A formula is called primitive positive (shortly pp) if it is of the form , where each is atomic, i.e., of the form , , , or for some relation in the signature.
Definition 6.
Let and be structures with relational signatures and , respectively. A primitive positive interpretation of dimension of in is a partial surjection such that for every relation , say of arity , which can be defined by an atomic formula over , the -ary relation given by
can be defined in by a primitive positive formula . Since equality and are always allowed as atomic formulas, there must in particular exist
-
a -formula (called the domain formula) such that holds if and only if is in the domain of ;
-
a -formula such that holds if and only if .
In this case we say that pp-interprets . We say that pp-constructs if pp-interprets a structure that is homomorphically equivalent to , i.e., there exists a homomorphism from to and one from to .
The following is well-known.
Proposition 7 (see, e.g., [7, Theorem 3.1.4]).
If pp-constructs , then is log-space reducible to . In particular, if pp-constructs , then is -hard.
An important concept from universal algebra to study the complexity of CSPs of finite and -categorical structures is that of polymorphisms.
Definition 8.
Let be a relational signature. A polymorphism of a -structure is a homomorphism from the direct product to .
Intuitively, polymorphisms are a generalisation of automorphisms; the existence of certain polymorphisms of can imply tractability of CSP(), while non-existence of certain polymorphisms often implies hardness.
2.2 Relation Algebras
(Integral) relation algebras have also been discovered and studied with a different formalism and under the different name of hypergroups [44] (also called polygroups [25]).
Definition 9.
A relation algebra is an algebra with domain and signature such that
-
1.
the structure , with defined by , is a Boolean algebra;
-
2.
is an associative binary operation on A, called composition;
-
3.
for all : ;
-
4.
for all : ;
-
5.
for all : ;
-
6.
for all : ;
-
7.
for all : ;
-
8.
for all : .
If is a relation algebra with elements and , then we write if holds in . Clearly, defines a partial order on . An element is called an atom if there is no element with . The set of all atoms is denoted by .
For a finite relation algebra , the operation is completely determined by its restriction to the atoms. A tuple is called an allowed triple if . Otherwise, is called a forbidden triple. We denote by
the set of all allowed triples. An element is called reflexive if , symmetric if , transitive if , and an equivalence relation if is reflexive, symmetric, and transitive. A relation algebra is called symmetric if all are symmetric, integral if and implies or (see [36]), and simple if for all . Each relation algebra has an associated finite relational structure, its atom structure.
Definition 10.
Let be a relation algebra. The atom structure of is the finite relational structure with domain and the following relations:
-
for every the unary relation ,
-
the binary relation , and
-
the ternary relation .
If are two binary relations, then denotes the composition
Definition 11.
Let be a relation algebra. A structure with signature is called a representation of if
-
1.
;
-
2.
;
-
3.
;
-
4.
for all we have ;
-
5.
for all we have ;
-
6.
for all we have ;
-
7.
for all we have .
Relation algebras that have a representation are called representable.
All relation algebras with at most elements have a representation [1]. Tarski [39] asked whether every relation algebra is representable. This question was answered by Lyndon [35], who found a relation algebra with elements which is not representable. Monk [38] later showed that this problem has no easy fix, because the class of representable relation algebras cannot be axiomatized by a finite set of identities, and not even by a finite set of first-order sentences, answering another question of Tarski. However, it follows from results of Tarski [40] that there is an infinite set of identities that axiomatizes the representable relation algebras.
A useful tool to construct more complex relation algebras from simpler ones is the so-called 2-cycle product; the construction preserves representability (and, as we will see, even fully universal representability, normal representability, etc.) and it will also be useful in complexity considerations.
Definition 12.
Let and be two finite relation algebras such that . The 2-cycle product is defined to be the up to isomorphism unique relation algebra such that and
Definition 13.
If is a relation algebra, then an -network consists of a finite set of variables and a function (see, e.g., [7, Section 1.5.3]). If is a representation of , then is called satisfiable in if there exists a function such that for all we have . An -network is called
-
atomic if for all we have that is an atom in ;
-
consistent (also: path-consistent, 3-consistent, or closed) if for all we have
(2.1) -
satisfiable if it is satisfiable in some representation of .
Definition 14.
The network satisfaction problem for a fixed finite relation algebra , denoted by , is the following computational problem: The input consists of an -network . The task is to decide whether is satisfiable.
Definition 15.
A representation of a relation algebra is called universal if every satisfiable -network is satisfiable in , and fully universal if every consistent atomic -network is satisfiable in .
Definition 16.
A representation of is called normal if it is square, fully universal, and homogeneous.
It follows from Theorem 18 below that the question whether a given finite relation algebra has a normal representation is decidable. The following definition is standard in model theory when phrased for structures; we present here a relation algebra version.
Definition 17 (The Amalgamation Property).
Let be a relation algebra and let be a class of consistent atomic -networks. We say that has (the -amalgamation property) if for any two networks with , and , if for all , then there exists a network with for all and . We say that has the Joint Embedding Property (JEP) if holds for all .
Theorem 18 ([6, Theorem 8]).
Let be a relation algebra with atoms and let be the class of all consistent atomic -networks. Then has a normal representation if and only if has .
Some relation algebras do not have a normal representation, but still have a fully universal representation. Such representations can be conveniently constructed with the following theorem, which is essentially due to Comer [24], but phrased there in a different formalism.
Theorem 19.
Let be a finite relation algebra. Then has a
-
fully universal representation if and only if the class of all consistent atomic -networks has AP for all ;
-
fully universal square representation if and only if the class of all consistent atomic -networks has the JEP and AP for all .
3 Representations for Algebras with at most 4 Atoms
In this section we revisit the representability for relation algebras with at most 4 atoms. We will show that we may focus on integral relation algebras. Exhaustive lists of integral relation algebras have been computed by Maddux [37]. There are
-
2 integral relation algebras with two atoms (Table 1),
-
3 integral asymmetric relation algebras with three atoms (Table 2),
-
7 integral symmetric relation algebras with three atoms (Table 3),
-
37 integral asymmetric relation algebras with four atoms (Table 4), and
-
65 integral symmetric relation algebras with four atoms (Table 5).
It can be shown that a relation algebra is simple in the sense defined earlier if and only if it is simple in the sense of universal algebra (see, e.g., [20]). The following lemma shows that we can focus on simple relation algebras.
Lemma 20 (see, e.g., [12]).
Let be a representation of and a representation of , and suppose that and . Then has a union representation, which is the -structure with domain defined by .
Example 21.
Consider the relation algebra on four atoms , which is uniquely given by requiring and the multiplication table given in Figure 1. It has a normal representation with domain which is given by , , , and . The algebra is simple, but not integral. It is easy to see that its NSP can be solved in polynomial time.
It turns out that we can even restrict our attention to integral relation algebras.
Proposition 22.
The algebra from Example 21 is up to isomorphism the only simple non-integral relation algebra with at most four atoms.
Comer [25] states that at least 28 of the 102 integral relation algebras with four atoms are not representable. Results of Maddux [37] imply that in fact 31 do not have a representation. (And, as we have mentioned earlier, all others turn out to have a representation.)
Theorem 23.
The following 31 integral relation algebras have no representation:
-
the 11 asymmetric relation algebras , , , –, , ;
-
the 20 symmetric relation algebras –, –, –, –, , , .
Therefore, their s are trivial and in .
Examples of finite relation algebras with a normal representation include those with a flexible atom (see, e.g., [11]).
Definition 24.
Let be a relation algebra. An atom is called a flexible atom if holds for all .
The relation algebras with a flexible atom are listed in Figure 2. Note that if a relation algebra has a flexible atom then it has a normal representation, as one can, when applying Theorem 18, always use a flexible atom for all undetermined values.
| Name | Flexible Atoms | Name | Flexible Atoms |
|---|---|---|---|
With the criterion presented in Theorem 18 we verified using a computer program that the following relation algebras with at most four atoms have a normal representation:
| (3.1) | ||||
We will now discuss how representability properties of relation algebras translate to their cycle products, and apply our results to the case of integral relation algebras with four atoms.
Theorem 25 ([36, Theorem 5], see also [24]).
Let and be two finite representable integral relation algebras such that and . Let and be square representations of and , respectively. Then is representable and has the representation on the domain defined as follows. For all :
Lemma 26.
Let be finite integral relation algebras with and representations and . Then
-
1.
if and are fully universal, then is a fully universal representation of .
-
2.
if and are square, then is a square representation of .
-
3.
if and are normal, then is a normal representation of .
To obtain a relation algebra from – as a 2-cycle product, we have to multiply an algebra from – with or with . See the first three lines of Figure 3 for all such products. Since all these algebras have a normal representation (see (3.1)), the 2-cycle product has a normal representation as well. To obtain a relation algebra from – as a 2-cycle product, we can restrict ourselves to the case where we multiply algebras from – with or with , see the last seven lines of Figure 3. Except for , all factors have a normal representation, so the corresponding products have a normal representation.
We are now left with relation algebras that are representable, but that do not have a normal representation. By verifying the criterion from Theorem 19, we obtain that the algebras , , , , and have fully universal square representations. It turns out that all remaining algebras do not have a fully universal representation. For the four algebras , , , and , this can be shown by using the fact that they can all be written as 2-cycle products with one factor being , which does not have a fully universal representation. has a square representation with 7 elements, but it has no fully universal representation. Moreover, it can be shown that all of its square representations have at most 16 elements. has a square representation with 13 elements, but also no fully universal representation. All square representations have at most 16 elements.
Finally, we are left with the three relation algebras , , and , which have infinite square representations, but no fully universal ones. For the first two of them, we even obtain the following stronger results.
Theorem 27.
There is a consistent, but unsatisfiable atomic -network on four vertices and a square representation of such that a consistent atomic -network is satisfiable in if and only if it does not have as a subnetwork.
Theorem 28.
There are four consistent, but unsatisfiable atomic -networks , , , and on four vertices and a square representation of such that a consistent atomic -network is satisfiable in if and only if it has none of , , , and as a subnetwork.
4 NP-hard Algebras with at most 4 Atoms
In this section we present -hardness results for relation algebras with at most 4 atoms. If the relation algebra has a normal representation, it falls into the scope of the tractability conjecture (Conjecture 1.1), and we provide a pp-construction of in each of these cases. For the relation algebras with at most 3 atoms, a classification has already been established in [26], with two corrections in [10]; in particular, is -complete. For the relation algebras with 4 atoms, the NSP for has been shown to be -complete by Broxvall and Jonsson [17]; by inspecting their proof, it is not difficult to obtain a pp-interpretation of in the normal representation of , confirming the tractability conjecture in this case. The remaining hardness proofs are grouped according to the applied proof method.
The -completeness of the and follows from our representability results together with the following lemma:
Lemma 29.
Let be a finite simple relation algebra such that the maximum cardinality of all square representations of equals . Then is in . If additionally has a square representation with at least three elements, then is -complete.
The network satisfaction problem for finite symmetric relation algebras with a flexible atom is in or -complete [11]. The tractability conjecture (Conjecture 1.1) has already been confirmed for this case (compare to [12, Theorem 9.1]). To determine which of the two cases applies in the concrete cases, we need the following propositions.
Proposition 30 ([11, Theorem 2.21 and Proposition 6.1]).
Let be a finite, symmetric, integral relation algebra with a flexible atom and a normal representation of . If does not have a binary injective polymorphism, then is -complete.
Proposition 31 ([12, Lemma 4.3]).
Let be a finite symmetric relation algebra with a normal representation that has a binary injective polymorphism. Then is an allowed triple of for all .
The relation algebras , , , , , , and are all symmetric, have a flexible atom (see Figure 2), but contain an element such that is a forbidden triple. Thus, they have no binary injective polymorphism by Proposition 31, and therefore, by Proposition 30, their NSPs are -complete. The algebra is symmetric and has a flexible atom too. It can be shown that its atom structure has an -complete CSP, which implies that is -complete as well due to the following theorem:
Theorem 32 ([11, Theorem 9.1]).
Let be a finite symmetric relation algebra with a flexible atom and atom structure . Then and are polynomial-time equivalent.
An equivalence relation is called proper if is a proper subset of ; it is called trivial if it is the equality relation on , and non-trivial otherwise. The algebras , , , , , , , , , , , , , , , and all have a normal representation and a non-trivial proper equivalence relation such that has only finitely many classes. Hence, their NSPs are -complete by the following theorem:
Theorem 33 ([10, Theorem 23]).
Let be a finite relation algebra with normal representation and a non-trivial proper equivalence relation such that has only finitely many classes. Then is -complete.
Next, we consider algebras which do not contain a non-trivial proper equivalence relation. A permutation group is called primitive if it does not preserve a non-trivial proper equivalence relation. Note that if is a finite relation algebra with a normal representation , then is primitive if and only if does not contain equivalence relations besides and .
Using the following theorem, we obtain -completeness for the NSPs of , , and .
Theorem 34 ([10, Theorem 29]).
Let be a relation algebra with a normal representation . If is primitive and is symmetric such that is forbidden in , then and are -complete.
The proofs of Theorem 33 and 34 in [10] already confirm the tractability conjecture (Conjecture 1.1) in all cases which we considered.
The following lemmas imply that if a relation algebra is a 2-cycle product of two relation algebras and , and or has an -complete NSP, then the network satisfaction problem for the 2-cycle product has an -complete NSP as well.
Lemma 35.
Let and be finite relation algebras such that and are both in . Then is in as well.
Lemma 36.
Let and be finite representable relation algebras such that . Then there is a polynomial-time reduction from to and from to . If and are normal representations of and , respectively, then pp-constructs and .
From these two lemmas and Table 3 we infer the -completeness of the NSPs of , , , , , , , , , and and confirm the tractability conjecture for those among them that have a normal representation.
We prove the -hardness of seven NSPs by means of pp-interpretations. For the algebras , , and , it can be inferred from the nonexistence of certain polymorphisms that the respective normal representation pp-interprets ; the argument is summarized in the following proposition.
Let be a normal representation of a finite relation algebra and . An operation is called -canonical (with respect to ) if there exists a function such that for all and , if for all , then . The function is called the behaviour of on .
Proposition 37.
Let be a finite relation algebra with a normal representation . If there are two distinct elements such that every polymorphism of is -canonical, but its behaviour on is not a binary symmetric, a ternary majority, or a ternary minority operation, then is -complete.
We take a different approach for the two hardness proofs of and , in which we directly give a pp-interpretation of a structure with -hard CSP in the normal representation of the respective relation algebra.
Let be the Henson graph, i.e., the countable homogeneous graph whose age is the class of all finite undirected triangle-free graphs. We obtain a (normal) representation of : we set , , , and extend to all other relations by taking the respective Boolean combinations. It is known that is -complete [10]. By a reduction from , we obtain that the normal representations of and pp-construct ; consequently, and are -complete.
The algebras , , and do not have a normal representation and hence do not fall within the scope of the tractability conjecture. We show the -hardness of their NSPs by many-one reductions from again the Henson graph and from -hard Boolean satisfiability problems.
As we have seen (Theorem 28), the algebra has a universal representation, which is obtained by excluding four atomic networks that are consistent but unsatisfiable; it follows that the NSP is in , and in fact it is -complete. The algebra is similar to the previous one, but allows one extra triple compared to . Its NSP is -hard as well; proving the containment of the NSP in turns out to be challenging and was published separately (see [8]). We obtain the -hardness of and as a corollary of the following new technique based on a recent hardness result from the area of promise constraint satisfaction problems [19].
Proposition 38.
Let be a representable finite relation algebra with two symmetric atoms such that and are forbidden and is an allowed triple. Then is -hard.
Remark 39.
This method also shows that the NSP for each of the algebras , , , , , , , , , , , , , and is -hard (which was already established earlier), since each of them is representable and has two atoms satisfying the condition of Proposition 38.
5 Tractable Algebras with at most 4 Atoms
We present polynomial-time algorithms for the network satisfaction problem for all the remaining integral relation algebras with at most four atoms.
Let be the atom structure of a relation algebra that has a fully universal representation. The following implies that if is in , then so is .
Proposition 40 ([12, Proposition 2.16]).
Let be a finite relation algebra with a fully universal representation . Then there is a polynomial-time reduction from to .
The good news here is that there is a complete complexity classification of finite domain CSPs, as we mentioned in the introduction; the bad news is that might be -complete, while is still in ; this happens for instance for the point algebra [41] and will later force us to treat some cases separately. But first, we will make use of Proposition 40 via the following lemma:
Lemma 41.
Let be a relation algebra with a fully universal representation and atom structure . If has a polymorphism which is binary symmetric or a ternary weak near unanimity operation, then is in .
The atom structures of the algebras , , , , , , , , , and all have a binary symmetric polymorphism; hence, the NSPs of those algebras are in . For the algebras , , , , , , , , and , we obtain tractability of their NSPs since their respective atom structures all have a ternary weak near unanimity polymorphism; for , this was already shown in [14].
A particularly natural polynomial-time algorithm in the context of the network consistency problem and the network satisfaction problem for a fixed relation algebra is the path consistency algorithm. It takes as input an -network and repeatedly considers three variables and updates by intersecting it with . The NSPs of , , and can be solved by the path consistency procedure, and are thus polynomial-time tractable.
We are left with the two algebras and , which turn out to have polynomial-time tractable NSPs as well. Our algorithms for them are more involved and make use of structural results about consistent - and -networks, respectively, to solve their NSPs by a divide-and-conquer approach. The algebra is related to the class of quasi-transitive oriented graphs, which has been studied in graph theory [2]. As we have mentioned, it has a universal square representation, which is obtained by excluding a single consistent, but unsatisfiable atomic network on four vertices (Theorem 27); this representation is in turn closely related to series-parallel partial orders. We discuss the NSP of in the following section and refer to the long version of the paper for .
5.1 The Relation Algebra
The algebra has four symmetric atoms and as forbidden triple. It is related to the class of 3-edge-coloured cliques with no rainbow triangle, which exhibits interesting combinatorics, and has a fully universal representation.
We need the following facts about consistent atomic -networks . If , let be the graph . The following is straightforward.
Lemma 42.
Let be a consistent atomic -network. If and are different connected components of , for some , then is constant on all pairs for and .
The following lemma is due to Sebastian Meyer (personal communication).
Lemma 43.
Let be a consistent atomic -network such that the image of is not . Then at least one of the graphs , , and is disconnected.
Note that all relations of the relation algebra can be generated from the following relations: and for . For example, . Similarly we can obtain and . We can then obtain all others by appropriately intersecting the ones that we already have. It therefore suffices to present an algorithm for the NSP restricted to networks with the relations (see the long version of the paper for details).
Definition 44.
Let be a -network such that the image of is contained in and let . A -cut of is a partition of into disjoint sets such that if , then and must lie in the same part. A -cut is valid if for all distinct there exists such that for all and .
Definition 45.
A non-identity solution to an -network is a solution such that there are with .
Lemma 46.
Let be a -network such that has a non-identity solution and the image of is contained in . Then there is a valid -cut in for some .
Proof.
Let be a non-identity solution of . By Lemma 43, there exists such that is disconnected. Let be the connected components of . Clearly, it is a -cut of . Lemma 42 implies that it is valid.
Note that the condition from Lemma 46 can be checked in polynomial time: to check whether has a valid -cut, we first compute the connected components of the graph (e.g., via depth-first search). If the connected components provide a valid -cut we are done. Otherwise, there exist two components and that witness that the cut is not valid. In this case, we merge and into one component. If the resulting -cut is valid, we are done. Otherwise, we repeat contracting components. If the procedure ends up with a single component, then there does not exist a valid -cut.
Proposition 47.
is in .
Proof.
Let be a given -network. As we have explained earlier, we may assume without loss of generality that the image of is contained in .
-
1.
If there is no pair of variables labelled , then answer “satisfiable” (we may map all of to the same point in a representation of ).
-
2.
Otherwise, if for every there is no valid -cut in return “unsatisfiable” (there is no solution by Lemma 46).
-
3.
Otherwise, let be a valid -cut in , for some , and recursively solve the subinstances induced on each of .
-
4.
If a recursive call returns “unsatisfiable”, then return “unsatisfiable”.
-
5.
Otherwise, return “satisfiable” (a consistent atomic network with for all can be obtained from solutions for by setting for every and with ).
The proof that this algorithm is correct follows by induction on the number of variables of the instance. The running time is in if is the size of the input.
6 Open Problems
We view our complexity dichotomy for the network satisfaction problem for relation algebras with at most 16 elements as an encouraging basis for a more general classification result without any restriction on the number of elements for the finite relation algebras with a normal (or even just fully universal) representation. The following other problems are also left open.
Question 47.
Is the existence of a fully universal representation for a given finite relation algebra effectively decidable?
Question 47.
What is the smallest relation algebra such that is not in ?
The network consistency problem (NCP) of a relation algebra is the following computational problem: Its input is an -network . The task is to decide whether there exists a consistent atomic network (which will also be called the solution to the given problem instance) on the same set of vertices such that for all we have . Unlike the network satisfaction problem of a finite relation algebra , which can be undecidable [31], the network consistency problem for is always in . For relation algebras with a fully universal representation, the NSP and the NCP have the same complexity, whereas for other algebras, additional efforts are required; e.g., if has no representation, then is trivial, whereas is generally not.
Problem 47.
Obtain a similar classification for the network consistency problem.
Problem 47.
Obtain a similar classification for the variant of the network satisfaction problem where the inputs are restricted to networks such that the range of consists only of atoms and .
References
- [1] Hajnal Andréka and Roger D. Maddux. Representations for small relation algebras. Notre Dame Journal of Formal Logic, 35(4):550–562, 1994. doi:10.1305/NDJFL/1040408612.
- [2] Jørgen Bang-Jensen and Jing Huang. Quasi-transitive digraphs. Journal of Graph Theory, 20(2):141–161, 1995. doi:10.1002/jgt.3190200205.
- [3] Libor Barto, Michael Kompatscher, Miroslav Olšák, Trung Van Pham, and Michael Pinsker. The equivalence of two dichotomy conjectures for infinite domain constraint satisfaction problems. In Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science – LICS’17, 2017. Preprint arXiv:1612.07551. arXiv:1612.07551.
- [4] Libor Barto, Jakub Opršal, and Michael Pinsker. The wonderland of reflections. Israel Journal of Mathematics, 223(1):363–398, 2018.
- [5] Libor Barto and Michael Pinsker. The algebraic dichotomy conjecture for infinite domain constraint satisfaction problems. In Proceedings of the 31st Annual IEEE Symposium on Logic in Computer Science – LICS’16, pages 615–622, 2016. Preprint arXiv:1602.04353. arXiv:1602.04353.
- [6] Manuel Bodirsky. Finite relation algebras with normal representations. In Relational and Algebraic Methods in Computer Science - 17th International Conference, RAMiCS 2018, Groningen, The Netherlands, October 29 - November 1, 2018, Proceedings, pages 3–17, 2018. doi:10.1007/978-3-030-02149-8_1.
- [7] Manuel Bodirsky. Complexity of Infinite-Domain Constraint Satisfaction. Lecture Notes in Logic (52). Cambridge University Press, Cambridge, United Kingdom; New York, NY, 2021. doi:10.1017/9781107337534.
- [8] Manuel Bodirsky, Santiago Guzmán-Pro, Moritz Jahn, Matěj Konečný, and Paul Winkler. Circular chromatic numbers, balanceability, relation algebras, and network satisfaction problems, 2025. Preprint available under https://arxiv.org/abs/2512.06878. doi:10.48550/arXiv.2512.06878.
- [9] Manuel Bodirsky and Jan Kára. The complexity of temporal constraint satisfaction problems. Journal of the ACM, 57(2):1–41, 2009. An extended abstract appeared in the Proceedings of the Symposium on Theory of Computing (STOC). doi:10.1145/1667053.1667058.
- [10] Manuel Bodirsky and Simon Knäuer. Hardness of network satisfaction for relation algebras with normal representations. In Relational and Algebraic Methods in Computer Science, pages 31–46. Springer International Publishing, 2020. doi:10.1007/978-3-030-43520-2_3.
- [11] Manuel Bodirsky and Simon Knäuer. The complexity of network satisfaction problems for symmetric relation algebras with a flexible atom. Journal of Artificial Intelligence Research, 75, 2022. doi:10.1613/jair.1.14195.
- [12] Manuel Bodirsky and Simon Knäuer. Network satisfaction problems solved by -consistency. In 50th International Colloquium on Automata, Languages, and Programming, ICALP 2023, July 10-14, 2023, Paderborn, Germany, pages 116:1–116:20, 2023. doi:10.4230/LIPIcs.ICALP.2023.116.
- [13] Manuel Bodirsky and Martin Kutz. Pure dominance constraints. In Proceedings of the Symposium on Theoretical Aspects of Computer Science (STACS), pages 287–298, 2002. doi:10.1007/3-540-45841-7_23.
- [14] Manuel Bodirsky, Barnaby Martin, Michael Pinsker, and András Pongrácz. Constraint satisfaction problems for reducts of homogeneous graphs. SIAM Journal on Computing, 48(4):1224–1264, 2019. A conference version appeared in the Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, pages 119:1-119:14. doi:10.1137/16M1082974.
- [15] Manuel Bodirsky and Michael Pinsker. Schaefer’s theorem for graphs. Journal of the ACM, 62(3):52 pages (article number 19), 2015. A conference version appeared in the Proceedings of STOC 2011, pages 655-664. doi:10.1145/2764899.
- [16] Manuel Bodirsky, Michael Pinsker, and András Pongrácz. Projective clone homomorphisms. Journal of Symbolic Logic, 86(1):148–161, 2021. doi:10.1017/JSL.2019.23.
- [17] Mathias Broxvall and Peter Jonsson. Point algebras for temporal reasoning: Algorithms and complexity. Artificial Intelligence, 149(2):179–220, 2003. doi:10.1016/S0004-3702(03)00075-4.
- [18] Andrei A. Bulatov. A dichotomy theorem for nonuniform CSPs. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, pages 319–330, 2017. doi:10.1109/FOCS.2017.37.
- [19] Jakub Bulín, Andrei A. Krokhin, and Jakub Opršal. Algebraic approach to promise constraint satisfaction. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, STOC 2019, Phoenix, AZ, USA, June 23-26, 2019, pages 602–613, 2019. doi:10.1145/3313276.3316300.
- [20] Stanley N. Burris and Hanamantagouda P. Sankappanavar. A Course in Universal Algebra. Springer Verlag, Berlin, 1981.
- [21] Peter J. Cameron. The random graph. R. L. Graham and J. Nešetřil, Editors, The Mathematics of Paul Erdös, 1996.
- [22] Gregory Cherlin. Homogeneous ordered graphs and metrically homogeneous graphs, 2020. Preprint.
- [23] Gregory L. Cherlin. The classification of countable homogeneous directed graphs and countable homogeneous -tournaments. AMS Memoir, 131(621), January 1998.
- [24] Stephen D. Comer. Extension of polygroups by polygroups and their representations using color schemes. In Ralph S. Freese and Octavio C. Garcia, editors, Universal Algebra and Lattice Theory, pages 91–103, Berlin, Heidelberg, 1983. Springer Berlin Heidelberg.
- [25] Stephen D. Comer. A remark on chromatic polygroups. Congressus Numerantium, 38:85–95, 1983.
- [26] Matteo Cristiani and Robin Hirsch. The complexity of the constraint satisfaction problem for small relation algebras. Artificial Intelligence Journal, 156:177–196, 2004. doi:10.1016/J.ARTINT.2004.02.003.
- [27] Michael Garey and David Johnson. A guide to NP-completeness. CSLI Press, Stanford, 1978.
- [28] C. Ward Henson. Countable homogeneous relational systems and categorical theories. Journal of Symbolic Logic, 37:494–500, 1972.
- [29] R. Hirsch and I. Hodkinson. Representability is not decidable for finite relation algebras. Transactions of the American Mathematical Society, 353(4):1387–1401, 2001.
- [30] Robin Hirsch. Relation algebras of intervals. Artificial Intelligence Journal, 83:1–29, 1996.
- [31] Robin Hirsch. A finite relation algebra with undecidable network satisfaction problem. Logic Journal of the IGPL, 7(4):547–554, 1999. doi:10.1093/JIGPAL/7.4.547.
- [32] Wilfrid Hodges. A shorter model theory. Cambridge University Press, Cambridge, 1997.
- [33] Alistair H. Lachlan and Robert E. Woodrow. Countable ultrahomogeneous undirected graphs. Transactions of the AMS, 262(1):51–94, 1980.
- [34] Richard E. Ladner. On the structure of polynomial time reducibility. Journal of the ACM, 22(1):155–171, 1975. doi:10.1145/321864.321877.
- [35] R. Lyndon. The representation of relational algebras. Annals of Mathematics, 51(3):707–729, 1950.
- [36] Roger D. Maddux. Finite symmetric integral relation algebras with no 3-cycles. In Renate A. Schmidt, editor, Relations and Kleene Algebra in Computer Science, 9th International Conference on Relational Methods in Computer Science and 4th International Workshop on Applications of Kleene Algebra, RelMiCS/AKA 2006, Manchester, UK, August 29-September 2, 2006, Proceedings, volume 4136 of Lecture Notes in Computer Science, pages 2–29. Springer, 2006. doi:10.1007/11828563_2.
- [37] Roger Duncan Maddux. Relation Algebras: Volume 150. Studies in logic and the foundations of mathematics. Elsevier Science, London, England, May 2006.
- [38] Donald Monk. On representable relation algebras. Michigan Mathematical Journal, 11(3):207–210, 1964. doi:10.1307/mmj/1028999131.
- [39] Alfred Tarski. On the calculus of relations. J. Symbolic Logic, 6, 1941. doi:10.2307/2268577.
- [40] Alfred Tarski. Contributions to the theory of models. Koninklijke Nederlandse Akademie van Wetenschappen, Proceedings, 58:56–64, 1955.
- [41] Marc Vilain, Henry Kautz, and Peter van Beek. Constraint propagation algorithms for temporal reasoning: A revised report. Reading in Qualitative Reasoning about Physical Systems, pages 373–381, 1989.
- [42] Dmitriy Zhuk. A proof of the CSP dichotomy conjecture. J. ACM, 67(5):30:1–30:78, 2020. doi:10.1145/3402029.
- [43] Dmitriy N. Zhuk. A proof of CSP dichotomy conjecture. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, pages 331–342, 2017. arXiv:1704.01914.
- [44] Paul-Hermann Zieschang. Hypergroups. Springer, 2023.
Appendix A Appendix
In Tables 1–5, we present Maddux’s lists of integral relation algebras, together with references and comments about their representability and the computational complexity of their network satisfaction problem, thus summarizing the findings of the previous sections. The first column is the numbering introduced by Maddux. The following columns are labelled by triples (omitting brackets and commas for space reasons). An entry of the table contains the triple if it is an allowed triple of the relation algebra; this uniquely describes the relation algebra.
In the tables, we use the following abbreviations:
-
none: no representation exists
-
f.u.: the relation algebra is representable, but there is no fully universal representation.
-
f.u.: there exists a fully universal square representation, but no normal representation.
-
normal: there exists a normal representation, but the algebra has no flexible atom.
-
flex: there is a flexible atom (which implies the existence of a normal representation).
In [10] it has been noted that in the case of and the claims about the complexity of the NSP from [26] are incorrect, and we state the corrected results.
| Representability | NSP Complexity | ||
|---|---|---|---|
| normal | |||
| flex |
| Representability | NSP Complexity | |||
|---|---|---|---|---|
| normal | ||||
| normal | ||||
| flex |
| Representability | NSP Complexity | |||||
|---|---|---|---|---|---|---|
| normal | ||||||
| normal | ||||||
| normal | ||||||
| normal | ||||||
| flex | ||||||
| flex |
| Representation | NSP Complexity | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| f.u. | |||||||||
| none | |||||||||
| normal | |||||||||
| none | |||||||||
| normal | |||||||||
| normal | |||||||||
| normal | |||||||||
| none | |||||||||
| normal | |||||||||
| normal | |||||||||
| none | |||||||||
| none | |||||||||
| none | |||||||||
| none | |||||||||
| none | |||||||||
| none | |||||||||
| f.u. | |||||||||
| flex | |||||||||
| none | |||||||||
| flex | |||||||||
| none | |||||||||
| flex | |||||||||
| flex | |||||||||
| flex |
| Representation | NSP Complexity | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| f.u. | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| normal | ||||||||||||
| f.u. | ||||||||||||
| f.u. | ||||||||||||
| flex | ||||||||||||
| flex | ||||||||||||
| flex | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| normal | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none | ||||||||||||
| none |
| normal | ||||||||||||
| normal | ||||||||||||
| none | ||||||||||||
| flex | ||||||||||||
| [8] | ||||||||||||
| flex | ||||||||||||
| none | ||||||||||||
| flex | ||||||||||||
| none | ||||||||||||
| flex | ||||||||||||
| flex | ||||||||||||
| flex | ||||||||||||
| flex |
