我需要最小化字典的最大值。如何表达目标函数?
示例输入:A = {1: 1.0, 2: 2.0, 3: 2.0, 4: 1.0, 5: 7.0, 6: 1.0, 7: 4.0}
到目前为止,我已经尝试过:
- 计数 == 最大值(A.values())
- 计数 == max(A.items(), key=operator.itemgetter(1))[1])
模型.最小化(计数)
我得到的错误是:DOcplexException: Unsupported relationship operator: x282 > x281, only <=, ==, >= are allowed
感谢任何答案!