Class KLinearRelaxationSolver

  • Direct Known Subclasses:
    KClpLinearRelaxationSolver, KCoinLinearRelaxationSolver, KXPRSLinearRelaxationSolver

    public class KLinearRelaxationSolver
    extends KRelaxationSolver
    This class is intended as a superclass for linear relaxation solvers.

    Such a solver must be provided with
    - a linear relaxation (KLinearRelaxation)
    - an objective variable (KNumVar)
    - a sense for optimization (KProblem::Sense).

    It relies on a LP/MIP solver to provide the following information:
    - a value (a bound for the relaxed problem, cf method getBound())
    - a solution, possibly not feasible for the original problem, but which can be used to guide the search for a feasible solution
    - if the problem is LP, reduced costs (that can be used for instance in the "reduced cost fixing" procedure).

    Since:
    2016.1
    • Constructor Detail

      • KLinearRelaxationSolver

        protected KLinearRelaxationSolver​(long cPtr,
                                          boolean cMemoryOwn)
    • Method Detail

      • getReducedCost

        public double getReducedCost​(KNumVar var)
      • getReducedCost

        public double getReducedCost​(KAuxVar var)
      • writeLP

        public int writeLP​(java.lang.String filename)
        Writes the current problem to a file (in lp format).

        Parameters:
        filename - the path of the file to write (existing file is overwrited, if any)
        Returns:
        return code is reserved for future use (for now, errors are trapped by an exception)