高性能混合整数规划求解器,现代Python API
Project description
MIPSolver
高性能混合整数规划求解器,提供现代化Python API。
安装
pip install mipsolver
快速开始
import mipsolver as mp
# 创建优化模型
model = mp.Model("example")
# 添加变量
x = model.add_var(vtype=mp.BINARY, name="x")
y = model.add_var(vtype=mp.BINARY, name="y")
# 设置目标函数
model.set_objective(5*x + 8*y, mp.MAXIMIZE)
# 添加约束
model.add_constr(2*x + 4*y <= 10, "capacity")
# 求解
model.optimize()
# 获取结果
print(f"最优值: {model.obj_val}")
print(f"x = {x.value}, y = {y.value}")
特性
- 高性能C++求解器核心
- 现代化Python API
- 支持二进制、整数和连续变量
- MPS文件格式支持
- 跨平台兼容性
- 完整类型提示支持
许可证
MIT License
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.1.tar.gz
(31.0 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.1.tar.gz.
File metadata
- Download URL: mipsolver-1.0.1.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
385e648a0ab1a9944672722f50ed453b319b9d0ddaa210bac0b6ce5e33bf3f73
|
|
| MD5 |
9990a569d9d3e6e9451f1142deb0cb72
|
|
| BLAKE2b-256 |
a00e2db259a46a5bb17267302e9338b755f65c7c68e6341556b4f131ed8a9e1d
|
File details
Details for the file mipsolver-1.0.1-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: mipsolver-1.0.1-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 216.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 |
0bc887c9ef27e52b1b505edab99996b3603da9b756ffd2e15f5f2bb888ef8ffc
|
|
| MD5 |
72b5a14e0877cf403bb7cfe2113ab845
|
|
| BLAKE2b-256 |
8a8bb13ff3fccf89f8d9924a522d78727c9bae36a5173ad88706e8c31293bc8f
|