You have a complete bipartite graph where each part contains exactly n nodes, numbered from 0 to n - 1 inclusive. The weight of the edge connecting two vertices with numbers x and y is x∧yx wedge yx∧
You have a complete bipartite graph where each part contains exactly n nodes, numbered from 0 to n - 1 inclusive. The weight of the edge connecting two vertices with numbers x and y is x∧yx wedge yx∧y (bitwise AND). Your task is to find a minimum cost perfect matching of the graph, i.e. each vertex on the left side matches with exactly one vertex on the right side and vice versa. The cost of a matching is the sum of cost of the edges in the matching. ∧wedge∧ denotes the bitwise AND operator. If you're not familiar with it, see {https://en.wikipedia.org/wiki/Bitwise_operation#AND}.