Quantaloidal approach to constraint satisfaction

Soichiro Fujii, Yuni Iwamasa and Kei Kimura

ACT 2021 Quantaloids = {complete join-semilattices}-enriched categories Quantaloidal approach to constraint satisfaction Constraint satisfaction problem (CSP): general framework for computational problems including k-SAT, graph k-colouring, … Soichiro Fujii, Yuni Iwamasa and Kei Kimura

ACT 2021 (Computational) Overview problems Quantaloids CSP !FinSet Special case Quantaloidal CSP "FinSet Special ": quantale case TVCSP (Optimisation problem) ℝFinSet (Computational) Overview problems Quantaloids CSP !FinSet Special case Quantaloidal CSP "FinSet Special ": quantale case TVCSP (Optimisation problem) ℝFinSet Graph k-colouring (k ∈ ℕ)

v2 v4

v1 v3 v5

∃s: {v1, …, v5} → {1,…, k} s.t. ∀edge (vi, vj), s(vi) ≠ s(vj)? Ex. k = 3 { 1 , 2 , 3 } A CSP instance I = (V, D, *) consists of: • V: of variables • D: finite set called the domain • *: finite set of “constraints” A constraint is (k, x, ρ) where • k ∈ ℕ, x ∈ Vk, ρ ⊆ Dk. A satisfies the constraint if s: V → D (k, x = (x1, …, xk), ρ) . (s(x1), …, s(xk)) ∈ ρ A solution of I = (V, D, *) is a function s: V → D satisfying every constraint in *. ,(I) = {solutions of I} ⊆ [V, D] Ex. Graph k-colouring

v2 v4

v1 v3 v5

∃s: {v1, …, v5} → {1,…, k} s.t. ∀edge (vi, vj), s(vi) ≠ s(vj)? A function s: V → D satisfies

the constraint k x x ρ ( ′, x = ( 1, …, k′), ) V = {v1, …, v5} if . (s(x ), …, s(x ) ) ∈ ρ D = {1,…, k} 1 k′ 2 * = {(2,(vi, vj), ≠ ⊆ D ) ∣ (vi, vj): edge} (Computational) Overview problems Quantaloids CSP !FinSet Special case Quantaloidal CSP "FinSet Special ": quantale case TVCSP (Optimisation problem) ℝFinSet The 2- !FinSet: φ φ ψ Obj. Finite sets Comp. A ⟶ B ⟶ C 2-cell A ⇓ B φ ψ ∘ φ = { g ∘ f ∣ g ∈ ψ, f ∈ φ } Mor. A ⟶ B φ′ {idA} φ ⊆ [A, B] Id. A ⟶ A φ ⊆ φ′ !FinSet is a quantaloid (the free quantaloid over FinSet): • ∀A, B ∈ !FinSet, !FinSet(A, B) = (![A, B], ⊆ ) is a complete lattice. • ∀A, B, C ∈ !FinSet, !FinSet(B, C) × !FinSet(A, B) ⟶∘ !FinSet(A, C) preserves arbitrary joins in each variable:

ψ φi ψi φ B ⟶ C (A ⟶ B)i∈I (B ⟶ C)i∈I A ⟶ B ψ φ ψ φ ψ φ ψ φ ∘ (⋁ i) = ⋁( ∘ i) (⋁ i) ∘ = ⋁( i ∘ ) i∈I i∈I i∈I i∈I In particular, φ • ∀A ⟶ B, C ∈ !FinSet, !FinSet(φ, C): !FinSet(B, C) ⟶ !FinSet(A, C) ψ φ ψ preserves arbitrary joins. (B ⟶ C) (A ⟶ B ⟶ C) ⟺ !FinSet(φ, C) has a right adjoint ( − ) ↙ φ: !FinSet(A, C) ⟶ !FinSet(B, C) θ B (A ⟶ C) φ θ ↙ φ ⇓ A C θ The right extension of θ along φ B B ψ ψ ↘ θ ψ ⇓ The right lifting of along A C A C θ ψ θ θ (Computational) Overview problems Quantaloids CSP !FinSet Special case Quantaloidal CSP "FinSet Special ": quantale case TVCSP (Optimisation problem) ℝFinSet A CSP instance I = (V, D, *) consists of: Each constraint (k, x, ρ) • V: finite set of variables yields !FinSet • D: finite set called the domain V • *: finite set of “constraints” { } ρ ↙ {x} A constraint is (k, x, ρ) where x k k ⇓ • k ∈ ℕ, x ∈ V , ρ ⊆ D . [k] D ρ A function s: V → D satisfies the constraint (k, x = (x , …, x ), ρ) if (s(x ), …, s(x )) ∈ ρ. ρ ↙ {x} ⊆ [V, D] 1 k 1 k A solution of I = (V, D, *) is a function { s: V → D ∣ s satisfies s: V → D satisfying every constraint in *. the constraint (k, x, ρ) } ,(I) = {solutions of I} ⊆ [V, D] I ρ V D ,( ) = ⋂ ↙ {x}: ⟶ (k,x,ρ)∈* (Computational) Overview problems Quantaloids CSP !FinSet Special case Quantaloidal CSP "FinSet Special ": quantale case TVCSP (Optimisation problem) ℝFinSet (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms Dichotomy theorem. [Bulatov 2017, Zhuk 2020] For each “constraint language” 7, CSP(7) is either in P or is NP-complete.

A constraint language 7 consists of • D: finite set Finite relational structure ki : finite family of relations on . • (ρi ⊆ D )i∈I D

: constraint language 7 = (D, (ρi)i∈I) CSP(7): set of CSP instances defined by

I = (V, D′, *) ∈ CSP(7) ⟺ D′ = D and ∀(k, x, ρ) ∈ *, ρ ∈ 7 When is CSP(7) easy to solve? • CSP(7) is in P if 7 admits enough “symmetry” • CSP(7) is NP-complete otherwise The relevant “symmetry” of 7 is captured by polymorphisms of 7 = homomorphisms (of relational structures) 7n → 7. Dichotomy theorem. [Bulatov 2017, Zhuk 2020] 7: constraint language ∀x, y, z ∈ D . f(y, x, y, z) = f(x, y, z, x) • CSP(7) is in P if 7 admits a Siggers operation f: D4 → D as a polymorphism • CSP(7) is NP-complete otherwise. : constraint language 7 = (D, (ρi)i∈I)

∀n ∈ ℕ, let Pol(7)n = {n-ary polymorphisms of 7} = {homomorphisms 7n → 7} Assume I: singleton, so that 7 = (D, ρ ⊆ Dk). n Then Pol(7)n : D ⟶ D is given by: Dn Dn n n n n {πi}i=1 ↘ ρ {πi}i=1 {πi}i=1 ↘ ρ ρ ↙ ({πi}i=1 ↘ ρ) ⇓ ⇓ = Pol(7)n k D k D [ ] ρ [ ] ρ (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms A quantale is a one-object quantaloid.

Explicitly, " = (Q, ≤ , e, ⊗ ) is a quantale if • (Q, ≤ ): complete lattice • (Q, e, ⊗ ): monoid satisfying:

α β α β α β α β ⊗ (⋁ i) = ⋁( ⊗ i) (⋁ i) ⊗ = ⋁( i ⊗ ) i∈I i∈I i∈I i∈I " = (Q, ≤ , e, ⊗ ): quantale The quantaloid "FinSet: φ ψ Obj. Finite sets Comp. A ⟶ B ⟶ C φ Mor. A B ψ φ h ψ g φ f f A B g B C g f h ⟶ ( ∘ )( ) = ⋁{ ( ) ⊗ ( ) ∣ : → , : → , ∘ = } φ: [A, B] → Q “Singleton” φ f Id. {idA} A ⟶ B A ⟶ A 2-cell A ⇓ B {f} A ⟶ B φ′ f A B Q { }: [ , ] → φ ≤ φ′ e if g f g = { ⊥Q otherwise (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case " = 2 Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case " = 2 Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms " = (Q, ≤ , e, ⊗ ): quantale A " -valued CSP instance I = (V, D, *) consists of: • V: finite set of variables • D: finite set called the domain • *: finite set of “" -valued constraints” A " -valued constraint is (k, x, ρ) where ρ: [k] ⟶ D in "FinSet • k ∈ ℕ, x ∈ Vk, ρ ⊆ Dk. ρ: Dk → Q Each "-valued constraint (k, x, ρ) yields V "FinSet ,(I) = ρ ↙ {x}: V ⟶ D {x} ρ ↙ {x} ⋀ ⇓ (k,x,ρ)∈* [k] D ρ ,(I): [V, D] → Q A " -valued constraint language 7 consists of • D: finite set ki : finite family of relations on . • (ρi ⊆ D )i∈I D : finite family of in (ρi : [ki] ⟶ D)i∈I "FinSet Assume I: singleton, so that 7 = (D, ρ: [k] ⟶ D). n Then Pol(7)n : D ⟶ D is given by: n Pol(7)n( f ) ∈ Q: the “degree” to which Pol(7) : [D , D] → Q n n f: D → D is a polymorphism of 7 Dn Dn n n n n {πi}i=1 ↘ ρ {πi}i=1 {πi}i=1 ↘ ρ ρ ↙ ({πi}i=1 ↘ ρ) ⇓ ⇓ = Pol(7)n k D k D [ ] ρ [ ] ρ (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case " = 2 Quantaloidal CSP "FinSet Special -valued polymorphisms ": quantale case " TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms (Computational) Overview problems Quantaloids CSP !FinSet Polymorphisms Special case " = 2 Quantaloidal CSP "FinSet Special "-valued polymorphisms ": quantale case " = ℝ TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms Letting " = ℝ = (ℝ ∪ {±∞}, ≥ ,0,+) (cf. [Lawvere 1973]), we obtain a class of optimisation problems:

inf sup ρ(s(x1), …, s(xk)) s: V→D (k,x,ρ)∈* which we call “tropical valued CSPs”.

Dichotomy theorem for TVCSPs.* 7: ℝ-valued constraint language • TVCSP(7) is in P if there exists a Siggers operation 4 with . f: D → D 0 ≥ Pol( f )4 • TVCSP(7) is NP-hard otherwise. * For a slightly more expressive version of TVCSPs. (Computational) Summary problems Quantaloids CSP !FinSet Polymorphisms Special case Dichotomy theorem " = 2 Quantaloidal CSP "FinSet Special "-valued polymorphisms ": quantale case " = ℝ TVCSP (Optimisation problem) ℝFinSet ℝ-valued polymorphisms Dichotomy theorem