dimod icon indicating copy to clipboard operation
dimod copied to clipboard

Add from_mps_file function for building CQMs

Open vgoliber opened this issue 2 years ago • 4 comments

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.

vgoliber avatar Jul 19 '22 16:07 vgoliber

Agree, we should have one.

arcondello avatar Jul 19 '22 16:07 arcondello

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.

arcondello avatar Jul 19 '22 16:07 arcondello

I don't know which existing packages work well and which have bugs to be honest!

vgoliber avatar Jul 19 '22 16:07 vgoliber

I have also been seeing requests for mps file readers from several customers and prospects.

krobbinsgit avatar Apr 18 '23 14:04 krobbinsgit