| 概述 | 组 | 树 | 图形 | 不推荐 | 索引 | 概念 |
该函数创建并返回一个约束条件,规定 "array的受约束枚举变量在固定时必须取不同的值。 换句话说,该约束扩展了操作符 "!=,用于约束变量数组。 该约束在搜索过程中使用,例如在目标("IlcGoal实例)或约束("IlcConstraint实例)中使用。 如果您想在IBM®ILOG® Concert Technology模型中使用类似功能,请参阅《IBMILOG Concert Technology 参考手册》中的 "IloAllDiff文档。
如果没有明确说明过滤级别,CP 优化器将使用该约束的默认过滤级别(即 "IlcBasic)。可选参数 "level可以使用枚举 "IlcFilterLevel"中的一个值,但值 "IlcLow"除外。 请参阅 "IlcFilterLevel,了解过滤器级别及其对约束传播的影响。
您必须发布返回的约束条件才能将其考虑在内,例如,将其添加到 "IloCPEngine实例中。
示例
For example, if you are looking for a Hamiltonian path in a graph that contains no directed cycles, (that is, you are looking for a path that visits each node exactly once) then IlcAllDiff with the parameter IlcExtended applied to an array consisting of the next nodes in the graph will produce the best propagation. 事实上,它将实现搜索的弧形一致性。
有关详细信息,请参阅《IBMILOG Concert 技术参考手册》中的 "IloAllDiff。
另请参阅: