Package com.artelys.kalis
Class KLinearRelaxationSolver
- java.lang.Object
-
- com.artelys.kalis.KRelaxationSolver
-
- com.artelys.kalis.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KLinearRelaxationSolver.SolveAlgorithm
Resolution algorithms
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KRelaxationSolver
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KLinearRelaxationSolver(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
void
generateCuts(KLinearRelaxation relaxation)
Cut generationprotected static long
getCPtr(KLinearRelaxationSolver obj)
double
getReducedCost(KAuxVar var)
double
getReducedCost(KNumVar var)
int
writeLP(java.lang.String filename)
Writes the current problem to a file (in lp format).
-
Methods inherited from class com.artelys.kalis.KRelaxationSolver
getAlgorithm, getBestBound, getBound, getConfigurator, getCPtr, getInternalPtr, getLPSolution, getLPSolution, getMIPSolution, getMIPSolution, getNumberGlobals, getTimeSpentInLastComputation, getTotalTimeSpentInComputation, instantiateNumVarsToCurrentSol, instantiateNumVarToCurrentSol, isGlobal, isGlobal, print, setAlgorithm, setAllGlobal, setConfigurator, setGlobal, setGlobal, setIndicatorsGlobal, setMaxMIPSol, setObjective, setSense, setSolveAsMIP, solve, solveAsMIP
-
-
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KLinearRelaxationSolver obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKRelaxationSolver
-
delete
public void delete()
- Overrides:
delete
in classKRelaxationSolver
-
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)
-
generateCuts
public void generateCuts(KLinearRelaxation relaxation)
Cut generation- Overrides:
generateCuts
in classKRelaxationSolver
-
-