[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [Help-glpk] How to add an index in GMPL?

**From**: |
Andrew Makhorin |

**Subject**: |
Re: [Help-glpk] How to add an index in GMPL? |

**Date**: |
Mon, 21 Dec 2009 16:26:07 +0300 |

>* I #39;m working on a scheduling problem in , and would like to add an*
>* index to each member of a set. That is, if I start with a set A, B,*
>* C, D, E ..., I #39;d like to end up with a set of tuples (1,A), (2,B),*
>* (3,C), ....*
>* I #39;m still crawling up the GMPL learning curve, but not sure of*
>* exactly the best way to do this. *
Probably you can use something like this:
set S;
/* A, B, C, ... */
param p{i in S};
/* p[i] maps i to 1, 2, 3, ... */
set T := setof{i in S} (p[i], i);
/* resulting set of doublets (1,A), (2,B), ... */