We have a large-scale optimization problem (~10K vars and ~10K constraints) in the form of LP format file (generated using Cplex library).
We wanted to solve that problem file using Cvxpy (with Gurobi solver - Note: Cvxpy is unavoidable), which doesn't accepts LP format file directly (rather constraint matrices/list).
So, is it possible to somehow read (/transform/parse) that LP format file into regular Numpy matrices?
scipy.sparseis what you are interested in (cvxpy supports both). 3) The task itself is 99% LP-format parsing, so focus on finding an accessible parser (in python). – sascha Feb 28 '22 at 20:15Numpyorscipy.sparsewould suffice. 3) Exactly, its about LP-format parsing, I tried out https://github.com/aphi/Lp-Parser but it fails (not robust on large-scale problems) – pqrz Mar 01 '22 at 02:24.lpfile (let's call itprob.lp), and you want to use gurobi, then why not just saym = read('probl.lp')and thenm.optimize()? – EhsanK Mar 01 '22 at 03:10Cvxpyis unavoidable becauseCvxpydoes clever transformations which stabilizes and significantly reduces runtime for our large-scale problem – pqrz Mar 01 '22 at 03:38lp formattopython matriceswould not work for us. – pqrz Mar 01 '22 at 03:55Cvxpy's transformed problemdecreases our runtime thenraw problem– pqrz Mar 01 '22 at 10:15LP format parsingtonumpy/scipy matrices. Especially, Do we have any ready made solution on this? – pqrz Mar 01 '22 at 10:58