We have a set of n nodes. From each node, we can place one outgoing edge. The goal is to place them in an optimal way.
Associated with each node is a set S of k elements. If there is an edge from x to y, we can "cross out" all elements in S(x) which are also in S(y). That applies even if those elements are also crossed out.
The goal is to minimise the number of elements which are not crossed out. However, if there is a cycle, those elements which are present in all the nodes in the cycle (and therefore crossed out in all of them) must still be counted once.
How should the edges be chosen? Is there a polynomial-time solution?
My first thought was that the optimal solution should not contain any cycles. Then each pair of nodes would have a potential weight of how many things they have in common, and we could use Kruskal's algorithm. But it turns out sometimes the optimal solution does have cycles, so that doesn't work. My latest idea is an algorithm which basically branches whenever it finds a potential cycle; I'm pretty sure it finds an optimal solution, but it's not guaranteed to be polynomial, and in fact seems to be quite slow in the typical case.
Any ideas?
