Documentation

CslibFrontier.Algorithms.Lean.Simplex.Dantzig

The simplex method with Dantzig's rule #

This module defines the simplex method with Dantzig's largest-coefficient rule ([Chv83], Chapter 4) on the dictionaries of CslibFrontier.Algorithms.Lean.Simplex.Dictionary, and proves that it is sound: when it stops, its answer is correct.

Algorithm #

In a dictionary D (dantzigStep):

dantzigRun D fuel iterates at most fuel pivots: it is runWith with Dantzig's rule, so its soundness is that of runWith, applied to the step lemmas of this module.

Main definitions #

Main results #

Limitations #

Dantzig's rule can cycle on degenerate programs (Chvátal's cycling example, [Chv83], Chapter 3, is among the worked examples of the test suite), so no termination theorem holds in general. On the Klee–Minty programs it takes 2 ^ n - 1 pivots (CslibFrontier.Algorithms.Lean.Simplex.KleeMinty).

References #

Dantzig's entering rule ([Chv83], Chapter 4): a nonbasic variable with the largest positive reduced cost, the smallest one in case of ties.

One step of the simplex method with Dantzig's entering rule and the smallest-index ratio test.

theorem Cslib.Algorithms.Lean.Simplex.Dictionary.dantzigEntering_eq_some_iff {ι : Type u_1} {K : Type u_2} [Fintype ι] [LinearOrder ι] [Field K] [LinearOrder K] (D : Dictionary ι K) {s : ι} :
D.dantzigEntering = some s ↔ s ∉ D.basis ∧ 0 < D.objCoeff s ∧ (∀ j ∉ D.basis, D.objCoeff j ≤ D.objCoeff s) ∧ ∀ j ∉ D.basis, D.objCoeff j = D.objCoeff s → s ≤ j

A pivot of Dantzig's rule preserves feasibility, equivalence and does not decrease the objective.

The simplex method with Dantzig's rule #

The simplex method with Dantzig's rule and at most fuel pivots.

theorem Cslib.Algorithms.Lean.Simplex.Dictionary.dantzigRun_eq_optimal {ι : Type u_1} {K : Type u_2} [Fintype ι] [LinearOrder ι] [Field K] [LinearOrder K] [IsStrictOrderedRing K] (D : Dictionary ι K) {fuel : ℕ} {D' : Dictionary ι K} (hD : D.Feasible) (h : D.dantzigRun fuel = Outcome.optimal D') :
D.Equivalent D' ∧ D'.Feasible ∧ D.objConst ≤ D'.objConst ∧ ∀ j ∉ D'.basis, D'.objCoeff j ≤ 0

Soundness of Dantzig's rule, optimal case: a run that stops at an optimal dictionary D' returns an equivalent feasible dictionary with no positive reduced cost, so its basic solution attains the maximum D'.objConst (Dictionary.isGreatest_value).

theorem Cslib.Algorithms.Lean.Simplex.Dictionary.dantzigRun_eq_unbounded {ι : Type u_1} {K : Type u_2} [Fintype ι] [LinearOrder ι] [Field K] [LinearOrder K] [IsStrictOrderedRing K] (D : Dictionary ι K) {fuel : ℕ} {D' : Dictionary ι K} {s : ι} (hD : D.Feasible) (h : D.dantzigRun fuel = Outcome.unbounded D' s) :
D.Equivalent D' ∧ D'.Feasible ∧ s ∉ D'.basis ∧ 0 < D'.objCoeff s ∧ ∀ i ∈ D'.basis, 0 ≤ D'.coeff i s

Soundness of Dantzig's rule, unbounded case: a run that stops with an unbounded entering variable s returns an equivalent feasible dictionary in which s is nonbasic with a positive reduced cost and no row bounds its increase, so the objective is unbounded (Dictionary.not_bddAbove_value).