Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 PuLP 获得混合整数线性规划问题的近似解?我的问题很复杂,确切的解决方案需要很长时间。
您可能不是指线性规划,而是混合整数规划。(最初的问题是关于 LP 的)。
LP 通常会很快解决,但我不知道为他们找到近似解决方案的好方法。您可能想尝试内部点或障碍方法并设置迭代或时间限制。对于 Simplex 方法,这通常不能很好地工作。
MIP 模型可能需要很长时间才能求解。求解器允许通过设置间隙提前终止(间隙 = 0 表示求解到最优)。例如
model.solve(GLPK(options=['--mipgap', '0.01']))