【问题标题】:Enumerating all basic feasible solutions列举所有基本可行的解决方案
【发布时间】:2019-07-02 11:37:31
【问题描述】:

我想列举线性规划的所有基本可行解。 我如何使用PuLP 做到这一点?

我已阅读 PuLP 文档,但不知道如何操作。非常感谢您的帮助。

【问题讨论】:

标签: computational-geometry linear-programming pulp polyhedra


【解决方案1】:

你可以用 Pulp 做到这一点,但这并不容易(当然只适用于小问题)。

首先用二进制变量对基进行编码。 IE。

b(i) = 1 if x(i) is basic (x(i) are all variables: structural and logical)
       0 otherwise

然后添加约束:

1. if b(i)=0 then x(i)=0 (i.e. if nonbasic then the variable should
                          be zero -- assuming non-negative variables).
2. sum(i, b(i)) = m      (the number of basic variables is equal to 
                          the number of constraints) 

然后使用这个算法:

step 1. Solve as a MIP.
        If infeasible: STOP 
step 2. Add cut to prevent the previous basis
        Go to step 1.

基本算法在here 中进行了解释,除了我们稍早停止:一旦目标恶化。这将列举所有的最优碱基。

【讨论】:

  • 谢谢!它可以工作并且易于定制。这是一个很好的解决方案。但是,我认为这种方法计算相同的基本可行解决方案,直到为每次运行 Pulp 找到最佳解决方案。如果我们可以利用这样的中间解的信息,让 Pulp 避免多次搜索相同的路径,这种方法可能会更快。可以这样做吗?
  • 如果存在简并解,您将看到多个碱基对应于一个看似单一的解。单纯形法也有同样的问题:一些迭代会导致基础发生变化,但没有进展。如果您熟悉线性规划,这应该不足为奇。
猜你喜欢
  • 1970-01-01
  • 2022-01-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-01-03
  • 1970-01-01
  • 2021-05-07
  • 1970-01-01
相关资源
最近更新 更多