I want to solve a problem with docplex.cp (module for Constraint Programming optimizer CPLEX for Python), and the problem is available in .lp or .mps formats. But I did not find the attribute for reading a file in it.
For the CPLEX itself, utilizing the cplex module it can be done as following:
import cplex
Model = cplex.Cplex("MyProblem.lp")
Model.solve()
But for the docplex module I tried to use import_model as following:
from docplex.cp.model import CpoModel
m = CpoModel()
Model = CpoModel.import_model(m,"MyProblem.lp")
Model.solve()
But it is not working as import_model only supports .cpo and .fzn formats.
docplex.mp? Maybe this helps: https://ibmdecisionoptimization.github.io/docplex-doc/mp/docplex.mp.model.html – JakobS Aug 01 '19 at 10:18model_readermodule – EhsanK Aug 01 '19 at 12:23.lpor.mpsfiles. – Mostafa Aug 12 '19 at 05:44