I have a graph with $N=12$ nodes. Some nodes may not have any edge between them. every edge has a weight. How to find the optimal partitioning of the graph so that total weight in the system is maximised.
Let the weight matrix is given by $W$ of size $N\times N$. The diagonal elements of $W$ are ones, therefore, if there is no edge between two nodes, the corresponding element in $W$ is 1.
Each part can have maximum 3 nodes and minimum 1 node. I want to find the optimal number of parts, and the nodes belonging to each part.
I want to find the partition that gives the maximum total weight sum.
- If there is only one node in a part, its weight sum is one.
- If there are two nodes in a part, then the weight sum is 1+1+weight between the nodes.
- If there are three nodes in a part, then the weight sum is 1+1+1+weights among the nodes.
EDIT: Data Sample
$N=15$
w={{0 0.0246848918296812 0.0222939272001262 0 0 0 0 0 0 0 0 0 0 0.0222250595626355 0},
{0 0 0.0223369829389658 0 0 0 0 0.0222127811912141 0.0222755933905518 0 0 0 0.0221795079043392 0.0223864339914097 0},
{0 0 0 0 0 0 0 0 0 0 0 0 0 0.0224654059932641 0},
{0 0 0 0 0.0228810151692974 0.0263781458115140 0 0 0 0 0 0.0225237815238005 0.0222085450604959 0.0224040301919779 0.0221851115072885},
{0 0 0 0 0 0.0221812062988533 0 0 0 0 0 0 0 0 0.0221772974146853},
{0 0 0 0 0 0 0 0 0 0 0 0.0221782447553519 0.0221942685958015 0 0.0221829507373709},
{0 0 0 0 0 0 0 0.0225053331512079 0.0239075792682171 0 0 0 0 0.0222343245946427 0},
{0 0 0 0 0 0 0 0 0.0224947575431974 0.0259331832060178 0 0.0227525834204816 0.0223768752560173 0.0223839654721248 0},
{0 0 0 0 0 0 0 0 0 0 0 0 0.0223333187890952 0.0233707396802904 0},
{0 0 0 0 0 0 0 0 0 0 0.0247836632820100 0.0231195566008868 0.0237113172691831 0.0224461979778054 0.0222144718706271},
{0 0 0 0 0 0 0 0 0 0 0 0.0359523557525197 0.0232883288308498 0 0.0285710707914430},
{0 0 0 0 0 0 0 0 0 0 0 0 0.0221951174734581 0.0223024273663844 0.0225769922365633},
{0 0 0 0 0 0 0 0 0 0 0 0 0 0.0237292800085860 0.0222613790897664},
{0 0 0 0 0 0 0 0 0 0 0 0 0 0 0},
{0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}}