简体   繁体   中英

Getting LP relaxation solution values

To get the final solution after optimization in pyscipopt, we can do

# define x to be a vector of x_ij variables
model.data = x
model.optimize()
X = model.getVal(x)

I would like to get the LP relaxation solutions at every node of the branch and bound tree. One method for doing this would be to use model.getVal(t_x_ij) for every (transformed) variable 'x_ij'. Is there a more efficient way of doing this than looping over all the transformed variables? Please let me know if you need any further clarifications.

If you are solving a MIP, you would need to get the LP solution values during the solving process. You need to implement a callback that is executed whenever a new node LP is solved.

You might want to check out TreeD , a project I created to inspect and visualize various LP-related information during the MIP solving process of PySCIPOpt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM