Class 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.
    • Constructor Detail

      • NaiveRule

        public NaiveRule()
    • 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:
        pricing in interface SimplexPivoting
        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:
        ratioTest in interface SimplexPivoting
        Parameters:
        table - a simplex table
        s - a column
        Returns:
        the pivot row