简体   繁体   English

CPLEX中整数约束与二进制约束的复杂度

[英]Complexity of Integer vs. Binary Constraints in CPLEX

Recently, I have been trying to learn a bit about CPLEX and was hoping someone could help me understand the complexity when solving for integer vs. binary constraints. 最近,我一直在尝试学习一些关于CPLEX的方法,希望有人可以帮助我理解整数和二进制约束的求解复杂性。

For example, say we are trying to allocate a pie around 10 people for maximum utility, where each person has a utility that is linear with the amount of pie they receive. 例如,假设我们正在尝试分配约10个人的饼图以实现最大效用,其中每个人的效用与他们收到的饼图的数量成线性关系。 However, we want to introduce the constraint that at least 3 people have to get a bit of pie. 但是,我们要引入一个约束,即至少3个人必须得一点点馅饼。

What's the difference between thinking of this as a single integer constraint (number_of_people_with_pie >= 3) vs. 10 binary variables (person_1_has_pie + person_2_has_pie + ... person_10_has_pie >= 3)? 将其视为单个整数约束(number_of_people_with_pie> = 3)与10个二进制变量(person_1_has_pie + person_2_has_pie + ... person_10_has_pie> = 3)之间有什么区别? I would imagine the former is simplest but wonder if there is any benefits to forming the problem in terms of binary variables? 我以为前者是最简单的,但想知道用二进制变量来构成问题是否有好处?

In addition to this, any recommended reading for better understanding MIP and CPLEX would be greatly appreciated, especially in better understanding where the problem becomes NP or in what situations simplex struggles to find the global minima. 除此之外,任何对更好地理解MIP和CPLEX的推荐读物都将不胜感激,尤其是在更好地理解问题在哪里成为NP或在什么情况下单纯形难以找到全局最小值的情况下。

Thanks! 谢谢!

I agree with Alex and Erwin's comment that this really depends on what you want to model. 我同意亚历克斯(Alex)和欧文(Erwin)的评论,即这实际上取决于您要建模的内容。 For this particular model I disagree with Alex: to me it makes more sense to use one decision variable per person, otherwise it may become hard to figure out which person gets how much of the pie. 对于这个特定的模型,我不同意Alex的观点:对我而言,每个人使用一个决策变量更有意义,否则可能很难弄清楚哪个人从饼中得到了多少。

A problem becomes NP hard as soon as you add integrality or SOS constraints. 添加完整性或SOS约束后,问题就会变得难以解决。 A good reading for MIP in general is Alex Schrijver's "Theory of Integer and Linear Programming". 一般来说,对于MIP来说,不错的一本书是Alex Schrijver的“整数和线性编程理论”。 That should cover all the topics you need for an in-depth understanding of things. 那应该涵盖您对事物有深入了解所需的所有主题。

It really depends on the case but in yours I would use 1 decision variable rather than 10. 这实际上取决于情况,但在您的情况下,我将使用1个决策变量而不是10个。

Sometimes, that's not obvious and trying and measuring can prove oneself right or wrong. 有时,这并不明显,尝试和衡量可以证明自己是对还是错。 And that's one of the reason why using high modeling languages can help. 这就是使用高级建模语言可以提供帮助的原因之一。 (Abstract modeling languages such as OPL) (诸如OPL之类的抽象建模语言)

I recommend a MOOC on cognitive class : https://cognitiveclass.ai/courses/mathematical-optimization-for-business-problems/ 我建议在认知课堂上进行MOOC: https : //cognitiveclass.ai/courses/mathematical-optimization-for-business-problems/

and the OPL language manual : https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.studio.help/pdf/opl_languser.pdf 和OPL语言手册: https : //www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.studio.help/pdf/opl_languser.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM