[math-fun] Re: Marriage theorem generalization
Well, here's a reduction to what is hopefully a well-studied graph theory problem. Add two special sets: S, which contains only the interval [0,0], and E, which contains only [n+1,n+1]. Now make a graph G with a vertex for every interval and an edge between two intervals iff (1) the union of the two intervals is itself an interval and (2) the two intervals come from different sets. Thus, if there were k sets of intervals in the beginning, G is (k+2)-partite graph. The problem now becomes: find a path in G from [0,0] in S to [n+1,n+1] in E that visits each part of G at most once. As I said, I hope this is a well-studied problem, because all I know are bad solutions to it. (For example: starting at [0,0] and continually growing a list of valid paths to each vertex until you grow a valid path to [n+1,n+1].) Speaking of bad solutions, here's an algorithm for your general problem that isn't at all guaranteed to find a solution, but might often do so in practice. Let c(i) be the number of sets that don't contain i in one of the set's subsets. Pick the subset that maximizes sum_{j in subset} c(j)^N for some N >> k, and then recalculate all the c(i) with the picked set removed and c(i)=0 if i was in the picked subset. Repeat. (The exponent is there simply to turn sum into a "soft max" function, and can be replaced with an equivalent ordering on vectorized counts if you like.) -Thomas C
participants (1)
-
Thomas Colthurst