获取LP松弛解决方案值
为了在Pyscipopt进行优化后获得最终解决方案,我们可以
# define x to be a vector of x_ij variables
model.data = x
model.optimize()
X = model.getVal(x)
在分支和绑定树的每个节点上获取LP松弛解决方案。这样做的一种方法是使用model.getVal(t_x_ij)
对每个(转换的)变量'x_ij'使用。是否有比在所有转换变量上循环的更有效的方法? 如果您需要进一步的澄清,请告诉我。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要求解MIP,则需要在求解过程中获得LP解决方案值。您需要在解决新节点LP时实现一个回调。
您可能需要查看 treed ,我创建了一个项目,用于检查和可视化各种LP相关的信息。
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.