Re: next question - find some element of a set

2019-12-12 Thread Michael Hennebry
I think the answer is no: GMPL does not believe in the axiom of choice. -- Michael henne...@web.cs.ndsu.nodak.edu "Sorry but your password must contain an uppercase letter, a number, a haiku, a gang sign, a heiroglyph, and the blood of a virgin."

Re: next question - find some element of a set

2019-12-12 Thread Mate Hegyhati
Yes, sorry, forgot to mention that limitation. I may be wrong, but getting a Singleton set is doable. Getting its only element is the thing for which I don't see a way now. So it is possible to generate such a set, Selected, and include {s in Selected} everywhere where needed. One way to ge

RE: next question - find some element of a set

2019-12-12 Thread Meketon, Marc
Thank you. That works in the case that the array cost is numeric (and would work for me in this case!). The max function will not work if the array is symbolic. Out of sheer curiosity, I wonder if there is a general solution for getting an element from a set and putting that into a (symboli

Re: next question - find some element of a set

2019-12-12 Thread Mate Hegyhati
Hi! Thanks for the clarification. If I understand correctly, and ANY proper cost value is ok, and you don't need the element itself, just the cost value, then min/max could also work. param some_valid_cost := max{s in S} cost[s]; Another more "random" solution (more like a workaround): par

RE: next question - find some element of a set

2019-12-12 Thread Meketon, Marc
Here is more clarification. I have a set S and an array cost[]. I wanted to get a cost -- any cost -- that is found in the array cost. I didn't want to have to specify in the data section a sample element of S, I just wanted to use GMPL to find one. In the example below, I want to find