How to make solverstudio (pulp and cbc) report out conflict constraints in case of infeasble?

笑着哭i 提交于 2020-01-05 04:25:10

问题


I am using solverstudio (pulp and cbc). How to make the solver report out the conflict constraints? Thank you.


回答1:


If your problem is infeasible, then technically ALL of your constraints are in conflict. However, for whatever intermediate solution was found before the solver returned Infeasible, you can try this to see which constraints were violated:

for c in lp.constraints.itervalues():
    if not c.valid(0):
        print c.name, c.value()


来源:https://stackoverflow.com/questions/43861880/how-to-make-solverstudio-pulp-and-cbc-report-out-conflict-constraints-in-case

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