How can I apply AMPLs ordered-set functions to pairs and higher-dimensional objects?
AMPL does not define any ordering on pairs, triples, or objects of higher dimension. Thus next, prev, and other functions that apply to objects in ordered sets cannot be applied to pairs, triples, or tuples of higher dimension. For the same reason, first, last and other functions of ordered sets may not be applied to multi-dimensional sets. You may apply these functions to individual indices of a multi-dimensional parameter or variable, however. The following examples are from steelT2.