betaFeedback

WorksComputer Science

Graph Homomorphisms and Universal Algebra

Abstract

Constraint satisfaction problems are computational problems that naturally appear in many areas of theoretical computer science. One of the central themes is their computational complexity, and in particular the border between polynomial-time tractability and NP-hardness. In this course we introduce the universal-algebraic approach to study the computational complexity of finite-domain CSPs. The course covers in particular the cyclic terms and bounded width theorems. To keep the presentation accessible, we start the course in the tangible setting of directed graphs and graph homomorphism problems.

Disclaimer: these are course notes in draft state, and they might contain mistakes; in case that you find any, please report them to [email protected]. Almost all of the material is not original; I have tried to provide references to the primary sources as much as possible, but might have failed at some places, in which case I am thankful for hints as well.

Course Goals. This course has different groups of readers in mind.

  • For readers interested in theoretical computer science, it provides an introduction to complexity analysis of constraint satisfaction problems.

  • For readers interested in graph theory and graph homomorphisms, it provides an introduction to a universal-algebraic approach to many fundamental questions in the area.

  • For readers interested in universal algebra, it treats the part of universal algebra that is most relevant for the study of graph homomorphism problems and constraint satisfaction.

Prerequisites. This course is designed for students of mathematics or computer science who have already had an introduction to discrete structures (so we assume that the reader knows basic set theory, the natural numbers N\mathbb{N}, the integers Z\mathbb{Z}, the rational numbers Q\mathbb{Q}, and the residue rings Zn\mathbb{Z}_n). All further notions that we use in this text will be formally introduced, with the following notable exceptions.

  • Basic concepts from complexity theory. For example, we do not formally introduce the class of polynomial-time computable functions and NP-completeness, even though these concepts are used when we discuss computational aspects of graph homomorphisms. Here we refer to an introduction to the theory of computation as for instance the book of Papadimitriou [100]; we have also added a short appendix with the basics (Appendix B).

  • Basic concepts of first-order logic. For example, we assume that the reader knows the difference between bound and free variables, quantifier-free formulas, and prenex normal form. We refer to [24] or [22].

AI disclaimer. ChatGPT 5.6 Sol and 6 Astra, and Claude Opus 5 were used for proofreading the final text, solving the exercises and grading their difficulty, finding mistakes and fixing them.

Acknowledgements. Many thanks to Catarina Carvalho, Philipp Grzywaczyk, Lukas Juhrich, Mathison Knight, Sebastian Meyer, Andrew Moorhead, Michael Pinsker, Lukas Schneider, Moritz Schöbi, Žaneta Semanišinová, Mark Siggers, the participants of the course in the Corona spring semester 2020 and the course in spring 2023 for their suggestions and bug reports. Thanks also to Zarathustra Brady for his lecture notes [34] and to Zarathustra Brady and Dima Zhuk for answering my questions.

Exercises. The text contains 294 exercises; some of them are graded using the old Mandala colour scale (no longer in use).

Climbing wall

Figure 23.

Possible Routes for Courses. This course has been taught several times in one semester, but never covering all sections. Possible selections of material can be deduced from the section diagram below; an arc from section A to section B indicates that section A should typically be treated before section B. After treating some basics about digraphs and homomorphisms, I always started with the arc-consistency procedure, because it is a fantastic algorithm (both from a theoretical and practical perspective), and because it is concrete and elementary, but with non-trivial and interesting results quite early in the course. These results will then be important examples for more general and abstract results later. For example, the material about minions strictly speaking does not rely on the arc-consistency procedure, but I prefer to teach it having the concrete example of the minion arising from the arc-consistency procedure.

Figure 24 (PDF p. 6).

Introduction

Around the turn of the millennium, several previously separate research communities realised that many of their central questions are essentially the same. In the late 80s and 90s, the graph homomorphism community intensively studied the computational complexity of the HH-colouring problem [68]. Independently, the theoretical artificial intelligence community studied constraint satisfaction problems and their computational complexity (including the important Boolean CSPs which were classified by Schaefer [105] in 1978). In the late 90s, researchers realised that universal algebra provides the right tools for this task [41, 73].

The paper by Feder and Vardi, whose conference version appeared in 1993, is probably the most influential article in the area and has inspired generations of researchers [59, 60]. It formulates for the first time the dichotomy conjecture, which was solved in 2017 by Bulatov [39] and by Zhuk [115]. It also links the topic with finite model theory. For example, it identifies Datalog from database theory as an important framework that captures many of the central consistency algorithms that have been used to solve CSPs. Feder and Vardi prove that a complexity dichotomy for finite-domain CSPs implies a complexity classification for the fragment of NP called MMSNP. They also prove that every finite-domain CSP is computationally equivalent to the HH-colouring problem for some finite digraph, thus further substantiating the connection between graph homomorphisms and constraint satisfaction.

This course starts very concretely, in the setting of digraphs rather than the more general setting of relational structures, because digraphs are notationally simpler than general structures. Digraphs are ideal for black-board teaching, because they are easy to draw and it is easy to come up with interesting examples. After having introduced the basics of the theory of graph homomorphisms in § 2, we present an algorithm of outstanding importance: the so-called arc-consistency procedure. This algorithm is theoretically very well understood. Moreover, it is practically important, because of its low time and space requirements, because it is easy to implement, and because it is widely applicable. Numerous exercises that we formulate at the end of the subsections can be easily solved if the reader properly understands the underlying principles of arc-consistency.

The arc-consistency procedure can be generalised to the kk-consistency procedure, which is more powerful, and still in P, but more demanding in time and space requirements. Theoretical results in later sections of this course show that if kk-consistency solves the HH-colouring problem, then so does the 3-consistency algorithm. This algorithm is sometimes referred to as the (strong) path-consistency procedure and it is the topic of § 4. A full description of when this procedure solves the HH-colouring problem has to wait until § 16 of the course, but we do see some sufficient conditions that can be used to answer the question for many concrete digraphs HH.

At some point, the restriction to digraphs becomes unnatural; we step to general relational structures in § 5. This will be the appropriate setting for presenting the main tools for complexity classification, which are, in increasing strength, primitive positive definitions, primitive positive interpretations, and primitive positive constructions. Primitive positive constructions are part of the statement of a solution to the Feder-Vardi dichotomy conjecture: if a finite structure admits a primitive positive construction of K3K_3 (the complete graph with three vertices), then its CSP is NP-hard (a statement that we prove in § 5); otherwise, its CSP is in P (this is the content of the result of Bulatov [39] and of Zhuk [115]).

All three of these concepts (pp definitions, pp interpretations, and pp constructions) can also be characterised universal-algebraically, in terms of polymorphisms. For primitive positive definability, this can be found in § 7, where we also apply it to prove Schaefer’s complexity dichotomy result for CSPs of two-element structures. The universal-algebraic theory that captures primitive positive interpretations is presented in § 8, and the universal-algebraic theory for primitive positive constructions in § 10.

In § 11 we show the Hell-Nešetřil dichotomy for the HH-colouring problem for finite undirected graphs HH. From this result we obtain a universal-algebraic formulation of the complexity dichotomy for all finite structures in terms of a Siggers polymorphism (of arity six). A much more informative formulation of the complexity dichotomy uses cyclic polymorphisms in § 15, which is substantially more difficult to prove. In particular, we need the fundamental theorem of abelian algebras from § 13, and absorption theory, developed by Barto and Kozik [12] and presented in § 14.

Concerning algorithms for CSPs, we treat the Bulatov-Dalmau algorithm for structures with a Maltsev polymorphism (§ 9), and in § 16 the bounded width case (i.e., the CSPs that can be solved by Datalog). A complete algorithm that solves all tractable finite-domain CSPs is outside of the scope of this course.

