我有一个正在转换为 GLPK 的 AMPL 模型文件。它始于:
param n; # The number of nodes in the graph
set V := {1 .. n}; # The set of vertices in the graph
set E within V cross V; # The set of edges in the graph
set NE within V cross V := {i in V, j in V: i < j} diff E;
set FIXED within V cross V default {}; # The set of demand pairs with fixed flow
运行此程序时,我收到以下错误:
_test.mod:5: set expression following default must have dimension 2 rather than 1
Context: : i < j } diff E ; set FIXED within V cross V default { } ;
MathProg model processing error
这一定是 MathProg 与其超集 AMPL 之间的句法差异——在 AMPL 中运行代码可以完美运行。如何在 MathProg 中表达一个 2D 空集?