答案 0 :(得分:1)
您可以使用Pulp执行此操作,但这并不容易(当然,仅适用于小问题)。
首先通过二进制变量对基础进行编码。即
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,只是我们在此稍早停止了:目标恶化后立即停止。这将枚举所有最佳基准。