Many computational problems in temporal and spatial reasoning can be formulated as network satisfaction problems for a fixed finite relation algebra [Dün05, RN07, BJ17]. Famous examples of finite relation algebras that have been studied in this context are the Point Algebra, the Left Linear Point Algebra, Allen’s Interval Algebra, RCC5, and RCC8, just to name a few; much more material about relation algebras can be found in [HH02]. Robin Hirsch [Hir96] asked in 1996 the Really Big Complexity Problem (RBCP)
: can we classify the computational complexity of the network satisfaction problem for every finite relation algebra? For example, the network satisfaction problem for the Point Algebra and the Left Linear Point Algebra are polynomial-time tractable[VKvB89, BK07], while it is NP-complete for the other relation algebras mentioned above [All83, RN99]. A finite relation algebra with an undecidable network satisfaction problem has been found by Hirsch [Hir99].
An important notion in the theory of representability of finite relation algebras are normal representations, i.e., representations that are fully universal, square, and homogeneous [Hir96]. The network satisfaction problem for a relation algebra with a normal representation can be seen as the constraint satisfaction problem for an infinite structure that is homogeneous and finitely bounded (these concepts from model theory will be introduced in Section 3). The network satisfaction problem is in this case in NP and a complexity dichotomy has been conjectured [BPP14]. There is even a promising candidate condition for the boundary between NP-completeness and containment in P; the condition can be phrased in several equivalent ways [BKO17, Bod18]. However, this conjecture has not yet been verified for the homogeneous finitely bounded structures that arise as the normal representation of a finite relation algebra.
We present some first steps towards a solution to the RBCP for relation algebras with a normal representation . Our approach is to study the automorphism group of and to identify properties that imply hardness. Because of the homogeneity of , one can translate back and forth between properties of and properties of . For example, is primitive if and only if contains no equivalence relation which is different from the trivial equivalence relations and . Specifically, we show that the network satisfaction problem for is NP-complete if
In our proof we use the so-called universal-algebraic approach which has recently led to a full classification of the computational complexity of constraint satisfaction problems for if the domain of is finite [Bul17, Zhu17]. The central insight is that the complexity of the CSP is for finite fully determined by the polymorphism clone of . This result extends to homogeneous structures with finite relational signature (more generally, to -categorical structures [BN06]). Both of our hardness proofs come from the technique of factoring with respect to a congruence with finitely many classes, and using known hardness conditions from corresponding finite-domain constraint satisfaction problems. The article is fully self-contained: we introduce the network satisfaction problem (Section 2), normal representations (Section 3), and the universal algebraic approach (Section 4).
2 The (General) Network Satisfaction Problem
Network satisfaction problems have been introduced in [LM94], capturing well-known computational problems, e.g., for Allen’s Interval Algebra [All83]; see [Dün05] for a survey. An algebra in the sense of universal algebra is a set together with operations on this set, each equipped with an arity . In this context, operations of arity zero are viewed as constants. The type of an algebra is a tuple that represents the arities of the operations. For the definitions concerning relation algebras, we basically follow [Mad06].
Let be a set and an equivalence relation. Let be an algebra of type with the following operations:
A subalgebra of is called a proper relation algebra.
A representable relation algebra is an algebra of type that is isomorphic (as an algebra) to a proper relation algebra. We denote algebras by bold letters, like ; the underlying domain of an algebra is denoted with the regular letter . An algebra is finite if is finite. We do not need the more general definition of an (abstract) relation algebra (for a definition see for example [Mad06]) because the network satisfaction problem for relation algebras that are not representable is trivial. We use the language of model theory to define representations of relation algebras; the definition is essentially the same as the one given in [Mad06].
A relational structure is called a representation of a relation algebra if
is an -structure with domain (i.e., each element is used as a relation symbol denoting a binary relation on );
there exists an equivalence relation such that the set of relations of is the domain of a subalgebra of ;
the map that sends to is an isomorphism between and this subalgebra.
For a relation algebra the algebra is a Boolean algebra. With respect to this algebra there is a partial ordering on the elements of a relation algebra. We denote this with since in proper relation algebras this ordering is with respect to set inclusion. The minimal non-empty relations with respect to are called the atomic relations or atoms; we denote the set of atoms of by .
Let be a relation algebra. An -network is a finite set of nodes together with a function .
Let be a representation of . An -network is satisfiable in if there exists an assignment such that for all
An -network is satisfiable if there exists some representation of such that is satisfiable in .
The (general) network satisfaction problem for a finite relation algebra , denoted by , is the problem of deciding whether a given -network is satisfiable.
3 Normal Representations and CSPs
Definition 5 (from [Hir96])
Let be a relation algebra. An -network is called atomic if the image of only contains atoms and if
The last line ensures a “local consistency” of the atomic -network with respect to the multiplication rules in the relation algebra . This property is in the literature sometimes called “closedness” of an -network [Hir97].
Definition 6 (from [Hir96])
A representation of a relation algebra is called
fully universal if every atomic -network is satisfiable in ;
square if ;
homogeneous if every isomorphism of finite substructures of can be extended to an automorphism;
normal if it is fully universal, square and homogeneous.
If a relation algebra has a normal representation then the problem of deciding whether an -network is satisfiable in some representation reduces to a question whether it is satisfiable in the concrete representation . Such decision problems are known as constraint satisfaction problems, which are formally defined in the following.
Let be a -structure for a finite relational signature . The constraint satisfaction problem of is the problem of deciding for a given finite -structure whether there exists a homomorphism from to .
To formulate the connection between NSPs and CSPs, we have to give a translation between networks and structures. On the one hand we may view an -network as an -structure with domain where . On the other hand we can transform an -structure into an -network with and by defining the network function for as follows: let be the set of all relations that hold on in . If is non-empty we define ; otherwise .
Proposition 1 (see [Bod18])
Let be a normal representation of a finite relation algebra . Then and are the same problem (up to the translation showed above).
The following is an important notion in model theory and the study of infinite-domain CSPs. Let be a finite set of finite -structures. Then is the class of all finite -structures that embed no . A class of finite -structures is called finitely bounded if for a finite set . A structure is called finitely bounded if the class of finite structures that embed into is finitely bounded.
Proposition 2 (see [Bod18])
Let be a finite relation algebra with a normal representation . Then is finitely bounded and and are in NP.
4 The Universal Algebraic Approach
This section gives a short overview of the important notions and concepts for the universal-algebraic approach to the computational complexity of CSPs.
We start with the definition of an operation clone.
Let be some set. Then denotes the set of -ary operations on and . A set is called a operation clone (on ) if it contains all projections and is closed under composition, that is, for every and all the -ary operation with
is also in . We denote the -ary operations of by .
Let be a relational structure. Then preserves a relation of if the component-wise application of on tuples results in a tuple of the relation. If preserves all relations of then is called a polymorphism of . The set of all polymorphisms of arity is denoted by and is called the polymorphism clone of .
Polymorphisms are closed under the composition and a projection is always a polymorphism, therefore a polymorphism clone is indeed an operation clone.
Let and be operation clones. A function is called minor-preserving if it maps every operation to an operation of the same arity and satisfies for every and all projections the following identity:
Operation clones on countable sets can be equipped with the following complete ultrametric . Assume that . For two polymorphisms and of different arity we define . If and are both of arity we have
The following is a straightforward consequence of the definition.
Let be an operation clone on and an operation clone on and let a map. Then is uniformly continuous (u.c.) if and only if
In order to demonstrate the use of polymorphisms in the study of CSPs we have to define primitive positive formulas. Let be a relational signature. A first-order formula is called primitive positive if it has the form
where are atomic formulas, i.e., formulas of the form for and , of the form for , or of the form false and true. We have the following correspondence between polymorphisms and primitive positive formulas (or relations that are defined by them). Note that all of the statements in the following hold in a more general setting, but we only state them here for normal representations of finite relation algebras.
Theorem 4.1 (follows from [Bn06])
Let be a normal representation of a finite relation algebra . Then the set of primitive positive definable relations in is exactly the set of relations that are preserved by .
A special type of polymorphism plays an important role in our analysis.
Let be an -ary operation on a countable set . Then is called cyclic if
We write for the operation clone on a two-element set that consists of only the projections.
Let be an operation clone on a finite set . If there exists no minor-preserving map then contains for every prime a -ary cyclic operation.
Note that every map between operation clones on finite domains is uniformly continuous.
Theorem 4.3 (from [Bop18])
Let be normal representation of a finite relation algebra. If there is a uniformly continuous minor-preserving map , then is NP-complete.
4.2 Canonical Functions
Let be a normal representation of a finite relation algebra .
Let . Then denotes a binary relation on such that for
Recall that denotes the set of atoms of a representable relation algebra .
Let . Since is square there are unique such that . Then we call the configuration of . If then is called an -configuration.
We specialise the concept of canonical functions (see, e.g., [BP16]) to our setting.
Let be a -ary operation on . Let and let be the set of all -configurations. Then is called -canonical if there exists a map such that for every and we have . If then is called canonical.
An operation is called conservative if for all
If is a finite structure such that every polymorphism of is conservative, then has been classified already before the proof of the Feder-Vardi conjecture, and there are several proofs [Bul03, Bul14, Bar11]. The polymorphisms of normal representations of finite relation algebras satisfy a strong property that resembles conservativity.
Let be a normal representation. Then every is edge-conservative, that is, for all with configuration it holds that
By definition, is part of the signature of . Moreover, for every we have that by the assumption on the configuration of and . Then because preserves . ∎
5 Finitely Many Equivalence Classes
In the following, denotes a finite relation algebra with a normal representation .
Suppose that is such that is a non-trivial equivalence relation with finitely many classes. Then is NP-complete.
We use the notation . Let be a set of representatives of the equivalence classes of . We denote the equivalence class of by . A -ary polymorphism induces an operation of arity on in the following way:
for all . This definition is independent from the choice of the representatives since the polymorphisms preserve the relation . We denote the set of all operations that are induced in this way by operations from by . It is easy to see that is an operation clone on a finite set. Moreover, the mapping defined by is a minor-preserving map. To show that is uniformly continuous, we use Lemma 1; it suffices to observe that if two -ary operations are equal on , then they induce the same operation on the equivalence classes.
Suppose for contradiction that contains a -ary cyclic operation for every prime .
Case 1: . By assumption there exists a ternary cyclic operation . Since is non-trivial, one of the equivalence classes of must have size at least two. So we may without loss of generality assume that contains at least two elements. Let with . We have that which means that
On the other hand . Since is an edge conservative polymorphism we have that
Similarly, . Since preserves the equivalence relation we also have . But then holds. Also note that implies that . These two facts together imply . By (3) and the transitivity of equality we get . But this is impossible because implies that .
Case 2: . Let be a -ary cyclic operation for some prime . Consider the representatives and . By the cyclicity of we have
On the other hand,
and since preserves we get that
We showed that there exists a prime such that does not contain a -ary cyclic polymorphism and therefore Theorem 4.2 implies the existence of a (uniformly continuous) minor-preserving map . Since the composition of uniformly continuous minor-preserving maps is again uniformly continuous and minor-preserving, there exists a uniformly continuous minor-preserving map . This map implies the NP-hardness of by Theorem 4.3. ∎
6 No Non-Trivial Equivalence Relations
In this section denotes a finite relation algebra with a normal representation with .
The automorphism group of a relational structure is called primitive if does not preserve a non-trivial equivalence relation, i.e., the only equivalence relations that are preserved by are and .
Let be an atom of . If is primitive then implies .
would be such that is a non-trivial equivalence relation. ∎
Let be a symmetric atom of with . If is primitive then .
Assume for contradiction . This implies and therefore is an equivalence relation. Since is primitive . By assumption contains at least elements. These elements are now all connected by the atomic relation . This is a contradiction to our assumption . ∎
Higman’s lemma states that a permutation group on a set is primitive if and only if for every two distinct elements the undirected graph with vertex set and edge set is connected (see, e.g., [Cam99]). We need the following variant of this result for ; we also present its proof since we are unaware of any reference in the literature. If then a sequence is called an -walk (of length ) if for every (we count the number of traversed edges rather than the number of vertices when defining the length).
Let be a symmetric atom of with and suppose that is primitive. Then there exists an -walk of even length between any . Moreover, there exists such that for all there exists an -walk of length between and .
If is a binary relation then denotes the -th relational power of . The sequence of binary relations is non-decreasing by definition and terminates because all binary relations are unions of at most finitely many atoms. Therefore, there exists such for all we have . Note that is an equivalence relation, namely the relation “there exists an -walk of even length between and ”. Since is primitive must be trivial. If then there exists an -walk of length between any two and we are done. Otherwise,
Let be a symmetric atom of such that is primitive and is forbidden. Then all polymorphisms of are -canonical.
In the proof, we need the following notation. Let be such that and . Instead of writing we use the shortcut .
Proof (of Lemma 3)
The following ternary relation on is primitive positive definable in .
Observe that if and only if or .
Let be a polymorphism of of arity . Let be arbitrary such that and have the same -configuration. Without loss of generality we may assume that and . Now consider such that holds.
Note that by the edge-conservativeness of the following holds:
By Lemma 2 there exists a such that for every there exists an -walk with and . Now consider the following walk in :
Every three consecutive elements on this walk are component wise in the relation . Since is primitive positive definable the polymorphism preserves by Theorem 4.1. This means that maps this walk on a walk where the atomic relations are an alternating sequence of and , which implies
If we repeat the same argument with a walk from to we get:
Combining these two equivalences gives us
Since the tuples were arbitrary this shows that is -canonical. ∎
Let be primitive and let be a symmetric atom of such that is forbidden. Then is NP-hard.
By Lemma 3 we know that all polymorphisms of are -canonical. This means that every induces an operation of the same arity on the set . Let be the set of induced operations. Note that is an operation clone on a Boolean domain. The mapping defined by is a uniformly continuous minor-preserving map.
Assume for contradiction that there exists a ternary cyclic polymorphism in . Let be such that
By the cyclicity of the operation and the edge-conservativeness of we have that either
Since is forbidden, the second case holds. Note that must have an atom such that the triple is allowed, because otherwise would be an equivalence relation. Now consider such that
Since is -canonical and with the observation from before we have
Now the transitivity of equality contradicts .
Andréka and Maddux classified small relation algebras, i.e., finite relation algebras with at most 3 atoms [AM94]. We consider the complexity of the network satisfaction problem of two of them, namely the relation algebras and (we use the enumeration from [AM94]). Both relation algebras have normal representations (see below) and fall into the scope of our hardness criteria. Cristani and Hirsch [CH04] classified the complexities of the network satisfaction problems for small relation algebras, but due to a mistake the algebras and were left open.
Example 1 (Relation Algebra )
The relation algebra is given by the multiplication table in Fig. 1. This finite relation algebra has a normal representation defined as follows. Let and be countable, disjoint sets. We set and define the following atomic relations:
It is easy to check that this structure is a square representation for . Moreover, this structure is fully universal for and homogeneous, and therefore a normal representation.
Example 2 (Relation Algebra )
The relation algebra is given by the multiplication table in Fig. 1. Let be the countable, homogeneous, universal triangle-free, undirected graph (see [Hod97]), also called called a Henson graph. We use this Henson graph to obtain a square representation with domain for the relation algebra as follows:
This structure is homogeneous and fully universal since is homogeneous and embeds every triangle free graph. It is easy to see that there exists no non-trivial equivalence relation in this relation algebra. For the atom the triangle is forbidden, which means we can apply Theorem 6.1 and get NP-hardness for the (general) network satisfaction problem for the relation algebra . Also in this case, the hardness result can also be deduced from the results in [BMPP19].
8 Conclusion and Future Work
To the best of our knowledge the computational complexity of the (general) network satisfaction problem was previously only known for a small number of isolated finite relation algebras, for example the point algebra, Allens interval algebra, or the 18 small relation algebras from [AM94]. Both of our criteria, Theorem 5.1 and Theorem 6.1, show the NP-hardness for relatively large classes of finite relation algebras. In Section 7 we applied these results to settle the complexity status of two problems that were left open in [CH04].
To obtain our general hardness conditions we used the universal algebraic approach for studying the complexity of constraint satisfaction problems. This approach will hopefully lead to a solution of Hirsch’s RBCP for all finite relation algebras with a normal representation . It is also relatively easy to prove that the network satisfaction problem for is NP-complete if has an equivalence relation with an equivalence class of finite size larger than two. Hence, the next steps that have to be taken with this approach are the following.
Classify the complexity of the network satisfaction problem for finite relation algebras where the normal representation has a primitive automorphism group.
Classify the complexity of the network satisfaction problem for relation algebras that have equivalence relations with infinitely many classes of size two.
Classify the complexity of the network satisfaction problem for relation algebras that have equivalence relations with infinitely many infinite classes.
- [All83] James F. Allen. Maintaining knowledge about temporal intervals. Communications of the ACM, 26(11):832–843, 1983.
- [AM94] Hajnal Andréka and Roger D. Maddux. Representations for small relation algebras. Notre Dame Journal of Formal Logic, 35(4):550–562, 1994.
- [Bar11] Libor Barto. The dichotomy for conservative constraint satisfaction problems revisited. In Proceedings of the Symposium on Logic in Computer Science (LICS), Toronto, Canada, 2011.
Manuel Bodirsky and Peter Jonsson.
A model-theoretic view on qualitative constraint reasoning.
Journal of Artificial Intelligence Research, 58:339–385, 2017.
- [BK07] Manuel Bodirsky and Martin Kutz. Determining the consistency of partial tree descriptions. Artificial Intelligence, 171:185–196, 2007.
- [BK12] Libor Barto and Marcin Kozik. Absorbing subalgebras, cyclic terms and the constraint satisfaction problem. Logical Methods in Computer Science, 8/1(07):1–26, 2012.
- [BKO17] 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.
- [BMPP19] 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.
- [BN06] Manuel Bodirsky and Jaroslav Nešetřil. Constraint satisfaction with countable homogeneous templates. Journal of Logic and Computation, 16(3):359–373, 2006.
- [Bod18] 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.
- [BOP18] Libor Barto, Jakub Opršal, and Michael Pinsker. The wonderland of reflections. Israel Journal of Mathematics, 223(1):363–398, 2018.
- [BP16] Manuel Bodirsky and Michael Pinsker. Canonical Functions: a Proof via Topological Dynamics. Preprint available under http://arxiv.org/abs/1610.09660, 2016.
- [BPP14] Manuel Bodirsky, Michael Pinsker, and András Pongrácz. Projective clone homomorphisms. Accepted for publication in the Journal of Symbolic Logic, Preprint arXiv:1409.4601, 2014.
- [Bul03] Andrei A. Bulatov. Tractable conservative constraint satisfaction problems. In Proceedings of the Symposium on Logic in Computer Science (LICS), pages 321–330, Ottawa, Canada, 2003.
- [Bul14] Andrei A. Bulatov. Conservative constraint satisfaction revisited. Manuscript, ArXiv:1408.3690v1, 2014.
- [Bul17] 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, 2017, pages 319–330, 2017.
- [Cam99] Peter J. Cameron. Permutation Groups. LMS Student Text 45. Cambridge University Press, Cambridge, 1999.
- [CH04] Matteo Cristiani and Robin Hirsch. The complexity of the constraint satisfaction problem for small relation algebras. Artificial Intelligence Journal, 156:177–196, 2004.
- [Dün05] Ivo Düntsch. Relation algebras and their application in temporal and spatial reasoning. Artificial Intelligence Review, 23:315–357, 2005.
- [HH02] Robin Hirsch and Ian Hodkinson. Relation Algebras by Games. North Holland, 2002.
- [Hir96] Robin Hirsch. Relation algebras of intervals. Artificial Intelligence Journal, 83:1–29, 1996.
- [Hir97] Robin Hirsch. Expressive power and complexity in algebraic logic. Journal of Logic and Computation, 7(3):309 – 351, 1997.
- [Hir99] Robin Hirsch. A finite relation algebra with undecidable network satisfaction problem. Logic Journal of the IGPL, 7(4):547–554, 1999.
- [Hod97] Wilfrid Hodges. A shorter model theory. Cambridge University Press, Cambridge, 1997.
- [LM94] Peter B. Ladkin and Roger D. Maddux. On binary constraint problems. Journal of the Association for Computing Machinery, 41(3):435–469, 1994.
- [Mad06] Roger Duncan Maddux. Relation Algebras -. Elsevier, Amsterdam, 2006.
- [RN99] Jochen Renz and Bernhard Nebel. On the complexity of qualitative spatial reasoning: A maximal tractable fragment of the region connection calculus. Artificial Intelligence, 108(1-2):69–123, 1999.
- [RN07] Jochen Renz and Bernhard Nebel. Qualitative spatial reasoning using constraint calculi. In M. Aiello, I. Pratt-Hartmann, and J. van Benthem, editors, Handbook of Spatial Logics, pages 161–215. Springer Verlag, Berlin, 2007.
- [VKvB89] 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.
- [Zhu17] Dmitriy 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, 2017, pages 331–342, 2017.