Microsoft Solver Foundation 的 InteriorPointSolver 最小化了哪些函数?

发布于 2024-12-29 02:17:15 字数 787 浏览 3 评论 0原文

我正在尝试使用 InteriorPointSolver 用于解决具有线性约束的标准二次规划问题(根据可以找到的定义此处)。我的问题没有线性项(定义中的“c”向量)。我正在使用 设置“Q”矩阵SetCoefficient(Int32, Rational, Int32, Int32) 跨越我的所有变量(将“目标”行作为 vidRow 传递)。我假设 InteriorPointSolver 最小化二次规划问题标准定义中定义的目标函数是否正确?

我问这个问题是因为当我自己计算 x^T * Q * x 时(使用从求解器获得的 x 的最优解),我得到的值与求解器声称的最优目标函数值有很大不同(通过Statistics.Primal 或GetValue(目标))。我的计算和求解器的最优值唯一一致的时候是当我使用 Q 的单位矩阵时。我猜测我设置错误或者不准确理解正在最小化什么函数。

我已经查阅了我能找到的所有文档,但找不到关于内点求解器正在最小化的函数的良好解释。谁能引导我朝正确的方向前进?

I am attempting to use InteriorPointSolver to solve a standard Quadratic Programming problem with linear constraints (per the definition that can be found here). My problem has no linear term (the "c" vector in the definition). I am setting up the "Q" matrix by using SetCoefficient(Int32, Rational, Int32, Int32) across all my variables (passing the "goal" row as the vidRow). Am I correct in assuming that the InteriorPointSolver is minimizing the objective function as defined in the standard definition of the quadratic programming problem?

I ask this because when I calculate x^T * Q * x myself (using the optimal solution for x that I get from the solver), I get a value that is substantially different than what the solver claims the optimal objective function value is (via Statistics.Primal or GetValue(goal)). The only time my calculation and the solver's optimal value agree is when I use an identity matrix for Q. I am guessing that I am setting something up wrong or am not understanding exactly what function is being minimized.

I have consulted all the documentation I can find and cannot find a good explanation of exactly what function the interior point solver is minimizing. Can anyone guide me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

终止放荡 2025-01-05 02:17:15

事实证明,

SetCoefficient(goal, 2.0, x, y)

与两次调用的效果完全相同,

SetCoefficient(goal, 2.0, y, x)

都是在目标函数中设置 x*y 项的系数,第二次调用只是覆盖您在第一次调用中设置的系数。求解器将 xy 项与 yx 项区别对待,并且添加系数(正如我所预期的那样)。因此,如果您的目标是在目标函数中包含 4xy 项,则必须进行以下调用:

SetCoefficient(goal, 4.0, x, y)

而不是上面列出的两个调用。

As it turns out,

SetCoefficient(goal, 2.0, x, y)

Has exactly the same effect as

SetCoefficient(goal, 2.0, y, x)

The effect of both calls is to set the coefficient of the x*y term in your objective function, and the second call simply overwrites the coefficient that you set in the first call. The solver does not treat the xy term as distinct from the yx term, and does not add the coefficients (as I had expected). So, if your goal is to have a 4xy term in your objective function, you must make the following call:

SetCoefficient(goal, 4.0, x, y)

instead of the two calls listed above.

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