我一直在尝试使用GNU来解决序列化问题。但我无法写出这样的总结。
param n, integer, >= 3;
set O := 1..n;
param d{i in O,j in O};
var x{i in O,j in O}, binary, i < j;
var v{i in O,j in O,k in O}, binary, i < j < k;
maximize total: sum{i in O,j in O, i<j}(d[i,j] - d[j,i])* x[i,j] + sum{i in O,j in O, i<j}d[j,i];
s.t. tran{i in O,j in O,k in O, i<j<k}: x[i,j] + x[j,i] - x[i,k] + v[i,j,k] = 1;
感谢
您应该在"such that"子句i < j
:中使用:
而不是,
sum{i in O,j in O: i < j} ...
# ^ note ':' here