dimod
dimod copied to clipboard
Add from_mps_file function for building CQMs
Application
We have a function from_lp_file
. Would be good to add one as from_mps_file
, as some databases provide problems in this format. Users are currently using 3rd party tools to do this conversion, and some have bugs.
Agree, we should have one.
Do we have an official recommendation in the mean time? AFAIK python-mip works pretty well.
import dimod
import mip
model = mip.Model()
model.read('example.mps')
model.write('example.lp')
cqm = dimod.lp.load(open('example.lp', 'r'))
Though of course doing it directly with Ocean would be preferable.
I don't know which existing packages work well and which have bugs to be honest!
I have also been seeing requests for mps file readers from several customers and prospects.