PySCIPOpt icon indicating copy to clipboard operation
PySCIPOpt copied to clipboard

how to bind user variable to the nodes of the branching tree

Open Fengyuan-Shi opened this issue 4 years ago • 2 comments

I have installed the SCIP 7.0.1 using CMake, as well as PySCIPOpt 3.1.0 by running the command python setup.py install at my anaconda virtual environment. And pytest is running successfully. Now I want to implement branch and price algorithm using pyscipopt, while branching rule using some additional designed information. So this is my question: how to add additional variables (e.g. list) to nodes so that I can get the value of the variable of current node and set a new value to it in the function branchexeclp()

Fengyuan-Shi avatar Jan 25 '21 08:01 Fengyuan-Shi

Hi, please have a look at the conversation in #289 for pointers, is this what you are going for?

CGraczyk avatar Jan 25 '21 11:01 CGraczyk

Hi, please have a look at the conversation in #289 for pointers, is this what you are going for?

Thanks for replying to me, I mean the procedure variable like user_defined_parameter = list() , not the decision variables related to columns generated by pricer. I say bind a user variable means I want to define a list in the BBNode object such as I can get its value and set a new value: initial the list as node.user_defined_parameter = [0,0,0,0,0,0,0,0,0,0] while create new child nodes after branching. while selecting node or variable to branch: curNode = model.getCurrentNode() evalResult = evaluateFunc(curNode.user_defined_parameter) curNode.user_defined_parameter = [1,1,1,1,1,1,1,1,1,1] that is what I mean "bind user variable".

Fengyuan-Shi avatar Jan 25 '21 14:01 Fengyuan-Shi

In case this is still relevant: I would solve this "externally", by using your own hashmap, e.g., which maps nodes to the information you want to store. Please reopen if you have any further questions.

ambros-gleixner avatar Aug 25 '22 04:08 ambros-gleixner