I need to create a matrix which constraints merging opportunities (presented in a integer vector). The merging opportunities are defined by adjacent nodes (i.e. connected by an edge) in an undirected network.
As an example, consider this undirected graph:
D
¦
A --- B-------
¦ .......¦.........¦
C----E------F
Starting from node A, I could merge B C and D. If B is part, F and E could be part as well. If C is part, E could be part. Moreover, I could merge all of them, or none of them. This is valid for all the possible starting node.
The matrix (or set of matrices) should be included in a constraint that limits a merging vector. As an example, a vector [A,B,0,0,E,0] should be allowed, while a vector [A,0,0,0,E,F] not, since it is not a contiguous space. Unfortunately, I am still not able to create a matrix with n columns that describes this merging possibilities.
Considering n nodes, it is possible to create n different matrices defining n different directed network (each starting from a different node). Unfortunately, this creates problems since not all the merging possibilities are allowed.
I even though to pre-create all the merging possibilities, but then the problem becomes too complex.
Thank you!