简体   繁体   English

获取 LP 松弛解值

[英]Getting LP relaxation solution values

To get the final solution after optimization in pyscipopt, we can do要在 pyscipopt 中优化后得到最终的解决方案,我们可以这样做

# 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.我想在分支定界树的每个节点获得 LP 松弛解决方案。 One method for doing this would be to use model.getVal(t_x_ij) for every (transformed) variable 'x_ij'.这样做的一种方法是对每个(转换后的)变量“x_ij”使用model.getVal(t_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.如果要求解 MIP,则需要求解过程中获取 LP 解值。 You need to implement a callback that is executed whenever a new node LP is solved.您需要实现一个回调,每当解决新节点 LP 时都会执行该回调。

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 .您可能想查看TreeD ,这是我创建的一个项目,用于在PySCIPOpt的 MIP 求解过程中检查和可视化各种与 LP 相关的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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