Many other topics are not treated by these course notes, most notably

  • infinite-domain CSPs; we refer to [21].

  • promise CSPs; we refer to [9].

  • valued CSPs; we refer to [78,79,83].

The Basics

We mostly work with finite graphs; results that also hold for graphs with infinitely many vertices are mentioned only when this requires no extra effort.

Graphs and Digraphs

The concepts in this section are probably known to most students, and can safely be skipped; the section fixes standard terminology and conventions from graph theory and can be consulted later if needed. Almost all definitions in this section have generalisations to relational structures, which will be introduced in § 5; however, we focus exclusively on graphs in this section since they allow us to reach the key ideas of the underlying theory with a minimum of notation.

A directed graph (also digraph) GG is a pair (V,E)(V,E) of a set V=V(G)V=V(G) of vertices and a binary relation E=E(G)E=E(G) on VV. Note that in general we allow that VV is an infinite set. For some definitions and results, we require that VV is finite, in which case we say that GG is a finite digraph. However, since this course deals mainly with finite digraphs, we will omit this most of the time. The elements (u,v)(u,v) of EE are called the arcs (or directed edges) of GG. Note that we allow loops, i.e., arcs of the form (u,u)(u,u); a digraph without loops is called loopless. If (u,v)∈E(G)(u,v)\in E(G) is an arc, then we say that vv is an out-neighbour of uu and that uu is an in-neighbour of vv; a neighbour is an in-neighbour or an out-neighbour. The (in-, out-) degree of a vertex uu is the number of (in-, out-) neighbours of uu. We say that the vertices uu and vv are incident to the edge (u,v)(u,v).

An (undirected) graph is a pair (V,E)(V,E) of a set V=V(G)V=V(G) of vertices and a set E=E(G)E=E(G) of edges, each of which is an unordered pair of (not necessarily distinct) elements of VV. In other words, we explicitly allow loops, which are edges that link a vertex with itself. Undirected graphs can be viewed as symmetric digraphs: a digraph G=(V,E)G=(V,E) is called symmetric if (u,v)∈E(u,v)\in E if and only if (v,u)∈E(v,u)\in E. For a digraph GG, we say that G′G' is the undirected graph of GG if G′G' is the undirected graph with V(G′)=V(G)V(G')=V(G) and where {u,v}∈E(G′)\{u,v\}\in E(G') if (u,v)∈E(G)(u,v)\in E(G) or (v,u)∈E(G)(v,u)\in E(G). For an undirected graph GG, we say that G′G' is an orientation of GG if G′G' is a directed graph such that V(G′)=V(G)V(G')=V(G) and E(G′)E(G') contains for each edge {u,v}∈E(G)\{u,v\}\in E(G) either the arc (u,v)(u,v) or the arc (v,u)(v,u), and no other arcs.

For some notions for digraphs GG one can just use the corresponding notions for undirected graphs applied to the undirected graph of GG; conversely, most notions for directed graphs, specialised to symmetric graphs, translate to notions for the respective undirected graphs.

Examples of graphs, and corresponding notation

  • The complete graph on nn vertices [n]:={1,…,n}[n]:=\{1,\ldots,n\}, denoted by KnK_n. This is an undirected graph on nn vertices in which every vertex is joined with any other distinct vertex (so KnK_n contains no loops).

  • The cyclic graph on nn vertices, denoted by CnC_n; this is the undirected graph with the vertex set {0,…,n−1}\{0,\ldots,n-1\} and edge set

{{0,1},…,{n−2,n−1},{n−1,0}}={{i,i+1}:i∈Zn}.\{ \{0,1\},\ldots,\{n-2,n-1\},\{n-1,0\}\}=\{\{i,i+1\}:i\in\mathbb{Z}_n\}.

Note that C1C_1 has a loop and C2=K2C_2=K_2.

  • The directed cycle on nn vertices, denoted by C⃗n\vec{C}_n; this is the digraph with the vertex set {0,…,n−1}\{0,\ldots,n-1\} and the arc set

