Proposed New AMPL Features Draft of May 2?, 1997

Sets


Member extraction operators

All of the AMPL set operators and functions have sets as their return values. As a result, it is very hard to construct an expression for an individual member of a set that has a certain property. The following operators are intended to fill this gap:

arg min {indexing-expr} object-expr
arg max {indexing-expr} object-expr

Returns a member of the indexing-expr for which the minimum or maximum of the object-expr is achieved. In the case of ties, one arbitrarily selected member is returned. (Should there also be operators for determining the set of all members for which the min or max is achieved?)

member_of {indexing-expr}
unique_of {indexing-expr}

Returns a member of the specified set. If the specified set has more than one member, member_of chooses one arbitrarily, whereas unique_of signals an error. An empty specified set is an error for either operator.


True sets of sets

Although a declaration like
   set CLIQUE {1..nCliques} within NODES
is sometimes loosely said to specify a "set of sets", in fact it creates only a collection of sets CLIQUE[k] indexed over the set of all k in 1..nCliques. To use such a collection, it is necessary to define and use an underlying set (1..nCliques in this case) that often is not an essential part of the formulation. We describe below an extension to true sets of sets, which are sets whose members are also sets. Then we describe and discuss three models that could use this new feature to give a more natural and direct formulation.

More to come . . .



Comments or questions?
Write to info@ampl.com or use our comment form.

Return to the AMPL update page.

Return to the AMPL home page.


LAST MODIFIED 1 APRIL 1996 BY 4er.