我一直在尝试使用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;
由于
答案 0 :(得分:0)
您应该在“此类”条款:
中使用,
代替i < j
:
sum{i in O,j in O: i < j} ...
# ^ note ':' here