scalation.minima

RevisedSimplex

class RevisedSimplex extends MinimizerLP

This class solves Linear Programming (LP) problems using the Revised Simplex Algorithm. Given a constraint matrix 'a', constant 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

The Revised Simplex Algorithm operates on 'b_inv', which is the inverse of the basis-matrix ('ba' = 'B'). It has benefits over the Simplex Algorithm (less memory and reduced chance of round off errors).

Linear Supertypes
MinimizerLP, Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RevisedSimplex
  2. MinimizerLP
  3. Error
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

    a

    the constraint matrix

    b

    the constant/limit vector

    c

    the cost/revenue vector

    x_B

    the initial basis (set of indices where x_i is in the basis)

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
    RevisedSimplexMinimizerLP
  10. def clone(): AnyRef

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

    Return the dual solution vector (y).

  12. def entering(): Int

    Find the best variable x_l to enter the basis.

    Find the best variable x_l to enter the basis. Use Dantiz's Rule: index of max positive (cycling possible) z value. Return -1 to indicate no such column.

  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[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  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(): 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(l: Int): Int

    Find the best variable x_k to leave the basis given that x_l is entering.

    Find the best variable x_k to leave the basis given that x_l is entering. Determine the index of the leaving variable corresponding to ROW k using the Min-Ratio Rule. Return -1 to indicate no such row.

    l

    the variable chosen to enter the basis

  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 optimal objective function value (f(x) = c x).

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

    x

    the primal solution vector

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

    Pivot by replacing x_k with x_l in the basis.

    Pivot by replacing x_k with x_l in the basis. Update b_inv, b_ and c_.

    k

    the leaving variable

    l

    the entering variable

  26. def primal: VectorD

    Return the primal (basis only) solution vector (x).

  27. def primalFull(x: VectorD): VectorD

    Return the full primal solution vector (xx).

  28. def rebuild(): Unit

    Rebuild the b_inv matrix from the original a matrix, by setting basis columns and inverting that matrix in-place.

  29. def setBasis(j: Int = N-M, l: Int = M): Array[Int]

    There are M+N variables, N decision and M slack variables, of which, for each iteration, M are chosen for a Basic Feasible Solution (BFS).

    There are M+N variables, N decision and M slack variables, of which, for each iteration, M are chosen for a Basic Feasible Solution (BFS). The the variables not in the basis are set to zero. Setting j to N will start with the slack variables in the basis (only works if b >= 0).

    j

    the offset to start the basis

    l

    the size of the basis

  30. def showTableau(iter: Int): Unit

    Show the current revised tableau.

    Show the current revised tableau.

    iter

    the number of iterations do far

  31. def solve(): VectorD

    Solve a Linear Programming (LP) problem using the Revised Simplex Algorithm.

    Solve a Linear Programming (LP) problem using the Revised Simplex Algorithm. Iteratively pivot until there an optimal solution is found or it is determined that the solution is unbounded. Return the optimal vector x.

    Definition Classes
    RevisedSimplexMinimizerLP
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Convert the current revised tableau (basis, b_inv, b_, and c_) to a string.

    Convert the current revised tableau (basis, b_inv, b_, and c_) to a string.

    Definition Classes
    RevisedSimplex → AnyRef → Any
  34. def unbounded(u: VectorD): Boolean

    Check if u <= 0.

    Check if u <= 0., the solution is unbounded.

    u

    the vector for leaving

  35. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. var x_B: Array[Int]

    the initial basis (set of indices where x_i is in the basis)

Inherited from MinimizerLP

Inherited from Error

Inherited from AnyRef

Inherited from Any

Ungrouped