The phaseTwo module provides functions to build and clean a tableau for the first phase of the two-phased simplex method.
- Source:
Methods
(inner) buildPhaseTwoTableau(model, variables) → {Array}
- Source:
Builds a tableau by creating an objective function that will minimize the artificial variables.
Parameters:
Name | Type | Description |
---|---|---|
model |
Array | A two-dimensional array representing the original tableau minus the objective function. |
variables |
Array | An array of strings representing the variables of the tableau. |
Returns:
A tableau with the artificial variables minimized.
- Type
- Array
(inner) reBaseModel(model, variables, basicVariables) → {Array}
- Source:
Returns the model to canonical form.
Parameters:
Name | Type | Description |
---|---|---|
model |
Array | A two-dimensional array of numbers representing the current simplex tableau. |
variables |
Array | An array of strings representing the variables of the tableau. |
basicVariables |
Array | An array of strings representing the basic variables of the tableau. |
Returns:
A two-dimensional array with the rebased model.
- Type
- Array
(inner) cleanPhaseTwoTableau(model, objective, variables, basicVariables, nonBasicVariables) → {Array|string}
- Source:
Tests the tableau for infeasibility and cleans out artificial variables from the basis.
Parameters:
Name | Type | Description |
---|---|---|
model |
Array | A two-dimensional array of numbers representing the current simplex tableau. |
objective |
Array | The original objective function. |
variables |
Array | An array of strings representing the variables of the tableau. |
basicVariables |
Array | An array of strings representing the basic variables of the tableau. |
nonBasicVariables |
Array | An array of strings representing the variables of the tableau. |
Returns:
If the model cannot be solved returns 'infeasible'. Otherwise a two-dimensional array with the cleaned model and an empty string.
- Type
- Array | string