{(0,1),…,(n−2,n−1),(n−1,0)}={(i,i+1):i∈Zn}.\{(0,1),\ldots,(n-2,n-1),(n-1,0)\}=\{(i,i+1):i\in\mathbb{Z}_n\}.
  • The path with n+1n+1 vertices and nn edges, denoted by PnP_n; this is an undirected graph with the vertex set {0,…,n}\{0,\ldots,n\} and edge set {{0,1},…,{n−1,n}}\{\{0,1\},\ldots,\{n-1,n\}\}.

  • The directed path with n+1n+1 vertices and nn edges, denoted by P⃗n\vec{P}_n; this is a digraph with the vertex set {0,…,n}\{0,\ldots,n\} and edge set {(0,1),…,(n−1,n)}\{(0,1),\ldots,(n-1,n)\}.

  • A tournament is a directed loopless graph GG with the property that for all distinct vertices x,yx,y either (x,y)(x,y) or (y,x)(y,x) is an edge of GG, but not both.

  • The transitive tournament on n≥2n\ge2 vertices, denoted by TnT_n; this is a directed graph with the vertex set {1,…,n}\{1,\ldots,n\} where (i,j)(i,j) is an arc if and only if i<ji<j.

Let GG and HH be graphs (we define the following notions both for directed and for undirected graphs). Then G⊎HG\uplus H denotes the disjoint union of GG and HH, which is the graph with vertex set V(G)∪V(H)V(G)\cup V(H) (we assume that the two vertex sets are disjoint; if they are not, we take a copy of HH on a disjoint set of vertices and form the disjoint union of GG with the copy of HH) and edge set E(G)∪E(H)E(G)\cup E(H). A graph G′G' is a subgraph of GG if V(G′)⊆V(G)V(G')\subseteq V(G) and E(G′)⊆E(G)E(G')\subseteq E(G). A graph G′G' is an induced subgraph of GG if V′=V(G′)⊆V(G)V'=V(G')\subseteq V(G) and (u,v)∈E(G′)(u,v)\in E(G') if and only if (u,v)∈E(G)(u,v)\in E(G) for all u,v∈V′u,v\in V'. We also say that G′G' is induced by V′V' in GG, and write G[V′]G[V'] for G′G'. We write G−uG-u for G[V(G)∖{u}]G[V(G)\setminus\{u\}], i.e., for the subgraph of GG where the vertex uu and all incident arcs are removed.

We call ∣V(G)∣+∣E(G)∣|V(G)|+|E(G)| the size of a graph GG. This quantity will be important when we analyse the efficiency of algorithms on graphs.

Paths and Cycles

We start with definitions for directed paths; the corresponding terminology is then also used for undirected graphs as explained in the beginning of this section.

A path PP (from u1u_1 to uku_k in GG) is a sequence (u1,…,uk)(u_1,\ldots,u_k) of vertices of GG and a sequence (e1,…,ek−1)(e_1,\ldots,e_{k-1}) of edges of GG such that ei=(ui,ui+1)∈E(G)e_i=(u_i,u_{i+1})\in E(G) or ei=(ui+1,ui)∈E(G)e_i=(u_{i+1},u_i)\in E(G), for every 1≤i<k1\le i<k. The vertex u1u_1 is called the start vertex and the vertex uku_k is called the terminal vertex of PP, and we say that PP is a path from u1u_1 to uku_k. Edges (ui,ui+1)(u_i,u_{i+1}) with ui≠ui+1u_i\ne u_{i+1} are called forward edges and edges (ui+1,ui)(u_{i+1},u_i) with ui≠ui+1u_i\ne u_{i+1} are called backward edges. A loop edge is neither forward nor backward. The path is called directed if

References

No references were extracted for this paper.

Paper details

vlnc:W_37mdnygq
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY-SA 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents