Given: n variables in X, and m sets of variables where each set, Ci contains a subset of X. I am trying to generate the graph G = (X, E) by picking the edges in E given the following constraints.
- Variables in each set Ci must be connected by a spanning tree (no extra edges).
- The graph should prefer spanning tree configurations so that the variance of the degrees of all nodes is maximised.
- Following the previous constraint, prefer spanning tree configurations such that the degrees of nodes have greater variance, rather than average all around. So given the choice between configurations resulting in nodes of degree 1, 2, 3 vs 2, 2, 2. Prefer 1, 2, 3.
X = {x1, x2, x3, x4, x5, x6}
C1 = {x1, x2, x3}
C2 = {x2, x4}
C3 = {x4, x5}
C4 = {x3, x5, x6}
The optimal solution for the given variables is:
Each subset of variables Ci is connected by a spanning tree, and the degree of x3 is maximised. x3 has a maximised degree, and there are nodes with degrees of 1 (preferred).
There are a few things I am having trouble with.
Actually defining the problem: this graph is a constraint graph which is to be processed under some tree decomposition or cycle cutset algorithm. Variables in each set Ci share a common attribute. I am trying to remove redundant constraints so that I can get a favourable tree structure, under some ordering, for the next stage. I'm wondering if this preprocessing step is a known problem.
Efficiently implementing this preprocessing step. I am thinking that it may be able to be reformulated as trying to minimise the average all pairs shortest paths, and then if there is a tie, pick the one with the greatest variance. And if this is the case, whether there is an efficient algorithm to do this.
EDIT: A simpler example without cycles.
X = {x1, x2, x3, x4}
C1 = {x1, x2}
C2 = {x2, x3, x4}
There is a spanning tree between, x1 and x2 for C1.
This image shows the graph if I chose all the edges instead of just the spanning tree. It is undesirable as I am trying to minimise the edges, and there is an avoidable cycle.
If I didn't create the x2 to x3 edge, the graph would have the minimal edges satisfied, but not optimal as x2 has a degree of 2. When choosing to not create the x3 to x4 edge, x2 has a degree of 3.
If I summed the degrees in both cases they are 6. But the second case has a greater variance in the degrees (which is preferred). This is where the concept of dependency comes in, if x2 is removed in the second case, all other nodes are disconnected. In the first case, there would still be an edge between x3 to x4.