Documentation

CslibFrontier.Computability.Complexity.Reduction.LinearApproximation

Linear reductions for optimization problems #

An L-reduction maps instances and recovers feasible solutions in polynomial time. The target optimum is bounded by a fixed multiple of the source optimum, and the recovered solution's absolute error is bounded by a fixed multiple of the target solution's error Papadimitriou and Yannakakis, §1, pp. 427–428. Natural-number factors suffice because increasing a positive real factor to a positive integer preserves both inequalities.

Main definitions #

Main results #

noncomputable def Cslib.Complexity.NPOptimizationProblem.optimum {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) (a : α) :

The objective value of an optimal feasible solution.

theorem Cslib.Complexity.NPOptimizationProblem.exists_optimum {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) (a : α) :
∃ (b : β), problem.Feasible a b ∧ problem.value (a, b) = problem.optimum a

There is a feasible solution with the optimal objective value.

theorem Cslib.Complexity.NPOptimizationProblem.optimum_le_value {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) {a : α} {b : β} (hgoal : problem.goal = OptimizationGoal.minimize) (hb : problem.Feasible a b) :
problem.optimum a ≤ problem.value (a, b)

The optimum is at most the value of any feasible solution to a minimization problem.

theorem Cslib.Complexity.NPOptimizationProblem.value_le_optimum {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) {a : α} {b : β} (hgoal : problem.goal = OptimizationGoal.maximize) (hb : problem.Feasible a b) :
problem.value (a, b) ≤ problem.optimum a

The value of any feasible solution to a maximization problem is at most the optimum.

theorem Cslib.Complexity.NPOptimizationProblem.isApproximate_iff_error {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) {k : ℕ} {a : α} {b : β} :
problem.IsApproximate k a b ↔ problem.Feasible a b ∧ k * (problem.value (a, b)).dist (problem.optimum a) ≤ problem.optimum a

For a feasible solution, the accuracy bound is equivalent to an absolute error bound scaled by the inverse accuracy.

structure Cslib.Complexity.LReduction {α₁ β₁ α₂ β₂ : Type} {encI₁ : α₁ ↪ List Bool} {encS₁ : β₁ ↪ List Bool} {encI₂ : α₂ ↪ List Bool} {encS₂ : β₂ ↪ List Bool} (A : NPOptimizationProblem encI₁ encS₁) (B : NPOptimizationProblem encI₂ encS₂) :

A polynomial-time L-reduction between two NP optimization problems.

def Cslib.Complexity.LReduction.refl {α₁ β₁ : Type} {encI₁ : α₁ ↪ List Bool} {encS₁ : β₁ ↪ List Bool} (A : NPOptimizationProblem encI₁ encS₁) :

The identity L-reduction.

def Cslib.Complexity.LReduction.trans {α₁ β₁ α₂ β₂ α₃ β₃ : Type} {encI₁ : α₁ ↪ List Bool} {encS₁ : β₁ ↪ List Bool} {encI₂ : α₂ ↪ List Bool} {encS₂ : β₂ ↪ List Bool} {encI₃ : α₃ ↪ List Bool} {encS₃ : β₃ ↪ List Bool} {A : NPOptimizationProblem encI₁ encS₁} {B : NPOptimizationProblem encI₂ encS₂} {C : NPOptimizationProblem encI₃ encS₃} (r : LReduction A B) (s : LReduction B C) :

L-reductions compose, multiplying the optimum and error factors.

theorem Cslib.Complexity.LReduction.isApproximate_recover {α₁ β₁ α₂ β₂ : Type} {encI₁ : α₁ ↪ List Bool} {encS₁ : β₁ ↪ List Bool} {encI₂ : α₂ ↪ List Bool} {encS₂ : β₂ ↪ List Bool} {A : NPOptimizationProblem encI₁ encS₁} {B : NPOptimizationProblem encI₂ encS₂} (r : LReduction A B) {k : ℕ} {a : α₁} {b : β₂} (hb : B.IsApproximate (r.optimumFactor * (k * r.errorFactor)) (r.mapInstance a) b) :

The recovered solution has the requested accuracy if the target accuracy is scaled by the two reduction factors [Papadimitriou and Yannakakis, Proposition 2] [PY91].

theorem Cslib.Complexity.LReduction.ptas {α₁ β₁ α₂ β₂ : Type} {encI₁ : α₁ ↪ List Bool} {encS₁ : β₁ ↪ List Bool} {encI₂ : α₂ ↪ List Bool} {encS₂ : β₂ ↪ List Bool} {A : NPOptimizationProblem encI₁ encS₁} {B : NPOptimizationProblem encI₂ encS₂} (r : LReduction A B) (h : B.PTAS) :

A PTAS for the target induces a PTAS for the source.