SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.multivariate.constrained.integer.linear.bb

Class ILPNode

• java.lang.Object
• com.numericalmethod.suanshu.optimization.multivariate.constrained.integer.linear.bb.ILPNode
• Constructor Summary

Constructors
Constructor and Description
ILPNode(ILPProblem problem)
Construct a BB node and associate it with an ILP problem.
• Method Summary

All Methods
Modifier and Type Method and Description
List<ILPNode> branching()
Get the children of this node by using the branching operation.
int dimension()
Get the number of variables.
RealScalarFunction f()
Get the objective function.
EqualityConstraints getEqualityConstraints()
Gets the equality constraints, hi(x) = 0
static LinearGreaterThanConstraints getGreaterThanConstraint(Vector minimizer, int i)
Construct a greater-than constraint for the branching greater-than subproblem.
static LinearLessThanConstraints getLessThanConstraint(Vector minimizer, int i)
Construct a less-than constraint for the branching less-than subproblem.
LessThanConstraints getLessThanConstraints()
Gets the less-than-or-equal-to constraints, gi(x) ≤ 0
boolean isCandidate()
Check if this node is a possible solution to the original problem, e.g., not pruned.
ImmutableVector solution()
the solution to the sub-problem associated with this node
String toString()
double value()
the value of this node
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• Constructor Detail

• ILPNode

public ILPNode(ILPProblem problem)
Construct a BB node and associate it with an ILP problem.
Parameters:
problem - an ILP problem
• Method Detail

• solution

public ImmutableVector solution()
Description copied from interface: BBNode
the solution to the sub-problem associated with this node
Specified by:
solution in interface BBNode
Returns:
the solution to the sub-problem associated with this node
• value

public double value()
Description copied from interface: BBNode
the value of this node
Specified by:
value in interface BBNode
Returns:
the value of this node
• isCandidate

public boolean isCandidate()
Description copied from interface: BBNode
Check if this node is a possible solution to the original problem, e.g., not pruned.
Specified by:
isCandidate in interface BBNode
Returns:
true if this node is a possible solution to the original problem
• branching

public List<ILPNode> branching()
Get the children of this node by using the branching operation.

This implementation assumes

• the parent node has a solution;
• the parent solution has more than 1 non-satisfying integral variable.
Specified by:
branching in interface BBNode
Returns:
the children of this node
• getLessThanConstraint

public static LinearLessThanConstraints getLessThanConstraint(Vector minimizer,
int i)
Construct a less-than constraint for the branching less-than subproblem.
Parameters:
minimizer - the node's solution
i - the index of a non-satisfying integral variable (the branching variable), counting from 1
Returns:
a less-than constraint for the branching less-than subproblem
• getGreaterThanConstraint

public static LinearGreaterThanConstraints getGreaterThanConstraint(Vector minimizer,
int i)
Construct a greater-than constraint for the branching greater-than subproblem.
Parameters:
minimizer - the node's solution
i - the index of a non-satisfying integral variable (the branching variable), counting from 1
Returns:
a greater-than constraint for the branching greater-than subproblem
• getLessThanConstraints

public LessThanConstraints getLessThanConstraints()
Description copied from interface: ConstrainedOptimProblem
Gets the less-than-or-equal-to constraints, gi(x) ≤ 0
Specified by:
getLessThanConstraints in interface ConstrainedOptimProblem
Returns:
the less-than-or-equal-to constraints
• getEqualityConstraints

public EqualityConstraints getEqualityConstraints()
Description copied from interface: ConstrainedOptimProblem
Gets the equality constraints, hi(x) = 0
Specified by:
getEqualityConstraints in interface ConstrainedOptimProblem
Returns:
the equality constraints
• dimension

public int dimension()
Description copied from interface: OptimProblem
Get the number of variables.
Specified by:
dimension in interface OptimProblem
Returns:
the number of variables.
• f

public RealScalarFunction f()
Description copied from interface: OptimProblem
Get the objective function.
Specified by:
f in interface OptimProblem
Returns:
the objective function
• toString

public String toString()
Overrides:
toString in class Object