python - Performance of pyomo to generate a model with a huge number of constraints -


i interested in performance of pyomo generate or model huge number of constraints , variables (about 10e6). using gams launch optimizations use different python features , therefore use pyomo generate model.

i made tests , apparently when write model, python methods used define constraints called each time constraint instanciated. before going further in implementation, know if there exists way create directly block of constraints based on numpy array data ? point of view, constructing constraints block may more efficient large models.

do think possible obtain performance comparable gams or other aml languages pyomo or other python modelling library ?

thanks in advance !

while can use numpy data when creating pyomo constraints, cannot create blocks of constraints in single numpy-style command pyomo. fow it's worth, don't believe can in languages ampl or gams, either. while pyomo may support users defining constraints using matrix , vector operations, not that interface avoid generating individual constraints, solver interfaces (e.g., nl, lp, mps files) "flat" representations explicit represent individual constraints. because pyomo needs explicitly generate representations of algebra (i.e., expressions) send out solvers. in contrast, numpy has calculate result: gets efficiency creating data in c/c++ backend (i.e., not in python), relying on low-level blas operations compute results efficiently, , bringing result python.

as far performance , scalability goes, have generated raw models on 13e6 variables , 21e6 constraints. said, pyomo designed flexibility , extensibility on speed. runtimes in pyomo can order of magnitude slower ampl when using cpython (although can shrink within factor of 4 or 5 using pypy). @ least historically, ampl has been faster gams, gap between pyomo , gams should smaller.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -