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: ibmdecisionoptimization.github.io/docplex-doc/mp/… $\endgroup$model_reader
module $\endgroup$.lp
or.mps
files. $\endgroup$