amplglpkmathprog

GLPK: set expression following default must have dimension 2 rather than 1


I have an AMPL model file that I'm working to convert to GLPK. It begins:

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

When running this, I get the following error:

_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

This must be a syntactic difference between MathProg and its superset, AMPL—running the code in AMPL works perfectly. How does one express a 2D empty set in MathProg?


Solution

  • Alright, the hack of a solution is this:

    set FIXED within V cross V default {i in V, j in V: 1 < 0};
    

    Put an obviously false condition. It'll have the dimensionality you want and still be empty.