问题标签 [pulp]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - How to prevent infeasible error with pulp and python?
I have an optimization problem and I write a python program to solve it. I used Pulp with the CPLEX solver:
I get the error:
My question is : How can I test if the problem is infeasible or not? I want to prevent this event like if problem is infeasible then return 0.
I tried :
and I tried
python - 如何在有限时间内运行纸浆模拟?
我在 python 上运行设施位置问题,并且只想运行 10 分钟,因为完整的解决方案需要 2 个多小时。我怎样才能做到这一点?
python - 如何使用 Python 在 Pulp 中获得最佳优化变量?
我正在使用 Pulp 和 Python 来解决优化问题。
我在用
现在,我想访问优化变量。这个怎么做?
在Pulp 的文档中,我发现了类似的东西,use_vars[i].varValue
但我应该循环获取整个向量。我可以像客观值一样直接得到它吗?有人熟悉纸浆吗?
python-3.x - PyCharm + conda + pip 包无法识别
我可以说我对 Python 世界很陌生,但对编程并不陌生。去年我一直在使用 PyCharm,并且我得到了 Python conda 发行版,通过包管理让我的生活更轻松。
最近,我一直在尝试使用一个名为 PuLP 的包,该包无法通过 conda 下载,但我使用 pip 安装。我意识到虽然 PyCharm 在运行我的代码时可以识别纸浆,但它不在可用的包中,我不确定是否在 PyCharm 内外使用了相同版本的 PuLP。具体来说,当我运行从终端查找已安装求解器的pullTestAll 命令时,识别的求解器与我在PyCharm 中运行完全相同的脚本时识别的求解器不同。
有人可以给我一个关于如何解决这个问题的提示吗?
python - 计算机关闭时运行 Python 脚本会发生什么?
我一直在使用 Python 中的 PuLP 求解器通过代码运行一个大型数据集。cdc 求解器本身已经花费了很长时间来解决 MILP 最小化问题,但这是意料之中的,因为数据集非常大。在运行程序的前 12 个小时内,我设法让我的电脑保持开启状态,但最终我的笔记本电脑因电池没电而关闭。令我惊讶的是,当我打开电脑时,Python 窗口仍然打开,代码仍在运行。我想知道,程序是否重新启动,从停止的地方继续,还是我应该怀疑它不再工作?
澄清一下,我知道 Python 程序可以正常工作——它为大型数据集的较小子集返回正确答案(它在 16 分钟内解决了 85% 的大型数据集的问题)。我会很感激我能得到的任何见解!
python - How do I generate PuLP variables and constrains without using exec?
I have written the following Python Code using the PuLP Library for solving the Knapsack Problem using the Integer Programming formulation. I am using strings to generate the LpVariable commands and add the constraints and then executing them with eval. Is there a way to do this without using eval?
python - 用纸浆处理 MILP 的近似解决方案
是否可以使用 PuLP 获得混合整数线性规划问题的近似解?我的问题很复杂,确切的解决方案需要很长时间。