Highs with python-mip is slow
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- performance
Research direction
Start with the reproduction script in the issue and run it on Ubuntu with Python-MIP 1.16tc0, comparing Highs, CBC, and GRB variable-addition times. Trace the Highs path used by add_var and identify why adding 10,000 variables is much slower; done means the Highs timing is substantially improved without regressing the other solvers.
Written by the indexing model from the issue text.
Description
Hello, everyone
Firstly, thanks for the great package and also for adding support for Highs.
However, it seems that creating a optimization model with Highs is rather slow.
Describe the bug
Adding variables to a Highs optimization model is slow.
To Reproduce
import sys
import mip as pm
from timeit import default_timer as dt
def main(solver):
m = pm.Model(solver_name=solver)
ini = dt()
x = {i: m.add_var() for i in range(10000)}
print(f"{dt() - ini} seconds to add vars", flush=True)
if __name__ == '__main__':
main(sys.argv[1])
Expected behavior
GRB: 0.021987227955833077 seconds to add vars
CBC: 0.026054809102788568 seconds to add vars
Highs: 6.408406416885555 seconds to add vars
Desktop (please complete the following information):
- Operating System, version: Ubuntu 23.10
- Python version: 3.11.6
- Python-MIP version (we recommend you to test with the latest version): 1.16tc0
Thanks again!
- Dominant language
- Linear Programming
- Stars
- 601
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coin-or/python-mip
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
coin-or/python-mip#426 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#425 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
coin-or/python-mip#423 · 4 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
coin-or/python-mip#422 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#420 · 4 comments ·
All issues in coin-or/python-mip
Similar issues
-
community
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tenstorrent/tt-xla#6086 ·
-
chunk() never resets its size counter: past 500 KB every queued event is uploaded as its own request Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
segmentio/analytics-react-native#1334 ·
-
🎙️ task - perf(jest): source keyrack once per run in globalSetup, not per suite file (~25s each) Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dbt-labs/dbt-common#375 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
melgarafael/DeskcommCRM#1571 · 2 comments ·