[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [Help-glpk] MathProg problem

**From**: |
Robert Fourer |

**Subject**: |
Re: [Help-glpk] MathProg problem |

**Date**: |
Mon, 21 Feb 2005 11:22:37 -0600 |

**User-agent**: |
Microsoft-Entourage/10.0.0.1309 |

You should be able to declare an indexed collection of sets, for example:
set BaseSET;
set SetColl {BaseSET};
param DataVals {s in BaseSET, t in SetColl[s]};
Each of the sets in the collection may be given different numbers of
elements. For example the data file could contain:
set BaseSET := a b c ;
set SetColl[a] := ABD KDL ;
set SetColl[b] := G H LKM H KI ;
set SetColl[c] := ZZ YY XX ;
SetColl can be used similarly to index parameters, variables, constraints,
sums, and the like.
Bob Fourer
address@hidden
In reply to the message from >>> Niyati Parikh <address@hidden>
received 2/18/05 11:13 PM:
>* Greetings,*
>* I am using MathProg to solve a Linear Programming Problem. I need to*
>* create a parameter that will be an array of Sets. How can I declare such a*
>* parameter ?*
>* *
>* At runtime I would give sets for this array. Note that these sets would be 1*
>* dimensional and would contain different number of elements.*
>* *
>* I appreciate your help.*
>* *
>* Thanks,*
>* Niyati Parikh*
>* Graduate Student*
>* Arizona State University*
>* *
>* *
>* Yahoo! India Matrimony: Find your life partneronline.*
>* _______________________________________________*
>* Help-glpk mailing list*
>* address@hidden*
>* http://lists.gnu.org/mailman/listinfo/help-glpk*
>* *