How to make solverstudio (pulp and cbc) report out

2019-07-23 19:35发布

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

标签: pulp
1条回答
2楼-- · 2019-07-23 20:04

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()
查看更多
登录 后发表回答