Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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"):
ABCDE
100110
210111
301010
411001
501110

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:
AE
211
411
BCD
1011
3101
5111

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


In reply to decomposing binary matrices by hv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2021-10-22 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?