Documentation

CslibFrontier.Computability.Complexity.Classes.ApproximationSchemes

Polynomial-time approximation schemes #

An NPOptimizationProblem has typed instances and solutions, polynomially bounded feasible solutions, and polynomial-time feasibility and objective evaluation. Its instance type supplies the valid inputs. The feasibility certificate starts with a typed instance and candidate solution. Kann, Definition 1 additionally requires recognizing valid encoded instances in polynomial time. The typed model permits zero objective values and requires a feasible solution for every instance.

We use Williamson and Shmoys, Definitions 3.3–3.4. A solution at accuracy 1 / k for positive integer k is within the factor 1 + 1 / k for minimization, or achieves at least the fraction 1 - 1 / k for maximization. Comparing with every feasible solution avoids division and also covers zero-valued optima. Reciprocal integer accuracies suffice since for any positive error one can choose a reciprocal no larger than that error. A PTAS supplies a polynomial-time solver for each fixed accuracy. An FPTAS supplies one polynomial-time solver on the instance paired with unary k.

The direction of an optimization objective.

structure Cslib.Complexity.NPOptimizationProblem {α β : Type} (encI : α ↪ List Bool) (encS : β ↪ List Bool) :

A typed NP optimization problem with natural-valued objective.

def Cslib.Complexity.NPOptimizationProblem.IsApproximate {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) (k : ℕ) (a : α) (b : β) :

The solution is feasible and satisfies the multiplicative error guarantee at accuracy 1 / k. The approximation schemes use this predicate only for positive k.

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

A polynomial-time approximation scheme with a separate solver for each fixed accuracy.

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

A fully polynomial-time approximation scheme with one solver polynomial in the instance length and the unary inverse accuracy.

theorem Cslib.Complexity.NPOptimizationProblem.FPTAS.toPTAS {α β : Type} {encI : α ↪ List Bool} {encS : β ↪ List Bool} (problem : NPOptimizationProblem encI encS) (h : problem.FPTAS) :
problem.PTAS

Fixing the unary accuracy gives a polynomial-time solver for that accuracy.