高性能混合整数规划求解器,现代Python API
Project description
MIPSolver
高性能混合整数规划求解器,提供现代Python API。
特性
- 高性能C++求解器核心
- 友好的Python API
- 支持线性规划和混合整数规划
- 跨平台支持(macOS, Windows, Linux)
安装
pip install mipsolver
快速开始
import mipsolver as mp
# 创建模型
model = mp.Model("example")
# 添加变量
x = model.add_var(name="x", vtype=mp.BINARY)
y = model.add_var(name="y", vtype=mp.CONTINUOUS, lb=0, ub=10)
# 设置目标函数
model.set_objective(3*x + 5*y, mp.MAXIMIZE)
# 添加约束
model.add_constr(x + 2*y <= 10)
model.add_constr(x >= 0)
# 求解
model.optimize()
# 输出结果
print(f"最优值: {model.obj_val}")
print(f"x = {x.value}")
print(f"y = {y.value}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mipsolver-1.0.10.tar.gz
(27.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mipsolver-1.0.10.tar.gz.
File metadata
- Download URL: mipsolver-1.0.10.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21b700ba55c185e6cb1e6213155e02a957d4749ea0fb8a40e66cbceed567b592
|
|
| MD5 |
ca0b483e097582b9f4278967577456ff
|
|
| BLAKE2b-256 |
79f71fc59870b2dcdfaed88e6888f6f3b13b0714fc50ed2a105b5eb96f7d7d17
|
File details
Details for the file mipsolver-1.0.10-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: mipsolver-1.0.10-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 217.5 kB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a61c129cab27657f6a56d9a13fcef1b676a0aef1f8c7e8f176002ef686d61456
|
|
| MD5 |
fb2e0b45901d8fabe8092e176b5a3441
|
|
| BLAKE2b-256 |
e8db51a17de397d43c326dc9965fd50fc8e064b7612bb61f742e8ad64729fff8
|