I have undirected graph with N nodes each with some weight. There are M edges and in exactly K operations I want to maximize the XOR sum of connected components of the graph. ((n1 XOR n2 XOR n3) + (c1 XOR c2 XOR c3)). (There can be multiple edges between 2 nodes.
I've tried attempting it with Minimum spanning tree with cut edge but couldn't succeed. Any help?