MATLAB 中的敏感性分析
我有一个大规模的线性规划问题。我可以使用“linprog”在 matlab 中解决它。但是,它在一个循环内,我需要从第二次迭代到循环结束绕过它。这是一个简单的 LP,其形式如下:
最小化 a_i b_i 之和 英石。 ...
其中 a_is 是我的变量,b_is 是系数。在每次循环迭代中,只有 b_is 略有变化。我想要更改后变量的新值。 (请注意,Matlab 不使用单纯形法来解决大规模问题)。
有什么方法可以节省我在循环中的时间并且不多次求解LP?
谢谢
I have a large scale linear programming problem. I can solve it within matlab using "linprog". However, it is within a loop, and I need to bypass it from second iteration to end of my loop. It is a simple LP in the form of below:
Minimize sum a_i b_i
st. ...
Where a_is are my variables and b_is are coefficients. In each loop iteration only b_is change slightly. I want the new values of my variables after this change. (please note that matlab does not use simplex method for large-scale problems).
Is there any way I can save my time in the loop and do not solve LP multiple times?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,LP/IP 的敏感性分析不是 MATLAB 的强项之一。
选项 1:如果您可以使用 CPLEX 或 SAS,它们都有“热启动”方法,可以根据您以前的基础并快速提出一些建议。 (这是真正的敏感性分析。)
这是 一个 IBM/CPLEX链接设置初始解决方案。
同样,SAS/OR 也有 热启动选项。
选项 2:如果您只能访问 MATLAB
,请从 Matlab 文档中获取以下信息:“强制”它使用 Simplex。
注意:如果默认的内点方法更适合您的特定 LP,请首先像在迭代 1 中所做的那样求解它。然后将基本变量的上限和下限设置为解值,现在设置 linprog调用 Simplex 的选项。它会轻松解决它。
尝试将解决方案引擎切换为使用单纯形,并查看这是否有助于您对 LP 的第二次和后续迭代(对系数进行轻微更改)。
Note that Sensitivity Analysis for LPs/IPs is not one of MATLAB's strengths.
Option 1: If at all you can use CPLEX or SAS, they both have "warm-start" methods that will have your previous basis and come up with something fast. (This is true Sensitivity Analysis.)
Here's one IBM/CPLEX's link to setting an initial solution.
Similarly, SAS/OR also has warmstart options.
Option 2: If you only have access to MATLAB
From Matlab's documentation, here's how to "force" it to use Simplex.
Note: If the default Interior-point method is much better suited for your particular LP, first solve it as you are doing in iteration 1. Then set the Upper and Lower bounds of your basic variables to be the solution values, and now set linprog options to invoke Simplex. It will trivially solve it.
Try switching the Solution engine to use simplex, and see if that helps in your second and subsequent iterations of the LP with slight changes to the coefficients.