Class ILPNode

    • 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
      • 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.