Hello GLPK List,

Is there a method to pick an arbitrary single item from a set? I don't care which one, but I need to have a single element from a set such that I can uniquely and consistently identify it.

There is no order to the set, but /if/ there were an ordering to this set, I might reference this element as "nought". Put differently, say I have a set X:

set X, dimen 2 := {(5, 7), (1, 10), (23, -3), ("y", "x"), ("a", "abc")};

Is there functionality -- say a function called "pick()" -- to pick an arbitrary element from that set?

Put another way, /if/ I could put that set into a list:

list(X) == [(5, 7), (1, 10), (23, -3), ("y", "x"), ("a", "abc")]

then I could get an arbitrary element, perhaps like 'get(list(X), 0)'.

Is there a method to grab a single element from the set?

I'll point out that I have an ad-hoc method of this for a single-dimensional set (using a nested setof structure and a comparison operator), but can't do it for any higher-dimensionality sets.

Thanks,

Kevin

_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to