public class BranchAndBound extends CplexSolver
Modifier and Type | Field and Description |
---|---|
protected static double |
INTEGER_PRECISION
Precision in numerical computations.
|
protected int |
iterations
Number of branch and bound nodes processed.
|
protected CplexSolver |
solver
Solver for the quadratic problems.
|
protected double |
upperBound
Best bound found in branch and bound tree.
|
constraints, cplex, linearCoefficients, linearPart, quadraticCoefficients, quadraticPart, x
Constructor and Description |
---|
BranchAndBound(double Omega,
double[] linearCoefficients)
Constructor.
|
BranchAndBound(double Omega,
double[] linearCoefficients,
double[] quadraticCoefficients,
int numContinuous,
int numVariables)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getIterations()
Gets the number of iterations/nodes used to solve the problem.
|
double |
getLowerBound()
Gets the lower bound of the problem.
|
int |
getQPs()
Gets the number of QPs solved.
|
double |
getRootRelaxation()
Gets the value at the root node of branch and bound.
|
double[] |
getSol()
Gets the optimal solution for the problem.
|
long |
getTime()
Gets the time used to solve the problem.
|
double |
getUpperBound()
Gets the objective value of the best feasible solution.
|
void |
setSolver(Main.ObjAlgorithm algorithm) |
void |
setTolerance(double tolerance)
Sets the tolerance for the solver.
|
void |
solve()
Solves the problem.
|
setConfiguration
protected static final double INTEGER_PRECISION
protected double upperBound
protected CplexSolver solver
protected int iterations
public BranchAndBound(double Omega, double[] linearCoefficients) throws ilog.concert.IloException
Omega
- The coefficient of the nonlinear term. linearCoefficients
- Coefficients of the linear part of the
objective. ilog.concert.IloException
public BranchAndBound(double Omega, double[] linearCoefficients, double[] quadraticCoefficients, int numContinuous, int numVariables) throws ilog.concert.IloException
Omega
- The coefficient of the nonlinear term. linearCoefficients
- Coefficients of the linear part of the
objective. quadraticCoefficients
- Coefficients for the separable quadratic. numContinuous
- Number of continuous variables. numVariables
- Total number of variables. ilog.concert.IloException
public long getTime()
CplexSolver
getTime
in class CplexSolver
public double getUpperBound()
CplexSolver
getUpperBound
in class CplexSolver
public int getIterations()
CplexSolver
getIterations
in class CplexSolver
public void setSolver(Main.ObjAlgorithm algorithm)
public void solve() throws ilog.concert.IloException
CplexSolver
solve
in class CplexSolver
ilog.concert.IloException
public double getLowerBound()
getLowerBound
in class CplexSolver
public double[] getSol()
CplexSolver
getSol
in class CplexSolver
public int getQPs()
CplexSolver
getQPs
in class CplexSolver
public double getRootRelaxation()
CplexSolver
getRootRelaxation
in class CplexSolver
public void setTolerance(double tolerance)
CplexSolver
setTolerance
in class CplexSolver
tolerance
- The tolerance to set.