The complexity of general-valued CSPs seen from the other side
TThe complexity of general-valued CSPs seen from the other side ∗ Cl´ement CarbonnelUniversity of Oxford, UK [email protected]
Miguel RomeroUniversity of Oxford, UK [email protected]
Stanislav ˇZivn´yUniversity of Oxford, UK [email protected]
Abstract
The constraint satisfaction problem (CSP) is concerned with homomorphisms betweentwo structures. For CSPs with restricted left-hand side structures, the results of Dalmau,Kolaitis, and Vardi [CP’02], Grohe [FOCS’03/JACM’07], and Atserias, Bulatov, andDalmau [ICALP’07] establish the precise borderline of polynomial-time solvability (subjectto complexity-theoretic assumptions) and of solvability by bounded-consistency algorithms(unconditionally) as bounded treewidth modulo homomorphic equivalence.The general-valued constraint satisfaction problem (VCSP) is a generalisation of theCSP concerned with homomorphisms between two valued structures. For VCSPs withrestricted left-hand side valued structures, we establish the precise borderline of polynomial-time solvability (subject to complexity-theoretic assumptions) and of solvability by the k -th level of the Sherali-Adams LP hierarchy (unconditionally). We also obtain results onrelated problems concerned with finding a solution and recognising the tractable cases;the latter has an application in database theory. The homomorphism problem for relational structures is a fundamental computer scienceproblem: Given two relational structures A and B over the same signature, the goal is todetermine the existence of a homomorphism from A to B (see, e.g., the book by Hell andNeˇsetˇril on this topic [35]). The homomorphism problem is known to be equivalent to theevaluation problem and the containment problem for conjunctive database queries [12, 37],and also to the constraint satisfaction problem (CSP) [23], which originated in artificialintelligence [43] and provides a common framework for expressing a wide range of boththeoretical and real-life combinatorial problems. ∗ An extended abstract of this work will appear in the
Proceedings of the 59th Annual IEEE Symposium onFoundations of Computer Science (FOCS’18) [11]. Stanislav ˇZivn´y was supported by a Royal Society UniversityResearch Fellowship. This project has received funding from the European Research Council (ERC) under theEuropean Union’s Horizon 2020 research and innovation programme (grant agreement No 714532). The paperreflects only the authors’ views and not the views of the ERC or the European Commission. The EuropeanUnion is not liable for any use that may be made of the information contained therein. a r X i v : . [ c s . CC ] A ug or a class C of relational structures, we denote by CSP ( C , − ) the restriction of thehomomorphism problem in which the input structure A belongs to C and the input structure B is arbitrary (these types of restrictions are known as structural restrictions). Similarly,by CSP ( − , C ) we denote the restriction of the homomorphism problem in which the inputstructure A is arbitrary and the input structure B belongs to C .Feder and Vardi initiated the study of CSP ( − , { B } ), also known as non-uniform CSPs,and famously conjectured that, for every fixed finite structure B , either CSP ( − , { B } ) is inPTIME or CSP ( − , { B } ) is NP-complete. For example, if B is a clique on k vertices then CSP ( − , { B } ) is the well-known k -colouring problem, which is known to be in PTIME for k ≤ k ≥
3. Most of the progress on the Feder-Vardi conjecture (e.g.,[6, 3, 36, 10, 2]) is based on the algebraic approach [9], culminating in two recent (affirmative)solutions to the Feder-Vardi conjecture obtained independently by Bulatov [7] and Zhuk [52].Note that
CSP ( C , − ) is only interesting if C is an infinite class of structures as otherwise CSP ( C , − ) is always in PTIME. (This is, however, not the case for CSP ( − , C ) as we haveseen in the example of 3-colouring.) Freuder observed that CSP ( C , − ) is in PTIME if C consists of trees [25] or, more generally, if it has bounded treewidth [26]. Later, Dalmau,Kolaitis, and Vardi showed that CSP ( C , − ) is solved by k -consistency, a fundamental localpropagation algorithm [16], if C is of bounded treewidth modulo homomorphic equivalence , i.e.,if the treewidth of the cores of the structures from C is at most k , for some fixed k ≥ k -consistency [1]. In [32], Grohe proved that the tractability result of Dalmau et al. [15] isoptimal for classes C of bounded arity: Under the assumption that FPT (cid:54) = W[1], CSP ( C , − )is tractable if and only if C has bounded treewidth modulo homomorphic equivalence. General-valued Constraint Satisfaction Problems (VCSPs) are generalisations of CSPs whichallow for not only decision problems but also for optimisation problems (and the mix of thetwo) to be considered in one framework [14]. In the case of VCSPs we deal with valued structures. Regarding tractable restrictions, the situation of the non-uniform case is by nowwell-understood. Indeed, assuming the (now proved) Feder-Vardi conjecture, it holds thatfor any fixed valued structure B , either VCSP ( − , { B } ) is in PTIME or VCSP ( − , { B } ) isNP-complete [41, 39].For structural restrictions, it is a folklore result that VCSP ( C , − ) is tractable if C is ofbounded treewidth; see, e.g. [4]. So is the fact that the ( k + 1)-st level of the Sherali-AdamsLP hierarchy [48] solves VCSP ( C , − ) to optimality if the treewidth of all structures in C isat most k . (We are not aware of any reference for this fact. For certain special problems,it is discussed in [5]. For the extension complexity of such problems, see [38].) However,unlike the CSP case, the precise borderline of polynomial-time solvability and the power offundamental algorithms (such as the Sherali-Adams LP hierarchy) for VCSP( C , − ) is stillunknown. Understanding these complexity and algorithmic frontiers for VCSP( C , − ) is themain goal of this paper. We study the problem
VCSP ( C , − ) for classes C of valued structures and give three mainresults. 2
1) Complexity classification
As our first result, we give (in Theorem 19) a completecomplexity classification of
VCSP ( C , − ) and identify the precise borderline of tractability, forclasses C of bounded arity. A key ingredient in our result is a novel notion of valued equivalence and a characterisation of this notion in terms of valued cores . More precisely, we show that VCSP ( C , − ) is tractable if and only if C has bounded treewidth modulo valued equivalence.This latter notion strictly generalises bounded treewidth and it is strictly weaker than boundedtreewidth modulo homomorphic equivalence. Our proof builds on the characterisation byDalmau et al. [15] and Grohe [32] for CSPs. We show that the newly identified tractableclasses are solvable by the Sherali-Adams LP hierarchy. (2) Power of Sherali-Adams Our second result (Theorem 29) gives a precise character-isation of the power of Sherali-Adams for
VCSP ( C , − ). In particular, we show that the( k + 1)-st level of the Sherali-Adams LP hierarchy solves VCSP ( C , − ) to optimality if and onlyif the valued cores of the structures from C have treewidth modulo scopes at most k and the overlaps of scopes are of size at most k + 1. The proof builds on the work of Atserias et al. [1]and Thapper and ˇZivn´y [51], as well as on an adaptation of the classical result connectingtreewidth and brambles by Seymour and Thomas [47]. (3) Search VCSP Our first two results are for the
VCSP in which we ask for the cost of anoptimal solution. It is also possible to define the
VCSP as a search problem, in which one isadditionally required to return a solution with the optimal cost. A complete characterisationof tractable search cases in terms of structural properties of (a class of structures) C is openeven for CSPs and there is some evidence that the tractability frontier cannot be capturedin simple terms. Building on our first two results as well as on techniques from [50], wegive in Section 6 a characterisation of the tractable cases for search
VCSP( C , − ) in terms oftractable core computation (Theorem 41). (4) Additional results In addition to our main results, we provide in Section 7 tightcomplexity bounds for several problems related to our classification results, e.g., decidingwhether the treewidth is at most k modulo valued equivalence, deciding solvability by the k -thlevel of the Sherali-Adams LP hierarchy, and deciding valued equivalence for valued structures.These results have interesting consequences to database theory, specifically, to the evaluationand optimisation of conjunctive queries over annotated databases. In particular, we showthat the containment problem of conjunctive queries over the tropical semiring is in NP, thusimproving on the work of [40], which put it in Π p . In his PhD thesis [21], F¨arnqvist studied the complexity of VCSP( C , − ) and also somefragments of VCSPs (see also [22, 20]). He considered a very specific framework that onlyallows for particular types of classes C ’s to be classified. For these classes, he showed thatonly bounded treewidth gives rise to tractability (assuming bounded arity) and asked aboutmore general classes. In particular, decision CSPs do not fit in his framework and Grohe’sclassification [32] is not implied by F¨arnqvist’s work. In contrast, our characterisation (of all In particular, [8, Lemma 1] shows that a description of tractable cases of
SCSP( C , − ) , which is the searchvariant of CSP( C , − ) defined in Section 6, would imply a description of tractable cases of CSP( − , { B } ) . C ’s of valued structures) gives rise to new tractable cases going beyond those identifiedby F¨arnqvist. Moreover, we can derive both Grohe’s classification and F¨arnqvist’s classificationdirectly from our results, as explained in Section 4.It is known that Grohe’s characterisation applies only to classes C of bounded arity , i.e., whenthe arities of the signatures are always bounded by a constant (for instance, CSPs over digraphs)and fails for classes of unbounded arity. In this direction, several hypergraph-based restrictionsthat lead to tractability have been proposed (for a survey see, e.g. [28]). Nevertheless, theprecise tractability frontier for CSP( C , − ) is not known. The situation is different for fixed-parameter tractability : Marx gave a complete classification of the fixed-parameter tractablerestrictions CSP( C , − ), for classes C of structures of unbounded arity [42]. In the case ofVCSPs, Gottlob et al. [29] and F¨arnqvist [20] applied well-known hypergraph-based tractablerestrictions of CSPs to VCSPs. We assume familiarity with relational structures and homomorphisms. Briefly, a relationalsignature is a finite set τ of relation symbols R , each with a specified arity ar( R ). A relationalstructure A over a relational signature τ (or a relational τ -structure, for short) is a finiteuniverse A together with one relation R A ⊆ A ar( R ) for each symbol R ∈ τ . A homomorphism from a relational τ -structure A (with universe A ) to a relational τ -structure B (with universe B ) is a mapping h : A (cid:55)→ B such that for all R ∈ τ and all tuples x ∈ R A we have h ( x ) ∈ R B .We refer the reader to [35] for more details.We use Q ≥ to denote the set of nonnegative rational numbers with positive infinity,i.e. Q ≥ = Q ≥ ∪ {∞} . As usual, we assume that ∞ + c = c + ∞ = ∞ for all c ∈ Q ≥ , ∞ × × ∞ = 0, and ∞ × c = c × ∞ = ∞ , for all c > Valued structures A signature is a finite set σ of function symbols f , each with a specifiedarity ar( f ). A valued structure A over a signature σ (or valued σ -structure, for short) is afinite universe A together with one function f A : A ar( f ) (cid:55)→ Q ≥ for each symbol f ∈ σ . Wedefine tup( A ) to be the set of all pairs ( f, x ) such that f ∈ σ and x ∈ A ar( f ) . The set of positive tuples of A is defined by tup( A ) > := { ( f, x ) ∈ tup( A ) | f A ( x ) > } . If A , B , . . . arevalued structures, then A, B, . . . denote their respective universes.For simplicity we assume a straightforward table encoding for valued structures, whichmeans that the interpretation f A of a symbol f in a valued structure A is encoded as a collectionof triples { ( f, x , f A ( x )) | ( f, x ) ∈ tup( A ) } . However, it follows directly from our proofs thatthe exact same results hold for the more compact positive encoding , which represents f A bythe set { ( f, x , f A ( x )) | ( f, x ) ∈ tup( A ) > } . In particular, the size of a valued σ -structure A isroughly | A | = | σ | + | A | + (cid:88) ( f, x ) ∈ tup( A ) log | σ | + ar( f ) log | A | + | enc ( f A ( x )) | where enc ( · ) denotes a reasonable encoding for elements p/q ∈ Q ≥ . (For instance, we canencode p/q as a sequence of two nonnegative integers p and q , with the convention that p/q = ∞ if and only if q = 0.) VCSPs
We define
Valued Constraint Satisfaction Problems (VCSPs) as in [49]. An instanceof the
VCSP is given by two valued structures A and B over the same signature σ . For a4apping h : A (cid:55)→ B , we definecost( h ) = (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) f B ( h ( x )) . The goal is to find the minimum cost over all possible mappings h : A (cid:55)→ B . We denote thiscost by opt( A , B ).For a class C of valued structures (not necessarily over the same signature), we denoteby VCSP ( C , − ) the class of VCSP instances ( A , B ) such that A ∈ C . We say that VCSP ( C , − ) is in PTIME, the class of problems solvable in polynomial time , if there is a deterministicalgorithm that solves any instance ( A , B ) of VCSP ( C , − ) in time ( | A | + | B | ) O (1) . We alsoconsider the parameterised version of VCSP ( C , − ), denoted by p - VCSP ( C , − ), where theparameter is | A | . We say that p - VCSP ( C , − ) is in FPT, the class of problems that are fixed-parameter tractable , if there is a deterministic algorithm that solves any instance ( A , B )of p - VCSP ( C , − ) in time f ( | A | ) · | B | O (1) , where f : N (cid:55)→ N is an arbitrary computable function.The class W[1], introduced in [18], can be seen as an analogue of NP in parameterisedcomplexity theory. Proving W[1]-hardness of p - VCSP ( C , − ) (under an fpt-reduction, formallydefined in Section 4.1) is a strong indication that p - VCSP ( C , − ) is not in FPT as it is believedthat FPT (cid:54) = W[1]. We refer the reader to [24] for more details on parameterised complexity. Treewidth of a valued structure
The notion of treewidth (originally introduced byBertel´e and Brioschi [4] and later rediscovered by Robertson and Seymour [44]) is a well-knownmeasure of the tree-likeness of a graph [17]. Let G = ( V ( G ) , E ( G )) be a graph. A treedecomposition of G is a pair ( T, β ) where T = ( V ( T ) , E ( T )) is a tree and β is a function thatmaps each node t ∈ V ( T ) to a subset of V ( G ) such that1. V ( G ) = (cid:83) t ∈ V ( T ) β ( t ),2. for every u ∈ V ( G ), the set { t ∈ V ( T ) | u ∈ β ( t ) } induces a connected subgraph of T ,and3. for every edge { u, v } ∈ E ( G ), there is a node t ∈ V ( T ) with { u, v } ⊆ β ( t ).The width of the decomposition ( T, β ) is max {| β ( t ) | | t ∈ V ( T ) } −
1. The treewidth tw ( G ) ofa graph G is the minimum width over all its tree decompositions.Let A be a relational structure over relational signature τ . Its Gaifman graph (also knownas primal graph ), denoted by G ( A ), is the graph whose vertex set is the universe of A andwhose edges are the pairs { u, v } for which there is a tuple x and a relation symbol R ∈ τ suchthat u, v appear in x and x ∈ R A . We define the treewidth of A to be tw ( A ) = tw ( G ( A )).Let A be a valued σ -structure. Note that if A is the left-hand side of an instance of the VCSP , the only tuples relevant to the problem are those in tup( A ) > . Hence, in order to definestructural restrictions and in particular, the notion of treewidth, we focus on the structureinduced by tup( A ) > . Formally, we associate with the signature σ a relational signature rel( σ )that contains, for every f ∈ σ , a relation symbol R f of the same arity as f . We define Pos( A )to be the relational structure over rel( σ ) with the same universe A of A such that x ∈ R Pos( A ) f if and only if ( f, x ) ∈ tup( A ) > . We let the treewidth of A be tw ( A ) = tw (Pos( A )). Remark 1.
Observe that, in the
VCSP , we allow infinite costs not only in B but also inthe left-hand side structure A . This allows us to consider the VCSP as the minimum-cost5 . It can be proved that the labels produced by the previous algorithm are precisely the levels of G . We have thefollowing lemmas, from [21]: Lemma 8.2 . If G and H are two balanced digraphs such that G → H , then hg ( G ) ≤ hg ( H ) . Lemma 8.3 . Let G and H be two balanced digraphs of the same height, then any homomorphism from G into H preserves the levels of vertices. Now we prove the Proposition. Let P and P ′ be oriented paths. We define the digraph D ( P, P ′ ) as follows: Considerthe digraph ( { a, b, c, d } , { ( a, b ) , ( a, d ) , ( c, b ) , ( c, d ) } ). Add disjoint copies of P and P ′ and identify the initial vertexof the copy of P and P ′ , with b and d , respectively. Finally, add disjoint copies of P and P ′ again, and identify theterminal vertex of the copy of P and P ′ , with a and c , respectively. See Figure 3. a a ′ a ′ a ′ a ′ a ′ Figure 3:
Now, for oriented paths P and P ′ , we define D ac ( P, P ′ ) and D bd ( P, P ′ ) as the digraphs obtained from D ( P, P ′ ) byidentifying a with c , and b with d , respectively. See Figure 4. eb PP P ′ P ′ de PP ′ P ′ P a c
Figure 4: The digraphs D ac ( P, P ′ ) and D bd ( P, P ′ ) . We have the following claim:
Claim 8.4 . Let P and P ′ be incomparable ( P ̸→ P ′ and P ′ ̸→ P ) oriented paths of the same net length k > , suchthat each interior vertex (vertex different from the initial and terminal vertices) in P and P ′ has a level that isneither nor k . Then D ac ( P, P ′ ) and D bd ( P, P ′ ) are incomparable cores.Proof: Suppose that D ac ( P, P ′ ) is not a core. Then D ac ( P, P ′ ) h −→ D ac ( P, P ′ ), where h is not surjective. UsingLemma 8.3, we know that h preserves levels. It follows that h ( e ) = e (see Figure 5). Now, h ( x ) is either x or x .Note that h ( x ) = x , implies that P → P ′ , since no vertex in the copy of P between x and e can be mapped to b or d , and no vertex, except for the terminal one, has level k . It follows that h ( x ) = x . Similarly, we have that h ( x ) = x . Using the same argument, we have that h ( b ) = b , otherwise h ( b ) = d and P → P ′ , since no vertex in14 Figure 1: The valued structures A , B and A (cid:48) of Example 4 and 16, from left to right.mapping problem between two mathematical objects of the same nature. Intuitively, mappingthe tuples of A to infinity ensures that those are logically equivalent to hard constraints , asany minimum-cost solution must map them to tuples of cost exactly 0 in B . Thus, decisionCSPs, which are { , ∞} -valued VCSPs, are a special case of our definition and all our resultsalso apply to CSPs. We start by introducing the notion of valued equivalence that is crucial for our results.
Definition 2.
Let A , B be valued σ -structures. We say that A improves B , denoted by A (cid:22) B ,if opt( A , C ) ≤ opt( B , C ) for all valued σ -structures C .When two valued structures improve each other, we call them equivalent. (In Section 1,we used the term “valued equivalence”. In the rest of the paper, we drop the word “valued”unless needed for clarity.) Definition 3.
Let A , B be valued σ -structures. We say that A and B are equivalent , denotedby A ≡ B , if A (cid:22) B and B (cid:22) A .Hence, two valued σ -structures A and B are equivalent if they have the same optimal costover all right-hand side valued structures. Observe that equivalence implies homomorphic equivalence of Pos( A ) and Pos( B ). Indeed, whenever Pos( A ) is not homomorphic to Pos( B ),we can define a valued σ -structure C as follows: C and B have the same universe B , andfor every f ∈ σ and x ∈ B ar( f ) , f C ( x ) = 0 if ( f, x ) ∈ tup( B ) > , and f C ( x ) = ∞ otherwise.Note that opt( B , C ) = 0 (as the identity mapping has cost 0), but opt( A , C ) = ∞ , and hence, A (cid:54)≡ B . As the following example shows, the converse does not hold in general. Example 4.
Consider the valued σ -structures A and B from Figure 1, with σ = { f, µ } , where f and ν are binary and unary function symbols, respectively. In Figure 1, µ is represented bythe numbers labelling the nodes, and f is represented as follows: pairs receiving cost ∞ aredepicted as edges, while all remaining pairs are mapped to 0. Observe that Pos( A ) and Pos( B )are homomorphically equivalent. However, they are not (valued) equivalent. Indeed, considerthe valued σ -structure C with same universe B as B such that (i) for every x ∈ B , f C ( x ) = 0if f B ( x ) = ∞ , otherwise f C ( x ) = ∞ , and (ii) µ C = µ B . It follows that opt( A , C ) = 9 andopt( B , C ) = 5, and thus A (cid:54)≡ B .In the rest of the section, we give characterisations of equivalence in terms of certain typesof homomorphisms and (valued) cores. We conclude with a useful characterisation of bounded6reewidth modulo equivalence in terms of cores. In order to keep the flow uninterrupted, wedefer some of the proofs from this section to Appendix A. A homomorphism between two relational structures is a structure-preserving mapping. A fractional homomorphism between two valued structures played an important role in [49].Intuitively, it is a probability distribution over mappings between the universes of the twostructures with the property that the expected cost is not increased [49]. In this paper, wewill need a different but related notion of inverse fractional homomorphism. For sets A and B , we denote by B A the set of all mappings from A to B . Definition 5.
Let A , B be valued σ -structures. An inverse fractional homomorphism from A to B is a function ω : B A (cid:55)→ Q ≥ with (cid:80) g ∈ B A ω ( g ) = 1 such that for each ( f, x ) ∈ tup( B ) wehave (cid:88) g ∈ B A ω ( g ) f A ( g − ( x )) ≤ f B ( x ) , where f A ( g − ( x )) := (cid:80) y ∈ A ar( f ) : g ( y )= x f A ( y ). We define the support of ω to be the setsupp( ω ) := { g ∈ B A | ω ( g ) > } .The following result relates improvement and inverse fractional homomorphisms. Theproof is based on Farkas’ Lemma. Proposition 6.
Let A , B be valued σ -structures. Then, A (cid:22) B if and only if there exists aninverse fractional homomorphism from A to B . Let us remark that an inverse fractional homomorphism ω from A to B is actually adistribution over the set of homomorphisms from Pos( A ) to Pos( B ), i.e., every g ∈ supp( ω )is a homomorphism from Pos( A ) to Pos( B ). Indeed, for every x ∈ R Pos( A ) f , where f ∈ σ and x ∈ A ar( f ) , it must be the case that f B ( g ( x )) ≥ (cid:80) h ∈ B A ω ( h ) f A ( h − ( g ( x ))) ≥ ω ( g ) f A ( x ) > g ( x ) ∈ R Pos( B ) f . In view of Proposition 6, this offers another explanation of the factthat equivalence implies homomorphic equivalence (of the positive parts). Appropriate notions of cores have played an important role in the complexity classifications ofleft-hand side restricted CSPs [32], right-hand side restricted CSPs [9, 7, 52], and right-handside restricted VCSPs [50, 39]. In this paper, we will define cores around inverse fractionalhomomorphisms. The proofs of some of the propositions are deferred to the appendix.For two valued σ -structures A and B , we say that that an inverse fractional homomorphism ω from A to B is surjective if every g ∈ supp( ω ) is surjective. Definition 7.
A valued σ -structure A is a core if every inverse fractional homomorphismfrom A to A is surjective.Next we show that equivalent valued structure that are cores are in fact isomorphic. Definition 8.
Let A , B be valued σ -structures. An isomorphism from A to B is a bijectivemapping h : A (cid:55)→ B such that f A ( x ) = f B ( h ( x )) for all ( f, x ) ∈ tup( A ). If such an h exists,we say that A and B are isomorphic . 7 roposition 9. If A , B are core valued σ -structures such that A ≡ B , then A and B areisomorphic. We now introduce the central notion of a core of a valued structure and show that everyvalued structure has a unique core (up to isomorphism). In order to do so, we need to statesome properties of inverse fractional homomorphisms. The next proposition highlights akey property shared by all mappings g that belong to the support of an inverse fractionalhomomorphism from a valued structure A to itself: for every right-hand side valued structure C , the composition of g and a minimum-cost mapping from A to C is always a minimum-costmapping from A to C . Proposition 10.
Let A be a valued σ -structure and g : A (cid:55)→ A be a mapping. Supposethere exists an inverse fractional homomorphism ω from A to A such that g ∈ supp ( ω ) .Then, for every valued σ -structure C and mapping s : A (cid:55)→ C such that cost ( s ) = opt ( A , C ) ,cost ( s ◦ g ) = opt ( A , C ) . Next we introduce the “image valued structure” of g , where g : A (cid:55)→ A is a mapping froma valued structure A to itself. When g belongs to a inverse fractional homomorphism from A to itself, Proposition 10 allows us to show that A and the image of g are actually equivalent. Definition 11.
Let A be a valued σ -structure, and g : A (cid:55)→ A be a mapping. We define g ( A ) to be the valued σ -structure over universe g ( A ) such that f g ( A ) ( x ) = f A ( g − ( x )) = (cid:80) y ∈ A ar( f ) : g ( y )= x f A ( y ), for all f ∈ σ and x ∈ g ( A ) ar( f ) . Proposition 12.
Let A be a valued σ -structure and g : A (cid:55)→ A be a mapping. Suppose thereexists an inverse fractional homomorphism ω from A to A such that g ∈ supp ( ω ) . Then, g ( A ) ≡ A . Now we are ready to define cores and prove their existence.
Definition 13.
Let A , B be valued σ -structures. We say that B is a core of A if B is a coreand A ≡ B . Proposition 14.
Every valued structure A has a core and all cores of A are isomorphic.Moreover, for a given valued structure A , it is possible to effectively compute a core of A andall cores of A are over a universe of size at most | A | .Proof. Let A be a valued structure. To see that there is always a core for A , we can argueinductively. If A is a core itself we are done. Otherwise, there is a non-surjective mapping g ∈ supp( ω ) for some inverse fractional homomorphism ω from A to itself. By Proposition 12, A ≡ g ( A ). If g ( A ) is core we are done. Otherwise, we repeat the process. As in each step thesize of the universe strictly decreases, at some point we reach a valued structure that is a core,and in particular, a valued structure that is a core of A . Uniqueness follows directly fromProposition 9. From the argument described above, it follows that the universe of any coreof A has size at most | A | , and also that we can compute a core from A , as each step in theabove-mentioned process is computable. Indeed, by solving a suitable linear program, it ispossible to decide whether a valued structure is a core, and in the negative case, compute anon-surjective mapping g ∈ supp( ω ) for some inverse fractional homomorphism ω from thevalued structure to itself (see Appendix A.5 for a detailed proof).8roposition 14 allows us to speak about the core of a valued structure. It follows thenthat equivalence can be characterised in terms of cores: A and B are equivalent if and only iftheir cores are isomorphic.We conclude with a technical characterisation of the property of being a core that will beimportant in the paper. Intuitively, it states that every non-surjective mapping from a core A to itself is suboptimal with respect to a fixed weighting of the tuples of A . Proposition 15.
Let A be a valued σ -structure. Then, A is a core if and only if there existsa mapping c : tup ( A ) (cid:55)→ Q ≥ such that for every non-surjective mapping g : A (cid:55)→ A , (cid:88) ( f, x ) ∈ tup ( A ) f A ( x ) c ( f, x ) < (cid:88) ( f, x ) ∈ tup ( A ) f A ( x ) c ( f, g ( x )) . Moreover, such a mapping c : tup ( A ) (cid:55)→ Q ≥ is computable, whenever A is a core. Example 16.
Let A and A (cid:48) be the valued σ -structures depicted in Figure 1. Recall that σ = { f, µ } , where f is a { , ∞} -valued binary function (represented by edges) and µ is unary(represented by node labels). Also, the elements of A are denoted by a ij , where i and j indicatethe corresponding row and column of the grid, respectively (for readability, only a is depictedin Figure 1). We claim that A (cid:48) is the core of A . Indeed, since Pos( A (cid:48) ) is a relational core, itfollows that A (cid:48) is a core. To see that A (cid:22) A (cid:48) , let g : A (cid:55)→ A (cid:48) be the mapping that maps allelements in the i -th diagonal of A (first diagonal is { a } , second diagonal is { a , a } , andso on) to a (cid:48) i . Assigning ω ( g ) = 1 gives an inverse fractional homomorphism ω from A to A (cid:48) ,and thus A (cid:22) A (cid:48) by Proposition 6.Conversely, consider the mappings g , g , g , g , g , g from A (cid:48) to A that map ( a (cid:48) , a (cid:48) , a (cid:48) , a (cid:48) , a (cid:48) )to ( a , a , a , a , a ), ( a , a , a , a , a ), ( a , a , a , a , a ), ( a , a , a , a , a ),( a , a , a , a , a ) and ( a , a , a , a , a ), respectively. We define the distribution ω (cid:48) ( g ) = 1 / ω (cid:48) ( g ) = 1 / ω (cid:48) ( g ) = 1 / ω (cid:48) ( g ) = 1 / ω (cid:48) ( g ) = 1 /
12 and ω (cid:48) ( g ) = 1 / (cid:88) k ω (cid:48) ( g k ) µ A (cid:48) ( g − k ( a ij )) = (2 × / × / × a ij ∈ { a , a } (1 / × / × a ij ∈ { a , a , a , a } (1 / × a ij ∈ { a , a } (4 × / × a ij = a and hence for all i, j , (cid:80) k ω (cid:48) ( g k ) µ A (cid:48) ( g − k ( a ij )) = 1 ≤ µ A ( a ij ). It follows that ω (cid:48) is an inversefractional homomorphism from A (cid:48) to A . Therefore, A (cid:48) (cid:22) A and A (cid:48) is the core of A . Inparticular, A is not a core. As we explain later in Example 23, it is possible to modify A (more precisely, µ A ) so that it becomes a core. In this section we show an elementary property of cores that is crucial for our purposes:the treewidth of the core of a valued structure A is the lowest possible among all structuresequivalent to A . Proposition 17.
Let A be a valued σ -structure and A (cid:48) be its core. Then, tw ( A (cid:48) ) ≤ tw ( A ) . roof. Since treewidth is preserved under relational substructures, it suffices to show thatPos( A (cid:48) ) is a substructure of Pos( A ), i.e., there is an injective homomorphism from Pos( A (cid:48) ) toPos( A ). Let ω and ω (cid:48) be inverse fractional homomorphisms from A (cid:48) to A , and from A to A (cid:48) ,respectively. Pick any mapping g ∈ supp( ω ). As observed at the end of Section 3.1, g has tobe a homomorphism from Pos( A (cid:48) ) to Pos( A ). It suffices to show that g is injective. Towards acontradiction, suppose g is not injective and define ω (cid:48) ◦ ω : A (cid:48) A (cid:48) (cid:55)→ Q ≥ as ω (cid:48) ◦ ω ( h ) = (cid:88) h : A (cid:48) (cid:55)→ A,h : A (cid:55)→ A (cid:48) h ◦ h = h ω ( h ) ω (cid:48) ( h ) . Observe that ω (cid:48) ◦ ω is an inverse fractional homomorphism from A (cid:48) to A (cid:48) . Pick any g (cid:48) ∈ supp( ω (cid:48) ).It follows that g (cid:48) ◦ g is not injective and g (cid:48) ◦ g ∈ supp( ω (cid:48) ◦ ω ). In particular, g (cid:48) ◦ g is notsurjective. This contradicts the fact that A (cid:48) is a core.We conclude Section 3 with the following useful characterisation of “being equivalent to abounded treewidth structure” in terms of cores. Proposition 18.
Let A be a valued σ -structure and k ≥ . Then, the following are equivalent:1. There is a valued σ -structure A (cid:48) such that A (cid:48) ≡ A and A (cid:48) has treewidth at most k .2. The treewidth of the core of A is at most k .Proof. (2) ⇒ (1) is immediate. For (1) ⇒ (2), let A (cid:48) be of treewidth at most k such that A (cid:48) ≡ A . Let B and B (cid:48) be the cores of A and A (cid:48) , respectively. Since B ≡ B (cid:48) , B and B (cid:48) areisomorphic, by Proposition 9. By Proposition 17, the treewidth of B (cid:48) is at most k , and so isthe treewidth of B . VCSP ( C , − ) Let C be a class of valued structures. We say that C has bounded arity if there is a constant r ≥ σ -structure A ∈ C and f ∈ σ , we have that ar( f ) ≤ r .Similarly, we say that C has bounded treewidth modulo equivalence if there is a constant k ≥ A ∈ C is equivalent to a valued structure A (cid:48) with tw ( A (cid:48) ) ≤ k . The following isour first main result. Theorem 19 ( Complexity classification ) . Assume FPT (cid:54) = W[1]. Let C be a recursivelyenumerable class of valued structures of bounded arity. Then, the following are equivalent:1. VCSP ( C , − ) is in PTIME.2. p - VCSP ( C , − ) is in FPT.3. C has bounded treewidth modulo equivalence. Remark 20.
Although Grohe’s result [32] for CSPs looks almost identical to Theorem 19,we emphasise that his result involves a different type of equivalence. In Grohe’s case, theequivalence in question is homomorphic equivalence whereas in our case the equivalence inquestion involves improvement (cf. Definition 3). As we will explain later in this section,Grohe’s classification follows as a special case of Theorem 19.10 . It can be proved that the labels produced by the previous algorithm are precisely the levels of G . We have thefollowing lemmas, from [21]: Lemma 8.2 . If G and H are two balanced digraphs such that G → H , then hg ( G ) ≤ hg ( H ) . Lemma 8.3 . Let G and H be two balanced digraphs of the same height, then any homomorphism from G into H preserves the levels of vertices. Now we prove the Proposition. Let P and P ′ be oriented paths. We define the digraph D ( P,P ′ ) as follows: Considerthe digraph ( { a,b,c,d } , { ( a,b ) , ( a,d ) , ( c,b ) , ( c,d ) } ). Add disjoint copies of P and P ′ and identify the initial vertexof the copy of P and P ′ , with b and d , respectively. Finally, add disjoint copies of P and P ′ again, and identify theterminal vertex of the copy of P and P ′ , with a and c , respectively. See Figure 3. (1 ,
1) 11 11 M MM M M M Figure 3:
Now, for oriented paths P and P ′ , we define D ac ( P,P ′ ) and D bd ( P,P ′ ) as the digraphs obtained from D ( P,P ′ ) byidentifying a with c , and b with d , respectively. See Figure 4.We have the following claim: Claim 8.4 . Let P and P ′ be incomparable ( P ̸→ P ′ and P ′ ̸→ P ) oriented paths of the same net length k > , suchthat each interior vertex (vertex different from the initial and terminal vertices) in P and P ′ has a level that isneither nor k . Then D ac ( P,P ′ ) and D bd ( P,P ′ ) are incomparable cores.Proof: Suppose that D ac ( P,P ′ ) is not a core. Then D ac ( P,P ′ ) h −→ D ac ( P,P ′ ), where h is not surjective. UsingLemma 8.3, we know that h preserves levels. It follows that h ( e ) = e (see Figure 5). Now, h ( x ) is either x or x .Note that h ( x ) = x , implies that P → P ′ , since no vertex in the copy of P between x and e can be mapped to b or d , and no vertex, except for the terminal one, has level k . It follows that h ( x ) = x . Similarly, we have that h ( x ) = x . Using the same argument, we have that h ( b ) = b , otherwise h ( b ) = d and P → P ′ , since no vertex in14 Figure 2: The valued σ -structure C from Example 23 ( M >
Remark 21.
As in [32], we can remove the condition in Theorem 19 of C being recursivelyenumerable, by assuming a stronger hypothesis than FPT (cid:54) = W[1] regarding non-uniformcomplexity classes.Note that by Proposition 18, a class C has bounded treewidth modulo equivalence if andonly if the class given by the cores of the valued structures in C has bounded treewidth. Thisnotion strictly generalises bounded treewidth, as illustrated in Example 22. Consequently,Theorem 19 gives new tractable cases. Example 22.
Consider the signature σ = { f, µ } , where f and µ are binary and unaryfunction symbols, respectively. For n ≥
1, let A n be the valued σ -structure with universe A n = { , . . . , n } × { , . . . , n } such that (i) f A n (( i, j ) , ( i (cid:48) , j (cid:48) )) = ∞ if i ≤ i (cid:48) , j ≤ j (cid:48) , and( i (cid:48) − i ) + ( j (cid:48) − j ) = 1; otherwise f A n (( i, j ) , ( i (cid:48) , j (cid:48) )) = 0, and (ii) µ A n (( i, j )) = 1, for all ( i, j ) ∈ A n .Also, for n ≥
1, let A (cid:48) n be the valued σ -structure with universe A (cid:48) n = { , . . . , n − } such that(i) f A (cid:48) n ( i, j ) = ∞ if j = i + 1; otherwise f A (cid:48) n ( i, j ) = 0, and (ii) µ A (cid:48) n ( i ) = i , for 1 ≤ i ≤ n , and µ A (cid:48) n ( i ) = 2 n − i , for n +1 ≤ i ≤ n −
1. The structures A and A (cid:48) from Figure 1 correspond to A and A (cid:48) , respectively; informally A n is a crisp directed grid of size n × n with a unary function µ with weight 1 applied to each element. Generalising the reasoning behind Example 16, weargue in Appendix B that for each n ≥ A (cid:48) n is the core of A n . Since tw ( A (cid:48) n ) = 1, the class C := { A n | n ≥ } has bounded treewidth modulo equivalence. However, C has unbounded treewidth as the Gaifman graphs in { G (Pos( A n )) | n ≥ } correspond to theclass of (undirected) grids , which is a well-known family of graphs with unbounded treewidth(see, e.g. [17]). We also describe in Appendix B how to alter the definition of C to obtain aclass of finite-valued structures (taking on finite values in Q ≥ ) that has bounded treewidthmodulo equivalence but Gaifman graphs of unbounded treewidth.It is worth noticing that bounded treewidth modulo equivalence implies bounded treewidthmodulo homomorphic equivalence (of the positive parts), but the converse is not true ingeneral, as the next example shows. Therefore, Theorem 19 tells us that the tractabilityfrontier for VCSP( C , − ) lies strictly between bounded treewidth and bounded treewidthmodulo homomorphic equivalence. Example 23.
For n ≥
3, let A n be the valued σ -structure from Example 22. Let C n bethe valued σ -structure with the same universe as A n , i.e., C n = { , . . . , n } × { , . . . , n } , suchthat f C n = f A n and µ C n is defined as follows. Let D , . . . , D n be the n first diagonals of11 n starting from the bottom left corner (1 ,
1) (see Figure 2 for an illustration of C ). For1 ≤ i ≤ n , let E i be the top-left to bottom-right enumeration of D i . In particular, E = ((1 , E = ((2 , , (1 , E = ((3 , , (2 , , (1 , E n = (( n, , ( n − , , . . . , (1 , n )). Fix aninteger M = M ( n ) such that M > n . The values assigned by µ C n to E , E and E are (1),( M,
1) and (cid:0) M , M , M (cid:1) , respectively, and for E i , with 4 ≤ i ≤ n , is ( M, , . . . , , M ). Allremaining elements in C n \ (cid:83) ≤ i ≤ n D i receive cost 1. Figure 2 depicts the case of C .Let C := { C n | n ≥ } . Note first that Pos( C n ) is homomorphically equivalent to therelational structure P n − over relational signature rel( σ ) = { R f , R µ } (recall the definitionof rel( σ ) from Section 2), whose universe is P n − = { , . . . , n − } , R P n − µ = P n − and R P n − f = { ( i, i + 1) | ≤ i ≤ n − } . Since tw ( P n − ) = 1, for all n ≥
3, it follows that { Pos( C n ) | n ≥ } has bounded treewidth modulo homomorphic equivalence. We claim that C has unbounded treewidth modulo (valued) equivalence. It suffices to show that C n is acore, for all n ≥
3. In order to prove this, we apply Proposition 15. Fix n ≥ c : tup( C n ) (cid:55)→ Q ≥ such that (i) c ( f, x ) = 0 if f C n ( x ) = ∞ ; otherwise c ( f, x ) = 1, and (ii) c ( µ, x ) = 1 /µ C n ( x ), for all x ∈ C n . Note that (cid:80) ( p, y ) ∈ tup( C n ) p C n ( y ) c ( p, y ) = | C n | = n . Nextwe show that if g : C n (cid:55)→ C n satisfies that v ( g ) = (cid:80) ( p, y ) ∈ tup( C n ) p C n ( y ) c ( p, g ( y )) ≤ n , then g is the identity mapping. Using Proposition 15, this implies that C n is a core.Let g : C n (cid:55)→ C n such that v ( g ) ≤ n . The mapping g must satisfy the followingtwo conditions: (a) g is a homomorphism from Pos( C n ) to Pos( C n ) (otherwise v ( g ) = ∞ ), and (b) for every x ∈ C n , µ C n ( x ) ≤ µ C n ( g ( x )), otherwise v ( g ) ≥ µ C n ( x ) c ( µ, g ( x )) = µ C n ( x ) /µ C n ( g ( x )) ≥ M > n . We can argue inductively, and show that g is the identityover D i , for all 1 ≤ i ≤ n . Note that condition (a) implies that g is the identity over theremaining elements in C n \ (cid:83) ≤ i ≤ n D i , as required. For D , we have that g ((1 , ,
1) bycondition (a). For D , note that (a) implies that { g ((2 , , g ((1 , } ⊆ { (2 , , (1 , } . Bycondition (b), g ((2 , , g ((1 , , g ((1 , , g ((1 , ∈ { (3 , , (2 , } , which violates (b).For the case 3 ≤ i ≤ n , recall that E i = x , x , . . . , x | D i | is the above-defined enumeration of D i . Since g is the identity over D i − and by condition (a), we have that g is the identity over { x , . . . , x | D i |− } . As µ C n ( x ) > µ C n ( x ) and µ C n ( x | D i | ) > µ C n ( x | D i |− ), conditions (a) and(b) imply that g ( x ) = x and g ( x | D i | ) = x | D i | , as required.To conclude this example we note that the class of valued σ -structures { B n | n ≥ } whereeach B n is derived from C n by setting B n = C n , µ B n = µ C n and f B n ( x ) = min(1 , f C n ( x )) forall x ∈ ( B n ) is an example of a finite-valued class of structures that has bounded treewidthmodulo homomorphic equivalence but unbounded treewidth modulo equivalence. Corollaries of the complexity classification
We can obtain the classification for CSPsof Dalmau et al. [15] and Grohe [32] as a special case of Theorem 19. Indeed, we can associatewith a relational τ -structure A a valued σ τ -structure A , ∞ such that (i) σ τ = { f R | R ∈ τ, ar( f R ) = ar( R ) } , (ii) A and A , ∞ have the same universe A , and (iii) if x ∈ R A , then f A , ∞ R ( x ) = ∞ , otherwise f A , ∞ R ( x ) = 0, for every R ∈ τ and x ∈ A ar( R ) . For a class C relational structures, we define the class of valued structures C , ∞ := { A , ∞ | A ∈ C} . It isnot hard to check that, when C is of bounded arity, CSP ( C , − ) reduces in polynomial time to VCSP ( C , ∞ , − ) and vice versa. Hence, a classification of CSP ( C , − ), for C ’s of bounded arity,is equivalent to a classification of VCSP ( C , ∞ , − ). Finally, note that C has bounded treewidthmodulo homomorphic equivalence if and only if C , ∞ has bounded treewidth modulo (valued)equivalence. This implies the known CSP classification from [15] and [32].12n his PhD thesis [21], F¨arnqvist also considered the complexity of VCSP ( C , − ). However,he considered a different definition of the problem, that we denote by VCSP F ( C , − ). Formally,for a relational τ -structure A , let A F be the valued σ A -structure such that (i) σ A = { f R, x | R ∈ τ, x ∈ R A , ar( f R, x ) = ar( R ) } , (ii) A and A F have the same universe A , and (iii) for every f R, x ∈ σ A and x ∈ A ar( f R, x ) , we have that f A F R, x ( x ) = 1 and f A F R, x ( y ) = 0, for all y (cid:54) = x . For aclass of relational structures C , VCSP F ( C , − ) is precisely the problem VCSP ( C F , − ), where C F := { A F | A ∈ C} . It was shown in [21] that for a class C of relational structures of boundedarity, VCSP F ( C , − ) is tractable if and only if C has bounded treewidth. This result followsdirectly from Theorem 19 as every valued structure in a class of the form C F is a (valued) core,and hence, bounded treewidth modulo equivalence boils down to bounded treewidth.Intuitively, VCSP F ( C , − ) restricts VCSP only based on the (multiset of) tuples appearingin the structures from C . In contrast, our definition of VCSP( C , − ) considers directly thestructures in C . This allows us for a more fine-grained analysis of structural restrictions,and in particular, provides us with new tractable classes beyond bounded treewidth. Indeed,as Example 22 illustrates, we can find simple tractable classes of valued structures withunbounded treewidth.Finally, let us note that since Theorem 19 applies to all valued structures, it in particularcovers the finite-valued VCSP , where all functions are restricted to take finite values in Q ≥ ,and hence the tractability part of Theorem 19 directly applies to the finite-valued case. Thehardness part also applies to the finite-valued case. Indeed, the right-hand side structure B constructed in the reduction of Proposition 24 is actually finite-valued. Therefore, Theorem 19also gives a classification for finite-valued VCSPs. Moreover, Examples 22 and 23 demonstratethat already for finite-valued structures the tractability frontier is strictly between boundedtreewidth and bounded treewidth modulo homomorphic equivalence.The rest of this section is devoted to proving the hardness part of Theorem 19, i.e.,the implication (2) ⇒ (3). The tractability part of Theorem 19 (implication (3) ⇒ (1)) isestablished in Section 5. In particular, it will follow from Theorem 29 that, if there is aconstant k ≥ C is equivalent to a valuedstructure of treewidth at most k , then VCSP ( C , − ) can be solved in polynomial time usingthe ( k + 1)-th level of the Sherali-Adams LP hierarchy. Note that the remaining implication(1) ⇒ (2) is immediate. We start with the notion of fpt-reductions [24] tailored to our setting. Formally, a decisionproblem P with parameter κ over Σ is a subset of Σ ∗ , the set of all string over the alphabetΣ, describing the “yes” instances of P , and κ : Σ ∗ (cid:55)→ N . It is known that each optimisationproblem has an equivalent decision problem. We denote by p - VCSP d ( C , − ) the decisionversion of p - VCSP ( C , − ). Formally, p - VCSP d ( C , − ) with parameter κ (cid:48) over Σ (cid:48) is a subsetof (Σ (cid:48) ) ∗ such that x = (( A , B ) , c ) ∈ p - VCSP d ( C , − ) if and only if ( A , B ) is a VCSP ( C , − )instance such that opt( A , B ) ≤ c , and κ (cid:48) : (Σ (cid:48) ) ∗ (cid:55)→ N is defined by κ (cid:48) ( x ) = | A | .An fpt -reduction from ( P , κ ) to p - VCSP d ( C , − ) is a mapping red : Σ ∗ (cid:55)→ (Σ (cid:48) ) ∗ suchthat (i) for all x ∈ Σ ∗ we have x ∈ P if and only if red ( x ) ∈ p - VCSP d ( C , − ); (ii) there is acomputable function f : N (cid:55)→ N and an algorithm that, given x ∈ Σ ∗ , computes red ( x ) in time f ( κ ( x )) · | x | O (1) ; and (iii) there is a computable function g : N (cid:55)→ N such that for all instances x ∈ Σ ∗ , we have κ (cid:48) ( red ( x )) ≤ g ( κ ( x )). 13et us mention that our hardness result does not follow directly from Grohe’s result forCSPs [32]. The natural approach is to define, for a class of valued structures C , the class ofrelational structures Pos( C ) = { Pos( A ) | A ∈ C} . Then one can observe that p - CSP (Pos( C ), − ) fpt-reduces to p - VCSP d ( C , − ), and hence W[1]-hardness of the former problem implieshardness for the latter. However, if C has unbounded treewidth modulo equivalence, the classPos( C ) does not necessarily have unbounded treewidth modulo homomorphic equivalence (seeExample 23), and hence Pos( C ) is not necessarily hard according to Grohe’s classification.We instead adapt Grohe’s proof to the case of VCSPs. We need some notation. For k ≥ k -clique of a graph is a clique of size k . A graph H is a minor of a graph G if H is isomorphicto a graph that can be obtained from a subgraph of G by contracting edges (for more detailssee, e.g. [17]). For k, (cid:96) ≥
1, the ( k × (cid:96) )-grid is the graph with vertex set { , . . . , k } × { , . . . , (cid:96) } and an edge between ( i, j ) and ( i (cid:48) , j (cid:48) ) if | i − i (cid:48) | + | j − j (cid:48) | = 1. The parameterised problem p - CLIQUE asks, given instance (
G, k ), whether there is a k -clique in G , and has parameter κ such that κ ( G, k ) = k . It is a well-known result that p - CLIQUE is complete for W [1]under fpt-reductions [19]. The implication (2) ⇒ (3) in Theorem 19 follows from the followingproposition. Proposition 24.
Let C be a recursively enumerable class of valued structures of bounded arity.Suppose C is of unbounded treewidth modulo equivalence. If p - VCSP ( C , − ) is fixed-parametertractable then FPT = W[1].Proof.
We present an fpt-reduction from p - CLIQUE to p - VCSP d ( C , − ). More precisely, givenan instance ( G, k ) of p - CLIQUE , we shall construct valued structures A (cid:48) ∈ C and B , togetherwith a threshold M ∗ ≥
0, such that G contains a k -clique if and only if opt( A (cid:48) , B ) ≤ M ∗ . Asin [32], we rely on the Excluded Grid Theorem [45], which states that there is a function w : N (cid:55)→ N such that every graph H of treewidth at least w ( k ) contains the ( k × k )-grid asa minor. Given an instance ( G, k ) of p - CLIQUE , with k ≥
2, we start by enumerating theclass C until we obtain a valued structure A (cid:48) ∈ C with core A such that tw ( A ) ≥ w ( K ), where K = (cid:0) k (cid:1) . By Proposition 18, such A (cid:48) ∈ C always exists. Let A := Pos( A ). By the ExcludedGrid Theorem, the Gaifman graph G ( A ) of A (see the definition of the Gaifman graph inSection 2) contains the ( K × K )-grid, and hence, the ( k × K )-grid as a minor. Note that,since C is recursively enumerable and cores are computable (by Proposition 14), the valuedstructure A (cid:48) and its core A can be effectively computed in time α ( k ), where α is a computablefunction.In order to define B , we exploit the main construction in [32], which defines a relationalstructure B from G , k and A . The key property of B is that, assuming A is a relational core,then G contains a k -clique if and only if there is a homomorphism from A to B . Since in ourcase A is not necessarily a relational core, we restate in the following lemma the propertiesof B simply in terms of surjective homomorphisms. Together with our characterisation of(valued) cores in Proposition 15, this will allow us to define our required valued structure B and threshold M ∗ . Lemma 25.
Given k ≥ , K = (cid:0) k (cid:1) , graph G and relational τ -structure A such that the ( k × K ) -grid is a minor of its Gaifman graph G ( A ) , there is a relational τ -structure B suchthat1. There exists a fixed homomorphism π from B to A such that the following are equivalent:(a) G contains a k -clique. b) There is a homomorphism h from A to B such that π ◦ h is a surjective mappingfrom A to itself, where A is the universe of A .2. B can be computed in time β ( | A | , k ) · | G | O ( r ( A )) , where β is a computable function and r ( A ) ≥ is the arity of the relational signature τ .Proof. In the case when G ( A ) is connected, the lemma follows directly (although it is notexplicitly stated) from [32, Lemma 4.4]. Suppose then that A , . . . , A n are the connectedcomponents of A , where n ≥
2. Without loss of generality let us assume that the ( k × K )-gridis a minor of A . For A , let B be the relational structure satisfying (1)–(2) and let π bethe homomorphism from B to A . We define B to be the disjoint union of B , A , . . . , A n .We also define π to be the homomorphism from B to A such that π ( b ) = π ( b ), if b belongsto B and π ( b ) = b , otherwise. It suffices to check condition (1) with respect to π .Suppose that G contains a k -clique. Then there is a homomorphism h from A to B suchthat π ◦ h is surjective. We can define the mapping h from A to B such that h ( a ) = h ( a ),if a belongs to A , and h ( a ) = a , otherwise. It follows that h is a homomorphism and π ◦ h is surjective. Assume now that there is a homomorphism h from A to B such that π ◦ h issurjective. Let B , A , . . . , A n be the universes of B , A , . . . , A n , respectively. Since π ◦ h is surjective, there is an index i ∈ { , . . . , n } such that h | A i is a homomorphism from A i to B , and π ◦ h | A i ( A i ) = A . We can argue inductively, and find a sequence of distinctindices i , . . . , i (cid:96) ∈ { , . . . , n } such that (a) i (cid:96) = 1, (b) h | A i is a homomorphism from A i to B and π ◦ h | A i ( A i ) = A , and (c) for every j ∈ { , . . . , (cid:96) } , h | A ij is a homomorphismfrom A i j to A i j − , and π ◦ h | A ij ( A i j ) = A i j − . We can define the mapping h : A (cid:55)→ B as h = h | A i ◦ · · · ◦ h | A i(cid:96) . By construction, h is a homomorphism from A to B , and π ◦ h issurjective. Since A and B satisfy condition (1), we conclude that G contains a k -clique. (cid:4) Let B be the relational structure from Lemma 25 applied to G, k and A = Pos( A ).Recall that A , and hence B , are defined over the relational signature rel( σ ), where σ is thesignature of A (see definition in Section 2). By Proposition 15, we can compute a function c ∗ : tup( A ) (cid:55)→ Q ≥ such that for every non-surjective mapping g : A (cid:55)→ A , it is the case that (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) < (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, g ( x )) . From B and c ∗ we construct a valued structure B over the same signature σ of A asfollows. Let π be the homomorphism from B to A given by Lemma 25. Let M ∗ := (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) and δ := min { f A ( x ) | ( f, x ) ∈ tup( A ) > } . Note that tup( A ) > (cid:54) = ∅ and hence δ is well-defined (notice that δ could be ∞ ). Also, observe that M ∗ < ∞ . Theuniverse of B is the universe B of B . For each f ∈ σ and x ∈ B ar( f ) , we define (assuming d/ ∞ = 0 for all d ∈ Q ≥ ): f B ( x ) = (cid:40) c ∗ ( f, π ( x )) if x ∈ R B f M ∗ /δ otherwise . We show that G contains a k -clique if and only if opt( A (cid:48) , B ) ≤ M ∗ . Before doing so, notethat the total running time of the reduction is α ( k ) + β ( α ( k ) , k ) | G | O ( r ( A )) , where β is fromLemma 25 and r ( A ) is the arity of rel( σ ), and hence the arity of σ . Since the class C hasbounded arity, there is a constant r ≥ r ( A ) ≤ r . Thus the running time of the15eduction is β (cid:48) ( k ) | G | O (1) for a computable function β (cid:48) . Also, since A (cid:48) is computed in time α ( k ), we have that | A (cid:48) | ≤ α ( k ). It follows that our reduction is actually an fpt-reduction, andhence, p - VCSP d ( C , − ) is W[1]-hard. Therefore, if p - VCSP ( C , − ) is in FPT, then p - VCSP d ( C , − ) is in FPT, and consequently FPT = W[1], as required.Assume that G contains a k -clique. By Lemma 25, there is a homomorphism h from A to B such that π ◦ h is surjective. This implies that there is a homomorphism g from A to B such that π ◦ g is the identity mapping. Indeed, since s = π ◦ h is surjective, then it is anisomorphism from A to itself. In particular, the inverse s − is a homomorphism A to A . Wethen can set g = h ◦ s − . We have thatopt( A (cid:48) , B ) = opt( A , B ) ≤ cost( g ) = (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) f B ( g ( x )) = (cid:88) x ∈ R A f f A ( x ) f B ( g ( x ))= (cid:88) x ∈ R A f f A ( x ) c ∗ ( f, π ( g ( x ))) = (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) c ∗ ( f, x ) = M ∗ . Suppose now that opt( A (cid:48) , B ) ≤ M ∗ . In particular, opt( A , B ) ≤ M ∗ . Let h ∗ : A (cid:55)→ B be amapping with cost opt( A , B ). We claim that h ∗ is a homomorphism from A to B . Indeed,suppose by contradiction that x ∈ R A f but h ∗ ( x ) (cid:54)∈ R B f , for some ( f, x ) ∈ tup( A ) > . Itfollows that cost( h ∗ ) ≥ f A ( x ) f B ( h ∗ ( x )) = f A ( x )(1 + M ∗ /δ ) = f A ( x ) + f A ( x ) M/ ∗ δ . Note that f A ( x ) M ∗ /δ ≥ M ∗ . Since f A ( x ) >
0, then cost( h ∗ ) > M ∗ ; a contradiction. Hence, h ∗ is ahomomorphism.Now we show π ◦ h ∗ is surjective. Assume to the contrary. By the definition of c ∗ , it followsthat M ∗ < (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, π ( h ∗ ( x ))). On the other hand, using the fact that h ∗ is ahomomorphism, we have that (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, π ( h ∗ ( x ))) = (cid:88) x ∈ R A f f A ( x ) c ∗ ( f, π ( h ∗ ( x ))) = (cid:88) x ∈ R A f f A ( x ) f B ( h ∗ ( x ))= (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) f B ( h ∗ ( x )) = cost( h ∗ ) . Hence, M ∗ < cost( h ∗ ); a contradiction. It follows that we can apply Lemma 25, and obtainthat G contains a k -clique. C , − ) In this section we will present and prove our second main result, Theorem 29. First, inSection 5.1, we will define the Sherali-Adams LP relaxation for VCSPs and state Theorem 29.Second, in Section 5.2, we will define the key concept of treewidth modulo scopes , whichessentially captures the applicability of the Sherali-Adams for VCSP( C , − ). Section 5.3 provesthe sufficiency part of Theorem 29, whereas Sections 5.4 and 5.5 prove the necessity part ofTheorem 29. Given a tuple x , we write Set( x ) to denote the set of elements appearing in x . Let ( A , B ) be aninstance of the VCSP over a signature σ and k ≥
1. We define a new signature σ k = σ ∪ { ρ k } ,16in (cid:88) ( f, x ) ∈ tup( A k ) > , s :Set( x ) (cid:55)→ B k f A k ( x ) × f B k ( s ( x )) < ∞ λ ( f, x , s ) f A k ( x ) f B k ( s ( x )) λ ( f, x , s ) = (cid:88) r :Set( y ) (cid:55)→ B k ,r | Set( x ) = s λ ( p, y , r ) (SA1) ∀ ( f, x ) , ( p, y ) ∈ tup( A k ) > :Set( x ) ⊆ Set( y ) and | Set( x ) | ≤ k ; ∀ s : Set( x ) (cid:55)→ B k (cid:88) s :Set( x ) (cid:55)→ B k λ ( f, x , s ) = 1 (SA2) ∀ ( f, x ) ∈ tup( A k ) > λ ( f, x , s ) = 0 (SA3) ∀ ( f, x ) ∈ tup( A k ) > , s : Set( x ) (cid:55)→ B k : f A k ( x ) × f B k ( s ( x )) = ∞ λ ( f, x , s ) ≥ (SA4) ∀ ( f, x ) ∈ tup( A k ) > , s : Set( x ) (cid:55)→ B k Figure 3: The Sherali-Adams relaxation of level k of ( A , B ).where ρ k is a new function symbol of arity k . Then, we create from ( A , B ) an instance ( A k , B k )over σ k such that A k = A , B k = B , ρ A k k ( x ) = 1 for any x ∈ A kk , ρ B k k ( x ) = 0 for any x ∈ B kk ,and for every f ∈ σ we have f A k = f A and f B k = f B . Because the new function ρ k isidentically zero in B k , we have that for any mapping h : A (cid:55)→ B , cost( h ) is the same in bothinstances ( A , B ) and ( A k , B k ). The Sherali-Adams relaxation of level k [48] of ( A , B ), denotedby SA k ( A , B ), is the linear program given in Figure 3, which has one variable λ ( f, x , s ) foreach ( f, x ) ∈ tup( A k ) > and s : Set( x ) (cid:55)→ B k .Note that the variables are indexed not only by x and s but also by f . This would not benecessary if k ≥ ar( f ) but we are also interested in the case of k < ar( f ). Definition 26.
Let A , B be valued σ -structures and k ≥ • We denote by opt k ( A , B ) the minimum cost of a solution to SA k ( A , B ). • We write A (cid:22) k B if opt k ( A , C ) ≤ opt k ( B , C ) for all valued σ -structures C .The existence of an inverse fractional homomorphism between two valued structures impliesa (cid:22) k relationship. The proof can be found Appendix C. Proposition 27.
Let A , B be valued σ -structures and k ≥ . If there exists an inversefractional homomorphism from A to B , then A (cid:22) k B . We also have the following.
Proposition 28.
Let A be a valued σ -structure, A (cid:48) be the core of A and k ≥ . Then,opt k ( A , C ) = opt k ( A (cid:48) , C ) , for all valued σ -structures C .Proof. Since A ≡ A (cid:48) , by Proposition 6, there exist inverse fractional homomorphisms from A to A (cid:48) and from A (cid:48) to A . Therefore, by Proposition 27, opt k ( A , C ) = opt k ( A (cid:48) , C ) for all valued σ -structures C . 17iven a valued σ -structure A , the overlap of A is the largest integer m such that thereexist ( f, x ) , ( p, y ) ∈ tup( A ) > with ( f, x ) (cid:54) = ( p, y ) and | Set( x ) ∩ Set( y ) | = m .The following is our second main result; tw ms ( A ) is defined in Section 5.2 and Theorem 29is implied by Theorems 35, 38, and 40 proved in Sections 5.3, 5.4, and 5.5, respectively. Theorem 29 ( Power of Sherali-Adams ) . Let A be a valued σ -structure and let k ≥ . Let A (cid:48) be the core of A . The Sherali-Adams relaxation of level k is always tight for A , i.e., for everyvalued σ -structure B , we have that opt k ( A , B ) = opt ( A , B ) , if and only if (i) tw ms ( A (cid:48) ) ≤ k − and (ii) the overlap of A (cid:48) is at most k . We remark that although Theorem 29 deals with valued structures, it also shows the sameresult for finite-valued structures, where all functions are restricted to finite values in Q ≥ . Inparticular, the sufficiency part of Theorem 29, i.e., if the core satisfies conditions (i) and (ii)then the k -th level of Sherali-Adams is tight, applies directly to the finite-valued case. It willfollow from the proofs of Theorems 36 and 39 that whenever the core violates condition (i) or(ii) then the k -th level of Sherali-Adams is not tight even for finite-valued structures. Hence,Theorem 29 also characterises the tightness of Sherali-Adams for finite-valued VCSPs.Let us note that the characterisation given by Theorem 29 for levels k ≥ r , where r is thearity of the signature of A , boils down to the notion of treewidth. That is, if k ≥ r , the k -thlevel of Sherali-Adams is tight if and only if the treewidth of the core of A is at most k − precisely under which conditions the k -th level works evenfor k < r .Finally, we remark that the tractability part of Theorem 19, which we obtain as a corollaryof Theorem 29, does not immediately follow from a naive algorithm that would compute, for A ∈ C , opt( A , B ) using dynamic programming along a tree decomposition of the core A (cid:48) of A . Such an algorithm would first need to compute A (cid:48) , and it is not clear that it can be donein polynomial time, even with the promise that A (cid:48) has bounded treewidth. (The situationis different for relational structures, where this promise problem is known to be solvable inpolynomial time [13, Lemma 25].) Theorem 29 gives a way to circumvent this issue since thelinear program SA k ( A , B ) does not depend on A (cid:48) in any way. Let A be a relational structure with universe A over a relational signature τ . Recall fromSection 2 that G ( A ) denotes the Gaifman graph of A . A scope of G ( A ) is a set X for whichthere is relation symbol R ∈ τ and a tuple x ∈ R A such that X = Set( x ). In other words,the scopes of G ( A ) are the sets that appear precisely in the tuples of A . Observe that everyscope X of G ( A ) induces a clique in G ( A ). Definition 30.
Let A be a relational structure and G ( A ) its Gaifman graph. Let ( T, β ) be atree decomposition of G ( A ), where T = ( V ( T ) , E ( T )). The width modulo scopes of ( T, β ) isdefined by max {| β ( t ) | − | t ∈ V ( T ) and β ( t ) is not a scope of G ( A ) } . If β ( t ) is a scope for all nodes t ∈ V ( T ) then we set the width modulo scopes of ( T, β )to be 0. The treewidth modulo scopes of G ( A ), denoted by tw ms ( G ( A )), is the minimumwidth modulo scopes over all its tree decompositions. The treewidth modulo scopes of A is In a (V)CSP instance, the term scope usually refers to the list of variables a (valued) constraint depends on. w ms ( A ) = tw ms ( G ( A )). For a valued structure A , we define the treewidth modulo scopes of A as tw ms ( A ) = tw ms (Pos( A )).Note that, unlike treewidth, the notion of treewidth modulo scopes is not monotone , i.e., itcan increase after taking substructures. To see this, take for instance the relational structure A that corresponds to the undirected k × k grid. We have tw ms ( A ) = k . However, adding a newrelation with only one tuple containing all elements of A lowers the treewidth modulo scopesto 0. Let us also remark that the relational structures with treewidth modulo scopes 0 areprecisely the relational structures whose underlying hypergraphs are α -acyclic (see e.g. [28]).Let G = ( V, E ) be a graph. A bramble B of G is a collection of subsets of V such that (i)each B ∈ B is a connected set, and (ii) every pair of sets B, B (cid:48) ∈ B touch, i.e., they have avertex in common or G contains an edge between them. A subset of V is a cover of B if itintersects every set in B . There is a well-known connection between treewidth and brambles. Theorem 31 ([47]) . Let G be a graph and k ≥ . Then the treewidth of G is at most k ifand only if any bramble in G can be covered by a set of size at most k + 1 . We show an analogous characterisation for treewidth modulo scopes.
Theorem 32.
Let A be a relational structure and k ≥ . Then tw ms ( A ) ≤ k if and only ifany bramble in G ( A ) can be covered by a set of size at most k + 1 or by a scope in G ( A ) .Proof. The proof is an adaptation of the proof of [17, Theorem 12.3.9]. Suppose first that tw ms ( A ) ≤ k and let ( T, β ) be a tree decomposition of G ( A ) of width modulo scopes at most k , where T = ( V ( T ) , E ( T )). Let B be any bramble of G ( A ). We show that there is t ∈ V ( T )such that β ( t ) covers B . If there is an edge { t , t } of T such that β ( t ) ∩ β ( t ) covers B , thenwe are done. Otherwise, we can define an orientation for each edge { t , t } of T as follows.Let X := β ( t ) ∩ β ( t ) and B X = { B ∈ B | X ∩ B = ∅} . By assumption, X does not cover B and then B X is not empty. If we remove the edge { t , t } from T , we obtain exactly twoconnected components T = ( V ( T ) , E ( T )) and T = ( V ( T ) , E ( T )) containing t and t ,respectively. Let U := (cid:83) t ∈ V ( T ) β ( t ) and U := (cid:83) t ∈ V ( T ) β ( t ). It is a well-known property oftree decompositions (e.g., [17, Lemma 12.3.1]) that X separates U and U in G ( A ). Take B ∈ B X . Since B is connected, it follows that B ⊆ U i \ X , for some i ∈ { , } . Since all setsin B X mutually touch, we can choose the same i ∈ { , } , for all B ∈ B X . We then orient { t , t } towards t i .Let t be a source node in this orientation of T , i.e., t has only incoming arcs (note thatthere must be at least one source). We claim that β ( t ) covers B . Let B ∈ B and take b ∈ B .Let t b ∈ V ( T ) such that b ∈ β ( t b ). If t b = t , we are done. Otherwise, let { t (cid:48) , t } be the lastedge in the unique simple path from t b to t . If ( β ( t (cid:48) ) ∩ β ( t )) ∩ B (cid:54) = ∅ , then we are done. If thisis not the case, since the edge { t (cid:48) , t } is oriented towards t , we have that B ⊆ U t \ β ( t (cid:48) ) ∩ β ( t ),where U t = (cid:83) t ∈ V ( T t ) β ( t ), and T t = ( V ( T t ) , E ( T t )) is the connected component of T − { t (cid:48) , t } containing t . In particular, there is t ∗ ∈ V ( T t ) such that b ∈ β ( t ∗ ). By the connectednessproperty of tree decompositions, we have that b ∈ β ( t ).Assume now that any bramble in G ( A ) can be covered by a set of size at most k + 1 or bya scope. We say that a set of vertices of G ( A ) is bad if it is of size greater than k + 1 and itis not a scope. Let G (cid:48) be a subgraph of G ( A ) and B be a bramble of G ( A ). A B -admissible tree decomposition for G (cid:48) , is a tree decomposition ( T, β ) of G (cid:48) with T = ( V ( T ) , E ( T )) suchthat every β ( t ), with t ∈ V ( T ), that is a bad set of G ( A ) does not cover B . We show that for19very bramble B of G ( A ), there is a B -admissible tree decomposition for G ( A ). Note thatevery set covers the empty bramble B = ∅ . Thus, the result follows since any B -admissibletree decomposition for B = ∅ , does not have bad bags, and then its width modulo scopes is atmost k . We proceed by induction on |B| . Base case:
Suppose that B is a bramble of G ( A ) of maximum size. By hypothesis, there is aset X covering B which is either of size at most k + 1 or a scope. In particular, X is not bad.We show the following:( † ) For every connected component C = ( V ( C ) , E ( C )) of G ( A ) − X , there is a B -admissibletree decomposition of G ( A )[ X ∪ V ( C )], i.e., the subgraph of G ( A ) induced by X ∪ V ( C ),which has X as one of its bags.These decompositions can be glued to define a B -admissible tree decomposition of G ( A ) asrequired. Let C = ( V ( C ) , E ( C )) be a connected component of G ( A ) − X . Since X ∩ V ( C ) = ∅ and X covers B , it follows that V ( C ) (cid:54)∈ B . Then if we define B (cid:48) := B ∪ { V ( C ) } , we havethat |B (cid:48) | > |B| . By maximality of B , B (cid:48) is not a bramble of G ( A ), i.e., V ( C ) fails to toucha set B ∗ ∈ B . Let N ( C ) be the union of V ( C ) and all vertices in G ( A ) adjacent to somevertex in V ( C ). We have N ( C ) ∩ B ∗ = ∅ , and hence, N ( C ) does not cover B . Note that N ( C ) ⊆ X ∪ V ( C ), and that every edge in G ( A )[ X ∪ V ( C )] either belongs to G ( A )[ X ] or G ( A )[ N ( C )]. Then our desired tree decomposition contains two adjacent bags X and N ( C ).This shows ( † ), and then the base case. Inductive case:
Let B be a bramble of G ( A ). We define a cover X of B as follows. Wedistinguish two cases:1. B can be covered by a set of size at most k + 1. In this case we let X to be a cover of B of minimum size.2. If case (1) does not hold, by assumption, we have that B can be covered by a scope. Inthis case we let X to be a maximal scope of G ( A ) covering B .Note that in any case, X is not bad. As in the base case, it suffices to show ( † ). Let C = ( V ( C ) , E ( C )) be a connected component of G ( A ) − X . Since X ∩ V ( C ) = ∅ and X covers B , it is the case that V ( C ) (cid:54)∈ B . Then if we define B (cid:48) := B ∪ { V ( C ) } , we have that |B (cid:48) | > |B| . If B (cid:48) is not a bramble we can argue as in the base case. Then we assume that B (cid:48) is a bramble. By inductive hypothesis, there is a B (cid:48) -admissible tree decomposition ( T, β ) for G ( A ), where T = ( V ( T ) , E ( T )). • Suppose case (1) above holds. In this case we can argue as in the proof of [17, Theo-rem 12.3.9]. Let (cid:96) := | X | ≤ k + 1. If ( T, β ) is B -admissible then we are done, so weassume that there exists s ∈ V ( T ) such that β ( s ) is bad and covers B . Note that everyseparator of two covers of a bramble is also a cover of that bramble [17, Lemma 12.3.8]. Itfollows that the minimum size of a separator of X and β ( s ) is (cid:96) . By Menger’s theorem [17,Theorem 3.3.1], there exist (cid:96) disjoint paths P , . . . , P (cid:96) linking X and β ( s ). In particular, P i is a path that starts and ends at some node in X and β ( s ), respectively, and suchthat every internal node is not in X ∪ β ( s ). Since ( T, β ) is B (cid:48) -admissible, it followsthat β ( s ) does not cover B (cid:48) , i.e., β ( s ) and V ( C ) are disjoint. This implies that for each i ∈ { , . . . , (cid:96) } the path P i only intersects X in its initial node x i . For each i ∈ { , . . . , (cid:96) } ,let t i be a node in T such that x i ∈ β ( t i ). Note that X = { x , . . . , x (cid:96) } .20et ( T, β (cid:48) ) be the restriction of (
T, β ) to the set of nodes X ∪ V ( C ), i.e., β (cid:48) ( t ) = β ( t ) ∩ ( X ∪ V ( C )), for all t ∈ V ( T ). Note that ( T, β (cid:48) ) is a tree decomposition of G ( A )[ X ∪ V ( C )]. The desired tree decomposition ( T, β (cid:48)(cid:48) ) for G ( A )[ X ∪ V ( C )] is theresult of adding some of the nodes x i ’s to some particular bags of ( T, β (cid:48) ). Formally,(
T, β (cid:48)(cid:48) ) is given by β (cid:48)(cid:48) ( t ) = β (cid:48) ( t ) ∪ { x i | t is in the unique simple path from t i to s in T } Note that (
T, β (cid:48)(cid:48) ) still satisfies the connectedness property of tree decompositions. Also,observe that | β ( t ) | ≥ | β (cid:48)(cid:48) ( t ) | , for all t ∈ V ( T ). Indeed, for each x i ∈ β (cid:48)(cid:48) ( t ) \ β ( t ), with i ∈ { , . . . , (cid:96) } , the node t is in the unique simple path from t i to s in T . It follows that β ( t ) contains one node from the path P i , for each such x i . Since the P i ’s are disjoint,the claim follows.Since β ( s ) ∩ V ( C ) = ∅ , we have that β (cid:48)(cid:48) ( s ) = X . Therefore, to prove ( † ) it remains toshow that ( T, β (cid:48)(cid:48) ) is B -admissible. Suppose that for some t ∈ V ( T ), the set β (cid:48)(cid:48) ( t ) is bad,i.e., | β (cid:48)(cid:48) ( t ) | > k + 1 and β (cid:48)(cid:48) ( t ) is not a scope. We need to show that β (cid:48)(cid:48) ( t ) does not cover B .We claim first that β ( t ) is a bad set of G ( A ). By contradiction, suppose that β ( t ) is notbad. Since | β ( t ) | ≥ | β (cid:48)(cid:48) ( t ) | > k + 1, it follows that β ( t ) is a scope. Since | X | = (cid:96) ≤ k + 1,it is the case that β (cid:48)(cid:48) ( t ) ∩ V ( C ) (cid:54) = ∅ . This implies that β ( t ) ∩ V ( C ) (cid:54) = ∅ . It follows that β ( t ) ⊆ X ∪ V ( C ), since β ( t ) is a clique in G ( A ). Consequently, β ( t ) ⊆ β (cid:48)(cid:48) ( t ), and since | β ( t ) | ≥ | β (cid:48)(cid:48) ( t ) | , we conclude that β ( t ) = β (cid:48)(cid:48) ( t ). But β (cid:48)(cid:48) ( t ) is not a scope, which is acontradiction.Since ( T, β ) is B (cid:48) -admissible and β ( t ) is bad, we have that there is B ∗ ∈ B (cid:48) such that β ( t ) ∩ B ∗ = ∅ . From the previous paragraph, we know that β ( t ) ∩ V ( C ) (cid:54) = ∅ . It followsthat B ∗ ∈ B . We claim that β (cid:48)(cid:48) ( t ) ∩ B ∗ = ∅ , which implies that β (cid:48)(cid:48) ( t ) does not cover B ,as required. Towards a contradiction, suppose that x i ∈ B ∗ , for x i ∈ β (cid:48)(cid:48) ( t ) \ β ( t ), with i ∈ { , . . . , (cid:96) } . By definition, t is in the unique simple path from t i to s in T . Also, bydefinition, β ( s ) covers B , and then there is b ∈ B ∗ ∩ β ( s ). Since B ∗ is connected, thereis a path P from x i to b in G ( A ) whose nodes belong to B ∗ . We have that β ( t ) mustcontain a node from P , and then a node from B ∗ , which is a contradiction. • Suppose that case (2) holds. Then X is a maximal scope covering B . Let ( T, β (cid:48) ) be therestriction of (
T, β ) to the set of nodes X ∪ V ( C ), i.e., β (cid:48) ( t ) = β ( t ) ∩ ( X ∪ V ( C )), forall t ∈ V ( T ). For t ∈ V ( T ), we say that β (cid:48) ( t ) is maximal if there is no t (cid:48) ∈ V ( T ) suchthat β (cid:48) ( t ) (cid:40) β (cid:48) ( t (cid:48) ). We define ( ˜ T , ˜ β ), where ˜ T = ( V ( ˜ T ) , E ( ˜ T )), to be a decomposition of G ( A )[ X ∪ V ( C )] whose bags are precisely the maximal bags of ( T, β (cid:48) ), or more formally, { ˜ β ( t ) | t ∈ V ( ˜ T ) } = { β (cid:48) ( t ) | t ∈ V ( T ) and β (cid:48) ( t ) is maximal } . In order to obtain ( ˜
T , ˜ β ) we can iteratively remove non-maximal bags from ( T, β (cid:48) ) asfollows: if β (cid:48) ( t ) is not maximal and it is strictly contained in β (cid:48) ( t (cid:48) ), for t, t (cid:48) ∈ V ( T ), and { t, t (cid:48)(cid:48) } is the first edge in the unique simple path from t to t (cid:48) in T , then remove β (cid:48) ( t ) bycontracting the edge { t, t (cid:48)(cid:48) } into a new node s defining β (cid:48) ( s ) = β (cid:48) ( t (cid:48)(cid:48) ).We claim that ( ˜ T , ˜ β ) satisfies the conditions for ( † ). Note first that, since X is a scope andthen a clique in G ( A ), there is a node t X ∈ V ( T ) such that X ⊆ β ( t X ). We show that β (cid:48) ( t X ) = X , i.e., β ( t X ) ∩ V ( C ) = ∅ . By contradiction, suppose that β ( t X ) ∩ V ( C ) (cid:54) = ∅ .21hen β ( t X ) covers B (cid:48) . Also, | β ( t X ) | ≥ | X | > k + 1 and since X ⊂ β ( t X ), the set β ( t X )is not a scope by maximality of X . Hence, β ( t X ) is a bad set. This contradicts the factthat ( T, β ) is B (cid:48) -admissible. Notice that β (cid:48) ( t X ) = X is maximal for ( T, β (cid:48) ). Indeed, if X (cid:40) β (cid:48) ( t ), for some t ∈ V ( T ), then using the same argument as above, we can deducethat β ( t ) is a bad set covering B (cid:48) , which is a contradiction. By construction of ( ˜ T , ˜ β ),there exists ˜ t ∈ V ( ˜ T ) such that ˜ β (˜ t ) = X . It only remains to show that ( ˜ T , ˜ β ) is B -admissible.Let ˜ β ( t ), with t ∈ V ( ˜ T ), be a bad set. We prove that ˜ β ( t ) ∩ V ( C ) (cid:54) = ∅ . By contradiction,assume that ˜ β ( t ) ⊆ X . It follows that ˜ β ( t ) = X , otherwise ˜ β ( t ) would not be amaximal bag of ( T, β (cid:48) ). But X is a scope and then ˜ β ( t ) cannot be bad. This is acontradiction. Let t ∗ ∈ V ( T ) be a node such that β (cid:48) ( t ∗ ) = ˜ β ( t ). We claim that β ( t ∗ ) isa bad set. Since β (cid:48) ( t ∗ ) ⊆ β ( t ∗ ), we know that | β ( t ∗ ) | ≥ | β (cid:48) ( t ∗ ) | > k + 1. For the sakeof contradiction, suppose that β ( t ∗ ) is a scope. In particular, β ( t ∗ ) is a clique in G ( A ).Since β (cid:48) ( t ∗ ) ∩ V ( C ) (cid:54) = ∅ , and hence β ( t ∗ ) ∩ V ( C ) (cid:54) = ∅ , we have that β ( t ∗ ) ⊆ X ∪ V ( C ).Therefore, β (cid:48) ( t ∗ ) = β ( t ∗ ). This is a contradiction since β (cid:48) ( t ∗ ) is bad and then not a scope.Thus β ( t ∗ ) is a bad set. As ( T, β ) is B (cid:48) -admissible, there is B ∗ ∈ B (cid:48) with β ( t ∗ ) ∩ B ∗ = ∅ .Since β ( t ∗ ) ∩ V ( C ) (cid:54) = ∅ , it follows that B ∗ ∈ B . Finally, since β (cid:48) ( t ∗ ) ⊆ β ( t ∗ ), we havethat β (cid:48) ( t ∗ ) ∩ B ∗ = ∅ . Hence, β (cid:48) ( t ∗ ) = ˜ β ( t ) does not cover B . We conclude that ( ˜ T , ˜ β ) is B -admissible and then ( † ) holds. We show the following.
Theorem 33.
Let A be a valued σ -structure and let k ≥ . Suppose that (i) tw ms ( A ) ≤ k − and (ii) the overlap of A is at most k . Then the Sherali-Adams relaxation of level k is alwaystight for A , i.e., for every valued σ -structure B , we have that opt k ( A , B ) = opt ( A , B ) .Proof. Let B be an arbitrary valued σ -structure with universe B . Let A := Pos( A ) and let( T, β ) be a tree decomposition of the Gaifman graph G ( A ) of width modulo scopes smallerthan or or equal to k −
1, where T = ( V ( T ) , E ( T )). As usual, we denote by A the universe of A , A and G ( A ). Recall that the solutions for SA k ( A , B ) are indexed by the set I := { ( f, x , s ) : ( f, x ) ∈ tup( A k ) > , s : Set( x ) (cid:55)→ B k } = { ( f, x , s ) : ( f, x ) ∈ tup( A ) > , s : Set( x ) (cid:55)→ B } ∪ { ( ρ k , x , s ) : x ∈ A k , s : Set( x ) (cid:55)→ B } . Let BTup ⊆ tup( A k ) > be the setBTup := { ( f, x ) ∈ tup( A k ) > | Set( x ) ⊆ β ( t ) for some t ∈ V ( T ) } . Note that tup( A ) > ⊆ BTup. We define T := { ( f, x , s ) ∈ I : ( f, x ) ∈ BTup } . Let P ( A , B )be the system of linear inequalities given by the constraints of SA k ( A , B ) restricted to thevariables indexed by T . More precisely, P ( A , B ) is the following system over variables { λ ( f, x , s ) : ( f, x , s ) ∈ T } : 22 ( f, x , s ) = (cid:88) r :Set( y ) (cid:55)→ B,r | Set( x ) = s λ ( p, y , r ) ∀ ( f, x ) , ( p, y ) ∈ BTup , Set( x ) ⊆ Set( y ) , | Set( x ) | ≤ k, s : Set( x ) (cid:55)→ B (1) (cid:88) s :Set( x ) (cid:55)→ B λ ( f, x , s ) = 1 ∀ ( f, x ) ∈ BTup (2) λ ( f, x , s ) = 0 ∀ ( f, x , s ) ∈ T , f A k ( x ) × f B k ( s ( x )) = ∞ (3) λ ( f, x , s ) ≥ ∀ ( f, x , s ) ∈ T (4)From the definition of the Sherali-Adams hierarchy, we have opt k ( A , B ) ≤ opt( A , B ). Weneed to prove that opt( A , B ) ≤ opt k ( A , B ). Let λ = { λ ( f, x , s ) : ( f, x , s ) ∈ I} be an optimalsolution to SA k ( A , B ). Let c = { c ( f, x , s ) : ( f, x , s ) ∈ I} be the vector defining the objectivefunction of SA k ( A , B ). Consider the projection λ | T = { λ ( f, x , s ) : ( f, x , s ) ∈ T } of λ to T .Similarly, consider the projection c | T of c to T . Note that the restriction of c to I \ T is thevector 0, and hence, c | T · λ | T = c · λ . Note that λ | T is a solution to P ( A , B ). By Lemma 34proved below, the polytope P ( A , B ) is integral and thus λ | T is a convex combination of integralsolutions I g , . . . , I g n of P ( A , B ), for assignments g i : A (cid:55)→ B . It follows that there exists i ∈ { , . . . , n } such that c | T · I g i ≤ c | T · λ | T = c · λ . In particular, the cost of the assignment g i is c | T · I g i ≤ c · λ = opt k ( A , B ). We conclude that opt( A , B ) ≤ opt k ( A , B ).This is the last missing piece in the proof of Theorem 33. Lemma 34.
The polytope described by P ( A , B ) is integral.Proof. We start by defining a useful subset of BTup. Let E ∩ ⊆ E ( T ) be the set of edges { t, t (cid:48) } in T such that β ( t ) ∩ β ( t (cid:48) ) (cid:54) = ∅ . We define set of tuples { ( f t , x t ) : t ∈ V ( T ) } and { ( f e , x e ) : e ∈ E ∩ } as follows. First, let t ∈ V ( T ). Since the width modulo scopes of ( T, β ) isat most k − β ( t ) is either (a) of size at most k or (b) a scope of G ( A ). If (a) applies, thenwe set ( f t , x t ) = ( ρ k , x t ) such that Set( x t ) = β ( t ). Otherwise, (b) applies and, by definitionof scope, there is a tuple ( p, y ) ∈ tup( A ) > such that Set( y ) = β ( t ). In this case, we let( f t , x t ) = ( p, y ). Now let e = { t, t (cid:48) } ∈ E ∩ . We assume without loss of generality that all thebags of ( T, β ) are distinct and hence β ( t ) (cid:54) = β ( t (cid:48) ). Since the overlap of A is at most k , we havethat 1 ≤ | β ( t ) ∩ β ( t (cid:48) ) | ≤ k . Then we set ( f e , x e ) = ( ρ k , x e ) such that Set( x e ) = β ( t ) ∩ β ( t (cid:48) ).Observe that { ( f t , x t ) : t ∈ V ( T ) } ∪ { ( f e , x e ) : e ∈ E ∩ } ⊆ BTup.Let us fix a solution λ of P ( A , B ). We need to show that λ is a convex combination ofintegral solutions. Note that integral solutions of P ( A , B ) correspond naturally to mappingsfrom A to B . For ( f, x ) ∈ BTup, let supp( λ, f, x ) = { h : Set( x ) (cid:55)→ B | λ ( f, x , h ) > } .Note that, by Equation (2), supp( λ, f, x ) (cid:54) = ∅ , for all ( f, x ) ∈ BTup. Let G = { g : A (cid:55)→ B | g | β ( t ) ∈ supp( λ, f t , x t ), for all t ∈ V ( T ) } . Claim 1.
Let g ∈ G and let I g = { I ( f, x , s ) : ( f, x , s ) ∈ T } be the 0/1-vector satisfying I g ( f, x , s ) = 1 if and only if s = g | Set ( x ) . Then, I g is an integral solution to P ( A , B ) .Proof. By definition, I g satisfies Equation (1), (2) and (4) of P ( A , B ). For Equation (3),suppose that f A k ( x ) f B k ( s ( x )) = ∞ for some ( f, x , s ) ∈ T . We need to show that I g ( f, x , s ) = 0,i.e., s (cid:54) = g | Set( x ) . Note that, since λ satisfies Equation (3), we have that λ ( f, x , s ) = 0. Inparticular, s (cid:54)∈ supp( λ, f, x ). Since ( f, x ) ∈ BTup, there is a node t ∈ V ( T ) such thatSet( x ) ⊆ β ( t ). We consider two cases: 23 Suppose that ( f, x ) = ( f t , x t ). As g ∈ G , we have that g | β ( t ) = g | Set( x ) ∈ supp( λ, f, x ).As s (cid:54)∈ supp( λ, f, x ), it follows that s (cid:54) = g | Set( x ) . • Assume that ( f, x ) (cid:54) = ( f t , x t ). Since g ∈ G , we have that g | β ( t ) = g | Set( x t ) ∈ supp( λ, f t , x t ),i.e., λ ( f t , x t , g | Set( x t ) ) >
0. Since the overlap of A is at most k , we have that | Set( x ) | ≤ k .We can apply Equation (1) to obtain that λ ( f, x , g | Set( x ) ) >
0, and thus, g | Set( x ) ∈ supp( λ, f, x ). As s (cid:54)∈ supp( λ, f, x ), we have that s (cid:54) = g | Set( x ) . (cid:4) We prove that λ is a convex combination of the integral vectors { I g | g ∈ G} . We show thisby bottom-up induction on the tree T . Recall that T is rooted at the node r . Let t ∈ V ( T ).We denote by T t = ( V ( T t ) , E ( T t )) the subtree of T rooted at t . Let U t := (cid:83) u ∈ V ( T t ) β ( u ). Notethat U r = A . We define BTup t = { ( f, x ) ∈ BTup | Set( x ) ⊆ β ( u ) for some u ∈ V ( T t ) } and T t = { ( f, x , s ) ∈ I : ( f, x ) ∈ BTup t } . Let λ | t be the restriction of λ to the variables { λ ( f, x , s ) :( f, x , s ) ∈ T t } and let P t ( A , B ) be the system obtained from P ( A , B ) by replacing BTup and T by BTup t and T t , respectively. Note that λ | t is a solution to P t ( A , B ). Observe that λ | r = λ and P r ( A , B ) = P ( A , B ). We define G| t = { g : U t (cid:55)→ B | g | β ( u ) ∈ supp( λ, f u , x u ), for all u ∈ V ( T t ) } .Notice that G| r = G . For g ∈ G| t , we define I g as in Claim 1. We show by induction that λ | t is a convex combination of the vectors { I g : g ∈ G| t } . The lemma follows by taking t = r . Base case:
Let t ∈ V ( T ) be a leaf of T . In this case, we have that G| t = supp( λ, f t , x t ). For g ∈ G| t , let γ g = λ ( f t , x t , g ). By Equation (2), (cid:80) g ∈G| t γ g = 1. Also, (cid:80) g ∈G| t γ g I g = λ | t . Indeed,let ( f, x , s ) ∈ T t . Suppose first that ( f, x ) = ( f t , x t ). If s (cid:54)∈ supp( λ, f t , x t ), then (cid:88) g ∈G| t γ g I g ( f t , x t , s ) = (cid:88) g ∈ supp( λ,f t , x t ) γ g I g ( f t , x t , s ) = 0 = λ ( f t , x t , s ) . On the other hand, if s ∈ supp( λ, f t , x t ), then (cid:88) g ∈G| t γ g I g ( f t , x t , s ) = (cid:88) g ∈ supp( λ,f t , x t ) γ g I g ( f t , x t , s ) = γ s = λ ( f t , x t , s ) . Now suppose that ( f, x ) (cid:54) = ( f t , x t ). Note that Set( x ) ⊆ Set( x t ). We have that (cid:88) g ∈ supp( λ,f t , x t ) γ g I g ( f, x , s ) = (cid:88) g ∈ supp( λ,f t , x t ) g | Set( x ) = s γ g = (cid:88) g ∈ supp( λ,f t , x t ) g | Set( x ) = s λ ( f t , x t , g ) = (cid:88) g :Set( x t ) (cid:55)→ Bg | Set( x ) = s λ ( f t , x t , g ) . Since the overlap of A is at most k , we have that | Set( x ) | ≤ k . Hence, we can apply Equation (1)and obtain (cid:88) g ∈G| t γ g I g ( f, x , s ) = (cid:88) g :Set( x t ) (cid:55)→ Bg | Set( x ) = s λ ( f t , x t , g ) = λ ( f, x , s ) . Inductive case:
Let t ∈ V ( T ) be an internal node of T with children t , . . . , t (cid:96) , with (cid:96) ≥
1. Byinductive hypothesis, for every i ∈ { , . . . , (cid:96) } , there exist nonnegative coefficients { γ g | g ∈ G| t i } such that (cid:80) g ∈G| ti γ g = 1 and (cid:80) g ∈G| ti γ g I g = λ | t i . Without loss of generality, we suppose thatthere exists m ∈ { , . . . , (cid:96) } such that { t, t i } ∈ E ∩ , for i ∈ { , . . . , m } , and { t, t i } ∈ E ( T ) \ E ∩ ,for i ∈ { m + 1 , . . . , (cid:96) } . For i ∈ { , . . . , (cid:96) } , let e i = { t, t i } and Y i = β ( t ) ∩ β ( t i ). Recall that for i ∈ { , . . . , m } , we have that 1 ≤ | Y i | ≤ k and that ( f e i , x e i ) ∈ BTup satisfies Set( x e i ) = Y i .24et h : β ( t ) (cid:55)→ B be a mapping. Let also h i : U t i (cid:55)→ B be mappings that are consistent with h , i.e., h | Y i = h i | Y i , for all i ∈ { , . . . , (cid:96) } . Then we denote by h ∪ h ∪ · · · ∪ h (cid:96) the mappingfrom U t to B that maps x ∈ β ( t ) to h ( x ), and x ∈ U t i to h i ( x ), for all i ∈ { , . . . , (cid:96) } . Observethen that G| t = { h ∪ h ∪ · · · ∪ h (cid:96) | h ∈ supp( λ, f t , x t ), h i ∈ G| t i and h i | Y i = h | Y i , ∀ i ∈ { , . . . , (cid:96) }} Let g = h ∪ h ∪ · · · ∪ h (cid:96) ∈ G| t . We define δ g ≥ δ g = λ ( f t , x t , h ) (cid:81) ≤ i ≤ m λ ( f e i , x e i , h | Y i ) (cid:89) ≤ i ≤ (cid:96) γ h i . Note that δ g is well-defined. Indeed, using the fact that h ∈ supp( λ, f t , x t ) and applying Equa-tion (1) to ( f e i , x e i ) , ( f t , x t ) and h | Y i , we obtain that λ ( f e i , x e i , h | Y i ) >
0, for i ∈ { , . . . , m } .We claim that (cid:80) g ∈G| t δ g = 1. We have that (cid:88) g ∈G| t δ g = (cid:88) h ∈ supp( λ,f t , x t ) (cid:88) ( h ,...,h (cid:96) ) h i ∈G| ti h i | Yi = h | Yi λ ( f t , x t , h ) (cid:81) ≤ i ≤ m λ ( f e i , x e i , h | Y i ) (cid:89) ≤ i ≤ (cid:96) γ h i = (cid:88) h ∈ supp( λ,f t , x t ) λ ( f t , x t , h ) (cid:81) ≤ i ≤ m λ ( f e i , x e i , h | Y i ) (cid:88) h ∈G| t h | Y = h | Y γ h · · · (cid:88) h (cid:96) ∈G| t(cid:96) h (cid:96) | Y(cid:96) = h | Y(cid:96) γ h (cid:96) . (5)By inductive hypothesis, we have that (cid:88) h i ∈G| ti h i | Yi = h | Yi γ h i = (cid:88) h i ∈G| ti γ h i I h i ( f e i , x e i , h | Y i ) = λ ( f e i , x e i , h | Y i ) for all i ∈ { , . . . , m } (cid:88) h i ∈G| ti h i | Yi = h | Yi γ h i = (cid:88) h i ∈G| ti γ h i = 1 for all i ∈ { m + 1 , . . . , (cid:96) } . (6)From Equations (6) and (5), we obtain that (cid:88) g ∈G| t δ g = (cid:88) h ∈ supp( λ,f t , x t ) λ ( f t , x t , h ) = 1 . We conclude by proving that (cid:80) g ∈G| t δ g I g = λ | t . Let ( f, x , s ) ∈ T t . Since ( f, x ) ∈ BTup t ,there exists u ∈ V ( T t ) such that Set( x ) ⊆ β ( u ). Suppose first that u ∈ V ( T t i ), for some25 ∈ { , . . . , m } . In particular, Set( x ) ⊆ U t i . We have that (cid:88) g ∈G| t δ g I g ( f, x , s ) = (cid:88) g ∈G| t g | Set( x ) = s δ g == (cid:88) h i ∈G| ti h i | Set( x ) = s (cid:88) h ∈ supp( λ,f t , x t ) h | Yi = h i | Yi (cid:88) ( h ,...,h i − ,h i +1 ,...,h (cid:96) ) h j ∈G| tj h j | Yj = h | Yj λ ( f t , x t , h ) (cid:81) ≤ j ≤ m λ ( f e j , x e j , h | Y j ) (cid:89) ≤ j ≤ (cid:96) γ h j = (cid:88) h i ∈G| ti h i | Set( x ) = s γ h i λ ( f e i , x e i , h i | Y i ) (cid:88) h ∈ supp( λ,f t , x t ) h | Yi = h i | Yi λ ( f t , x t , h ) (cid:81) ≤ j ≤ mj (cid:54) = i λ ( f e j , x e j , h | Y j ) (cid:88) ( h ,...,h i − ,h i +1 ,...,h (cid:96) ) h j ∈G| tj h j | Yj = h | Yj (cid:89) ≤ j ≤ (cid:96)j (cid:54) = i γ h j = (cid:88) h i ∈G| ti h i | Set( x ) = s γ h i λ ( f e i , x e i , h i | Y i ) (cid:88) h ∈ supp( λ,f t , x t ) h | Yi = h i | Yi λ ( f t , x t , h ) . (by Equation (6))By Equation (1), (cid:88) h ∈ supp( λ,f t , x t ) h | Yi = h i | Yi λ ( f t , x t , h ) = λ ( f e i , x e i , h i | Y i )and then (cid:88) g ∈G| t δ g I g ( f, x , s ) = (cid:88) h i ∈G| ti h i | Set( x ) = s γ h i = (cid:88) h i ∈G| ti γ h i I h i ( f, x , s ) = λ ( f, x , s ) , where the last equality follows by inductive hypothesis.Assume now that u ∈ V ( T t i ), for some i ∈ { m + 1 , . . . , (cid:96) } . Using the same reasoning as26efore, we obtain that (cid:88) g ∈G| t δ g I g ( f, x , s ) = (cid:88) g ∈G| t g | Set( x ) = s δ g == (cid:88) h i ∈G| ti h i | Set( x ) = s (cid:88) h ∈ supp( λ,f t , x t ) (cid:88) ( h ,...,h i − ,h i +1 ,...,h (cid:96) ) h j ∈G| tj h j | Yj = h | Yj λ ( f t , x t , h ) (cid:81) ≤ j ≤ m λ ( f e j , x e j , h | Y j ) (cid:89) ≤ j ≤ (cid:96) γ h j = (cid:88) h i ∈G| ti h i | Set( x ) = s γ h i (cid:88) h ∈ supp( λ,f t , x t ) λ ( f t , x t , h ) (cid:81) ≤ j ≤ m λ ( f e j , x e j , h | Y j ) (cid:88) ( h ,...,h i − ,h i +1 ,...,h (cid:96) ) h j ∈G| tj h j | Yj = h | Yj (cid:89) ≤ j ≤ (cid:96)j (cid:54) = i γ h j = (cid:88) h i ∈G| ti h i | Set( x ) = s γ h i (by Equation (6) and (2))= (cid:88) h i ∈G| ti γ h i I h i ( f, x , s ) = λ ( f, x , s ) . (by inductive hypothesis)Finally, suppose that u = t , i.e., Set( x ) ⊆ β ( t ). We have that (cid:88) g ∈G| t δ g I g ( f, x , s ) = (cid:88) g ∈G| t g | Set( x ) = s δ g == (cid:88) h ∈ supp( λ,f t , x t ) h | Set( x ) = s (cid:88) ( h ,...,h (cid:96) ) h j ∈G| tj h j | Yj = h | Yj λ ( f t , x t , h ) (cid:81) ≤ j ≤ m λ ( f e j , x e j , h | Y j ) (cid:89) ≤ j ≤ (cid:96) γ h j = (cid:88) h ∈ supp( λ,f t , x t ) h | Set( x ) = s λ ( f t , x t , h ) . (by Equation (6))Suppose that ( f, x ) = ( f t , x t ). If s (cid:54)∈ supp( λ, f t , x t ), then (cid:88) g ∈G| t δ g I g ( f t , x t , s ) = (cid:88) h ∈ supp( λ,f t , x t ) h | Set( x t ) = s λ ( f t , x t , h ) = 0 = λ ( f t , x t , s ) . On the other hand, if s ∈ supp( λ, f t , x t ), then (cid:88) g ∈G| t δ g I g ( f t , x t , s ) = (cid:88) h ∈ supp( λ,f t , x t ) h | Set( x t ) = s λ ( f t , x t , h ) = λ ( f t , x t , s ) . Assume now that ( f, x ) (cid:54) = ( f t , x t ). Since the overlap of A is at most k , we have that | Set( x ) | ≤ k .By Equation (1), we obtain that (cid:88) g ∈G| t δ g I g ( f, x , s ) = (cid:88) h ∈ supp( λ,f t , x t ) h | Set( x ) = s λ ( f t , x t , h ) = λ ( f, x , s ) . Theorem 35.
Let A be a valued σ -structure and A (cid:48) be its core. Suppose that (i) tw ms ( A (cid:48) ) ≤ k − and (ii) the overlap of A (cid:48) is at most k . Then the Sherali-Adams relaxation of level k isalways tight for A , i.e., for every valued σ -structure B , we have that opt k ( A , B ) = opt ( A , B ) .Proof. Let B be a valued σ -structure. We can apply Theorem 33 to A (cid:48) , and obtain thatopt k ( A (cid:48) , B ) = opt( A (cid:48) , B ). Since A (cid:48) ≡ A , we know that opt( A , B ) = opt( A (cid:48) , B ) (by thedefinition of equivalence and cores) and opt k ( A , B ) = opt k ( A (cid:48) , B ) (by Proposition 28). Hence,opt k ( A , B ) = opt( A , B ). We show the following.
Theorem 36.
Let A be a valued σ -structure and let k ≥ . Suppose that A is a core and tw ms ( A ) ≥ k . Then there exists a valued σ -structure B such that opt k ( A , B ) < opt ( A , B ) .Proof. Let A := Pos( A ). As usual, we denote by A the universe of A , A and G ( A ). Since tw ms ( A ) = tw ms ( G ( A )) ≥ k , Theorem 32 implies that there exists a bramble B of G ( A ) thatcannot be covered by any scope nor subset of size at most k in G ( A ). Note that every B ∈ B must belong to the same connected component of G ( A ), which we denote by G = ( A , E ).Fix any a ∈ A . For each a ∈ A , let d a denote the degree of a in G ( A ), and let e a , . . . , e ad a bea fixed enumeration of all the edges incident to a in G ( A ).Recall that A is defined over the relational signature rel( σ ) = { R f | f ∈ σ, ar( R f ) = ar( f ) } .We define a relational structure B over rel( σ ) as in [1]. The universe of B , denoted by B ,contains precisely all the tuples ( a, ( b , . . . , b d a )) such that1. a ∈ A and b , . . . , b d a ∈ { , } ,2. b + · · · + b d a ≡ a (cid:54) = a ,3. b + · · · + b d a ≡ a = a .Let R f ∈ rel( σ ) be of arity n . A tuple (( a , ( b , . . . , b d a )) , . . . , ( a n , ( b n , . . . , b nd an ))) belongsto R B f if and only if1. ( a , . . . , a n ) belongs to R A f ,2. if { a (cid:96) , a m } = e a (cid:96) i = e a m j , for some (cid:96), m ∈ { , . . . , n } , i ∈ { , . . . , d a (cid:96) } and j ∈ { , . . . , d a m } ,then b (cid:96)i = b mj .Let π : B (cid:55)→ A be the first projection, i.e., π (( a, ( b , . . . , b d a ))) = a , for all ( a, ( b , . . . , b d a )) ∈ B . By definition of B , π is a homomorphism from B to A .The following lemma follows from the proof of [1, Lemma 1]. Lemma 37.
There is no homomorphism h from A to B such that π ◦ h ( A ) = A .
28y Proposition 15, since A is a core, there is a function c ∗ : tup( A ) (cid:55)→ Q ≥ such that everynon-surjective mapping g : A (cid:55)→ A satisfies (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) < (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, g ( x )) . Now we are ready to define B . The universe of B is B , i.e., the same as B . For each f ∈ σ and tuple x ∈ B ar( f ) we define f B ( x ) = (cid:40) c ∗ ( f, π ( x )) if x ∈ R B f M ∗ /δ otherwisewhere M ∗ := (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) < ∞ and δ := min { f A ( x ) | ( f, x ) ∈ tup( A ) > } . Notethat δ could be ∞ in which case we let M ∗ /δ = 0. Claim 2. opt ( A , B ) > M ∗ .Proof. Let h be an arbitrary mapping from A to B . We have two cases: • Suppose h is a homomorphism from A to B . Thencost( h ) = (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) f B ( h ( x )) = (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) c ∗ ( f, π ( h ( x ))) . By Lemma 37, π ◦ h is a non-surjective mapping from A to A . By definition of c ∗ , wehave that cost( h ) > M ∗ . • If h is not a homomorphism from A to B , then there exists ( f, x ) ∈ tup( A ) > suchthat h ( x ) (cid:54)∈ R B f . By construction, f B ( h ( x )) = 1 + M ∗ /δ . In particular, cost( h ) ≥ f A ( x )(1+ M ∗ /δ ). If f A ( x ) = ∞ , then cost( h ) = ∞ > M ∗ . Otherwise, 1 ≤ f A ( x ) /δ < ∞ ,and then cost( h ) ≥ f A ( x )(1 + M ∗ /δ ) ≥ f A ( x ) + M ∗ > M ∗ . In any case cost( h ) > M ∗ , and then opt( A , B ) > M ∗ . (cid:4) In the rest of the proof, we will show that opt k ( A , B ) ≤ M ∗ . Together with Claim 2, thisestablishes Theorem 36.Let s be a partial homomorphism from A to B . We denote by dom( s ) the domain of s . Wesay that s is an identity partial homomorphism from A to B if π ( s ( a )) = a , for all a ∈ dom( s ).We denote by IPHom( A , B ) the set of all identity partial homomorphisms from A to B . Let λ be a feasible solution of SA k ( A , B ) satisfying the following property ( † ): if λ ( f, x , s ) > f, x ) ∈ tup( A k ) > , s : Set( x ) (cid:55)→ B , then s is an identity partial homomorphism from A to B .29e claim that the cost of any such λ is precisely M ∗ . Indeed, we have that (cid:88) ( f, x ) ∈ tup( A k ) > ,s :Set( x ) (cid:55)→ Bf A k ( x ) × f B k ( s ( x )) < ∞ λ ( f, x , s ) f A k ( x ) f B k ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) > ,s :Set( x ) (cid:55)→ Bf A ( x ) × f B ( s ( x )) < ∞ λ ( f, x , s ) f A ( x ) f B ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) (cid:88) s :Set( x ) (cid:55)→ B,f A ( x ) × f B ( s ( x )) < ∞ λ ( f, x , s ) f B ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) (cid:88) s :Set( x ) (cid:55)→ B,f A ( x ) × f B ( s ( x )) < ∞ s ∈ IPHom( A , B ) λ ( f, x , s ) f B ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) (cid:88) s :Set( x ) (cid:55)→ B,f A ( x ) × f B ( s ( x )) < ∞ s ∈ IPHom( A , B ) λ ( f, x , s ) c ∗ ( f, x )= (cid:88) ( f, x ) ∈ tup( A ) > f A ( x ) c ∗ ( f, x ) = M ∗ . Thus it suffices to show the existence of a feasible solution to SA k ( A , B ) satisfying ( † ).In [1] it is shown that, if the treewidth of A is at least k , then the ( k − A , B . To do this, the authors of [1] exhibit a winning strategy H k for theDuplicator in the existential k -pebble game over A , B . We built on their construction todefine a set H of identity partial homomorphisms from A to B , which will allow us to defineour required λ .Recall that we fixed a bramble B of G ( A ) that cannot be covered by any scope nor subsetof size at most k in G ( A ), whose existence is guaranteed by Theorem 32. Recall also thatevery set in B belongs to the connected component G = ( A , E ) of G ( A ) and that a ∈ A .Let P be a path in G ( A ) starting at a . For every edge e of G ( A ), we define x Pe = (cid:40) e appears an odd number of times in P . For a ∈ A , we define h P ( a ) = ( a, ( x Pe a , . . . , x Pe ada )). Note that h P ( a ) = ( a, (0 , . . . , a ∈ A \ A . The following claim is shown in [1]: Claim 3.
Let X ⊆ A , and let P be a path in G ( A ) from a to b , where b (cid:54)∈ X . Then, therestriction h P | X of h P to X is a partial homomorphism from A to B . Notice that in the previous claim, h P | X is actually an identity partial homomorphism. Let X := { X ⊆ A : X does not cover B} . We define a set H of identity partial homomorphismsfrom A to B as follows. For every X ∈ X and every path P in G ( A ) from a to b , where b belongs to a set B ∈ B disjoint from X , we include h P | X to H . By Claim 3, H contains onlyidentity partial homomorphisms from A to B . For X ∈ X , let H ( X ) := { h ∈ H | dom( h ) = X } .Note that |H ( X ) | >
0, for all X ∈ X , as X does not cover B and then there is a set B ∈ B disjoint from X , and by connectivity, there is at least one path P from a to some node b ∈ B .It follows from [1] that H has the following closure properties:30 laim 4. Let
X, X (cid:48) ∈ X such that X ⊆ X (cid:48) , then1. if h ∈ H ( X ) , then there exists h (cid:48) ∈ H ( X (cid:48) ) such that h (cid:48) | X = h .2. if h (cid:48) ∈ H ( X (cid:48) ) , then h (cid:48) | X ∈ H ( X ) . For
X, X (cid:48) ∈ X such that X ⊆ X (cid:48) and h ∈ B X , let H ( X (cid:48) ) | X,h := { h (cid:48) ∈ H ( X (cid:48) ) | h (cid:48) | X = h } .Note that Claim 4, item (1) states that |H ( X (cid:48) ) | X,h | >
0, for all h ∈ H ( X ).The arguments below are an adaptation of the argument from [51] for proving the existenceof gap instances for Sherali-Adams relaxations of VCSP( E G , ), and a refinement of an argumentfrom [1] (specifically Claim 6 below). In particular, we shall define a well-behaved subset S ⊆ X . A key property of S is that the family of distributions { U ( H ( S )) | S ∈ S} , where U ( H ( S )) is the uniform distribution over H ( S ), is consistent in the following sense: for every S ⊆ S (cid:48) , the marginal distribution of U ( H ( S (cid:48) )) over S coincides with U ( H ( S )). As it turnsout, we will be able to extend { U ( H ( S )) | S ∈ S} to a consistent family { µ ( H ( X )) | X ∈ X } over the whole set X . We shall define our required λ from this latter family.We say that X ⊆ A separates G if there exist nodes u, u (cid:48) ∈ A \ X such that X separates u and u (cid:48) , i.e., every path connecting u and u (cid:48) in G intersects X . Let S := { S ∈ X | S does not separate G } . Below we state two important properties of S : Claim 5. S is closed under intersection.Proof. Let
S, S (cid:48) ∈ S . Clearly, S ∩ S (cid:48) does not cover B . To see that S ∩ S (cid:48) does not separate G , take a, a (cid:48) ∈ A \ ( S ∩ S (cid:48) ). We need to find a path in G between a and a (cid:48) avoiding S ∩ S (cid:48) .If a, a (cid:48) ∈ A \ S or a, a (cid:48) ∈ A \ S (cid:48) , we are done as S and S (cid:48) do not separate G . Thus, withoutloss of generality we can assume that a ∈ ( A ∩ S ) \ S (cid:48) and a (cid:48) ∈ ( A ∩ S (cid:48) ) \ S . Let B, B (cid:48) ∈ B such that B ∩ S = ∅ and B (cid:48) ∩ S (cid:48) = ∅ , and pick b ∈ B and b (cid:48) ∈ B (cid:48) . Since S (cid:48) does not separate a and b (cid:48) , there exists a path P from a to b (cid:48) avoiding S (cid:48) , and hence, S ∩ S (cid:48) . Since B, B (cid:48) areconnected and they touch, there is also a path P (cid:48) from b (cid:48) to b avoiding S ∩ S (cid:48) . Finally, since S does not separate a (cid:48) and b , there is a path P (cid:48)(cid:48) from b to a (cid:48) avoiding S , and then, S ∩ S (cid:48) .The claim follows by taking the concatenation of P , P (cid:48) and P (cid:48)(cid:48) . (cid:4) Claim 6.
Let
S, S (cid:48) ∈ S such that S ⊆ S (cid:48) and let h ∈ H ( S ) . Then |H ( S (cid:48) ) | S,h | = |H ( S (cid:48) ) | / |H ( S ) | .Proof. The proof is by induction on (cid:96) := | S (cid:48) \ S | . If (cid:96) = 0, we are done. Suppose that (cid:96) = 1and S (cid:48) \ S = { x } . Assume first that x (cid:54)∈ A . Let g ∈ H ( S ) and P be a path starting at a andending at some node in B ∈ B , with B ∩ S = ∅ , such that h P | S = g . Note that B ∩ S (cid:48) = ∅ as B ⊆ A and thus h P | S (cid:48) ∈ H ( S (cid:48) ) | S,g . Notice also that for every g (cid:48) ∈ H ( S (cid:48) ) | S,g , it must be thecase that g (cid:48) ( x ) = ( x, (0 , . . . , P (cid:48) starting at a cannot visit an edge e incident to x , and hence x P (cid:48) e = 0. It follows that H ( S (cid:48) ) | S,g = { h P | S (cid:48) } . In particular, |H ( S (cid:48) ) | S,h | = 1 and |H ( S (cid:48) ) | = (cid:80) g ∈ B S |H ( S (cid:48) ) | S,g | . By Claim 4, item (2), (cid:80) g ∈ B S |H ( S (cid:48) ) | S,g | = (cid:80) g ∈H ( S ) |H ( S (cid:48) ) | S,g | .This implies that |H ( S (cid:48) ) | = |H ( S ) | , and then the claim follows.We now assume that x ∈ A . We show that there is an edge { x, u } in G ( A ) such that u (cid:54)∈ S (cid:48) . Assume to the contrary, and take B (cid:48) ∈ B such that S (cid:48) ∩ B (cid:48) = ∅ and pick b (cid:48) ∈ B (cid:48) . Notethat x, b (cid:48) ∈ A \ S . Since every neighbour of x lies in S , we have that S separates x and b (cid:48) , whichcontradicts the fact that S ∈ S . Let e , . . . , e m , with m ≥
1, be an enumeration of all the edgesfrom x to a node outside S (cid:48) . Recall that e x , . . . , e xd x is our fixed enumeration of all the edgesincidents to x . Without loss of generality, suppose that e x , . . . , e xd x = e , . . . , e m , e (cid:48) , . . . , e (cid:48) n ,31here e (cid:48) , . . . , e (cid:48) n is an enumeration ( n ≥
0) of all the edges from x to a node inside S . Weclaim that |H ( S (cid:48) ) | S,g | = 2 m − , for all g ∈ H ( S ).We start by proving |H ( S (cid:48) ) | S,g | ≤ m − . We define an injective mapping η from H ( S (cid:48) ) | S,g to { , } m − . Let g (cid:48) ∈ H ( S (cid:48) ) | S,g and suppose that g (cid:48) ( x ) = ( x, ( y , . . . , y m , y (cid:48) , . . . , y (cid:48) n )). We define η ( g (cid:48) ) = ( y , . . . , y m − ). Suppose that η ( g (cid:48) ) = η ( g (cid:48) ), for g (cid:48) , g (cid:48) ∈ H ( S (cid:48) ) | S,g . Thus, g (cid:48) ( x ) , g (cid:48) ( x )are of the form g (cid:48) ( x ) = ( x, ( η ( g (cid:48) ) , y m , y (cid:48) , . . . , y (cid:48) n )) and g (cid:48) ( x ) = ( x, ( η ( g (cid:48) ) , y m , y (cid:48) , . . . , y (cid:48) n )).Note that ( y (cid:48) , . . . , y (cid:48) n ) = ( y (cid:48) , . . . , y (cid:48) n ) as these values are already determined by g . Itfollows that y m = y m as the parity of the number of ones in ( η ( g (cid:48) ) , y m , y (cid:48) , . . . , y (cid:48) n )) and( η ( g (cid:48) ) , y m , y (cid:48) , . . . , y (cid:48) n )) must be the same. In particular, g (cid:48) = g (cid:48) , and thus η is injective.Now we show that |H ( S (cid:48) ) | S,g | ≥ m − . As we mentioned above, if g (cid:48) ∈ H ( S (cid:48) ) | S,g and g (cid:48) ( x ) = ( x, ( y , . . . , y m , y (cid:48) , . . . , y (cid:48) n )), then ( y (cid:48) , . . . , y (cid:48) n ) is already determined by g . Let ¯ z =( z , . . . , z m ) ∈ { , } m be an arbitrary 0 / • (cid:80) ≤ i ≤ m z i + (cid:80) ≤ j ≤ n y (cid:48) j ≡ x = a , • (cid:80) ≤ i ≤ m z i + (cid:80) ≤ j ≤ n y (cid:48) j ≡ x (cid:54) = a .Note that the number of such ¯ z ’s is precisely 2 m − , and hence, it suffices to show that,for every such ¯ z , there exists g (cid:48) ¯ z ∈ H ( S (cid:48) ) | S,g such that g (cid:48) ¯ z ( x ) = ( x, (¯ z, y (cid:48) , . . . , y (cid:48) n )). Let P bea path in G ( A ) from a to a node b ∈ B , where B ∈ B and B ∩ S = ∅ , such that h P | S = g .Let B (cid:48) ∈ B such that B (cid:48) ∩ S (cid:48) = ∅ and pick any b (cid:48) ∈ B (cid:48) . Since B, B (cid:48) are connected and theytouch, there exists a path P (cid:48) from b to b (cid:48) completely contained in B ∪ B (cid:48) , and hence, avoiding S . Let W be the concatenation of P and P (cid:48) . By construction, g (cid:48) := h W | S (cid:48) ∈ H ( S (cid:48) ). Since P (cid:48) avoids S , x We = x Pe , for every edge e incident to a node in S . Therefore, h W ( a ) = h P ( a ), forall a ∈ S . It follows that g (cid:48) ∈ H ( S (cid:48) ) | S,g .Let g (cid:48) ( x ) = ( x, ( y , . . . , y m , y (cid:48) , . . . , y (cid:48) n )). Suppose without loss of generality that ¯ z =( z , . . . , z r , z r +1 , . . . , z m ), where r ∈ { , . . . , m } and z i (cid:54) = y i if and only if i ∈ { , . . . , r } .If r = 0, we are done as we can set g (cid:48) ¯ z = g (cid:48) . Suppose then that r ≥
1. Observe that (cid:80) ≤ i ≤ r y i ≡ (cid:80) ≤ i ≤ r z i (mod 2). This implies that r is even. Recall that e , . . . , e m is ourfixed enumeration of all the edges from x to a node outside S (cid:48) . Let u , . . . , u r be the nodesoutside S (cid:48) such that e i = { x, u i } , for all i ∈ { , . . . , r } . Note that u i , b (cid:48) ∈ A \ S (cid:48) . Since S (cid:48) ∈ S , S (cid:48) cannot separate u i and b (cid:48) , and then, there is a path P i from b (cid:48) to u i avoiding S (cid:48) , for all i ∈ { , . . . , r } . Let W i be the extension of P i with the edge { u i , x } . We denoteby W − i the reverse path of W i , in particular, W − i is a path from x to b (cid:48) . Let W (cid:48) bethe extension of the path W with the concatenation Z of the paths W , W − , . . . , W r − , W − r . Note that W (cid:48) ends at b (cid:48) and hence h W (cid:48) | S (cid:48) ∈ H ( S (cid:48) ). Since the subpath Z of W (cid:48) avoids S , h W (cid:48) ( a ) = h W ( a ), for all a ∈ S , and then, h W (cid:48) | S (cid:48) ∈ H ( S (cid:48) ) | S,g . Notice also thatthe subpath Z visits only the e i ’s with i ∈ { , . . . , r } , and it visits each such e i exactlyonce. This implies that h W (cid:48) ( x ) = ( x, ( y + 1 , . . . , y r + 1 , y r +1 , . . . , y m , y (cid:48) , . . . , y (cid:48) n )), wherethe sum + is modulo 2. In other words, h W (cid:48) ( x ) = ( x, ( z , . . . , z m , y (cid:48) , . . . , y (cid:48) n )). The claimfollows by taking g (cid:48) ¯ z = h W (cid:48) | S (cid:48) . Therefore, |H ( S (cid:48) ) | S,g | = 2 m − , for all g ∈ H ( S ). In particular, |H ( S (cid:48) ) S,h | = 2 m − . On the other hand, |H ( S (cid:48) ) | = (cid:80) g ∈ B S |H ( S (cid:48) ) | S,g | . By Claim 4, item (2), (cid:80) g ∈ B S |H ( S (cid:48) ) | S,g | = (cid:80) g ∈H ( S ) |H ( S (cid:48) ) | S,g | . This implies that |H ( S (cid:48) ) | = 2 m − |H ( S ) | , and thenour claim holds for (cid:96) = 1.Assume now that (cid:96) ≥
2. We claim that there is a node x ∗ ∈ S (cid:48) \ S such that S (cid:48) \ { x ∗ } ∈ S .By contradiction, suppose that this is not the case. Note that, if x (cid:54)∈ A for x ∈ S (cid:48) \ S , then S (cid:48) \ { x } ∈ S as S (cid:48) \ { x } cannot separate G . Similarly, if there is an edge { x, u } in G ( A ) with32 ∈ S (cid:48) \ S and u (cid:54)∈ S (cid:48) , then S (cid:48) \ { x } ∈ S for the same reason as before. It follows that x ∈ A and every neighbour of x lies inside S (cid:48) , for all x ∈ S (cid:48) \ S . Let B (cid:48) ∈ B be disjoint from S (cid:48) .Then any path from a node in S (cid:48) \ S to a node in B (cid:48) must intersect S . This contradicts thefact that S ∈ S . Let S ∗ := S (cid:48) \ { x ∗ } ∈ S .Note that |H ( S (cid:48) ) | S,h | = (cid:80) g ∈H ( S ∗ ) | S,h |H ( S (cid:48) ) | S ∗ ,g | . By inductive hypothesis, we know that |H ( S (cid:48) ) | S ∗ ,g | = |H ( S (cid:48) ) | / |H ( S ∗ ) | , for every g ∈ H ( S ∗ ), and |H ( S ∗ ) | S,h | = |H ( S ∗ ) | / |H ( S ) | . Itfollows that |H ( S (cid:48) ) | S,h | = ( |H ( S (cid:48) ) | / |H ( S ∗ ) | ) |H ( S ∗ ) | S,h | = |H ( S (cid:48) ) | / |H ( S ) | . (cid:4) Now we are ready to define our vector λ satisfying ( † ). Fix ( f, x ) ∈ tup( A k ) > . Note thatSet( x ) is either a scope or a subset of size at most k of G ( A ). In particular, Set( x ) cannot cover B and thus Set( x ) ∈ X . Let Set( x ) := (cid:84) S ∈S| Set( x ) ⊆ S S . Let us note that Set( x ) is well-defined,i.e., there is S ∗ ∈ S such that Set( x ) ⊆ S ∗ . Indeed, we can take S ∗ = A \ B ∈ S , where B is any set in B disjoint from Set( x ). By Claim 5, Set( x ) ∈ S . Observe then that Set( x ) isthe inclusion-wise minimal set of S containing Set( x ). For every mapping s : Set( x ) (cid:55)→ B , wedefine λ ( f, x , s ) = Pr h ∼ U ( H (Set( x ))) (cid:2) h | Set( x ) = s (cid:3) where U ( H (Set( x ))) denotes the uniform distribution over H (Set( x )).By Claim 4, we have that ( ∗ ) λ ( f, x , s ) > s ∈ H (Set( x )). Hence, λ satisfies( † ). It remains to prove that λ is feasible for SA k ( A , B ). Conditions (SA4) and (SA2) followfrom definition. For condition (SA3) , recall first that the function c ∗ : tup( A ) (cid:55)→ Q ≥ , whoseexistence is guaranteed by the fact that A is a core, satisfies that (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) < (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, g ( x ))for every non-surjective mapping g : A (cid:55)→ A . In particular, (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ∗ ( f, x ) < ∞ .It follows that f A ( x ) = ∞ implies c ∗ ( f, x ) = 0, for every ( f, x ) ∈ tup( A ). By contradiction,suppose that condition (SA3) does not hold. Then there is ( f, x ) ∈ tup( A ) and s : Set( x ) (cid:55)→ B such that f A ( x ) f B ( s ( x )) = ∞ , but λ ( f, x , s ) >
0. By ( ∗ ), we know that s ∈ H (Set( x )). Inparticular, s is a partial homomorphism from A to B . On the other hand, note that f B ( s ( x )) < ∞ by construction of B , and then f A ( x ) = ∞ . By a previous remark, we havethat c ∗ ( f, x ) = 0. Additionally, note that x ∈ R A f , and since s is a partial homomorphism, s ( x ) ∈ R B f . By definition of B , it follows that f B ( s ( x )) = c ∗ ( f, π ( s ( x ))) = c ∗ ( f, x ) = 0. Hence, f A ( x ) f B ( s ( x )) = 0; a contradiction.For condition (SA1) , let ( f, x ) , ( p, y ) ∈ tup( A k ) > and define X := Set( x ) and Y := Set( y ).Suppose that | X | ≤ k and X ⊆ Y . Let s : X (cid:55)→ B . We need to show that λ ( f, x , s ) = (cid:88) r : Y (cid:55)→ Br | X = s λ ( p, y , r ) = (cid:88) r ∈H ( Y ) | X,s λ ( p, y , r ) , where the last equality holds due to ( ∗ ). Using again ( ∗ ) and Claim 4, item (2), the requiredequality holds directly when s (cid:54)∈ H ( X ). Then we assume that s ∈ H ( X ). Let µ ∈ H ( X ) and33et Z ∈ X such that X ⊆ Z ⊆ Y . Then,Pr h ∼ U ( H ( Y )) [ h | X = µ ] = (cid:88) ν : Z (cid:55)→ B Pr h ∼ U ( H ( Y )) [ h | X = µ, h | Z = ν ]= (cid:88) ν : Z (cid:55)→ Bν | X = µ Pr h ∼ U ( H ( Y )) [ h | Z = ν ] . (7)Note that X ⊆ { X, Y } ⊆ Y . Then by applying Equation (7) with Z = X and µ = s , wehave thatPr h ∼ U ( H ( Y )) [ h | X = s ] = (cid:88) ν : X (cid:55)→ Bν | X = s Pr h ∼ U ( H ( Y )) (cid:2) h | X = ν (cid:3) = (cid:88) ν ∈H ( X ) | X,s Pr h ∼ U ( H ( Y )) (cid:2) h | X = ν (cid:3) , (8)where the last equality holds due to Claim 4, item (2). By definition, Pr h ∼ U ( H ( Y )) (cid:2) h | X = ν (cid:3) = |H ( Y ) | X,ν | / |H ( Y ) | . Since ν ∈ H ( X ), we can apply Claim 6 and obtain that Pr h ∼ U ( H ( Y )) (cid:2) h | X = ν (cid:3) =1 / |H ( X ) | . Using this in Equation (8), we obtainPr h ∼ U ( H ( Y )) [ h | X = s ] = (cid:88) ν ∈H ( X ) | X,s / |H ( X ) | = Pr ν ∼ U ( H ( X )) [ ν | X = s ] = λ ( f, x , s ) . Hence, λ ( f, x , s ) = Pr h ∼ U ( H ( Y )) [ h | X = s ]= (cid:88) ν : Y (cid:55)→ Bν | X = s Pr h ∼ U ( H ( Y )) [ h | Y = ν ] (By Equation (7) with Z = Y and µ = s )= (cid:88) ν : Y (cid:55)→ Bν | X = s λ ( p, y , ν ) . Therefore, λ is a feasible solution of SA k ( A , B ). Theorem 38.
Let A be a valued σ -structure and let k ≥ . Let A (cid:48) be the core of A . If tw ms ( A (cid:48) ) ≥ k , then the Sherali-Adams relaxation of level k is not always tight for A .Proof. We can apply Theorem 36 to A (cid:48) , and obtain B such that opt k ( A (cid:48) , B ) < opt( A (cid:48) , B ).Since A (cid:48) ≡ A , we know that opt( A , B ) = opt( A (cid:48) , B ) (by the definition of equivalence and cores)and opt k ( A , B ) = opt k ( A (cid:48) , B ) (by Proposition 28). Hence, opt k ( A , B ) < opt( A , B ), and theresult follows. In this section we provide the last missing piece in the proof of Theorem 29.34 heorem 39.
Let A be a valued σ -structure and let k ≥ . Suppose that A is a core andthat the overlap of A is at least k + 1 . Then there exists a valued σ -structure B such thatopt k ( A , B ) < opt ( A , B ) .Proof. Given a tuple t and an index i ∈ { , . . . , | t |} , we denote by t [ i ] the i -th entry of t .By extension, given a set I of indices we use t [ I ] to denote the tuple obtained from t afterdiscarding all entries t [ j ] with j / ∈ I . Given a tuple t , we use (cid:107) t (cid:107) to denote the number ofdistinct elements appearing in t , i.e. (cid:107) t (cid:107) := | Set( t ) | .Because the overlap of A is at least k + 1, there exist ( q, x ) , ( p, y ) ∈ tup( A ) such that:(i) q A ( x ) , p A ( y ) > | Set( x ) ∩ Set( y ) | > k , and(iii) ( q, x ) (cid:54) = ( p, y ).Let I x , I y be sets of indices of size n = | Set( x ) ∩ Set( y ) | such that Set( x [ I x ]) = Set( y [ I y ]) =Set( x ) ∩ Set( y ). Let ( L i ) i ∈ ..(cid:96) be an arbitrary enumeration of the set of all ordered pairs ofdistinct elements of tup( A ) > .We first define a relational structure B over the signature rel( σ ) = { R f | f ∈ σ, ar( R f ) =ar( f ) } and universe B = { ( a, ( b , . . . , b (cid:96) )) | a ∈ A, ( b , . . . , b (cid:96) ) ∈ { , } (cid:96) } , where the i -th bit b i is associated with the pair L i . We define π : B (cid:55)→ A to be the projection onto the firstcoordinate, i.e. π (( a, ( b , . . . , b (cid:96) ))) = a for all ( a, ( b , . . . , b (cid:96) )) ∈ B , and π i : B (cid:55)→ { , } to bethe projection onto the bit associated with the pair L i , i.e. π i (( a, ( b , . . . , b (cid:96) ))) = b i for all i ∈ { , . . . , (cid:96) } and ( a, ( b , . . . , b (cid:96) )) ∈ B . We denote by ⊕ the addition modulo 2, and by ¬ theunary negation operation defined by ¬ ( b ) = b ⊕ R f ∈ rel( σ ), a tuple t ∈ B ar( R f ) does not belong to R B f if and only if( ∗ ) π ( t ) (cid:54)∈ R Pos( A ) f , or( ∗∗ ) f = q , (cid:107) π ( t [ I x ]) (cid:107) = n and there exists i ∈ { , . . . , (cid:96) } such that ( q, π ( t )) = L i [1] and (cid:76) j ∈ I x π i ( t [ j ]) = 1, or( ∗∗∗ ) f = p , (cid:107) π ( t [ I y ]) (cid:107) = n and there exists i ∈ { , . . . , (cid:96) } such that ( p, π ( t )) = L i [2] and (cid:76) j ∈ I y π i ( t [ j ]) = 0.Note that by ( ∗ ), π is a homomorphism from B to Pos( A ). As the next claim shows,whenever h is a homomorphism from Pos( A ) to B , the mapping π ◦ h cannot be surjective. Claim 7. If h : A → B is a homomorphism from Pos ( A ) to B , then ( π ◦ h )( A ) (cid:54) = A .Proof. By contradiction, suppose that ( π ◦ h )( A ) = A . In particular, (cid:107) π ( h ( x [ I x ])) (cid:107) = (cid:107) π ( h ( y [ I y ])) (cid:107) = n and ( q, x ) (cid:54) = ( p, y ) implies ( q, π ( h ( x ))) (cid:54) = ( p, π ( h ( y ))). Now, considerthe pair L i = (( q, π ( h ( x ))) , ( p, π ( h ( y )))). Let b S := (cid:77) v ∈ Set( x ) ∩ Set( y ) π i ( h ( v ))and observe that (cid:76) j ∈ I x π i ( h ( x )[ j ]) = (cid:76) j ∈ I y π i ( h ( y )[ j ]) = b S . If b S = 1 then by ( ∗∗ ) we have h ( x ) / ∈ R B q , and if b S = 0 then by ( ∗∗∗ ) we have h ( y ) / ∈ R B p . Since ( q, x ) , ( p, y ) ∈ tup( A ) > ,this implies that h is not a homomorphism from Pos( A ) to B ; a contradiction. (cid:4) A is a core, by Proposition 15 there exists a function c ∗ : tup( A ) (cid:55)→ Q ≥ such thatfor every non-surjective mapping g : A (cid:55)→ A , M ∗ := (cid:88) ( f, z ) ∈ tup( A ) f A ( z ) c ∗ ( f, z ) < (cid:88) ( f, z ) ∈ tup( A ) f A ( z ) c ∗ ( f, g ( z )) . In particular, M ∗ is finite so f A ( z ) = ∞ implies c ∗ ( f, z ) = 0 for all ( f, z ) ∈ tup( A ). Then,we define a (finite-)valued σ -structure B over the universe B such that for all f ∈ σ and t ∈ B ar( f ) , f B ( t ) := (cid:40) c ∗ ( f, π ( t )) if t ∈ R B f M ∗ /δ otherwisewhere δ := min { f A ( z ) | ( f, z ) ∈ tup( A ) > } . Again, if δ = ∞ we let M ∗ /δ = 0. Claim 8. opt ( A , B ) > M ∗ .Proof. Let h be an arbitrary mapping from A to B . We need to show that cost( h ) > M ∗ .Suppose first that h is not a homomorphism from Pos( A ) to B . Then, there exists ( f, z ) ∈ tup( A ) > such that h ( z ) / ∈ R B f and thencost( h ) ≥ f A ( z ) f B ( h ( z )) = f A ( z )(1 + M ∗ /δ ) . In this case, either f A ( z ) = ∞ and hence cost( h ) = ∞ > M ∗ , or 1 ≤ f A ( z ) /δ < ∞ (as f A ( z ) >
0) and cost( h ) ≥ f A ( z ) + M ∗ > M ∗ .Assume now that h is a homomorphism from Pos( A ) to B . By Claim 7, we have ( π ◦ h )( A ) (cid:54) = A , i.e., π ◦ h is not surjective. By definition of c ∗ , we have thatcost( h ) = (cid:88) ( f, z ) ∈ tup( A ) > f A ( z ) f B ( h ( z )) = (cid:88) ( f, z ) ∈ tup( A ) > f A ( z ) c ∗ ( f, π ( h ( z ))) > M ∗ and the claim follows. (cid:4) The next step is to exhibit a solution to SA k ( A , B ) of cost exactly M ∗ . Recall that thesignature σ k of the modified instance ( A k , B k ) used to define SA k ( A , B ) contains an additionalfunction symbol ρ k of arity k . For the rest of the proof, for any ( f, z ) ∈ tup( A k ) > we useid( f B , z ) to denote the set of all assignments r : Set( z ) (cid:55)→ B such that π ( r ( z )) = z and either f = ρ k or r ( z ) ∈ R B f . Claim 9.
The set id ( f B , z ) is non-empty for any ( f, z ) ∈ tup ( A k ) > .Proof. If any of the following conditions hold(P1) f / ∈ { q, p } (P2) f = q , q (cid:54) = p , (cid:107) z [ I x ] (cid:107) < n (P3) f = p , q (cid:54) = p , (cid:107) z [ I y ] (cid:107) < n (P4) f = p = q , (cid:107) z [ I x ] (cid:107) < n , (cid:107) z [ I y ] (cid:107) < n then id( f B , z ) is the set of all assignments r to Set( z ) such that π ( r ( z )) = z , which is non-empty.That leaves five remaining cases to examine: 36C1) f = q , q (cid:54) = p , (cid:107) z [ I x ] (cid:107) = n (C2) f = p , q (cid:54) = p , (cid:107) z [ I y ] (cid:107) = n (C3) f = p = q , (cid:107) z [ I x ] (cid:107) = n , (cid:107) z [ I y ] (cid:107) = n (C4) f = p = q , (cid:107) z [ I x ] (cid:107) < n , (cid:107) z [ I y ] (cid:107) = n (C5) f = p = q , (cid:107) z [ I x ] (cid:107) = n , (cid:107) z [ I y ] (cid:107) < n .If (C1) or (C5) holds, then id( f B , z ) contains the mapping r : Set( z ) (cid:55)→ B such that π ( r ( z )) = z and for each i ≤ (cid:96) and z ∈ Set( z ), π i ( r ( z )) = 0. If (C2) or (C4) holds, then it contains themapping r : Set( z ) (cid:55)→ B such that π ( r ( z )) = z and for each i ≤ (cid:96) , π i ( r ( z y )) = 1 for somefixed z y ∈ Set( z [ I y ]) and π i ( r ( z )) = 0 for all z (cid:54) = z y . Finally, if (C3) holds then it containsthe mapping r : Set( z ) (cid:55)→ B such that π ( r ( z )) = z and for each i ≤ (cid:96) , if ( f, z ) = L i [1] then π i ( r ( z )) = 0 for all z ∈ Set( z ) and otherwise π i ( r ( z y )) = 1 for some fixed z y ∈ Set( z [ I y ]) and π i ( r ( z )) = 0 for all z (cid:54) = z y . (cid:4) Claim 10.
Let ( f, v ) ∈ tup ( A k ) > and w be a tuple such that Set ( w ) ⊆ Set ( v ) and (cid:107) w (cid:107) ≤ k .For every pair of mappings s , s : Set ( w ) (cid:55)→ B such that π ( s ( w )) = π ( s ( w )) = w , it holdsthat |{ r ∈ id ( f B , v ) | r | Set ( w ) = s }| = |{ r ∈ id ( f B , v ) | r | Set ( w ) = s }| . Proof.
To prove the claim we exhibit a bijection between the two sets, which we denote by R and R respectively. We proceed using the same case analysis as in the proof of Claim 9. Ifany of the following conditions hold(P1) f / ∈ { q, p } (P2) f = q , q (cid:54) = p , (cid:107) v [ I x ] (cid:107) < n (P3) f = p , q (cid:54) = p , (cid:107) v [ I y ] (cid:107) < n (P4) f = p = q , (cid:107) v [ I x ] (cid:107) < n , (cid:107) v [ I y ] (cid:107) < n then id( f B , v ) is the set of all assignments r to Set( v ) such that π ( r ( v )) = v . In that case,the mapping that sends each r ∈ R to r such that r | Set( w ) := s and r ( v ) := r ( v ) otherwiseis a straightforward bijection between R and R . That leaves five remaining cases:(C1) f = q , q (cid:54) = p , (cid:107) v [ I x ] (cid:107) = n (C2) f = p , q (cid:54) = p , (cid:107) v [ I y ] (cid:107) = n (C3) f = p = q , (cid:107) v [ I x ] (cid:107) = n , (cid:107) v [ I y ] (cid:107) = n (C4) f = p = q , (cid:107) v [ I x ] (cid:107) < n , (cid:107) v [ I y ] (cid:107) = n (C5) f = p = q , (cid:107) v [ I x ] (cid:107) = n , (cid:107) v [ I y ] (cid:107) < n .First, let us assume that (C1) or (C5) holds. In those cases, the only way an assignment r such that π ( r ( v )) = v may fail to belong to id( f B , v ) is if r ( v ) / ∈ R B f because of condition( ∗∗ ). Since (cid:107) w (cid:107) ≤ k and | I x | = n > k , there exists some element v ∗ ∈ Set( v [ I x ]) \ Set( w ).Let S = Set( v [ I x ]) ∩ Set( w ). We define a mapping η that maps each r ∈ R to the uniquemapping η ( r ) : Set( v ) (cid:55)→ B that satisfies the following properties:37 For all v ∈ Set( v ), π ( η ( r )( v )) = v , • For all i ∈ { , . . . , (cid:96) } and w ∈ Set( w ), π i ( η ( r )( w )) = π i ( s ( w )), • For all i ∈ { , . . . , (cid:96) } , π i ( η ( r )( v ∗ )) = π i ( r ( v ∗ )) if (cid:76) w ∈S π i ( s ( w )) = (cid:76) w ∈S π i ( s ( w )),and π i ( η ( r )( v ∗ )) = ¬ ( π i ( r ( v ∗ ))) otherwise, • For all v ∈ Set( v ) \{ Set( w ) ∪ { v ∗ }} and i ∈ { , . . . , (cid:96) } , π i ( η ( r )( v )) = π i ( r ( v )).We first prove that η ( r ) belongs to R for all r ∈ R . By construction, η ( r ) | Set( w ) = s and π ( η ( r )( v )) = v . Then, the only way η ( r ) might not be in R is if η ( r )( v ) / ∈ R B f , so for thesake of contradiction let us assume that it is the case. By ( ∗∗ ), this implies that there exists i ∈ { , . . . , (cid:96) } such that ( f, π ( η ( r )( v ))) = ( q, v ) = L i [1] and (cid:76) j ∈ I x π i ( η ( r )( v [ j ])) = 1. Bythe definition of η we have (cid:32)(cid:77) w ∈S π i ( s ( w )) (cid:33) ⊕ π i ( r ( v ∗ )) = (cid:32)(cid:77) w ∈S π i ( s ( w )) (cid:33) ⊕ π i ( η ( r )( v ∗ ))and hence (cid:77) j ∈ I x π i ( η ( r )( v [ j ])) = (cid:32)(cid:77) w ∈S π i ( s ( w )) (cid:33) ⊕ π i ( η ( r )( v ∗ )) ⊕ (cid:77) v ∈ Set( v [ I x ]) \{S∪{ v ∗ }} π i ( η ( r )( v )) = (cid:32)(cid:77) w ∈S π i ( s ( w )) (cid:33) ⊕ π i ( η ( r )( v ∗ )) ⊕ (cid:77) v ∈ Set( v [ I x ]) \{S∪{ v ∗ }} π i ( r ( v )) = (cid:32)(cid:77) w ∈S π i ( s ( w )) (cid:33) ⊕ π i ( r ( v ∗ )) ⊕ (cid:77) v ∈ Set( v [ I x ]) \{S∪{ v ∗ }} π i ( r ( v )) = (cid:77) j ∈ I x π i ( r ( v [ j ]))which implies r / ∈ R , a contradiction. By construction η is injective. For surjectivity observethat for each mapping r ∈ R , the unique mapping r such that • For all v ∈ Set( v ), π ( r ( v )) = v , • For all i ∈ { , . . . , (cid:96) } and w ∈ Set( w ), π i ( r ( w )) = π i ( s ( w )), • For all i ∈ { , . . . , (cid:96) } , π i ( r ( v ∗ )) = π i ( r ( v ∗ )) if (cid:76) w ∈ S π i ( s ( w )) = (cid:76) w ∈ S π i ( s ( w )), and π i ( r ( v ∗ )) = ¬ ( π i ( r ( v ∗ ))) otherwise, • For all v ∈ Set( v ) \{ Set( w ) ∪ { v ∗ }} and i ∈ { , . . . , (cid:96) } , π i ( r ( v )) = π i ( r ( v )).belongs to R and is such that η ( r ) = r . Therefore η is a bijection from R to R and |R | = |R | .The cases (C2),(C4) are symmetrical to (C1),(C5), so let us assume that (C3) holds. Byhypothesis, we know that there exist v x ∈ Set( v [ I x ]) \ Set( w ) and v y ∈ Set( v [ I y ]) \ Set( w ). Let S xw = Set( v [ I x ]) ∩ Set( w ) and S yw = Set( v [ I y ]) ∩ Set( w ). We define a mapping η on R suchthat for each r ∈ R , η ( r ) satisfies 38 For all v ∈ Set( v ), π ( η ( r )( v )) = v , • For all i ∈ { , . . . , (cid:96) } and w ∈ Set( w ), π i ( η ( r )( w )) = π i ( s ( w )), • For all i ∈ { , . . . , (cid:96) } such that ( f, v ) = L i [1], π i ( η ( r )( v x )) = π i ( r ( v x )) if (cid:76) w ∈ S xw π i ( s ( w )) = (cid:76) w ∈ S xw π i ( s ( w )), and π i ( η ( r )( v x )) = ¬ ( π i ( r ( v x ))) otherwise. For i ∈ { , . . . , (cid:96) } with( f, v ) (cid:54) = L i [1], we let π i ( η ( r )( v x )) = π i ( r ( v x )). • For all i ∈ { , . . . , (cid:96) } such that ( f, v ) = L i [2], π i ( η ( r )( v y )) = π i ( r ( v y )) if (cid:76) w ∈ S yw π i ( s ( w )) = (cid:76) w ∈ S yw π i ( s ( w )), and π i ( η ( r )( v y )) = ¬ ( π i ( r ( v y ))) otherwise. For i ∈ { , . . . , (cid:96) } with( f, v ) (cid:54) = L i [2], we let π i ( η ( r )( v y )) = π i ( r ( v y )). • For all v ∈ Set( v ) \{ Set( w ) ∪ { v x , v y }} and i ∈ { , . . . , (cid:96) } , π i ( η ( r )( v )) = π i ( r ( v )).By construction, for all i such that ( f, π ( η ( r )( v ))) = ( q, v ) = L i [1] we have (cid:77) j ∈ I x π i ( η ( r )( v [ j ])) = (cid:77) j ∈ I x π i ( r ( v [ j ]))and for all i such that ( f, π ( η ( r )( v ))) = ( p, v ) = L i [2] we have (cid:77) j ∈ I y π i ( η ( r )( v [ j ])) = (cid:77) j ∈ I y π i ( r ( v [ j ])) . Therefore, η ( r ) belongs to R for all r ∈ R . Again, η is invertible and η − is defined onthe whole of R , so |R | = |R | . (cid:4) Claim 11. opt k ( A , B ) ≤ M ∗ .Proof. For every ( f, z ) ∈ tup( A k ) > and s : Set( z ) (cid:55)→ B k we define λ ( f, z , s ) = Pr h ∼ U (id( f B , z )) [ h = s ] , where U (id( f B , z )) is the uniform distribution on id( f B , z ). By Claim 9 the set id( f B , z ) cannotbe empty so λ is properly defined. Because λ ( f, z , s ) may only be nonzero if π ( s ( z )) = z and f A ( z ) = ∞ implies f B ( s ( z )) = c ∗ ( f, π ( s ( z ))) = c ∗ ( f, z ) = 0 for all such ( s, z ), λ satisfies thecondition (SA3) . By construction, λ satisfies the conditions (SA2) and (SA4) as well. Now,39et us compute the cost of λ : (cid:88) ( f, z ) ∈ tup( A k ) > , s :Set( z ) (cid:55)→ B k ,f A k ( z ) × f B k ( s ( z )) < ∞ λ ( f, z , s ) f A k ( z ) f B k ( s ( z ))= (cid:88) ( f, z ) ∈ tup( A k ) > , s ∈ id( f B , z ) λ ( f, z , s ) f A k ( z ) f B k ( s ( z ))= (cid:88) ( f, z ) ∈ tup( A ) > , s ∈ id( f B , z ) λ ( f, z , s ) f A ( z ) f B ( s ( z ))= (cid:88) ( f, z ) ∈ tup( A ) > , s ∈ id( f B , z ) λ ( f, z , s ) f A ( z ) c ∗ ( f, π ( s ( z )))= (cid:88) ( f, z ) ∈ tup( A ) > , s ∈ id( f B , z ) λ ( f, z , s ) f A ( z ) c ∗ ( f, z )= (cid:88) ( f, z ) ∈ tup( A ) > f A ( z ) c ∗ ( f, z )= M ∗ . At this point, to prove that λ is indeed a solution to SA k ( A , B ) of the desired cost we needonly show that it satisfies the condition (SA1) . Let ( g, w ) , ( f, v ) ∈ tup( A k ) > such thatSet( w ) ⊆ Set( v ) and (cid:107) w (cid:107) ≤ k . Then, for any assignment r to Set( w ) we havePr h ∼ U (id( f B , v )) (cid:2) h | Set( w ) = r (cid:3) = (cid:88) s :Set( v ) (cid:55)→ B,s | Set( w ) = r Pr h ∼ U (id( f B , v )) [ h = s ]= |{ s ∈ id( f B , v ) | s | Set( w ) = r }|| id( f B , v ) | . If r / ∈ id( g B , w ) this quantity is zero. Indeed, since (cid:107) w (cid:107) ≤ k < n , the only possibility is that π ( r ( w )) (cid:54) = w . In particular, there is no s ∈ id( f B , v ) with s | Set( w ) = r . If r ∈ id( g B , w ), thenby Claim 10, this quantity is independent of r . It follows that λ ( g, w , r ) = Pr s ∼ U (id( g B , w )) [ s = r ]= Pr h ∼ U (id( f B , v )) (cid:2) h | Set( w ) = r (cid:3) = (cid:88) s :Set( v ) (cid:55)→ B,s | Set( w ) = r Pr h ∼ U (id( f B , v )) [ h = s ]= (cid:88) s :Set( v ) (cid:55)→ B,s | Set( w ) = r λ ( f, v , s )and hence the condition (SA1) is satisfied. Therefore, λ is a feasible solution to SA k ( A , B ) ofcost M ∗ and the claim holds. (cid:4) The proof of Theorem 39 is now established by Claim 8 and Claim 11.
Theorem 40.
Let A be a valued σ -structure and let k ≥ . Let A (cid:48) be the core of A . If theoverlap of A (cid:48) is at least k + 1 , then the Sherali-Adams relaxation of level k is not always tightfor A . roof. We can apply Theorem 39 to A (cid:48) , and obtain B such that opt k ( A (cid:48) , B ) < opt( A (cid:48) , B ).Since A (cid:48) ≡ A , we know that opt( A , B ) = opt( A (cid:48) , B ) (by the definition of equivalence and cores)and opt k ( A , B ) = opt k ( A (cid:48) , B ) (by Proposition 28). Hence, opt k ( A , B ) < opt( A , B ), and theresult follows. C , − ) If a class C of valued structures has bounded treewidth modulo equivalence then the Sherali-Adams LP hierarchy can be used to solve in polynomial time VCSP( C , − ) , that is, to computethe minimum cost of a mapping from A ∈ C to some arbitrary valued structure B . However, itmay be the case that computing a mapping of that cost is NP-hard even though we know thatone exists. In this section we will focus on the search version of the VCSP , which explicitlyasks for a minimum-cost mapping and will be denoted by
SVCSP .If C is a class of valued structures, we denote by Core Computation( C ) the problemthat takes as input some A ∈ C , and asks to compute a mapping g : A (cid:55)→ A such that g ( A ) isthe core of A and there exists an inverse fractional homomorphism ω from A to A such that g ∈ supp( ω ).Building on our results from Section 5 and adapting techniques from [50], we will proveour third main result. Theorem 41 ( Search classification ) . Assume FPT (cid:54) = W[1]. Let C be a recursively enu-merable class of valued structures of bounded arity. Then, the following are equivalent:1. SVCSP( C , − ) is in PTIME.2. C is of bounded treewidth modulo equivalence and Core Computation( C ) is in PTIME. Remark 42.
Given a class C of relational structures, let SCSP( C , − ) denote the searchvariant of CSP( C , − ) ; i.e., given A and B with A ∈ C , the task is to return a homomorphismfrom A to B if one exists. When applied to (bounded-arity, recursively enumerable) classes ofrelational structures, Theorem 41 states that SCSP( C , − ) is in PTIME if and only if C hasbounded treewidth modulo homomorphic equivalence and computing a homomorphism fromany given A ∈ C to its core is in PTIME. This result is folklore and can be easily derivedfrom Grohe [32] and Dalmau, Kolaitis, and Vardi [15]. We provide here a brief sketch of theargument since our proof of Theorem 41 for classes of valued structures follows roughly thesame strategy, although the technical details are significantly more involved.First, observe that if a relational structure A (cid:48) has bounded treewidth, then computing ahomomorphism from A (cid:48) to any relational structure B (or concluding that none exists) is inPTIME; one can, for example, use dynamic programming along a tree decomposition of A (cid:48) . Itfollows that if a homomorphism h from A to its core A (cid:48) can be computed in polynomial timeand A (cid:48) has bounded treewidth, then a homomorphism from A to any relational structure B can be computed in polynomial time by composing h with a homomorphism from A (cid:48) to B .For the converse implication, if SCSP( C , − ) is in PTIME then, by Grohe’s result [32] (andunder our assumptions), C is of bounded treewidth modulo homomorphic equivalence. It onlyremains to prove that computing a homomorphism from A ∈ C to its core is in PTIME; forthis task we use a simple argument from [13]. Observe that A ∈ C is not a core if and onlyif there exists a relational structure A R , t obtained by removing one tuple t from a relation R A of A that is homomorphically equivalent to A . It follows that an algorithm that starts41ith the pair of structures ( A , A ) and greedily removes tuples from the second structurewhile maintaining homomorphic equivalence will eventually terminate with ( A , A (cid:48) ), where A (cid:48) is the core of A . Recall that A ∈ C and C has bounded treewidth modulo homomorphicequivalence. Thus the homomorphism tests required by the algorithm outlined above can bedone in polynomial time [15]. It then suffices to run the assumed algorithm for SCSP( C , − ) on the pair ( A , A (cid:48) ) to compute a homomorphism from A to its core.If C is a class of valued structures, the problem Reduction Step( C ) takes as input some A ∈ C and a mapping g : A (cid:55)→ A that belongs to the support of some inverse fractionalhomomorphism from A to A . The goal is to compute a mapping g + : A (cid:55)→ A such that g + ( A ) (cid:40) g ( A ) and g + belongs to the support of some inverse fractional homomorphismfrom A to A , or assert that no such mapping exist. The relevance of this problem to CoreComputation is highlighted by the following proposition.
Proposition 43.
Let A be a valued structure and g : A (cid:55)→ A be a mapping that belongs to thesupport of some inverse fractional homomorphism from A to A . Then, g ( A ) is not the core of A if and only if there exists a mapping g + : A (cid:55)→ A such that g + ( A ) (cid:40) g ( A ) and g + belongs tothe support of some inverse fractional homomorphism from A to A .Proof. If there exists such a mapping g + then by Proposition 12 we have A ≡ g ( A ) ≡ g + ( A ).Then, the cores of g ( A ) and g + ( A ) are equivalent and by Proposition 9 they are isomorphic.By Proposition 14 the universe of the core of g + ( A ) has size at most | g + ( A ) | < | g ( A ) | , so g ( A )is not a core.For the converse implication, suppose that g ( A ) is not a core. Let ω be an inverse fractionalhomomorphism from A to A such that g ∈ supp( ω ). By the definition of a core, there exists anon-surjective inverse fractional homomorphism from g ( A ) to g ( A ). Let g ∗ be a mapping in itssupport such that g ∗ ( g ( A )) (cid:40) g ( A ). By Proposition 12, we have A ≡ g ( A ) ≡ g ∗ ( g ( A )). Then,by Proposition 6 there exist an inverse fractional homomorphism ω from A to g ∗ ( g ( A )) andan inverse fractional homomorphism ω from g ∗ ( g ( A )) to A . Let g , g be arbitrary mappingsin the support of ω , ω , respectively. If we define ω + := ω ◦ ω ◦ ω , where ω + ( h ) = ( ω ◦ ω ◦ ω )( h ) = (cid:88) h : A (cid:55)→ g ∗ ( g ( A )) ,h : g ∗ ( g ( A )) (cid:55)→ A,h : A (cid:55)→ A : h ◦ h ◦ h = h ω ( h ) ω ( h ) ω ( h )then ω + is an inverse fractional homomorphism from A to A . Let g + := g ◦ g ◦ g . Because | g + ( A ) | ≤ | g ( A ) | ≤ | g ∗ ( g ( A )) | < | g ( A ) | , we have g + ( A ) (cid:40) g ( A ). Moreover, ω + ( g + ) ≥ ω ( g ) ω ( g ) ω ( g ) > g + belongs to the support of at least one inverse fractional homomorphism from A to A ,which concludes the proof. Lemma 44.
Let C be a class of valued structures. If Reduction Step( C ) is in PTIME,then Core Computation( C ) is in PTIME.Proof. Suppose that
Reduction Step( C ) is in PTIME, and let A ∈ C . We initialize avariable g : A (cid:55)→ A to the identity mapping on A and invoke the polynomial-time algorithmR for Reduction Step( C ) on input ( A , g ). If R asserts that no mapping g + : A (cid:55)→ A such42hat g + ( A ) (cid:40) g ( A ) and g + belongs to the support of some inverse fractional homomorphismfrom A to A exists, then from Proposition 43 we deduce that g ( A ) is a core and we are done.Otherwise, we set g := g + and repeat the procedure until R finds that g ( A ) is a core (viaProposition 43). In this case, by Proposition 12 it holds that g ( A ) ≡ A , so g ( A ) is the core of A and we return g . The procedure terminates after at most | A | calls to R.We start by proving the implication (1) ⇒ (2) of Theorem 41. If SVCSP( C , − ) is inPTIME, then, by Theorem 19 (and under the assumption that FPT (cid:54) = W[1]), C is of boundedtreewidth modulo equivalence; the nontrivial part is to show that Core Computation( C ) isin PTIME. To achieve this, we adapt an algorithm from [50, Proposition 4.7] originally usedto determine in polynomial time the complexity of core finite-valued constraint languages(here, “core” refers to the notion for right-hand side valued structures, which differs fromour own; see [50, Definition 2.6] for a precise definition). The central idea is to show that Reduction Step( C ) can be solved by the ellipsoid algorithm using a separation oracle thatmakes polynomially many calls to the assumed polynomial-time algorithm for SVCSP( C , − ) .Before we proceed with the main proof we need the following definitions and result fromcombinatorial optimisation, as well as two minor technical lemmas. Definition 45 ([33]) . Let A ∈ Q m × n , b ∈ Q m and P = { x ∈ Q n : Ax ≤ b } . A strongseparation oracle for P is an algorithm that, given on input a vector y ∈ Q n , either concludesthat y ∈ P or computes a vector a ∈ Q n such that a T y > a T x for all x ∈ P . Definition 46 ([33]) . Let A ∈ Q m × n , b ∈ Q m , P = { x ∈ Q n : Ax ≤ b } , c ∈ Q n and SEP be astrong separation oracle for P . A basic optimum dual solution with oracle inequalities is a setof inequalities a T x ≤ α , . . . , a Tk x ≤ α k valid for P , where a , . . . , a k are linearly independentoutputs of SEP, and dual variables λ , . . . , λ k ∈ Q ≥ such that λ a + . . . + λ k a k = c and λ α + . . . + λ k α k = max x ∈ P c T x . Lemma 47 ([33, Lemma 6.5.15]) . Let A ∈ Q m × n , b ∈ Q m , P = { x ∈ Q n : Ax ≤ b } and c ∈ Q n . Suppose that the bit sizes of the coefficients of A and b are bounded by φ . Given astrong separation oracle SEP for P where every output has encoding size at most φ , one can,in time polynomial in n , φ and the encoding size of c , and with polynomially many oraclequeries to SEP, either • find a basic optimum dual solution with oracle inequalities, or • assert that the dual problem is unbounded or has no solution. Lemma 48.
There exists a polynomially computable function ε ∆ which maps any two valued σ -structures A , B to a positive rational number ε ∆ ( A , B ) such that for any two mappings h , h : A (cid:55)→ B satisfying cost ( h ) < cost ( h ) < ∞ , we have cost ( h ) − cost ( h ) > ε ∆ ( A , B ) .Proof. First, recall that in our framework a nonnegative rational number p/q is encoded as asequence of two nonnegative integers p and q , which are themselves encoded using the unsignedbinary representation. It follows that given a positive integer n ≥
2, the smallest positiverational number with encoding size at most n is precisely f min ( n ) := 1 / (2 n − − φ be a polynomial such that for any two valued σ -structures A , B , the encoding size of the cost of any mapping A (cid:55)→ B is at most φ ( | A | + | B | ).Let also φ be a nondecreasing polynomial such that for all nonnegative rational numbers43 /q > p /q , the encoding size of p /q − p /q is at most φ ( | enc ( p /q ) | + | enc ( p /q ) | ).If we define ε ∆ ( A , B ) := 12 f min ( φ (2 · φ ( | A | + | B | )))then for any two valued σ -structures A , B and h , h : A (cid:55)→ B satisfying cost( h ) < cost( h ) < ∞ we have cost( h ) − cost( h ) ≥ f min ( | enc (cost( h ) − cost( h )) | ) ≥ f min ( φ ( | enc (cost( h )) | + | enc (cost( h )) | )) ≥ f min ( φ ( φ ( | A | + | B | ) + φ ( | A | + | B | ))) > / · f min ( φ (2 · φ ( | A | + | B | ))) = ε ∆ ( A , B )where the first inequality follows from the finiteness and positivity of cost( h ) − cost( h ), thesecond and third inequalities follow from the monotonicity of f min and φ , and the fourthfollows from the fact that f min is positive. The function ε ∆ ( A , B ) is polynomially computable,which concludes the proof. Lemma 49.
There exists a polynomially computable function ε Ω which maps any two valued σ -structures A , B to a positive rational number ε Ω ( A , B ) such that for any subset H S of B A ,the following statements are equivalent:(i) There exists an inverse fractional homomorphism ω from A to B such that (cid:80) h ∈H S ω ( h ) > .(ii) There exists an inverse fractional homomorphism ω from A to B such that (cid:80) h ∈H S ω ( h ) ≥ ε Ω ( A , B ) .Proof. Let φ be a nondecreasing polynomial such that every feasible linear program withencoding size n has an optimum value with encoding size at most φ ( n ). (Since linearprogramming is solvable in polynomial time, such a polynomial exists and depends on theencoding scheme chosen; for more details we refer the reader to [46].) Again, we let f min bethe polynomially computable function that maps each natural number n ≥ n . Let us define the set H < ∞ := { h ∈ B A : f B ( x ) < ∞ ⇒ f A ( h − ( x )) < ∞ , for all ( f, x ) ∈ tup( B ) } and observe that the statement (i) is true if and only if the linear programmax (cid:88) h ∈H S ∩H < ∞ ω ( h ) (cid:88) h ∈H < ∞ ω ( h ) f A ( h − ( x )) ≤ f B ( x ) ∀ ( f, x ) ∈ tup( B ) < ∞ (cid:88) h ∈H < ∞ ω ( h ) = 1 ω ( h ) ≥ ∀ h ∈ H < ∞ (9)44s feasible and its optimum value is positive. This program has polynomially many inequalities,hence if it is feasible then there exists an optimum solution ω ∗ such that supp( ω ∗ ) haspolynomial size. The restriction of the linear program (9) to the variables in supp( ω ∗ ) hasencoding size at most p ( | A | + | B | ) for some polynomial p , and has the same optimum value.Now, we define ε Ω ( A , B ) := f min ( φ ( p ( | A | + | B | )))and we observe that if the linear program (9) is feasible and its optimum value is positive,then it is at least ε Ω ( A , B ). This establishes the implication (i) ⇒ (ii) for the function ε Ω .The implication (ii) ⇒ (i) is trivial and given A , B the function ε Ω ( A , B ) is polynomiallycomputable, so the claim follows.The following lemma is the main technical part in establishing (1) ⇒ (2) in Theorem 41. Lemma 50.
Let C be a class of valued structures. If SVCSP( C , − ) is in PTIME then Reduction Step( C ) is in PTIME as well.Proof. Let ( A , g ) be an input to Reduction Step( C ) . We assume that | g ( A ) | >
1; otherwisethe problem is trivial. If A is { , ∞} -valued then we can solve the instance by following theargument described in Remark 42, so we also assume that max ( f, x ) ∈ tup( A ) < ∞ ( f A ( x )) >
0. Wedefine the set H < ∞ := { h ∈ A A : f A ( x ) < ∞ ⇒ f A ( h − ( x )) < ∞ , for all ( f, x ) ∈ tup( A ) } and we recall that for every inverse fractional homomorphism ω from A to A , every mapping g (cid:48) ∈ supp( ω ) belongs to H < ∞ . We denote by H ∗ the set of all mappings h in H < ∞ such that h ( A ) (cid:40) g ( A ). Let us consider the following linear program:min 0 (cid:88) h ∈H < ∞ ω ( h ) f A ( h − ( x )) ≤ f A ( x ) ∀ ( f, x ) ∈ tup( A ) < ∞ (cid:88) h ∈H < ∞ ω ( h ) = 1 (cid:88) h ∈H ∗ ω ( h ) ≥ ε Ω ( A , A ) ω ( h ) ≥ ∀ h ∈ H < ∞ (10)By Lemma 49, this program is not feasible if and only if g ( A ) is a core; otherwise a solutiongives a mapping g ∈ H ∗ with the desired property. This program has exponentially manyvariables, and hence we will solve its dual instead:max δ + ε Ω ( A , A ) δ (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + δ ≤ ∀ h ∈ H < ∞ \H ∗ (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + δ + δ ≤ ∀ h ∈ H ∗ z ( f, x ) ≥ ∀ ( f, x ) ∈ tup( A ) < ∞ δ ≥ P . Given avector ( z, δ , δ ) ∈ Q | tup( A ) < ∞ | × Q , we first check if there exists ( f ∗ , x ∗ ) ∈ tup( A ) < ∞ suchthat z ( f ∗ , x ∗ ) <
0; if it is the case then a ( f ∗ , x ∗ ) = − δ < a ( δ ) = − B be a valued σ -structure with universe B = A such that for all ( f, x ) ∈ tup( B ), f B ( x ) = z ( f, x ) if ( f, x ) ∈ tup( A ) < ∞ and f B ( x ) = 0 otherwise. We will be interested incomputing a mapping h ∈ B A ∩ H < ∞ with minimum cost. However, invoking the assumedalgorithm for SVCSP( C , − ) on the instance ( A , B ) is not sufficient for this task because thereturned mapping might not belong to H < ∞ . In order to solve this problem, we define ε := ε ∆ ( A , B ) | tup( A ) | · max ( f, x ) ∈ tup( A ) < ∞ ( f A ( x ))where the function ε ∆ is as in Lemma 48, and we let B be the valued σ -structure withuniverse B = A such that for all ( f, x ) ∈ tup( B ), f B ( x ) = z ( f, x ) + ε if ( f, x ) ∈ tup( A ) < ∞ and f B ( x ) = 0 otherwise. Because ε >
0, the set of finite-cost mappings A (cid:55)→ B is precisely H < ∞ and cannot be empty because of the identity mapping. Since ( A , B ) is an instance of SVCSP( C , − ) , we can find a mapping h ∗ from A to B of minimum cost in polynomial time.Then, we have h ∗ ∈ argmin h ∈ B A (cid:88) ( f, x ) ∈ tup( B ) f B ( x ) f A ( h − ( x )) = argmin h ∈H < ∞ (cid:88) ( f, x ) ∈ tup( B ) f B ( x ) f A ( h − ( x )) = argmin h ∈H < ∞ (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) + ε (cid:88) ( f, x ) ∈ tup( A ) < ∞ f A ( h − ( x )) . Recall that we are looking for a mapping in B A ∩ H < ∞ with minimum cost with respectto the instance ( A , B ). The mapping h ∗ we have just computed realises the minimum of aslightly different objective function, but the next claim shows that this is not an issue. Claim 12.
Let H S be a non-empty subset of H < ∞ and h (cid:48) ∈ H S . If h (cid:48) ∈ argmin h ∈H S (cid:88) ( f, x ) ∈ tup ( A ) < ∞ z ( f, x ) f A ( h − ( x )) + ε (cid:88) ( f, x ) ∈ tup ( A ) < ∞ f A ( h − ( x )) then h (cid:48) ∈ argmin h ∈H S (cid:88) ( f, x ) ∈ tup ( A ) < ∞ z ( f, x ) f A ( h − ( x )) . Proof.
We prove the statement by contraposition. Let h (cid:48) ∈ H S and suppose that there exists h ∈ H S such that (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) < (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h (cid:48)− ( x )) . h and h (cid:48) with respect to the instance( A , B ), and both are finite. By Lemma 48 we have (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) + ε ∆ ( A , B ) < (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h (cid:48)− ( x ))and since (cid:80) ( f, x ) ∈ tup( A ) < ∞ f A ( h − ( x )) | tup( A ) | · max ( f, x ) ∈ tup( A ) < ∞ ( f A ( x )) ≤ ε that (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) + ε (cid:88) ( f, x ) ∈ tup( A ) < ∞ f A ( h − ( x )) is strictly smaller than (cid:80) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h (cid:48)− ( x )), and a fortiori strictly smaller than (cid:80) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h (cid:48)− ( x )) + ε (cid:16)(cid:80) ( f, x ) ∈ tup( A ) < ∞ f A ( h (cid:48)− ( x )) (cid:17) , which concludes theproof. (cid:4) As a consequence of Claim 12 (with H S = H < ∞ ) we have that h ∗ realises the maximum ofthe function ζ ( h ) = (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + δ over H < ∞ . If this maximum is positive, then the vector a such that a ( f, x ) = f A ( x ) − f A ( h ∗− ( x )), a ( δ ) = 1 and a ( δ ) = 0 defines a separating hyperplane (this is true even if h ∗ ∈ H ∗ because δ is nonnegative). In this case we output a together with the mapping h ∗ .(Note that a separation oracle is supposed to only output the vector a , but later on we will needto know to which mapping it corresponds.) Otherwise, only two possibilities remain: either( z, δ , δ ) ∈ P , or the maximum of (cid:80) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:0) f A ( x ) − f A ( h − ( x )) (cid:1) + δ + δ over H ∗ is positive.To verify the latter condition, for every a ∈ g ( A ) we construct a valued σ -structure B a with universe B a = g ( A ) \{ a } such that for all ( f, x ) ∈ tup( B a ), f B a ( x ) = z ( f, x ) + ε if( f, x ) ∈ tup( A ) < ∞ and f B a ( x ) = 0 otherwise. Then, for each a ∈ g ( A ) we use the algorithmfor SVCSP( C , − ) to compute in polynomial time a minimum-cost mapping h ∗ a for the instance( A , B a ). If the cost of h ∗ a is infinite for each a ∈ g ( A ) then H ∗ is empty; it follows that g ( A ) isa core and we can stop. Otherwise, for each a ∈ g ( A ) such that the cost of h ∗ a is finite we have h ∗ a ∈ argmin h ∈ B Aa (cid:88) ( f, x ) ∈ tup( B a ) f B a ( x ) f A ( h − ( x )) = argmin h ∈H < ∞ : h ( A ) ⊆ g ( A ) \{ a } (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) + ε (cid:88) ( f, x ) ∈ tup( A ) < ∞ f A ( h − ( x )) and by Claim 12, h ∗ a ∈ argmin h ∈H < ∞ : h ( A ) ⊆ g ( A ) \{ a } (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) . h ∗∗ ∈ argmin h ∗ a : a ∈ g ( A ) (cid:16)(cid:80) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) (cid:17) then we have h ∗∗ ∈ argmin h ∈H < ∞ : h ( A ) ⊂ g ( A ) (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( h − ( x )) and either (cid:80) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:0) f A ( x ) − f A ( h ∗∗− ( x )) (cid:1) + δ + δ > a suchthat a ( f, x ) = f A ( x ) − f A ( h ∗∗− ( x )), a ( δ ) = 1 and a ( δ ) = 1 defines a separating hyperplane(which we output together with the mapping h ∗∗ ) or ( z, δ , δ ) ∈ P . This concludes thedescription of our strong separation oracle.We now apply Lemma 47 to the linear program (11). Its dual (10) is bounded, and if theellipsoid algorithm returns that it is not feasible then g ( A ) is a core. Otherwise, the algorithmwill return a set of polynomially many valid inequalities of the form (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + δ ≤ α (cid:48) h ∀ h ∈ H (cid:48) ⊆ ( H < ∞ \H ∗ ) (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + δ + δ ≤ α (cid:48)(cid:48) h ∀ h ∈ H (cid:48)(cid:48) ⊆ H ∗ − z ( f, x ) ≤ α f, x ∀ ( f, x ) ∈ T ⊆ tup( A ) < ∞ − δ ≤ α where each mapping h appearing in the inequalities is explicitly known (because we modifiedthe output of the strong separation oracle), and dual variables that satisfy (cid:88) h ∈H (cid:48) λ (cid:48) h (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) + (cid:88) h ∈H (cid:48)(cid:48) λ (cid:48)(cid:48) h (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) − λ f, x = 0 ∀ ( f, x ) ∈ tup( A ) < ∞ (cid:88) h ∈H (cid:48) λ (cid:48) h + (cid:88) h ∈H (cid:48)(cid:48) λ (cid:48)(cid:48) h = 1 (cid:88) h ∈H (cid:48)(cid:48) λ (cid:48)(cid:48) h − λ = ε Ω ( A , A )where we set λ f, x := 0 if ( f, x ) / ∈ T . Now, we define ω ( h ) := λ (cid:48) h if h ∈ H (cid:48) λ (cid:48)(cid:48) h if h ∈ H (cid:48)(cid:48) (cid:88) h ∈H < ∞ ω ( h ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) − λ f, x = 0 ∀ ( f, x ) ∈ tup( A ) < ∞ (12) (cid:88) h ∈H < ∞ ω ( h ) = 1 (13) (cid:88) h ∈H ∗ ω ( h ) ≥ ε Ω ( A , A ) > f, x ) ∈ tup( A ) < ∞ , (cid:88) h ∈H < ∞ ω ( h ) f A ( h − ( x )) ≤ f A ( x )and hence ω (complemented with ω ( h ) = 0 for all h / ∈ H < ∞ ) is an inverse fractional homo-morphism with a support of polynomial size. Finally, we search supp( ω ) for a mapping g + such that g + ( A ) (cid:40) g ( A ), which is guaranteed to exist by the definition of ω and (14).The next lemma is the last missing ingredient in the proof of Theorem 41. Lemma 51.
Let k ≥ and C be a class of valued σ -structures such that for every A ∈ C , tw ms ( A ) ≤ k − and the overlap of A is at most k . Then, SVCSP( C , − ) is in PTIME.Proof. Let ( A , B ) be an instance of SVCSP such that tw ms ( A ) ≤ k − A isat most k ( A does not necessarily belong to C ). Suppose that opt( A , B ) is finite. Let A I ⊆ A and suppose that there exists a known mapping g : A I (cid:55)→ B such that for all h : A (cid:55)→ B ofcost opt( A , B ), h | A I = g . If A I (cid:54) = A , we show how to produce in polynomial time an instance( A (cid:48) , B (cid:48) ) and a mapping g (cid:48) such that(i) A (cid:48) = A , B (cid:48) = B ;(ii) tw ms ( A (cid:48) ) ≤ k − A (cid:48) is at most k ;(iii) every minimum-cost mapping for ( A (cid:48) , B (cid:48) ) is also a minimum-cost mapping for ( A , B );(iv) there exists A + I ⊆ A (cid:48) , A I (cid:40) A + I , such that for all h : A (cid:48) (cid:55)→ B (cid:48) of cost opt( A (cid:48) , B (cid:48) ), h | A + I = g (cid:48) .Let a ∈ A \ A I . For every b ∈ B we construct a new SVCSP instance ( A a , B b ) over σ a = σ ∪ f a ,where f a is unary and A a = A , B b = B . The structures A a , B b are such that • f A a a ( x ) = ∞ if x = ( a ) and 0 otherwise; • f B b a ( x ) = 0 if x = ( b ) and ∞ otherwise; • f A a ( x ) = f A ( x ), f B b ( z ) = f B ( z ) for all f ∈ σ with ( f, x ) ∈ tup( A a ), ( f, z ) ∈ tup( B b ).Let b ∈ B be such that opt k ( A , B ) = opt k ( A a , B b ). We know that such a value b exists: byTheorem 33, opt( A , B ) = opt k ( A , B ) and hence we can take b = h ( a ) for some minimum-costmapping h from A to B . Then, if we take A (cid:48) = A a and B (cid:48) = B b the properties (i), (ii) and(iii) immediately hold. By property (iii) we also have h | A I = g for all h : A (cid:48) (cid:55)→ B (cid:48) of costopt( A (cid:48) , B (cid:48) ). Furthermore, by the definition of f a and because opt( A (cid:48) , B (cid:48) ) = opt( A , B ) is finite,for all h : A (cid:48) (cid:55)→ B (cid:48) of cost opt( A (cid:48) , B (cid:48) ) it holds that h ( a ) = b . Property (iv) therefore holds for A + I := A I ∪ { a } and g (cid:48) such that g (cid:48) | A I = g and g ( a ) = b . Note that the computation of A (cid:48) , B (cid:48) and g (cid:48) can be done in polynomial time given A , B and g . The lemma then follows by startingfrom ( A , B ) with A ∈ C , verifying that opt( A , B ) < ∞ (otherwise we can output any mappingfrom A to B ), setting A I = ∅ and repeating the construction until A I = A , at which point weoutput the mapping g . 49 roof of Theorem 41. If (1) holds, then, by Theorem 19, C has bounded treewidth moduloequivalence. Furthermore, by Lemma 50, Reduction Step( C ) is in PTIME and, by Lemma 44, Core Computation( C ) is in PTIME as well. For the converse implication, assume that (2)holds and let ( A , B ) be an instance of SVCSP( C , − ) . Let k denote the maximum treewidthof the core of a structure in C . We compute in polynomial time the core A (cid:48) of A and theassociated mapping g : A (cid:55)→ A (cid:48) . Because tw ( A (cid:48) ) ≤ k implies both tw ms ( A (cid:48) ) ≤ k and an upperbound of k + 1 for the overlap of A (cid:48) , we can use Lemma 51 to compute in polynomial timea minimum-cost solution h : A (cid:48) (cid:55)→ B to ( A (cid:48) , B ). By Proposition 10, h ◦ g is a minimum-costmapping from A to B and the claim follows. In this section we provide a quick overview of the complexity of deciding the various naturalquestions on valued structures that arise from our characterisations. We also highlight someinteresting implications of our results in the context of database theory.We establish tight complexity bounds for the following problems. We note that whilehardness mostly follows directly from existing results on relational structures, the technicalmachinery of Section 3 is required in order to derive precise upper bounds. • Improvement : given two valued structures A , B , is it true that A (cid:22) B ? • Equivalence : given two valued structures A , B , is it true that A ≡ B ? • Core Recognition : given a valued structure A , is A a core? • Core Treewidth : given a valued structure A and k ≥
1, is the treewidth of the coreof A at most k ? • Sherali-Adams Tightness : given a valued structure A and k ≥
1, is the Sherali-Adamsrelaxation of level k always tight for A ? Proposition 52.
Improvement and
Equivalence are NP-complete.Proof.
We first prove that
Improvement is in NP, which implies that
Equivalence isin NP as well. By Proposition 6, an instance ( A , B ) of Improvement is a yes-instance ifand only if there exists an inverse fractional homomorphism from A to B , or equivalently if G < ∞ := { g ∈ B A | f A ( g − ( x )) < ∞ for all ( f, x ) ∈ tup( B ) < ∞ } (where tup( B ) < ∞ := { ( f, x ) ∈ tup( B ) | f B ( x ) < ∞} ) is not empty and the system (cid:88) g ∈G < ∞ ω ( g ) f A ( g − ( x )) ≤ f B ( x ) ∀ ( f, x ) ∈ tup( B ) < ∞ (cid:88) g ∈G < ∞ ω ( g ) ≤ − (cid:88) g ∈G < ∞ ω ( g ) ≤ − − ω ( g ) ≤ ∀ g ∈ G < ∞ ω . Since the number of inequalities is polynomial in | A | and | B | , thissystem has a solution if and only if it has one with a polynomial number of non-zero variables.Such a subset of non-zero variables is an NP certificate: the corresponding restriction of thesystem has polynomial size and its satisfiability can be checked in polynomial time.For hardness, we note that in the special case of { , ∞} -valued structures (that is, relationalstructures) the Improvement and
Equivalence problems correspond respectively to
Homo-morphism and
Homomorphic Equivalence , which are well-known to be NP-complete evenin the bounded arity case [12].
Proposition 53.
Core Recognition is coNP-complete.Proof.
We start by establishing membership in coNP. Let ( A ) be an instance of CoreRecognition . By the definition of a core, ( A ) is a no-instance if and only if there exists anon-surjective inverse fractional homomorphism from A to A . This is true if and only if theoptimum of the linear programmin − (cid:88) g ∈G ∗ ω ( g ) (cid:88) g ∈G < ∞ ω ( g ) f A ( g − ( x )) ≤ f A ( x ) ∀ ( f, x ) ∈ tup( A ) < ∞ (cid:88) g ∈G < ∞ ω ( g ) ≤ − (cid:88) g ∈G < ∞ ω ( g ) ≤ − − ω ( g ) ≤ ∀ g ∈ G < ∞ is strictly negative, where tup( A ) < ∞ := { ( f, x ) ∈ tup( A ) | f A ( x ) < ∞} , G < ∞ := { g ∈ A A | f A ( g − ( x )) < ∞ for all ( f, x ) ∈ tup( A ) < ∞ } and G ∗ is the restriction of G < ∞ to non-surjectivemappings. Again, the number of inequalities in this system is polynomial in | A | so there existsa solution of minimum cost with a polynomial number of non-zero variables. Such a subset ofvariables is a coNP certificate.On { , ∞} -valued structures with a single binary symmetric function symbol, CoreRecognition coincides with the problem of deciding if a graph is a core in the usual sense(that is, the problem of deciding if all of its endomorphisms are surjective). This problem iscoNP-complete [34], so
Core Recognition is coNP-complete as well.
Proposition 54.
Core Treewidth is NP-complete even for fixed k ≥ , and Sherali-Adams Tightness is NP-complete even for fixed k ≥ .Proof. First, we prove that these problems belong to NP when k is part of the input. For CoreTreewidth , the certificate for a yes-instance ( A , k ) is a valued structure B , a polynomially-sized certificate that B ≡ A (which exists because Equivalence is in NP by Proposition 52) anda tree decomposition of G (Pos( B )) of width at most k . Correctness follows from Proposition 18.For Sherali-Adams Tightness , the certificate for a yes-instance ( A , k ) is a valued structure B whose overlap is at most k , a polynomially-sized certificate that B ≡ A and a tree decompositionof G (Pos( B )) of width modulo scopes at most k −
1. For correctness, by Theorem 29 it issufficient to prove that this certificate exists if and only if the core A (cid:48) of A has treewidth51odulo scopes at most k − k . One implication is immediate: if A (cid:48) has treewidth modulo scopes at most k − k then we can take B := A (cid:48) .For the converse implication, if this certificate exists then by Theorem 33 the Sherali-Adamsrelaxation of level k is always tight for B . Then, by Theorem 29 the core B (cid:48) of B has treewidthmodulo scopes at most k − k . Furthermore, A ≡ B so by Proposition 9 A (cid:48) and B (cid:48) are isomorphic, and finally A (cid:48) has treewidth modulo scopes at most k − k .As before, we derive hardness from the { , ∞} -valued case. Determining whether a graphhas a core of treewidth at most k is NP-complete for all fixed k ≥ Core Treewidth is NP-complete even for fixed k ≥ k ≥ Sherali-Adams Tightness is equivalent to
Core Treewidth with k (cid:48) = k −
1, and hence it is NP-complete. For the case k = 1 and arity at most 2 (i.e.,for directed graphs), Sherali-Adams Tightness is equivalent to deciding whether the coreof a directed graph is a disjoint union of oriented trees , i.e., simple directed graphs whoseunderlying undirected graphs are trees. It follows from the proof of [15, Theorem 13] that thisproblem is NP-complete.
It is well-known that the evaluation/containment problem for conjunctive queries (CQs) (i.e.,first-order queries using only conjunction and existential quantification) is equivalent to thehomomorphism problem, and hence equivalent to CSPs [12, 37]. This observation has beenfundamental in providing principled techniques for the static analysis and optimisation of CQs.Indeed, in their seminal work [12], Chandra and Merlin exploited this connection to showthat the containment and equivalence problem for CQs are NP-complete. They also providedtools for minimising CQs with strong theoretical guarantees. In terms of homomorphisms,minimising a CQ corresponds essentially to computing the (relational) core of a relationalstructure.The situation is less clear in the context of annotated databases [31]. In this framework,the tuples of the database are annotated with values from a particular semiring K , and thesemantics of a CQ is a value from K . For instance, the Boolean semiring ( { , } , ∨ , ∧ , , N , + , × , ,
1) correspondsto the so-called bag semantics of CQs. Another semiring considered in the literature isthe tropical semiring ( Q ≥ , min , + , ∞ , minimum-cost semantics [31].Unfortunately, the homomorphism machinery cannot be applied directly to the study ofcontainment and equivalence in the semiring setting. While there are some works in thisdirection (see, e.g. [40, 30]), several basic problems remain open. In particular, the precisecomplexity of containment/equivalence of CQs over the tropical semiring is open (it wasshown in [40] to be NP-hard and in Π p , the second level of the polynomial-time hierarchy).Our first observation is that these two problems are actually NP-complete. Indeed, it iswell known that VCSP is equivalent to CQ evaluation over the tropical semiring. Moreover,containment and equivalence of CQs over the tropical semiring correspond to improvementand (valued) equivalence of valued structures. By applying Proposition 52, we directly obtainNP-completeness of these problems.Our second observation is that our notion of (valued) core provides a notion of minimisationof CQs over the tropical semiring with theoretical guarantees. Indeed, as the followingproposition shows, the core of a valued structure is always an equivalent valued structure with52inimal number of elements, or in terms of CQs, with minimal number of variables. Proposition 55.
Let A and B be valued σ -structures. Then the following are equivalent:1. B is the core of A .2. B is a minimal (with respect to the size of the universe) valued structure equivalent to A .Proof. For (1) ⇒ (2), suppose that B is the core of A . By contradiction, assume that (2) isfalse, i.e., there is a valued σ -structure B (cid:48) such that | B (cid:48) | < | B | and B (cid:48) ≡ A . In particular, B (cid:48) ≡ B and then by Proposition 9 the core B (cid:48)(cid:48) of B (cid:48) is isomorphic to B . By Proposition 14, wehave that | B (cid:48)(cid:48) | ≤ | B (cid:48) | < | B | ; a contradiction. For (2) ⇒ (1), suppose by contradiction that B is not the core of A . Since B ≡ A by hypothesis, the only possibility is that B is not acore. Hence, there is an inverse fractional homomorphism ω and a non-surjective mapping g : B (cid:55)→ B such that g ∈ supp( ω ). By Proposition 12, g ( B ) ≡ B ≡ A . Since | g ( B ) | < | B | , thisis a contradiction.Note that Proposition 14 also gives an algorithm to compute the core of a CQ over thetropical semiring. (In fact, a PSPACE algorithm.) Finally, it is worth mentioning that ourclassification result from Theorem 19 can be interpreted as a characterisation of the classes ofCQs over the tropical semiring that can be evaluated in PTIME. References [1] Albert Atserias, Andrei A. Bulatov, and V´ıctor Dalmau. On the Power of k -Consistency.In Proceedings of the 34th International Colloquium on Automata, Languages and Pro-gramming (ICALP’07) , volume 4596 of
Lecture Notes in Computer Science , pages 279–290.Springer, 2007.[2] Libor Barto and Marcin Kozik. Constraint Satisfaction Problems Solvable by LocalConsistency Methods.
Journal of the ACM , 61(1), 2014. Article No. 3.[3] Libor Barto, Marcin Kozik, and Todd Niven. The CSP dichotomy holds for digraphswith no sources and no sinks (a positive answer to a conjecture of Bang-Jensen and Hell).
SIAM Journal on Computing , 38(5):1782–1802, 2009.[4] Umberto Bertel´e and Francesco Brioschi.
Nonserial dynamic programming . AcademicPress, 1972.[5] Daniel Bienstock and Nuri ¨Ozbay. Tree-width and the Sherali-Adams operator.
DiscreteOptimization , 1(1):13–21, 2004.[6] Andrei Bulatov. A dichotomy theorem for constraint satisfaction problems on a 3-elementset.
Journal of the ACM , 53(1):66–120, 2006.[7] Andrei Bulatov. A dichotomy theorem for nonuniform CSPs. In
Proceedings of the58th Annual IEEE Symposium on Foundations of Computer Science (FOCS’17) , pages319–330. IEEE, 2017.[8] Andrei Bulatov, V´ıctor Dalmau, Martin Grohe, and Daniel Marx. Enumerating homo-morphisms.
Journal of Computer and System Sciences , 78(2):638–650, 2012.539] Andrei Bulatov, Peter Jeavons, and Andrei Krokhin. Classifying the Complexity ofConstraints using Finite Algebras.
SIAM Journal on Computing , 34(3):720–742, 2005.[10] Andrei A. Bulatov. Complexity of conservative constraint satisfaction problems.
ACMTransactions on Computational Logic , 12(4), 2011. Article 24.[11] Cl´ement Carbonnel, Miguel Romero, and Stanislav ˇZivn´y. The complexity of general-valued CSPs seen from the other side. In
Proceedings of the 59th Annual IEEE Symposiumon Foundations of Computer Science (FOCS’18) . IEEE, 2018.[12] Ashok K. Chandra and Philip M. Merlin. Optimal implementation of conjunctive queriesin relational data bases. In
Proceedings of the 9th Annual ACM Symposium on Theory ofComputing (STOC’77) , pages 77–90. ACM, 1977.[13] Hubie Chen and Stefan Mengel. A trichotomy in the complexity of counting answers toconjunctive queries. In
Proceedings of the 18th International Conference on DatabaseTheory (ICDT’15) , pages 110–126, 2015.[14] David A. Cohen, Martin C. Cooper, Peter G. Jeavons, and Andrei A. Krokhin. TheComplexity of Soft Constraint Satisfaction.
Artificial Intelligence , 170(11):983–1016,2006.[15] V´ıctor Dalmau, Phokion G. Kolaitis, and Moshe Y. Vardi. Constraint Satisfaction,Bounded Treewidth, and Finite-Variable Logics. In
Proceedings of the 8th InternationalConference on Principles and Practice of Constraint Programming (CP’02) , volume 2470of
Lecture Notes in Computer Science , pages 310–326. Springer, 2002.[16] Rina Dechter.
Constraint Processing . Morgan Kaufmann, 2003.[17] Reinhard Diestel.
Graph Theory . Springer, fourth edition, 2010.[18] Rodney G. Downey and Michael R. Fellows. Fixed-Parameter Tractability and Com-pleteness I: Basic Results.
SIAM Journal on Computing Computing , 24(4):873–921,1995.[19] Rodney G. Downey and Michael R. Fellows. Fixed-parameter tractability and completenessII: On completeness for W[1].
Theoretical Computer Science , 141(1–2):109–131, 1995.[20] Tommy F¨arnqvist. Constraint optimization problems and bounded tree-width revisited.In
Proceedings of the 9th International Conference on Integration of Artificial Intelligenceand Operations Research Techniques in Constraint Programming (CPAIOR’12) , volume7298 of
Lecture Notes in Computer Science , pages 163–197. Springer, 2012.[21] Tommy F¨arnqvist.
Exploiting Structure in CSP-related Problems . PhD thesis, Departmentof Computer Science and Information Science, Link¨oping University, 2013.[22] Tommy F¨arnqvist and Peter Jonsson. Bounded tree-width and CSP-related problems.In
Proceedings of the 18th International Symposium on Algorithms and Computation(ISAAC) , volume 4835 of
Lecture Notes in Computer Science , pages 632–643. Springer,2007. 5423] Tom´as Feder and Moshe Y. Vardi. The Computational Structure of Monotone MonadicSNP and Constraint Satisfaction: A Study through Datalog and Group Theory.
SIAMJournal on Computing , 28(1):57–104, 1998.[24] J¨org Flum and Martin Grohe.
Parameterized complexity theory . Springer, 2006.[25] Eugene C. Freuder. A Sufficient Condition for Backtrack-free Search.
Journal of theACM , 29(1):24–32, 1982.[26] Eugene C. Freuder. Complexity of K-Tree Structured Constraint Satisfaction Problems.In
Proceedings of the 8th National Conference on Artificial Intelligence (AAAI’90) , pages4–9, 1990.[27] David Gale.
The Theory of Linear Economic Models . McGraw-Hill, 1960.[28] Georg Gottlob, Gianluigi Greco, Nicola Leone, and Francesco Scarcello. Hypertreedecompositions: Questions and answers. In
Proceedings of the 35th SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’16) , pages 57–74, 2016.[29] Georg Gottlob, Gianluigi Greco, and Francesco Scarcello. Tractable Optimization Prob-lems through Hypergraph-Based Structural Restrictions. In
Proceedings of the 36thInternational Colloquium on Automata, Languages and Programming (ICALP’09), PartII , volume 5556 of
Lecture Notes in Computer Science , pages 16–30. Springer, 2009.[30] Todd J. Green. Containment of conjunctive queries on annotated relations.
Theory ofComputing Systems , 49(2):429–459, 2011.[31] Todd J. Green and Val Tannen. The semiring framework for database provenance. In
Proceedings of the 36th SIGACT-SIGMOD-SIGART Symposium on Principles of DatabaseSystems (PODS’17) , pages 93–99, 2017.[32] Martin Grohe. The complexity of homomorphism and constraint satisfaction problemsseen from the other side.
Journal of the ACM , 54(1):1–24, 2007.[33] Martin Gr¨otschel, L´aszl´o Lov´asz, and Alexander Schrijver.
Geometric Algorithms andCombinatorial Optimization , volume 2 of
Algorithms and Combinatorics series . Springer,1988.[34] Pavol Hell and Jaroslav Neˇsetˇril. The core of a graph.
Discrete Mathematics , 109(1):117 –126, 1992.[35] Pavol Hell and Jaroslav Neˇsetˇril.
Graphs and Homomorphisms . Oxford University Press,2004.[36] Pawel M. Idziak, Petar Markovic, Ralph McKenzie, Matthew Valeriote, and Ross Willard.Tractability and learnability arising from algebras with few subpowers.
SIAM Journal onComputing , 39(7):3023–3037, 2010.[37] Phokion G. Kolaitis and Moshe Y. Vardi. Conjunctive-query containment and constraintsatisfaction. In
Proceedings of the 17th SIGACT-SIGMOD-SIGART Symposium onPrinciples of Database Systems (PODS’98) , pages 205–213, 1998.5538] Petr Kolman and Martin Kouteck´y. Extended formulation for CSP that is compact forinstances of bounded treewidth.
Electr. J. Comb. , 22(4):P4.30, 2015.[39] Vladimir Kolmogorov, Andrei A. Krokhin, and Michal Rol´ınek. The complexity ofgeneral-valued CSPs.
SIAM Journal on Computing , 46(3):1087–1110, 2017.[40] Egor V. Kostylev, Juan L. Reutter, and Andr´as Z. Salamon. Classification of annotationsemirings over containment of conjunctive queries.
ACM Trans. Database Syst. , 39(1):1:1–1:39, 2014.[41] Marcin Kozik and Joanna Ochremiak. Algebraic properties of valued constraint satisfactionproblem. In
Proceedings of the 42nd International Colloquium on Automata, Languagesand Programming (ICALP’15) , volume 9134 of
Lecture Notes in Computer Science , pages846–858. Springer, 2015.[42] D´aniel Marx. Tractable hypergraph properties for constraint satisfaction and conjunctivequeries.
Journal of the ACM , 60(6), 2013. Article No. 42.[43] Ugo Montanari. Networks of Constraints: Fundamental properties and applications topicture processing.
Information Sciences , 7:95–132, 1974.[44] Neil Robertson and Paul D. Seymour. Graph minors. III. Planar tree-width.
Journal ofCombinatorial Theory, Series B , 36(1):49–64, 1984.[45] Neil Robertson and Paul D. Seymour. Graph minors. V. Excluding a planar graph.
Journal of Combinatorial Theory, Series B , 41(1):92–114, 1986.[46] Alexander Schrijver.
Theory of linear and integer programming . John Wiley & Sons, Inc.,1986.[47] Paul D. Seymour and Robin Thomas. Graph searching and a min-max theorem fortree-width.
Journal of Combinatorial Theory, Series B , 58(1):22–33, 1993.[48] Hanif D. Sherali and Warren P. Adams. A hierarchy of relaxations between the continuousand convex hull representations for zero-one programming problems.
SIAM Journal ofDiscrete Mathematics , 3(3):411–430, 1990.[49] Johan Thapper and Stanislav ˇZivn´y. The power of linear programming for valued CSPs.In
Proceedings of the 53rd Annual IEEE Symposium on Foundations of Computer Science(FOCS’12) , pages 669–678. IEEE, 2012.[50] Johan Thapper and Stanislav ˇZivn´y. The complexity of finite-valued CSPs.
Journal ofthe ACM , 63(4), 2016. Article No. 37.[51] Johan Thapper and Stanislav ˇZivn´y. The power of Sherali-Adams relaxations for general-valued CSPs.
SIAM Journal on Computing , 46(4):1241–1279, 2017.[52] Dmitriy Zhuk. A proof of CSP dichotomy conjecture. In
Proceedings of the 58th AnnualIEEE Symposium on Foundations of Computer Science (FOCS’17) , pages 331–342. IEEE,2017. 56
Missing Proofs from Section 3
A.1 Proof of Proposition 6
We prove the following.
Proposition.
Let A , B be valued σ -structures. Then, A (cid:22) B if and only if there exists aninverse fractional homomorphism from A to B . We start by showing a useful characterisation of the notion of improvement.
Proposition 56.
Let A , B be valued σ -structures. Then, A (cid:22) B if and only if for all mappings c : tup ( B ) (cid:55)→ Q ≥ there exists a mapping h : A (cid:55)→ B such that (cid:88) ( f, x ) ∈ tup ( B ) c ( f, x ) f B ( x ) ≥ (cid:88) ( f, x ) ∈ tup ( A ) c ( f, h ( x )) f A ( x ) Proof.
We first prove the forward implication. Suppose A (cid:22) B , i.e., opt( A , C ) ≤ opt( B , C ) forall valued σ -structures C , and let c : tup( B ) (cid:55)→ Q ≥ be an arbitrary mapping. We define avalued σ -structure B c over the same universe B of B by letting f B c ( x ) = c ( f, x ) for each f ∈ σ and x ∈ B ar( f ) . Let h ∗ be a mapping from A to B c such that cost( h ∗ ) = opt( A , B c ). Then,using the identity mapping from B to B c and our hypothesis, we have (cid:88) ( f, x ) ∈ tup( B ) c ( f, x ) f B ( x ) ≥ opt( B , B c ) ≥ opt( A , B c ) = (cid:88) ( f, x ) ∈ tup( A ) c ( f, h ∗ ( x )) f A ( x )and the claim follows by setting h = h ∗ . For the converse implication, let C be an arbitraryvalued σ -structure. If there is no finite-cost mapping from B to C then opt( A , C ) ≤ opt( B , C )holds, so let us assume that the minimum-cost mapping g from B to C has finite cost. Let c : tup( B ) (cid:55)→ Q ≥ be such that c ( f, x ) = (cid:40) f C ( g ( x )) if ( f, x ) ∈ tup( B ) > B , C ) /δ otherwisewhere δ = min { f A ( x ) | ( f, x ) ∈ tup( A ) > } . (we are assuming tup( A ) > (cid:54) = ∅ , otherwise theclaim is trivial. Also, as δ could be ∞ , we adopt the convention c/ ∞ = 0, for all c ∈ Q ≥ .)By hypothesis, there exists a mapping h : A (cid:55)→ B such that (cid:88) ( f, x ) ∈ tup( B ) c ( f, x ) f B ( x ) = opt( B , C ) ≥ (cid:88) ( f, x ) ∈ tup( A ) c ( f, h ( x )) f A ( x )Note that ( f, x ) ∈ tup( A ) > implies ( f, h ( x )) ∈ tup( B ) > ; otherwise c ( f, h ( x )) f A ( x ) > opt( B , C ). Hence (cid:88) ( f, x ) ∈ tup( A ) c ( f, h ( x )) f A ( x ) = (cid:88) ( f, x ) ∈ tup( A ) > f C ( g ( h ( x ))) f A ( x ) = cost( g ◦ h ) ≥ opt( A , C )Therefore, opt( B , C ) ≥ opt( A , C ) and then A (cid:22) B as desired.Also, we will need the following variant of Farkas’ Lemma, due to Gale [27].57 emma 57 (Farkas’ Lemma) . Let A be an m × n rational matrix and b ∈ Q m . Then, exactlyone of the two holds: • Ax ≤ b for some x ∈ Q n , or • A T y = 0 and b T y = − for some y ∈ Q m ≥ .Proof of the Proposition. First, suppose that there exists an inverse fractional homomorphism ω from A to B . Let C be a valued σ -structure. Then, if h is a minimum-cost mapping from B to C we haveopt( B , C ) = (cid:88) ( f, x ) ∈ tup( B ) f B ( x ) f C ( h ( x )) ≥ (cid:88) ( f, x ) ∈ tup( B ) (cid:88) g ∈ B A ω ( g ) f A ( g − ( x )) f C ( h ( x ))= (cid:88) g ∈ B A ω ( g ) (cid:88) ( f, x ) ∈ tup( B ) f A ( g − ( x )) f C ( h ( x )) = (cid:88) g ∈ B A ω ( g ) (cid:88) ( f, y ) ∈ tup( A ) f A ( y ) f C ( h ( g ( y ))) and hence there exists g ∈ B A such that opt( B , C ) ≥ (cid:80) ( f, y ) ∈ tup( A ) f A ( y ) f C ( h ( g ( y ))) =cost( h ◦ g ) ≥ opt( A , C ). Therefore, A (cid:22) B .For the converse implication, let us assume that there is no inverse fractional homomorphismfrom A to B . Let tup( B ) < ∞ := { ( f, x ) ∈ tup( B ) : f B ( x ) < ∞} . Note that tup( B ) < ∞ (cid:54) = ∅ ,as there is no inverse fractional homomorphism from A to B . Let also G < ∞ := { g ∈ B A | f A ( g − ( x )) < ∞ for all ( f, x ) ∈ tup( B ) < ∞ } . Observe that for any fractional homomorphism ω from A to B , it is the case that ω ( g ) = 0, for all g (cid:54)∈ G < ∞ . If G < ∞ = ∅ , we are done,as Proposition 56 implies that A (cid:54)(cid:22) B . Hence, we assume that G < ∞ (cid:54) = ∅ . Since there is noinverse fractional homomorphism from A to B , the following linear system (whose variablesare { ω ( g ) : g ∈ G < ∞ } ) has no rational solution: (cid:88) g ∈G < ∞ ω ( g ) f A ( g − ( x )) ≤ f B ( x ) ∀ ( f, x ) ∈ tup( B ) < ∞ (cid:88) g ∈G < ∞ ω ( g ) ≤ − (cid:88) g ∈G < ∞ ω ( g ) ≤ − − ω ( g ) ≤ ∀ g ∈ G < ∞ Indeed, a solution to this system extended with ω ( g ) = 0, for each g ∈ B A \ G < ∞ , give us aninverse fractional homomorphism from A to B . Applying Lemma 57 to this system we obtainthe existence of a vector y whose first | tup( B ) < ∞ | entries are in one-on-one correspondencewith the tuples ( f, x ) ∈ tup( B ) < ∞ , followed by two entries y , y − and |G < ∞ | entries, one for58ach mapping g ∈ G < ∞ . This vector satisfies: (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f A ( g − ( x )) + y − y − − y ( g ) = 0 ∀ g ∈ G < ∞ (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f B ( x ) + y − y − = − y ≥ y ( g ) ≥
0) we obtain that for all g ∈ G < ∞ , (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f A ( g − ( x )) ≥ (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f B ( x ) + 1We define c : tup( B ) (cid:55)→ Q ≥ as follows: c ( f, x ) = (cid:40) y ( f, x ) + ε if ( f, x ) ∈ tup( B ) < ∞ ε := 1 / (1 + (cid:80) ( f, x ) ∈ tup( B ) < ∞ f B ( x )). Note that ε (cid:80) ( f, x ) ∈ tup( B ) < ∞ f B ( x ) <
1. Then forall g ∈ G < ∞ , we have that (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f A ( g − ( x )) ≤ (cid:88) ( f, x ) ∈ tup( B ) c ( f, x ) f A ( g − ( x ))= (cid:88) ( f, y ) ∈ tup( A ) c ( f, g ( y )) f A ( y )It follows that for all g ∈ G < ∞ , (cid:88) ( f, y ) ∈ tup( A ) c ( f, g ( y )) f A ( y ) ≥ (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f B ( x ) + 1 > (cid:88) ( f, x ) ∈ tup( B ) < ∞ y ( f, x ) f B ( x ) + ε (cid:88) ( f, x ) ∈ tup( B ) < ∞ f B ( x )= (cid:88) ( f, x ) ∈ tup( B ) c ( f, x ) f B ( x )Now we show that the strict inequality above also holds for g ∈ B A \ G < ∞ . We know that forsuch a g , there exists ( f, y ) ∈ tup( A ) such that f A ( y ) = ∞ but f B ( g ( y )) < ∞ . By definition, c ( f, g ( y )) >
0, and then c ( f, g ( y )) f A ( y ) = ∞ . Thus (cid:80) ( f, y ) ∈ tup( A ) c ( f, g ( y )) f A ( y ) = ∞ . Onthe other hand, (cid:80) ( f, x ) ∈ tup( B ) c ( f, x ) f B ( x ) < ∞ , and the claim follows.We have then that the mapping c is suitable for use in Proposition 56, and we concludethat A (cid:54)(cid:22) B . (cid:3) A.2 Proof of Proposition 9
We prove the following. 59 roposition. If A , B are core valued σ -structures such that A ≡ B , then A and B areisomorphic.Proof. By Proposition 6, since A ≡ B , there are inverse fractional homomorphisms ω and ω (cid:48) from A to B , and from B to A , respectively. Note that ω is surjective. Indeed, if this is notthe case, we can define ω ◦ ω (cid:48) : B B (cid:55)→ Q ≥ as ω ◦ ω (cid:48) ( g ) = (cid:88) g : B (cid:55)→ A,g : A (cid:55)→ Bg ◦ g = g ω ( g ) ω (cid:48) ( g )Observe that ω ◦ ω (cid:48) is an inverse fractional homomorphism from B to B . Moreover, ω ◦ ω (cid:48) is not surjective, which contradicts the fact that B is a core. Similarly, we obtain that ω (cid:48) is surjective. It follows that | A | = | B | and any mapping in either supp( ω ) or supp( ω (cid:48) ) is abijection.For each f ∈ σ , let v f < v f < · · · < v nf ∈ Q ≥ be an ordering of the image f A ( A ar( f ) ) of f A . We show by induction that for all i ∈ { , . . . , n } , we have that1. for every mapping g : A (cid:55)→ B such that g ∈ supp( ω ), f A ( x ) = v if ⇐⇒ f B ( g ( x )) = v if ,for all x ∈ A ar( f ) .2. for every mapping p : B (cid:55)→ A such that p ∈ supp( ω (cid:48) ), f B ( x ) = v if ⇐⇒ f A ( p ( x )) = v if ,for all x ∈ B ar( f ) .This implies that any mapping g ∈ supp( ω ) is an isomorphism from A to B .We start with the base case i = 1. Let v ∗ := min { f B ( x ) : x ∈ B ar( f ) } . We showthat v f = v ∗ . By contradiction, suppose first that v f > v ∗ . Pick x ∈ B ar( f ) such that f B ( x ) = v ∗ . Then (cid:80) h ∈ supp( ω ) ω ( h ) f A ( h − ( x )) ≥ v f > f B ( x ) = v ∗ , which is impossible.By an analogous argument, we have that v f ≥ v ∗ , and then v f = v ∗ . Now we provethat |{ x : f A ( x ) = v f }| = |{ x : f B ( x ) = v ∗ }| ( † ). Towards a contradiction assume that |{ x : f A ( x ) = v f }| < |{ x : f B ( x ) = v ∗ }| (the other case is analogous). Fix a mapping˜ h ∈ supp( ω ). Since ˜ h is a bijection, there is x ∈ A ar( f ) such that f A ( x ) > v f but f B (˜ h ( x )) = v ∗ .It follows that (cid:88) h ∈ supp( ω ) ω ( h ) f A ( h − (˜ h ( x ))) = ω (˜ h ) f A ( x ) + (cid:88) h ∈ supp( ω ) \{ ˜ h } ω ( h ) f A ( h − (˜ h ( x ))) > v f = v ∗ = f B (˜ h ( x )) , which is impossible.Let g : A (cid:55)→ B be any mapping in supp( ω ). Note that f A ( x ) = v f ⇒ f B ( g ( x )) ≥ v ∗ = v f ,for all x ∈ A ar( f ) . We show that f A ( x ) = v f ⇒ f B ( g ( x )) = v f , for all x ∈ A ar( f ) . Bycontradiction, assume f A ( x ) = v f but f B ( g ( x )) > v f , for some x ∈ A ar( f ) . Using ( † ) and thefact that g is a bijection, there exists y ∈ A ar( f ) such that f A ( y ) > v f and f B ( g ( y )) = v f .Using the same argument as above with ˜ h = g , we obtain a contradiction. By ( † ), we concludecondition (1). Using a symmetric argument, we obtain condition (2).For the inductive case, let i ≥ j ∈ { , . . . , i − } .Let v ∗ i := min { f B ( x ) : x ∈ B ar( f ) such that f B ( x ) > v i − f } . We show that v if = v ∗ i . By60ontradiction, suppose first that v if > v ∗ i . Pick x ∈ B ar( f ) such that f B ( x ) = v ∗ i . Byinductive hypothesis, we have that for all h ∈ supp( ω ), f A ( h − ( x )) ≥ v if . It follows that (cid:80) h ∈ supp( ω ) ω ( h ) f A ( h − ( x )) ≥ v if > v ∗ i = f B ( x ), which is a contradiction. By an analogousargument, we have that v if ≥ v ∗ i , and then v if = v ∗ i . Now we prove that |{ x : f A ( x ) = v if }| = |{ x : f B ( x ) = v ∗ i }| ( †† ). Towards a contradiction assume that |{ x : f A ( x ) = v if }| < |{ x : f B ( x ) = v ∗ i }| (the other case is analogous). Fix a mapping ˜ h ∈ supp( ω ). Using the inductivehypothesis and the fact that ˜ h is a bijection, there is x ∈ A ar( f ) such that f A ( x ) > v if but f B (˜ h ( x )) = v ∗ i . We also have that f A ( h − (˜ h ( x ))) ≥ v if , for all h ∈ supp( ω ). Then (cid:88) h ∈ supp( ω ) ω ( h ) f A ( h − (˜ h ( x ))) = ω (˜ h ) f A ( x ) + (cid:88) h ∈ supp( ω ) \{ ˜ h } ω ( h ) f A ( h − (˜ h ( x ))) > v if = v ∗ i = f B (˜ h ( x )) , which is a contradiction.Let g : A (cid:55)→ B be any mapping in supp( ω ). By inductive hypothesis, f A ( x ) = v if ⇒ f B ( g ( x )) ≥ v ∗ i = v if , for all x ∈ A ar( f ) . We show that f A ( x ) = v if ⇒ f B ( g ( x )) = v if , for all x ∈ A ar( f ) . By contradiction, assume f A ( x ) = v if but f B ( g ( x )) > v if , for some x ∈ A ar( f ) .Using the inductive hypothesis, condition ( †† ) and the fact that g is a bijection, there exists y ∈ A ar( f ) such that f A ( y ) > v if and f B ( g ( y )) = v if . Using the same argument as above with˜ h = g , we obtain a contradiction. By ( †† ), we conclude condition (1). Using a symmetricargument we obtain condition (2). A.3 Proof of Proposition 10
We prove the following.
Proposition.
Let A be a valued σ -structure and g : A (cid:55)→ A be a mapping. Suppose thereexists an inverse fractional homomorphism ω from A to A such that g ∈ supp ( ω ) . Then,for every valued σ -structure C and mapping s : A (cid:55)→ C such that cost ( s ) = opt ( A , C ) ,cost ( s ◦ g ) = opt ( A , C ) .Proof. We will need the following variant of Farkas’ Lemma, known as Motzkin’s transpositiontheorem. [50, Lemma 2.8] shows how it can be derived from Farkas’ Lemma [46, Corollary 7.1k].
Lemma 58.
For any A ∈ Q m × n and B ∈ Q p × n exactly one of the following holds: • Ay > , By ≥ for some y ∈ Q n ≥ , or • A T z + B T z ≤ for some (cid:54) = z ∈ Q m ≥ , z ∈ Q p ≥ . Now we are ready to prove the proposition. We define the sets H < ∞ := { h ∈ A A : f A ( x ) < ∞ ⇒ f A ( h − ( x )) < ∞ , for all ( f, x ) ∈ tup( A ) }H := { h ∈ A A : f A ( x ) = 0 ⇒ f A ( h − ( x )) = 0 , for all ( f, x ) ∈ tup( A ) } Let H := H < ∞ ∩ H . Notice that for any g (cid:48) : A (cid:55)→ A such that g (cid:48) ∈ supp( ω (cid:48) ), for someinverse fractional homomorphism ω (cid:48) from A to A , it must be the case that g (cid:48) ∈ H < ∞ ∩ H . Inparticular, g ∈ H . 61et tup( A ) + < ∞ := { ( f, x ) ∈ tup( A ) : 0 < f A ( x ) < ∞} . We start with the case whentup( A ) + < ∞ = ∅ . Let C be a valued σ -structure and s : A (cid:55)→ C be a mapping with cost( s ) =opt( A , C ). Then cost( s ) ∈ { , ∞} . Suppose that cost( s ) = 0 (otherwise we are done). Since g ∈ H < ∞ , f A ( x ) = ∞ ⇒ f A ( g ( x )) = ∞ , and then cost( s ◦ g ) = 0, as desired.Suppose now that tup( A ) + < ∞ (cid:54) = ∅ . By hypothesis, the following system over variables { ω ( h ) : h ∈ H} is satisfiable over Q ≥ : (cid:88) h ∈H ω ( h ) f A ( h − ( x )) ≤ (cid:88) h ∈H ω ( h ) f A ( x ) ∀ ( f, x ) ∈ tup( A ) + < ∞ ω ( g ) > ω ≥ (cid:88) ( f, x ) ∈ tup( A ) + < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) ≤ ∀ h ∈ H z + (cid:88) ( f, x ) ∈ tup( A ) + < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( g − ( x )) (cid:17) ≤ z > z ( f, x ) ≥ ∀ ( f, x ) ∈ tup( A ) + < ∞ Let C be a valued σ -structure and s : A (cid:55)→ C be a mapping with cost( s ) = opt( A , C ).We assume that cost( s ) < ∞ (otherwise we are done). It follows that f C ( s ( x )) < ∞ , for all( f, x ) ∈ tup( A ) + < ∞ . Then we can define z : tup( A ) + < ∞ (cid:55)→ Q ≥ with z ( f, x ) = f C ( s ( x )), foreach ( f, x ) ∈ tup( A ) + < ∞ . We have thatcost( s ) = (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) f C ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( x ) f C ( s ( x )) ( f A ( x ) = ∞ ⇒ f C ( s ( x )) = 0, as cost( s ) < ∞ )= (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( x ) z ( f, x )Also, for all h ∈ H , we havecost( s ◦ h ) = (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) f C ( s ( h ( x )))= (cid:88) ( f, x ) ∈ tup( A ) f A ( h − ( x )) f C ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( h − ( x )) f C ( s ( x )) ( f A ( x ) = 0 ⇒ f A ( h − ( x )) = 0, as h ∈ H )= (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( h − ( x )) z ( f, x )62ince cost( s ) ≤ cost( s ◦ h ), the vector z satisfies the first part of the linear system above. Itfollows that the second part is not satisfied, that is,cost( s ) = (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( x ) z ( f, x ) = (cid:88) ( f, x ) ∈ tup( A ) + < ∞ f A ( g − ( x )) z ( f, x ) = cost( s ◦ g ) A.4 Proof of Proposition 12
We prove the following.
Proposition.
Let A be a valued σ -structure and g : A (cid:55)→ A be a mapping. Suppose there existsan inverse fractional homomorphism ω from A to A such that g ∈ supp ( ω ) . Then g ( A ) ≡ A .Proof. First, note that A (cid:22) g ( A ) is a always true, for any mapping g (using for instanceProposition 56). For g ( A ) (cid:22) A , let C be a valued σ -structure and s : A (cid:55)→ C a mapping suchthat cost( s ) = opt( A , C ). By Proposition 10, cost( s ◦ g ) = opt( A , C ). Consider the restriction s | g ( A ) of s over g ( A ). This is a mapping from g ( A ) to C with costcost( s | g ( A ) ) = (cid:88) ( f, x ) ∈ tup( g ( A )) f g ( A ) ( x ) f C ( s ( x )) = (cid:88) ( f, x ) ∈ tup( g ( A )) f A ( g − ( x )) f C ( s ( x ))= (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) f C ( s ( g ( x ))) = cost( s ◦ g )It follows that opt( g ( A ) , C ) ≤ cost( s | g ( A ) ) = cost( s ◦ g ) = opt( A , C ). We conclude that g ( A ) ≡ A . A.5 Proof of Proposition 14
We show the following.
Proposition.
Every valued structure A has a core and all cores of A are isomorphic. Moreover,for a given valued structure A , it is possible to effectively compute a core of A and all cores of A are over a universe of size at most | A | .Proof. It only remains to show that given a valued structure A , it is possible to decide whether A is a core, and if this is not the case, we can compute a non-surjective mapping g ∈ supp( ω ),for some inverse fractional homomorphism ω from A to itself. Let tup( A ) < ∞ := { ( f, x ) ∈ tup( A ) | f A ( x ) < ∞} . If tup( A ) < ∞ = ∅ , then any mapping h : A (cid:55)→ A belongs to the supportof some inverse fractional homomorphism from A to A . In this case, if | A | ≥
2, we declarethat A is not a core and output any non-surjective mapping g : A (cid:55)→ A . If | A | = 1, wedeclare that A is a core. Thus we can assume that tup( A ) < ∞ (cid:54) = ∅ . Let G < ∞ := { g ∈ A A | f A ( g − ( x )) < ∞ for all ( f, x ) ∈ tup( A ) < ∞ } . Note that G < ∞ (cid:54) = ∅ (as the identity mapping isin G < ∞ ). Hence, the following linear program is well-defined, where G ∗ is the restriction of63 < ∞ to non-surjective mappings:min − (cid:88) g ∈G ∗ ω ( g ) (cid:88) g ∈G < ∞ ω ( g ) f A ( g − ( x )) ≤ f A ( x ) ∀ ( f, x ) ∈ tup( A ) < ∞ (cid:88) g ∈G < ∞ ω ( g ) ≤ − (cid:88) g ∈G < ∞ ω ( g ) ≤ − − ω ( g ) ≤ ∀ g ∈ G < ∞ Observe that A is not a core if and only if the optimal value of the program is less than 0.Hence, we can compute an optimal solution ω ∗ to this linear program and, if the optimalvalue is 0, we can declare that A is core. Otherwise, we return a mapping g ∈ G ∗ such that ω ∗ ( g ) > A.6 Proof of Proposition 15
We prove the following.
Proposition.
Let A be a valued σ -structure. Then, A is a core if and only if there exists amapping c : tup ( A ) (cid:55)→ Q ≥ such that for every non-surjective mapping g : A (cid:55)→ A , (cid:88) ( f, x ) ∈ tup ( A ) f A ( x ) c ( f, x ) < (cid:88) ( f, x ) ∈ tup ( A ) f A ( x ) c ( f, g ( x )) Moreover, such a mapping c : tup ( A ) (cid:55)→ Q ≥ is computable, whenever A is a core.Proof. First, suppose A is a core. Let tup( A ) < ∞ := { ( f, x ) ∈ tup( A ) : f A ( x ) < ∞} . Note thattup( A ) < ∞ (cid:54) = ∅ ; otherwise, picking any non-surjective mapping g : A (cid:55)→ A and setting ω ( g ) = 1and ω ( h ) = 0, for all h (cid:54) = g , give us a non-surjective inverse fractional homomorphism from A to A . (We assume there is at least one non-surjective mapping, i.e., | A | ≥
2; otherwise the propo-sition trivially holds.) Let H < ∞ := { h ∈ A A | f A ( h − ( x )) < ∞ for all ( f, x ) ∈ tup( A ) < ∞ } and let S = { g ∈ A A : g is non-surjective } . Note that H < ∞ (cid:54) = ∅ , as the identity map-ping belongs to H < ∞ . Suppose that S ∩ H < ∞ = ∅ . Then we can define c ( f, x ) = 1for all ( f, x ) ∈ tup( A ) < ∞ , and c ( f, x ) = 0 for all ( f, x ) (cid:54)∈ tup( A ) < ∞ . It follows that (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, x ) < ∞ = (cid:80) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, g ( x )), for all g ∈ S , as desired.Then we can assume that S ∩ H < ∞ (cid:54) = ∅ . Since A is a core, the following system overvariables { ω ( h ) : h ∈ H < ∞ } is unsatisfiable: (cid:88) h ∈H < ∞ ω ( h ) f A ( h − ( x )) ≤ (cid:88) h ∈H < ∞ ω ( h ) f A ( x ) ∀ ( f, x ) ∈ tup( A ) < ∞ (cid:88) h ∈S∩H < ∞ ω ( h ) > ω ≥ (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( h − ( x )) (cid:17) ≤ ∀ h ∈ H < ∞ \ S z + (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) (cid:16) f A ( x ) − f A ( g − ( x )) (cid:17) ≤ ∀ g ∈ S ∩ H < ∞ z > z ( f, x ) ≥ ∀ ( f, x ) ∈ tup( A ) < ∞ We define c : tup( A ) (cid:55)→ Q ≥ as follows: c ( f, x ) = (cid:40) z ( f, x ) + ε if ( f, x ) ∈ tup( A ) < ∞ ε := z / (1 + (cid:80) ( f, x ) ∈ tup( A ) < ∞ f A ( x )). Note that ε > (cid:80) ( f, x ) ∈ tup( A ) < ∞ εf A ( x ) < z .We show that c satisfies our requirements. First, suppose g ∈ S but g (cid:54)∈ H < ∞ . Since c ( f, x ) >
0, for all ( f, x ) ∈ tup( A ) < ∞ , we have that (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, x ) < ∞ = (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, g ( x ))Assume now that g ∈ S ∩ H < ∞ . From the system above, we have that (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, g ( x )) = (cid:88) ( f, x ) ∈ tup( A ) < ∞ f A ( g − ( x )) c ( f, x ) ≥ (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( g − ( x )) ≥ z + (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( x ) > (cid:88) ( f, x ) ∈ tup( A ) < ∞ εf A ( x ) + (cid:88) ( f, x ) ∈ tup( A ) < ∞ z ( f, x ) f A ( x )= (cid:88) ( f, x ) ∈ tup( A ) f A ( x ) c ( f, x )Conversely, assume that such a mapping c exists. Towards a contradiction, suppose that A isnot a core. Hence, there is a non-surjective mapping g ∈ supp( ω ), for some inverse fractionalhomomorphism ω from A to itself. Let A c be the valued σ -structure with universe A such thatfor every f ∈ σ and x ∈ A ar( f ) , it is the case that f A c ( x ) = c ( f, x ). Let id : A (cid:55)→ A be theidentity mapping, and h ∗ : A (cid:55)→ A a minimum-cost mapping from A to A c . By Proposition 10,we have thatcost( h ∗ ◦ g ) = (cid:88) ( f, x ) ∈ tup( A ) c ( f, h ∗ ( g ( x ))) f A ( x ) ≤ opt( A , A c ) ≤ cost( id ) = (cid:88) ( f, x ) ∈ tup( A ) c ( f, x ) f A ( x )On the other hand, by the definition of c and the fact that h ∗ ◦ g is non-surjective, we havethat (cid:88) ( f, x ) ∈ tup( A ) c ( f, x ) f A ( x ) < (cid:88) ( f, x ) ∈ tup( A ) c ( f, h ∗ ( g ( x ))) f A ( x )This is a contradiction. 65 Proof of Example 22
We prove the following.
Proposition.
For every n ≥ , A (cid:48) n is the core of A n .Proof. Let n ≥
1. First, Pos( A (cid:48) n ) is a relational core, so A (cid:48) n is a core. Then, if we define g : A n (cid:55)→ A (cid:48) n as g (( i, j )) := i + j − k ∈ A (cid:48) n we have | g − ( k ) | = |{ ( i, j ) ∈ A n | i + j − k }| = (cid:40) k if 1 ≤ k ≤ n n − k if n + 1 ≤ k ≤ n − k ∈ A (cid:48) n we have µ A n ( g − ( k )) = | g − ( k ) | ≤ µ A (cid:48) n ( k ). Furthermore, f A n (( i, j ) , ( i (cid:48) , j (cid:48) )) = ∞ implies g ( i (cid:48) , j (cid:48) ) − g ( i, j ) = ( i (cid:48) − i ) + ( j (cid:48) − j ) = 1 and in turn f A (cid:48) n ( g ( i, j ) , g ( i (cid:48) , j (cid:48) )) = ∞ . In particular, for all k , k ∈ A (cid:48) n it holds that f A n ( g − (( k , k ))) ≤ f A (cid:48) n (( k , k )), which completes the proof that the distribution ω ( g ) := 1 is an inverse fractionalhomomorphism from A n to A (cid:48) n .We now turn to the more delicate task of constructing an inverse fractional homomorphismfrom A (cid:48) n to A n . For k ∈ { , . . . , n − } the k -th diagonal , denoted by d k , is the set ofall ( i, j ) ∈ A n such that i + j − k . An arc is a pair (( i, j ) , ( i (cid:48) , j (cid:48) )) ∈ A n such that f A n (( i, j ) , ( i (cid:48) , j (cid:48) )) >
0. Given an element ( i, j ) ∈ A n we denote by O ( i, j ) (respectively I ( i, j ))the set of all arcs e whose first (respectively second) element is ( i, j ). Given two elements( i, j ) , ( i (cid:48) , j (cid:48) ) ∈ A n such that i (cid:48) ≥ i , j (cid:48) ≥ j we define a path from ( i, j ) to ( i (cid:48) , j (cid:48) ) as a sequence(( i , j ) , . . . , ( i q , j q )) of elements of A n such that ( i , j ) = ( i, j ), ( i q , j q ) = ( i (cid:48) , j (cid:48) ) and for each k ∈ { , . . . , q − } , (( i k , j k ) , ( i k +1 , j k +1 )) is an arc. We denote by E ( P ) the set of arcs of theform (( i k , j k ) , ( i k +1 , j k +1 )) in a path P = (( i , j ) , . . . , ( i q , j q )). Observe that for any mapping g in the support of an inverse fractional homomorphism from A (cid:48) n to A n , g ((1 , . . . , n − ,
1) to ( n, n ) and g ( k ) ∈ d k for every k ∈ A (cid:48) n .We define a mapping ψ that associates a particular cost to each arc (( i, j ) , ( i (cid:48) , j (cid:48) )) as follows.If ( i (cid:48) , j (cid:48) ) ∈ d k for some k ≤ n then ψ (( i, j ) , ( i (cid:48) , j (cid:48) )) := (cid:40) j/ ( i + j ) if i (cid:48) = ii/ ( i + j ) if j (cid:48) = j and otherwise ψ (( i, j ) , ( i (cid:48) , j (cid:48) )) := (cid:40) ( n − j (cid:48) + 1) / (2 n − i (cid:48) − j (cid:48) + 1) if i (cid:48) = i ( n − i (cid:48) + 1) / (2 n − i (cid:48) − j (cid:48) + 1) if j (cid:48) = j This mapping was constructed with certain useful properties in mind.
Claim 13.
For any ( i, j ) ∈ A n \ ( n, n ) , it holds that (cid:80) e ∈ O ( i,j ) ψ ( e ) = 1 .Proof. Suppose that ( i, j ) ∈ d k , k < n . Then, O ( i, j ) = { (( i + 1 , j ) , ( i, j )) , (( i, j ) , ( i, j + 1)) } so (cid:80) e ∈ O ( i,j ) ψ ( e ) = ψ (( i + 1 , j ) , ( i, j )) + ψ (( i, j ) , ( i, j + 1)) = i/ ( i + j ) + j/ ( i + j ) = 1 and the claimfollows. If ( i, j ) ∈ d k , k ≥ n , then we have three cases. If i = n then O ( i, j ) = { (( i, j ) , ( i, j +1)) } and the claim follows from the definition of ψ . The case where j = n is symmetrical. Finally, if i < n and j < n then O ( i, j ) = { (( i + 1 , j ) , ( i, j )) , (( i, j ) , ( i, j + 1)) } , and hence (cid:80) e ∈ O ( i,j ) ψ ( e ) = ψ (( i + 1 , j ) , ( i, j )) + ψ (( i, j ) , ( i, j + 1)) = ( n − i ) / (2 n − i − j ) + ( n − j ) / (2 n − i − j ) = 1. (cid:4) laim 14. Let k ∈ { , . . . , n − } . For any ( i, j ) ∈ d k , it holds that (cid:88) e ∈ I ( i,j ) ψ ( e ) = (cid:40) ( k − /k if k ≤ n (2 n − k + 1) / (2 n − k ) otherwiseProof. Suppose that ( i, j ) ∈ d k , k > n . Then, I ( i, j ) = { (( i − , j ) , ( i, j )) , (( i, j − , ( i, j )) } andhence (cid:80) e ∈ I ( i,j ) ψ ( e ) = ( n − i +1) / (2 n − i − j +1)+( n − j +1) / (2 n − i − j +1) = (2 n − k +1) / (2 n − k ).Now, let us assume that ( i, j ) ∈ d k , k ≤ n . If i = 1, then I ( i, j ) = { (( i, j − , ( i, j )) } and (cid:80) e ∈ I ( i,j ) ψ ( e ) = ( j − / ( i + j −
1) = ( i + j − / ( i + j −
1) = ( k − /k . The case j = 1is symmetrical. If i > j >
1, then I ( i, j ) = { (( i − , j ) , ( i, j )) , (( i, j − , ( i, j )) } and (cid:80) e ∈ I ( i,j ) ψ ( e ) = ( i − / ( i + j −
1) + ( j − / ( i + j −
1) = ( i + j − / ( i + j −
1) = ( k − /k ,which concludes the proof of the claim. (cid:4) Claim 15.
For any ( i, j ) ∈ A n \ ( n, n ) , it holds that (cid:80) P ∈P ( n,n )( i,j ) Π e ∈E ( P ) ψ ( e ) = 1 .Proof. We proceed by induction. The claim holds if ( i, j ) ∈ d n − since by Claim 13 we have (cid:80) P ∈P ( n,n )( i,j ) Π e ∈E ( P ) ψ ( e ) = (cid:80) e ∈ O ( i,j ) ψ ( e ) = 1. Now, let us suppose that the claim is true forall ( i, j ) ∈ d k for some k ∈ { , . . . , n − } . For every ( i, j ) ∈ d k − we have (cid:88) P ∈P ( n,n )( i,j ) Π e ∈E ( P ) ψ ( e ) = (cid:88) (( i,j ) , ( i (cid:48) ,j (cid:48) )) ∈ O ( i,j ) ψ (( i, j ) , ( i (cid:48) , j (cid:48) )) (cid:88) P ∈P ( n,n )( i (cid:48) ,j (cid:48) ) Π e ∈E ( P ) ψ ( e )= (cid:88) (( i,j ) , ( i (cid:48) ,j (cid:48) )) ∈ O ( i,j ) ψ (( i, j ) , ( i (cid:48) , j (cid:48) )) (by inductive hypothesis)= 1 (by Claim 13)and the claim follows. (cid:4) Claim 16.
Let k ∈ { , . . . , n − } . For any ( i, j ) ∈ d k , it holds that (cid:88) P ∈P ( n,n )(1 , :( i,j ) ∈ P Π e ∈E ( P ) ψ ( e ) = (cid:40) /k if k ≤ n / (2 n − k ) if k > n Proof.
We prove the claim for all k ≤ n . If k = 1, then ( i, j ) = (1 ,
1) and the claim holds byClaim 15. Let k ∈ { , . . . , n } , ( i, j ) ∈ d k and suppose that the claim is true for all ( i (cid:48) , j (cid:48) ) ∈ d k − .67hen, (cid:88) P ∈P ( n,n )(1 , :( i,j ) ∈ P Π e ∈E ( P ) ψ ( e ) = (cid:88) P ∈P ( i,j )(1 , Π e ∈E ( P ) ψ ( e ) (cid:88) P ∈P ( n,n )( i,j ) Π e ∈E ( P ) ψ ( e ) = (cid:88) P ∈P ( i (cid:48) ,j (cid:48) )(1 , Π e ∈E ( P ) ψ ( e ) (by Claim 15)= (cid:88) (( i (cid:48) ,j (cid:48) ) , ( i,j )) ∈ I ( i,j ) ψ (( i (cid:48) , j (cid:48) ) , ( i, j )) (cid:88) P ∈P ( i (cid:48) ,j (cid:48) )(1 , Π e ∈E ( P ) ψ ( e ) = ( k − /k (cid:88) P ∈P ( i (cid:48) ,j (cid:48) )(1 , Π e ∈E ( P ) ψ ( e ) (by Claim 14)= 1 /k (by inductive hypothesis)The claim for k > n follows from the exact same argument, using the case k = n to start theinduction. (cid:4) Now that we have highlighted the relevant properties of ψ , we can use it to construct aninverse fractional homomorphism from A (cid:48) n to A n . We define a distribution ω (cid:48) over the mappings g : A (cid:48) n (cid:55)→ A n by letting ω (cid:48) ( g ) := Π e ∈E ( g ((1 ,..., n − ψ ( e ) if g ((1 , . . . , n − ω (cid:48) is properly defined since by Claim 15 we have (cid:80) g : A (cid:48) n (cid:55)→ A n ω (cid:48) ( g ) = (cid:80) P ∈P ( n,n )(1 , Π e ∈E ( P ) ψ ( e ) = 1. Since every mapping g in the support of ω (cid:48) maps (1 , . . . , n − i, j ) , ( i (cid:48) , j (cid:48) ) ∈ A n we also have (cid:80) g : A (cid:48) n (cid:55)→ A n ω (cid:48) ( g ) f A (cid:48) n ( g − (( i, j ) , ( i (cid:48) , j (cid:48) ))) ≤ f A n (( i, j ) , ( i (cid:48) , j (cid:48) )). Finally, for every ( i, j ) ∈ d k , k ≤ n we have (cid:88) g : A (cid:48) n (cid:55)→ A n ω (cid:48) ( g ) µ A (cid:48) n ( g − (( i, j ))) = (cid:88) g : A (cid:48) n (cid:55)→ A n : g − (( i,j )) (cid:54) = ∅ ω (cid:48) ( g ) µ A (cid:48) n ( g − (( i, j )))= k (cid:88) g : A (cid:48) n (cid:55)→ A n : g − (( i,j )) (cid:54) = ∅ ω (cid:48) ( g ) (since ( i, j ) ∈ d k )= k (cid:88) P ∈P ( n,n )(1 , :( i,j ) ∈ P Π e ∈E ( P ) ψ ( e ) = 1 (by Claim 16)= µ A n (( i, j ))and similarly for every ( i, j ) ∈ d k , k > n we have (cid:80) g : A (cid:48) n (cid:55)→ A n ω (cid:48) ( g ) µ A (cid:48) n ( g − (( i, j ))) = (2 n − k ) (cid:18)(cid:80) P ∈P ( n,n )(1 , :( i,j ) ∈ P Π e ∈E ( P ) ψ ( e ) (cid:19) = 1 = µ A n (( i, j )). It follows that ω (cid:48) is an inverse fractionalhomomorphism from A (cid:48) n to A n , and finally A (cid:48) n is the core of A n .68s a concluding remark, we note that if we alter the definition of A n and A (cid:48) n so that foreach arc e we set f A n ( e ) := (cid:88) P ∈P ( n,n )(1 , : e ∈E ( P ) Π o ∈E ( P ) ψ ( o )and for each k , k ∈ A (cid:48) n such that k = k + 1 we set f A (cid:48) n (( k , k )) := 1 (instead of ∞ in theoriginal definition of A n , A (cid:48) n ), then for every arc e we have (cid:88) g : A (cid:48) n (cid:55)→ A n : e ∈E ( g ((1 ,..., n − ω (cid:48) ( g ) f A (cid:48) n ( g − ( e )) = (cid:88) g : A (cid:48) n (cid:55)→ A n : e ∈E ( g ((1 ,..., n − ω (cid:48) ( g ) = f A n ( e )and hence the distributions ω and ω (cid:48) are still inverse fractional homomorphisms between A n and A (cid:48) n . Since A (cid:48) n is still a core, this new construction shows that bounded treewidth modulo(valued) equivalence is a strictly more general property than bounded treewidth even forfinite-valued structures . C Proof of Proposition 27
We prove the following.
Proposition.
Let A , B be valued σ -structures and k ≥ . If there exists an inverse fractionalhomomorphism from A to B , then A (cid:22) k B .Proof. Let C be an arbitrary valued σ -structure, ω be an inverse fractional homomorphismfrom A to B and λ be a solution to SA k ( B , C ) of minimum cost. Note that we can writethe cost of λ as a sum over all ( f, x ) ∈ tup( B k ) > and s : Set( x ) (cid:55)→ C k , as constraint (SA3) ensures that λ ( f, x , s ) = 0, whenever f B k ( x ) × f C k ( s ( x )) = ∞ . Then, we haveopt k ( B , C ) = (cid:88) ( f, x ) ∈ tup( B k ) > ,s :Set( x ) (cid:55)→ C k λ ( f, x , s ) f B k ( x ) f C k ( s ( x ))= (cid:88) ( f, x ) ∈ tup( B ) ,s :Set( x ) (cid:55)→ C λ ( f, x , s ) f B ( x ) f C ( s ( x )) ≥ (cid:88) ( f, x ) ∈ tup( B ) ,s :Set( x ) (cid:55)→ C (cid:88) g ∈ supp( ω ) ω ( g ) f A ( g − ( x )) λ ( f, x , s ) f C ( s ( x ))= (cid:88) g ∈ supp( ω ) ω ( g ) (cid:88) ( f, x ) ∈ tup( B ) ,s :Set( x ) (cid:55)→ C λ ( f, x , s ) f A ( g − ( x )) f C ( s ( x )) = (cid:88) g ∈ supp( ω ) ω ( g ) (cid:88) ( f, y ) ∈ tup( A ) ,s :Set( g ( y )) (cid:55)→ C λ ( f, g ( y ) , s ) f A ( y ) f C ( s ( g ( y ))) and hence there exists g ∈ supp( ω ) such thatopt k ( B , C ) ≥ (cid:88) ( f, y ) ∈ tup( A ) ,s :Set( g ( y )) (cid:55)→ C λ ( f, g ( y ) , s ) f A ( y ) f C ( s ( g ( y )))= (cid:88) ( f, y ) ∈ tup( A k ) > ,s :Set( g ( y )) (cid:55)→ C k λ ( f, g ( y ) , s ) f A k ( y ) f C k ( s ( g ( y ))) (15)69ince g ∈ supp( ω ), we have that g is a homomorphism from Pos( A ) to Pos( B ) (see remarkat the end of Section 3.1). It follows that ( f, g ( y )) ∈ tup( B k ) > , for every ( f, y ) ∈ tup( A k ) > .Hence, for any ( f, y ) ∈ tup( A k ) > and r : Set( y ) (cid:55)→ C k , we can define λ (cid:48) ( f, y , r ) = (cid:40) λ ( f, g ( y ) , s ) if there exists s : Set( g ( y )) (cid:55)→ C k such that s ◦ g = r k ( B , C ) ≥ (cid:88) ( f, y ) ∈ tup( A k ) > ,r :Set( y ) (cid:55)→ C k λ (cid:48) ( f, y , r ) f A k ( y ) f C k ( r ( y ))All that remains to do is to show that λ (cid:48) is a feasible solution to SA k ( A , C ). The fact that thecondition (SA4) is satisfied is immediate. Also, it follows from ω ( g ) > f A k ( y ) = ∞ implies f B k ( g ( y )) = ∞ and f A k ( y ) > f B k ( g ( y )) >