Page 1 of 1

Node-edge constraint

Posted: Sat Feb 10, 2018 2:00 pm
by Damaskinos
Hi,

Imagine the situation of this constraint, which can be formally written as follows:

gamma(i,j) = gamma(i) for all i

I and j represent nodes as usually. Gamma(i,j) is value of binary variable representing if edge is connected (=0) or disconnected (=1). The same for gamma(i) = 1, then node is disabled, if gamma(i) = 0, nothing happens. It should be something like - if I disable node i, this means all connected edges (nodes) are also disabled. Gamma(i) is limited by ordinary budget constraint and prices. I wanted to use loop or for cycle, but it's not allowed. Of course, in my code I use gamma1(i,j) and gamma2(i) to have different names of those variables. Can you advice how to write this issue in GAMS?

Re: Node-edge constraint

Posted: Thu Feb 15, 2018 10:12 am
by Renger
Hi
Just a thought:
If you have a binary variable gamma(i) for the nodes and a binary variable delta(i,j) for the edges (if i is not activated, this doesn't mean that node j will be deactivated as there might be edges from other nodes), then you might do something like

gamma(i) - delta(i,j) = 0;

Hope this helps
Renger