获取LP松弛解决方案值

发布于 2025-01-23 12:10:07 字数 294 浏览 0 评论 0原文

为了在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万劫不复 2025-01-30 12:10:07

如果要求解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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文