writing .lp files very slow for large models

323 views
Skip to first unread message

Sunil Ahuja

unread,
Nov 27, 2018, 2:50:02 PM11/27/18
to Pyomo Forum
Hello! 

Is it possible to bypass writing out .lp files or is it a necessary step? I noticed that temporary .lp files are created, and perhaps those are sent to the solver? In my case, when models grow really large, this write step takes as long as 30 minutes and becomes the bottle-neck. 

Thanks! 
Sunil 

Bynum, Michael Lee

unread,
Nov 28, 2018, 11:09:35 AM11/28/18
to pyomo...@googlegroups.com
The answer to this depends on your application. 

If you are solving a large model once, you should consider the documentation for quicksum (https://pyomo.readthedocs.io/en/latest/developer_reference/expressions/performance.html#quicksum). In particular, if Pyomo knows an expression is linear, then writing that expression in lp format is much faster. 

If you are solving a model repeatedly with minor changes, you should consider the persistent solver interfaces (https://pyomo.readthedocs.io/en/latest/advanced_topics/persistent_solvers.html).

Michael

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunil Ahuja

unread,
Nov 28, 2018, 1:26:03 PM11/28/18
to pyomo...@googlegroups.com
Looks like quicksum is not released yet? It's only in master and not in 5.5.1, the latest version available via pip? What is the next release date?

Regarding minor changes to the model, I have a bigger question. The way my model updates is the following. One of my index/set is a time-series, and I need to march the result of the optimization in time. That is, at every step, I need to drop the first time-stamp from the set and append a new time-stamp at the end of the set. But most of my constraints are a function of this set as well, so I would need to reconstruct these constraints every time I change this set? That would be as expensive as just building constraints from scratch, isn't it? I can expand my explanation if it's not clear enough. 

Thanks,
Sunil 


 

You received this message because you are subscribed to a topic in the Google Groups "Pyomo Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyomo-forum/5NN6okba6I4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyomo-forum...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages