[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Constraints depending on the data section
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Constraints depending on the data section |
Date: |
Thu, 19 Jul 2007 20:07:19 +0400 |
> Part of my problem looks as follows:
> set X;
> var stilde{j in X, k in X} >=-1, <=1;
> where the variable stilde is constrained by a few conditions in the
> problem.
> Depending on the data section, I want to add some more constraints,
> which I don't know how to express.
> Imagine that in the data section I have:
> set X := a b c d;
> I would now like to express somehow in a constraint that
stilde[a,b] >= delta;
stilde[a,c] >= delta;
> where delta is a parameter. Note that depending on the problem, these
> constraints could involve different pairs of elements of X. That is why
> they have to be defined in the data section.
> I thought that I could add a parameter
> param stildeConstraint : 1 2 :=
> 1 a b
> 2 a c ;
> in the data section to express this, and write in the constraints section:
> s.t. constOutranking{i in 1..2}: stilde[stildeConstraint[i,1],
> stildeConstraint[i,2]] >= delta;
> Nevertheless, this does not seem to be appropriate.
> I receive as an error:
> "stildeConstraint requires numeric data"
> Does anybody know how this can be done in a more correct way ?
You should declare stildeConstraint as symbolic, e.g.
param stildeConstraint{...}, symbolic, in X;