scratchpad hv <p>Given a grid of logical relationships, like: <table border=1> <tr><th><th>A<th>B<th>C<th>D<th>E</tr> <tr><th>1<td>0<td>0<td>1<td>1<td>0</tr> <tr><th>2<td>1<td>0<td>1<td>1<td>1</tr> <tr><th>3<td>0<td>1<td>0<td>1<td>0</tr> <tr><th>4<td>1<td>1<td>0<td>0<td>1</tr> <tr><th>5<td>0<td>1<td>1<td>1<td>0</tr> </table> (where '0' means the relationship is not possible, and it is known each letter corresponds to a different number), it is possible to deduce that {A, E} must correspond to {2, 4}, and {B, C, D} to {1, 3, 5}. What algorithm would be able to determine that sort of decomposition efficiently for a larger grid? Or, what search terms would help find such an algorithm? </p> <p># --- #</p> <p><c> # # The program 'vix' I use to launch vi sessions in an xterm # #!/usr/bin/perl -w my \$xterm = '/usr/X11R6/bin/xterm'; my \$vi = '/bin/vi'; my \$single = 0; my @xopts = qw/ -cm +cn -dc -j -s +sb -sl 0 -wf -fg white -bg black /; my @vopts = (); while (@ARGV && \$ARGV =~ /^-/) { my \$arg = shift; last if \$arg eq '--'; push(@xopts, '-iconic'), next if \$arg eq '-i'; push(@vopts, '-R'), next if \$arg eq '-r'; \$single = 1, next if \$arg eq '-s'; die "unknown option '\$arg'\n"; } @ARGV = '' unless @ARGV; for (\$single ? \@ARGV : @ARGV) { my \$pid = fork; die "fork: \$!\n" unless defined \$pid; next if \$pid; my \$name = \$single ? "vix session" : \$_; exec \$xterm, @xopts, -name => \$name, -title => \$name, -e => \$vi, @vopts, \$single ? @\$_ : \$_; } </c></p>