Class NaiveRule
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.qp.lp.simplex.pivoting.NaiveRule
-
- All Implemented Interfaces:
SimplexPivoting
- Direct Known Subclasses:
SmallestSubscriptRule
public class NaiveRule extends Object implements SimplexPivoting
This pivoting rule chooses the column with the most negative reduced cost. This gives the biggest decrease in the cost per unit increase in the entering variable. However, since we cannot tell how much we can increase the entering variable until we perform the ratio test, it is not generally true that this choice leads to the best decrease in the cost in this step, among all possible pivot columns. Moreover, this naive rule does not prevent cycling, and should be used only for testing purpose.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.solver.multivariate.constrained.convex.sdp.socp.qp.lp.simplex.pivoting.SimplexPivoting
SimplexPivoting.Pivot
-
-
Constructor Summary
Constructors Constructor Description NaiveRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimplexPivoting.PivotgetPivot(SimplexTable table)Get the next pivot.intpricing(SimplexTable table)This is pivot column selection (pricing) rule.intratioTest(SimplexTable table, int s)This is pivot row selection (Ratio test) rule.
-
-
-
Method Detail
-
pricing
public int pricing(SimplexTable table)
This is pivot column selection (pricing) rule. We choose the column with most negative reduced cost (last entry in the column).- Specified by:
pricingin interfaceSimplexPivoting- Parameters:
table- a simplex table- Returns:
- the pivot column
-
ratioTest
public int ratioTest(SimplexTable table, int s)
This is pivot row selection (Ratio test) rule. The pivot row is the smallest basic variable index, r, such that row r satisfies -h(r) / H(r,s) = min {-h(i) / H(i,s) | H(i,s) < 0}- Specified by:
ratioTestin interfaceSimplexPivoting- Parameters:
table- a simplex tables- a column- Returns:
- the pivot row
-
getPivot
public SimplexPivoting.Pivot getPivot(SimplexTable table) throws LPUnbounded
Description copied from interface:SimplexPivotingGet the next pivot.- Specified by:
getPivotin interfaceSimplexPivoting- Parameters:
table- a simplex table- Returns:
- a pivot to reduce the cost;
nullif thetablealready optimal - Throws:
LPUnbounded- if the table is unbounded
-
-