I have a code snippet for a transport problem like:
set i /1*50/
d /1*10/
Alias(i,j,k)
parameter
edge(i,j)
distance(i,j)
possible(i,d) 'a collection of possible nodes for d'
possible_edge(i,j,d) 'a collection of possible edge for d';
binary variable x(i,j,d);
I import all the edges from an excel file. But to reduce the number of variables, I'd like to create another parameter like possible node
and possible edge
.
suppose we run a shortest path algorithm form a source node i
and we define possible(i,d)
to be all i
where distance(i,j)
is smaller than a predefined threshold.
In other words, when the network node become larger and larger, I want to find out if there's any possibility to not define x(i,j,d)
for every (i,j)
combination? Like forcing to only have x(i,j,d)$possible_edge(i,j,d)
?? Is there anything like this??