help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] sparse variables?


From: Guney Petek
Subject: [Help-glpk] sparse variables?
Date: Sun, 24 Feb 2008 17:04:50 -0500

Hello,

Is it possible to specify sparse variables in GMPL?
Such as:
var shipmWtoD {p in product, w in warehouse, d in demandpt, 1..T: MilageWhsDpt[w,d]>0} >=0, default 0.0;

which generates the syntax error:
<PRE>
Reading model section from Model.mod...
Model.mod:75: syntax error in variable statement
Context: ...demandpt , 1 .. T : MilageWhsDpt [ w , d ] > 0 } >= 0 , default
Model processing error
</PRE>

Here, MilageWhsDpt[w,d] is a sparse parameter denoting the distance between relevant nodes. defined as
<PRE>
param MilageWhsDpt default 0.0    :=
[WhsA,DptB]    1
[WhsA,DptC]    1
[WhsB,DptE]    1;
</PRE>

I think, 'default' keyword cannot be used with variables but then removing the default keyword makes glpsol look for some shipmWtoD variables which depend on some MilageWhsDpt values which is 0.0 due to the sparse nature of that data.

Error:
Model.mod:127: shipmWtoD[Prod1,WhsA,DptE,1] out of domain
Model processing error

What I would prefer is that GMPL does not create those variables at all. Is this possible?

Any ideas are welcome.
guney

reply via email to

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