Search code examples
pythonoptimizationscip

Understanding the getOpenNodes function in pyscipopt


I am trying to implement node selection and for that I need to understand the getOpenNodes function in pyscipopt. It is supposed to give the leaves, siblings and children of the focus node.

  1. Are these disjoint subsets, and does their union give all the open nodes in the tree?
  2. How is the focus node decided? Is it the node on which branching was just performed (In the case where depth of the tree is greater than 1)?
  3. If that's the case, then I understand the meaning of children and siblings wrt the focus node. Does the leaves set include all the other open nodes in the tree?

Thank you! Please let me know if any clarification is needed.


Solution

  • The total number of open nodes is computed as children + siblings + leaves (see SCIPtreeGetNNodes). So, yes these sets are disjoint.

    The focus node is the node that is currently being processed, that is, SCIP solves the corresponding LP relaxation and then decides where to go next, depending on the node selection strategy.

    And yes, the leaves are all currently open leaves except for the siblings and children of the focus node.

    In general, it is often very helpful to check the SCIP documentation of the respective functions being called by PySCIPOpt.