我有一个模型需要将 var float 数组的每个元素限制为完全不同
我尝试使用全局 alldifferent 全局约束,但出现以下错误:
MiniZinc: type error: no function or predicate with this signature found: `alldifferent(array[int] of var float)'
所以我用以下理解替换了 alldifferent 约束:
constraint forall (i,j in 1..nVERTICIES where i<j) (X[i] != X[j]);
但是现在当我使用地理编码求解器时出现以下错误:
Error: Registry: Constraint float_lin_ne not found
当我使用 G12 MIP 求解器时出现以下错误:
flatzinc: error: the built-in operation `float_lin_ne/3' is not supported by the MIP solver backend.
有没有不同的方法可以编码这个约束?