help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] how to defne an array (something like pointer to pointer


From: Andrew Makhorin
Subject: Re: [Help-glpk] how to defne an array (something like pointer to pointer in C)
Date: Tue, 12 May 2009 16:45:59 +0300

> thank you all,it worked well,but i have another question:

> i have a parameter Ec: AB BC CD DE:=
> AB 0 1 1 0
> BC 1 0 1 1
> CD 1 1 0 1
> DE 0 1 1 0;

> and it means that for example nodes AB and BC are connected, and AB and
> CD are also connected. Ec has a 1 value for each two nodes that are
> connected.

> the problem is that i want to define a var x like this:
> var x {u in Vc, v in Vc} binary >=0; ""if (u,v) in Ec""
> and we have: Vc := AB BC CD DE;

> i mean i want to have var x just for those pairs of Vc that have value 1
> in Ec, i want to define something like this:
> if EC[u,v]==1 then var x {u in Vc, v in Vc} binary >=0;

> but i don't know how to write if clauses.

> i'd be really grateful if you could help me with this problem too.

var x{u un Vc, v in Vc: EC[u,v] = 1}, binary;






reply via email to

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