help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Ordered Sets


From: Andrew Makhorin
Subject: Re: [Help-glpk] Ordered Sets
Date: Fri, 1 Dec 2006 07:46:08 +0300

> I would like to know if the symbolic sets are ordered or not.
> For instance:
> 
> set A;    #is a set of symbols;
> Param P{A};
> 
> ...
> s.t. sorted{s in A}: P[s+1]>=P[s];    #s is a symbol within A
> 
> #s+1 meaning the next element.
> 
> Is there a way to make this work?
> Is there a way to designate the first (the last, the nth) element of
> a set.
> 
> If I use a set of couple (symbol, index) a solution can be:
> s.t. sorted{(s,i) in A,(nexts,i+1) in A}: P[nexts]>=P[s];
> 
> Is there a more elegant solution?

Ordered sets are not implemented in GNU MathProg, because ordering
a set means defining a relation over that set, and I do not see an
easy way to do that. Do you agree that { a, b, c } = { b, c, a } ?
Then which element do you call the first (the last, the nth)?

Andrew Makhorin







reply via email to

[Prev in Thread] Current Thread [Next in Thread]