scalation.minima

DualSimplex

class DualSimplex extends MinimizerLP

This class solves Linear Programming (LP) problems using a tableau based Dual Simplex Algorithm. It is particularly useful when re-optimizing after a constraint has been added. The algorithm starts with an infeasible super-optimal solution and moves toward (primal) feasibility and optimality.

Given a constraint matrix 'a', limit/RHS vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function f(x), while satisfying all of the constraints, i.e.,

minimize f(x) = c x subject to a x <= b, x >= 0

Creates an MM-by-NN simplex tableau with -- [0..M-1, 0..N-1] = a (constraint matrix) -- [0..M-1, N..M+N-1] = s (slack/surplus variable matrix) -- [0..M-1, NN-1] = b (limit/RHS vector) -- [M, 0..NN-2] = c (cost vector)

Linear Supertypes
MinimizerLP, Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. DualSimplex
  2. MinimizerLP
  3. Error
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DualSimplex(a: MatrixD, b: VectorD, c: VectorD, x_B: Array[Int])

    a

    the M-by-N constraint matrix

    b

    the M-length limit/RHS vector (input b_i negative for surplus)

    c

    the N-length cost vector

    x_B

    the indices of the initial basis (e.g., from primal Simplex)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val EPSILON: Double

    Attributes
    protected
    Definition Classes
    MinimizerLP
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def check(x: VectorD, y: VectorD, f: Double): Boolean

    Determine whether the current solution is correct.

    Determine whether the current solution is correct.

    x

    the primal solution vector x

    y

    the dual solution vector y

    f

    the minimum value of the objective function

    Definition Classes
    MinimizerLP
  9. val checker: CheckLP

    Definition Classes
    DualSimplexMinimizerLP
  10. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def dual: VectorD

    Return the dual solution vector y (cost row (M) under the slack columns).

  12. def entering(k: Int): Int

    Find the best variable x_l to enter the basis given that x_k is leaving the basis.

    Find the best variable x_l to enter the basis given that x_k is leaving the basis. Determine the index of the entering variable corresponding to COLUMN l by selecting the minimum ratio. Return -1 to indicate no such column.

    k

    the variable that is leaving the basis

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  17. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def leaving(): Int

    Find the best variable x_k to leave the basis.

    Find the best variable x_k to leave the basis. Determine the index of the leaving variable corresponding to ROW k by selecting the most negative RHS value. Return -1 to indicate no such row.

  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def objF(x: VectorD): Double

    Return the value of the objective function f(x) = c x.

    Return the value of the objective function f(x) = c x.

    x

    the coordinate values of the current point

    Definition Classes
    DualSimplexMinimizerLP
  25. def pivot(k: Int, l: Int): Unit

    Pivot on entry (k, l) using Gauss-Jordan elimination to replace variable x_k with x_l in the basis.

    Pivot on entry (k, l) using Gauss-Jordan elimination to replace variable x_k with x_l in the basis.

    k

    the leaving variable (row)

    l

    the entering variable (column)

  26. def primal: VectorD

    Return the primal solution vector x (only the basic variables are non-zero).

  27. def showTableau(iter: Int): Unit

    Show the current tableau.

    Show the current tableau.

    iter

    the number of iterations do far

  28. def solve(): VectorD

    Run the simplex algorithm starting from an initial BFS and iteratively find a non-basic variable to replace a variable in the current basis so long as the objective function improves.

    Run the simplex algorithm starting from an initial BFS and iteratively find a non-basic variable to replace a variable in the current basis so long as the objective function improves. Return the optimal vector x.

    Definition Classes
    DualSimplexMinimizerLP
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Convert the current tableau and basis to a string suitable for display.

    Convert the current tableau and basis to a string suitable for display.

    Definition Classes
    DualSimplex → AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MinimizerLP

Inherited from Error

Inherited from AnyRef

Inherited from Any