hv has asked for the wisdom of the Perl Monks concerning the following question:
Update: this is now solved, see Re^2: decomposing binary matrices (2).
Given a set of variables and a set of values, with the property that each variable has a distinct value, we can get a matrix of booleans summarising the possibilities (such that a value of 1 means "possible", 0 means "not possible"):
A  B  C  D  E  

1  0  0  1  1  0 
2  1  0  1  1  1 
3  0  1  0  1  0 
4  1  1  0  0  1 
5  0  1  1  1  0 
With those constraints, we can derive additional information: since A and E are restricted to only two values between them, they must consume those two values; effectively we can split the above matrix into two smaller matrices:


While this is relatively easy to do by eye with a small grid, I'm looking for an efficient algorithm to find such decompositions for larger grids, for both the case as in the example above where the number of variables is the same as the number of values, and for the case where there are more values than variables (so not all the values are used).
I'm not sure quite where to start looking, so suggestions for useful search terms would also be appreciated  I suspect that I should be treating the '1's in the matrix as edges in a graph, but quite what I'm looking for in the resulting graph I've not been able to characterise.
Hugo