Node-edge constraint

Problems with modeling
Post Reply
Damaskinos
User
User
Posts: 8
Joined: 6 years ago

Node-edge constraint

Post 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?
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Node-edge constraint

Post 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
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply