高性能混合整数规划求解器,现代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.2.tar.gz
(31.2 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.2.tar.gz.
File metadata
- Download URL: mipsolver-1.0.2.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3297f6a31e10d043c20f21e9ef07bbac992466044e3437a0b62c7cf80878676d
|
|
| MD5 |
0a6d23c2b56080799adc6ac34ff20a12
|
|
| BLAKE2b-256 |
0797e786a64b78592fc899c0074f29e7c2a81bbf35b3de09893cf6f385f5f5d7
|
File details
Details for the file mipsolver-1.0.2-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: mipsolver-1.0.2-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 |
4c2f96841ab16bab41bcf71bd3880c9559797df42d46649cfd192d65d45b4afc
|
|
| MD5 |
6a8a32ac36d3b65fb7bf165da9a40a83
|
|
| BLAKE2b-256 |
af55958bb1f07d4e6a80b090920ca66a220b26a600101ffcb6b38bc249877c0b
|