Journal of Complexity 19 (2003) 153–160
http://www.elsevier.com/locate/jco
Algebra complexity problems involving graph homomorphism, semigroups and the constraint satisfaction problem Steve Seifa and Csaba Szabo´b,* b
a Department of Mathematics, University of Louisville, Kentucky, 40292, USA Department of Algebra and Number Theory, Eo¨tvo¨s Lora´nd University, 1117 Budapest, Pa´zma´ny Pe´ter se´ta´ny 1/c, Hungary
Received 6 November 2001; accepted 20 July 2002
Abstract In this paper, we connect the constraint satisfaction problem with other complexity problems, like the polynomial equivalence problem for combinatorial 0-simple semigroups, the graph retraction problem and the geometry problem. We show that every constraint satisfaction problem is polynomially equivalent to an easily formulated algebra complexity problem. As an application we prove that the polynomial equivalence problem (word problem) for the 2 2 matrices over the two element field is co-NP-complete. r 2002 Elsevier Science (USA). All rights reserved. Keywords: Constraint satisfaction; Graph homomorphism; Semigroup; Complexity
1. Introduction and preliminaries In this paper, we connect several complexity problems. Let M be a 0–1 matrix. The corresponding bipartite graph, combinatorial 0-simple semigroup and geometry are denoted by HM ; SM and GM ; respectively. We prove that OAL HM ; POL-SAT SM ; POL-NEQ SM and GEOM GM have the same computational complexity. As a corollary, we answer a question of Lawrence and Willard [7] showing that the polynomial equivalence problem for the 2 2 matrices over the two element field is co-NP complete. *Corresponding author. Tel.: +36-1-266-9833; fax: +36-1-266-4992. ! E-mail addresses:
[email protected] (S. Seif),
[email protected] (C. Szabo). 0885-064X/02/$ - see front matter r 2002 Elsevier Science (USA). All rights reserved. doi:10.1016/S0885-064X(02)00027-4
154
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
First, we need some basic background on all of these topics. We discuss the notions of graph homomorphism, completely 0-simple semigroups and geometries. For a graph H; we shall denote the vertices and edges of H by V ðHÞ and EðHÞ; respectively. The neighbors of the vertex vAV ðHÞ will be denoted by NðvÞ: We shall use the standard notations for computational complexity, like P, NP, coNP, etc. A set with a binary associative operation is called a semigroup.
1.1. Graphs A homomorphism f of a graph G to a graph H is a vertex mapping f : V ðGÞ-V ðHÞ; which preserves the edges, that is, uvAEðGÞ implies f ðuÞf ðvÞAEðHÞ: For a fixed graph H; the homomorphism problem HOM H asks whether or not there exists a homomorphism to H from an input graph G: Given graphs G; H; and lists LðvÞDV ðHÞ; vAV ðGÞ; a list homomorphism of G to H with respect to the lists L is a homomorphism f of G to H such that f ðvÞALðvÞ for all vAV ðGÞ: For a fixed graph H; the list homomorphism problem L-HOM H asks whether or not an input graph G with lists L admits a list homomorphism of G to H; mapping each vAV ðGÞ to an element of LðvÞ: For a fixed graph H; OAL H (one or all list homomorphism) asks, whether or not the input graph can be mapped to H with respect to the lists LðvÞ; where either jLðvÞj ¼ 1 or LðvÞ ¼ H: This means that we have a partial map g from G to H; where each vertex v with jLðvÞj ¼ 1 is mapped to the single element of LðvÞ by. The elements of the range of G are colored points. A colored point v has color gðvÞ: For a fixed graph H; RET H (retraction to H) asks, whether or not the input graph G with a subgraph H 0 ; isomorphic to H; admits a homomorphism to H 0 ; fixing H 0 vertexwise (such a map is called a retraction to H 0 ). We list the known results for the different homomorphism problems: A graph G is reflexive if it has a loop at each vertex, and is irreflexive if it has no loops. Unless we state otherwise, under the word graph we shall mean an irreflexive graph. Note that when H is the irreflexive complete graph with n vertices, a homomorphism of G to H is an n-coloring of G: For reflexive graphs HOM H is trivial. For irreflexive ones Hell and Nesˇ etrˇ il [6] showed that HOM H is in P if H is bipartite, and is NP-complete otherwise. Feder and Hell [4] proved for reflexive graphs H that L-HOM H is polynomial time solvable if H is an interval graph, and is NP-complete otherwise. Feder et al. [3] proved that for irreflexive graphs L-HOM H is polynomial time solvable if the complement of H is a circular arc graph of clique covering number two, and is NP-complete otherwise. Thus, for irreflexive graphs OAL H is NP-complete if H is not bipartite. They also show that if H is an even cycle, then OAL H is NP-complete. In [1] it is shown that OAL H is in P if H is an absolute retract. A graph H is an absolute retract, if for any isometric embedding of H into a graph G; H is a retract of G: we say that the vertex u dominates the vertex v if NðvÞDNðuÞ: A graph is called domination free if no vertex dominates another one. We shall use parts of Theorems 8 and 9 in [5]:
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
155
Theorem 1. Every constraint satisfaction problem is polynomially equivalent to a bipartite graph retraction problem. Theorem 2. Every constraint satisfaction problem (hence every retraction problem) is polynomially equivalent to a domination free retraction problem.
1.2. Semigroups We give a description of combinatorial completely 0-simple semigroups. Let a 0–1 matrix be called regular if each row and column contains at least one 1 entry. We define S ¼ SM ; the completely 0-simple semigroup belonging to the regular matrix M: Let L and I denote the index set for the rows and columns of M: The underlying set of S consists of all pairs of the form ½i; l where iAI; and lAL; along with 0. An associative multiplication is given by the following rule: If Mðl; jÞ ¼ 1; then ½i; l½ j; g ¼ ½i; g: If Mðl; jÞ ¼ 0; then ½i; l½ j; g ¼ 0: Example 1.1. Let 0 0 1 B M6 ¼ @ 1 0 1 1
1
1
C 1 A; 0
where L ¼ I ¼ f1; 2; 3g: Then ½1; 2½3; 1 ¼ ½1; 1 as M6 ð2; 3Þ ¼ 1 and ½1; 2½2; 1 ¼ 0 as M6 ð2; 2Þ ¼ 0: In SM6 the product ½i; l½ j; g ¼ 0 if and only if l ¼ j: It is easy to see that the possible expressions over S are of the form x1 x2 ; y; xk : We call an expression a term if it contains only variables, and we call it a polynomial if it may contain elements of S (constants), too. A product of two elements will be called a biproduct. POL-NEQ S has as instance a pair of polynomials fp; qg with the question: Is it true that p is not equal to q? (i.e. does there exists a k-tuple ða1 ; y; ak ÞASk such that pða1 ; y; ak Þaqða1 ; y; ak Þ). POL-SAT S has as instance fp; bg; where p is a polynomial and b is an element of S and the following question. With p ¼ pðx1 ; y; xk Þ; does there exist ða1 ; y; ak ÞAS k such that pða1 ; y; ak Þ ¼ b (i.e. does pðx1 ; y; xk Þ = b have a solution?). For example in SM6 ; let pðx1 ; x2 ; x3 Þ ¼ ½1; 2x1 x2 ½2; 3x3 and qðx1 ; x2 ; x3 Þ ¼ ½1; 3x3 x2 ½2; 3x3 x1 : Now, the values pð½2; 2; ½3; 1; ½2; 1Þ ¼ 0a½1; 2 ¼ qð½2; 2; ½3; 1; ½2; 1Þ; show the two polynomials are not equal. On the other hand it is easy to see that pðx1 ; x2 Þ ¼ ½1; 2x1 ½2; 3x1 x2 ½1; 1x1
and
qðx1 ; x2 Þ ¼ ½1; 3x2 ½2; 1x2 x1 ½12x2
are both identically 0, hence they are equal. POLa0 S has as instance fpg; where p is a polynomial and the following question. Is it true that p is not identically 0, in other words does there exist ða1 ; y; ak ÞAS k
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
156
such that pða1 ; y; ak Þa0: It is easy to see that POL-SAT S; POLa0 S and POL-NEQ S are in NP. Among others, these complexity problems are examined in [9] for other algebraic systems too (e.g. rings). In [2] they show that for a ring R POL-NEQ R is in P if R is nilpotent and NP-complete, otherwise. Lawrence and Willard [7] investigate the problem for polynomials that are given as the sum of monomials (the length of ðx þ yÞn is shorter then the length of its extended form). They denote the problem by POLS -NEQ R: The subscript S indicates that the instances involve polynomials that are sums of monomials. They prove in Theorem 5 that Theorem 3. Let Mn ðF Þ be the ring of n n matrices over a finite field F : If nX3; or if nX2 and jF jX4; then POLS -NEQ is NP-complete. They ask, what happens for n ¼ 2 and jF j ¼ 2; 4 (see problem 2), and the same about POL-NEQ Tn ðF Þ; where Tn ðF Þ denotes the multiplicative semigroup of n n matrices over F : Let Ln ðF Þ denote the multiplicative semigroup of singular n n matrices over F : In this paper, we show that these problems for SM are strongly connected with OAL HM ; where HM is a bipartite graph with adjacency matrix M: As a corollary, we show that both questions of Lawrence and Willard are NP-complete. Note that the completely 0-simple semigroups are also called Rees-matrix semigroups. We continue with an observation: Lemma 4. Let S ¼ SM be a combinatorial Rees matrix semigroup with elements að1Þ; y; aðnÞAS: (1) For s; tAS; sa0 and ta0; there exist u; vAS such that usv ¼ t: (2) að1ÞyaðkÞ ¼ 0 if and only if there exists j; 1ojpk; such that að j 1Það jÞ ¼ 0: (3) If að1ÞyaðkÞa0; then ðað1ÞyaðkÞÞ1 ¼ að1Þ1 and ðað1ÞyaðkÞÞ2 ¼ aðkÞ2 ; i.e. að1ÞyaðkÞa0 implies að1ÞyaðkÞ ¼ ½að1Þ1 ; aðkÞ2 :
1.3. Geometries A geometry G is a set and a collection of its subsets. We call the elements of G points and the subsets lines and we say that a point P is incident to a line l (lies on a line l) if the subset l contains P: An instance of the problem GEOM G is a set of constraints, fC1 ; C2 ; y; Ck g: C1 ¼ fx11 ; x12 ; y; x1i1 g; C2 ¼ fx21 ; x22 ; y; x2i2 g; ^ Ck ¼ fxk1 ; xk2 ; y; xkik g
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
157
with the question whether you can assign points to the variables such that each constraint is contained in a line. You can describe a geometry G with its incidence matrix MG : Conversely, to each 0–1 matrix M there belongs a geometry in a natural way, where the columns represent the subsets and the rows the points. From the aspect of GEOM a line l does not play role if it is contained in an other line. We say that a row (column) r1 of the matrix M is contained another row (column) r2 if r1 ðiÞ ¼ 1 implies r2 ðiÞ ¼ 1: We call a 0–1 matrix M non-inclusive, if no rows (columns) contain each other in M: A geometry G is called non-inclusive if MG is non-inclusive. This means, that no two lines contain each other and for any pair of points, P; Q there is a line containing P; but not containing Q: We extend the definition non-inclusive to Rees-matrix semigroups. They will be called non-inclusive if their matrix is non-inclusive. Observe that a graph is domination-free if and only if the corresponding matrix is non-inclusive.
2. Equivalences We need some lemmas connecting the different notions. We start with a consequence of item 1 of Lemma 4: Lemma 5. For every polynomial p of S of length n there is a set of n 1 biproducts such that p is identically 0 if and only if by any assignment of the variables at least one of the products is equal to 0. Item 2 and 3 of Lemma 4 imply the converse of the statement: Lemma 6. For any set of n biproducts there is a polynomial p of size 3n 1; such that p is identically 0 if and only if by any assignment of the variables at least one of the products is equal to 0. Proof. We connect the biproducts with buffer-variables. Let b1 ; y; bn the biproducts, x1 ; y; xn variables not occurring in any bi : Then the polynomial b1 x1 b2 x2 ybn 1 xn 1 bn satisfies the conditions. & For the remaining of the section let S be a Rees-matrix semigroup with matrix M; and H the bipartite graph with adjacency matrix M: Lemma 7. For any polynomial p of S there is a bipartite graph with a partial map f : G-H; such that p is identically 0 if and only if f cannot be extended to a graphhomomorphism. Proof. Let us suppose we have a polynomial p ¼ x1 x2 ?xn in S: We construct a bipartite graph Gp : To each variable and constant of p we introduce two corresponding vertices. A ‘‘top’’ and a ‘‘bottom’’ vertex, yi and zi for the variable xi : Let us connect the points yi and zj if xi is followed by xj somewhere in the
158
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
polynomial. The endpoints of the constants are obviously identified with the corresponding vertices of H: Let f be the partial map, mapping the endpoints of the constants to the corresponding points of HS : Now, let e be an evaluation of p: (i.e. we substitute the variables xi by elements eðxi Þ ¼ ðeðxi Þ1 ; eðxi Þ2 Þ). By Lemma 4 the evaluation p 3 ea0 if and only if whenever xj follows xi then the matrix entry Mðeðxi Þ2 ; eðxj Þ1 Þ ¼ 1: That is if xj follows xi then ðeðxi Þ2 ; eðxj Þ1 Þ is an edge of H equivalently the map g : Gp -HS ; where gðyi Þ ¼ eðxi Þ2 ; gðzi Þ ¼ eðxi Þ1 ; is a graph homomorphism that extends f : Thus the polynomial p is identically 0 if and only if there is no homomorphism from Gp to HS : & The converse of this lemma follows from Lemma 6 and the following. Lemma 8. For any bipartite graph G and partial map f : G-H there is a set of eðGÞ many biproducts in S; such that f extends to a homomorphism if and only if there is an evaluation of the variables such that none of the biproducts is equal to 0. Proof. Let G ¼ fv1 ; y; vt g; let f : G-H be the partial map from G to H: Let H1 and H2 be the bipartition of H; G1 and G2 the bipartition of G such that f 1 ðH1 Þ belongs to G1 ; and f 1 ðH2 Þ belongs to G2 : If these bipartitions do not exist, then f cannot be extended to a homomorphism. Now, let G1 ¼ fa1 ; y; ak ; o1 ; y; ol g; G2 ¼ fb1 ; y; bm ; u1 ; y; un g where f is defined on the oi ’s and the ui ’s. The oi ’s are mapped to H1 and the ui ’s to H2 : Now, we identify each vertex of G with a variable or a constant from S: The constant o1 will be an element of the form ½oi1 ; f ðoi ÞAS; where oi1 AI is arbitrary, and u1 will be an element of the form ½ f ðui Þ; ui2 AS; where ui2 AL is arbitrary. The variables will be denoted by ai and bj : The set of biproducts B ¼ fai bj ; ai ok ; ui bl ; ui om j ðai bj ÞAEðGÞ; ðai ok ÞAEðGÞ; ðui bl ÞAEðGÞ; ðui om ÞAEðGÞg will represent the edges of G: Now, at any evaluation e of the biproducts none of them is equal to 0 if and only if ðeðxÞ; eðyÞÞ is an edge of H for ðx; yÞAB or equivalently, if the map g with gðxÞ ¼ eðxÞ2 for xAG1 and gðyÞ ¼ eðyÞ1 for xAG2 is a graph homomorphism (that extends f ) from G-H: & We are ready to connect the complexity of these problems. In virtue of Theorems 1 and 2 it is enough to investigate the complexities for domination-free graphs meaning non-inclusive matrices. Theorem 9. Let M be a non-inclusive 0–1 matrix and H; S; G denote the corresponding graph, Rees-matrix semigroup and geometry, respectively. Then the following problems are polynomially equivalent: (1) RET H; (2) OAL H;
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
159
(3) POLa0 S; (4) POL-SAT S; (5) GEOM G:
Proof. The equivalence of RET H and OAL H is proved in [4]. The Lemmas 5–8 show that OAL H is equivalent to POLa0 S: The equivalence of 3 and 4 are proved in [9, Lemma 2.5]. For the equivalence of 5 and 2, first we have to see that fC1 ; C2 ; y; Ck g; an instance of GEOM G can be considered as a graph, where the vertices correspond to the variables and the instances. A constraint-vertex is connected with a variablevertex if the constraint contains the variable. In addition some of the point-vertices are colored. It is obvious that fC1 ; C2 ; y; Ck g can be satisfied if and only if there is a homomorphism from this graph to the graph H ¼ HM : Now, let ðG; f Þ be an instance of OAL H and G1 ; G2 and H1 ; H2 be the bipartitions of G and H; where H1 corresponds to the points and H2 to the lines of GM : We assign a variable xi to every vertex iAG1 and a constraint Cj ¼ fxk j kANð jÞg to the vertex jAG2 : The variable-vertices are colored naturally by the corresponding pointvertices. If a constraint-vertex Cj was colored by a line vertex yAH2 ; then define Cj0 ¼ Cj ,NðyÞ: Now, at a graph homomorphism the constraint-vertex Cj0 has to be mapped to a line-vertex that contains all the points of y: By the non-inclusivity of G the image of Cj0 has to be y: &
3. Applications It is independently proved in [3,8] that Theorem 10. Let C2n denote the 2n-cycle. If nX3 then OAL C2n is NP-complete. For n ¼ 3; C2n is a 6-cycle, and the adjacency matrix is M6 in Example 1.1. Now, let v1 ¼ u2 ¼ ð10Þ; v2 ¼ u1 ¼ ð01Þ; v3 ¼ u3 ¼ ð11ÞAZ22 : The map vi uTj -½i; j and 00 00 -0 is an isomorphism between L2 ðZ2 Þ; the multiplicative semigroup of singular matrices of M2 ðZ2 Þ; and SM6 : Thus by Theorem 9 POLa0 L2 ðZ2 Þ and POL-NEQ L2 ðZ2 Þ are NP-complete. Now we are able to answer the questions of Lawrence and Willard: Theorem 11. POLa0 T2 ðZ2 Þ and POL-NEQ T2 ðZ2 Þ are NP-complete. Proof. We show that POLa0 T2 ðZ2 Þ is more difficult than POLa0 L2 ðZ2 Þ: For every polynomial p ¼ pðx1 ; y; xk Þ over L2 ðZ2 Þ we exhibit a polynomial q over T2 ðZ2 Þ; such that p is identically 0 if and only if q is identically 0. For this let A be an arbitrary (but fixed) rank 1 matrix in M2 ðZ2 Þ and q ¼ pðy1 Az1 ; y; yk Azk Þ; where y1 ; z1 ; y; yk ; zk are variables. The polynomial q is constructed from p by substituting
160
S. Seif, C. Szabo! / Journal of Complexity 19 (2003) 153–160
yi Azi for xi : As yi and zi attains all possible values from T2 ðZ2 Þ; the value of yi Azi takes all possible values from L2 ðZ2 Þ: Thus p is identically 0 if and only if q is identically 0, and this is what we wanted to show. & As an obvious corollary we obtain the following theorem. Theorem 12. POLS -NEQ M2 ðZ2 Þ is NP-complete.
Acknowledgments The research of the Szabo´ was supported by the Hungarian National Foundation for Scientific Research, Grant F32325 and T38059.
References [1] H.J Bandelt, A. Da¨hlmann, H. Schu¨tte, Absolute retracts of bipartite graphs, Discrete Appl. Math. 16 (1987) 191–215. [2] S. Burris, J. Lawrence, The equivalence problem for finite rings, J. Symbolic Comput. 15 (1993) 67–71. [3] T. Feder, P. Hell, J. Huang, List homomorphisms and circular arc graphs, Combinatorica 19 (1999) 487–505. [4] T. Feder, P. Hell, List homomorphism to reflexive graphs, J. Combin. Theory Ser. B 72 (1998) 236– 250. [5] T. Feder, M.Y. Vardi, The computational structure of monotone monadic SNP and constraint satisfaction: a study through datalog and group theory, SIAM J. Comput. 28 (1998) 57–104. [6] P. Hell, J. Nesˇ etrˇ il, On the complexity of H-coloring, J. Combin. Theory Ser. B 48 (1990) 92–110. [7] J. Lawrence, R. Willard, The complexity of solving polynomial equations over finite rings, manuscript, 1997. [8] G. MacGillivary, personal information. [9] S. Seif, Zˇ. Sokolovic´, Cs. Szabo´, Complexity problems associated with matrix rings and Rees matrix semigroups, manuscript.