Documentation

Mathlib.Combinatorics.Optimization.ValuedCSP

General-Valued Constraint Satisfaction Problems #

General-Valued CSP is a very broad class of problems in discrete optimization. General-Valued CSP subsumes Min-Cost-Hom (including 3-SAT for example) and Finite-Valued CSP.

Main definitions #

References #

@[inline, reducible]
abbrev ValuedCSP (D : Type u_1) (C : Type u_2) [OrderedAddCommMonoid C] :
Type (max u_1 u_2)

A template for a valued CSP problem over a domain D with costs in C. Regarding C we want to support Bool, Nat, ENat, Int, Rat, NNRat, Real, NNReal, EReal, ENNReal, and tuples made of any of those types.

Equations
Instances For
    structure ValuedCSP.Term {D : Type u_1} {C : Type u_2} [OrderedAddCommMonoid C] (Γ : ValuedCSP D C) (ι : Type u_3) :
    Type (max (max u_1 u_2) u_3)

    A term in a valued CSP instance over the template Γ.

    • n :

      Arity of the function

    • f : (Fin self.nD)C

      Which cost function is instantiated

    • inΓ : { fst := self.n, snd := self.f } Γ

      The cost function comes from the template

    • app : Fin self.nι

      Which variables are plugged as arguments to the cost function

    Instances For
      def ValuedCSP.Term.evalSolution {D : Type u_1} {C : Type u_2} [OrderedAddCommMonoid C] {Γ : ValuedCSP D C} {ι : Type u_3} (t : ValuedCSP.Term Γ ι) (x : ιD) :
      C

      Evaluation of a Γ term t for given solution x.

      Equations
      Instances For
        @[inline, reducible]
        abbrev ValuedCSP.Instance {D : Type u_1} {C : Type u_2} [OrderedAddCommMonoid C] (Γ : ValuedCSP D C) (ι : Type u_3) :
        Type (max (max u_1 u_2) u_3)

        A valued CSP instance over the template Γ with variables indexed by ι.

        Equations
        Instances For
          def ValuedCSP.Instance.evalSolution {D : Type u_1} {C : Type u_2} [OrderedAddCommMonoid C] {Γ : ValuedCSP D C} {ι : Type u_3} (I : ValuedCSP.Instance Γ ι) (x : ιD) :
          C

          Evaluation of a Γ instance I for given solution x.

          Equations
          Instances For
            def ValuedCSP.Instance.IsOptimumSolution {D : Type u_1} {C : Type u_2} [OrderedAddCommMonoid C] {Γ : ValuedCSP D C} {ι : Type u_3} (I : ValuedCSP.Instance Γ ι) (x : ιD) :

            Condition for x being an optimum solution (min) to given Γ instance I.

            Equations
            Instances For