How to feed LP files to the GLOP solver of or-tools?

醉酒当歌 提交于 2021-01-28 07:13:01

问题


I would like to use or-tools and the GLOP solver to solve linear programming problems.

I already have another program that creates LP files which are, as far as I know, fairly standard for defining linear programs.

Has anyone managed to pass those files directly to GLOP? What file format das GLOP understand and how do I pass them to GLOP?

Example lp file:

maximize 2x1 + 3x2 - x3
subject to
 x1 + x2 <= 1
 x1 + x2 + x3 <= 0
 x2 - 2x3 <= 2
bounds
 x1 free
 x2 free
 x3 free
end

Edit:

  • I am looking for a Java solution
  • LoadLinearProgramFromModelOrRequest seems to be the way. See here. I don't know how to use it though

回答1:


There is not API to read LP files, we did not write a good enough LP reader. We do support reading MPS files.



来源:https://stackoverflow.com/questions/56395430/how-to-feed-lp-files-to-the-glop-solver-of-or-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!