I have a very large linear programming problem (over 10,000 equations and 20,000 variables). The optimization problem is even included in a loop and solved many times. As a result, I want to use sparse matrices with an efficient solver to perform optimization. I know cvxopt can use commercial solvers like Cplex and Gurobi, but do I need a license? How do I call Cplex in cvxopt?
When I use: solvers.lp(f, Ain, Bin, Aeq, Beq, solver='gurobi') solvers.lp(f, Ain, Bin, Aeq, Beq, solver='cplex')
The problem can't be solved (shows infeasible). I think that is because I didn't include a license.
I am a student and I have a free Cplex license but don't know how to include it in Python cvxopt.
Here are my codes.
while(1):
# some code before
f=matrix(OPT['c1M'].T)
Ain=sparse_to_spmatrix(OPT['AinM'])
OPT['Xu']=np.reshape(OPT['Xu'],(len(OPT['Xu']),1))
OPT['Xd'] = np.reshape(OPT['Xd'], (len(OPT['Xd']), 1))
Bin=matrix(np.vstack([OPT['BinM'], OPT['Xu'], -OPT['Xd']]))
Aeq=sparse_to_spmatrix(OPT['AeqM'])
Beq=matrix(OPT['BeqM'])
sol = solvers.lp(f, Ain, Bin, Aeq, Beq,solver='glpk',options={'glpk':{'msg_lev':'GLP_MSG_OFF'}})
# some code after