On Thu, 11 Aug 2005 00:09:46 +0100, Ralph Shumaker <[EMAIL PROTECTED]> wrote:

I have a problem that I have been trying to figure out by hand (for some time now). I may just simply not know the right logic with which to approach it, or it may be something best suited for a computer to iterate through the possibilities to find the best solutions. If computer iteration is the best approach, I would like to do it in Perl. (I won't have access to my Perl books for a while though, so I'm having to do the best I can without them.)

The data set has 41 units consisting of "A", "B", and "C":
("A" and "C" can *not* be beside each other within a unit.)
AAAA AAAB AABA AABB AABC ABAA ABAB ABBA ABBB ABBC ABCB ABCC
BAAA BAAB BABA BABB BABC
BBAA BBAB BBBA BBBB BBBC BBCB BBCC BCBA BCBB BCBC BCCB BCCC
CBAA CBAB CBBA CBBB CBBC CBCB CBCC CCBA CCBB CCBC CCCB CCCC

These units should be coupled into pairs that have only one step difference between them, like so:
AAAA       or       ABAA
BAAA                BBAA


What if you solve a more trivial problem? Drop the NOT -AC- / -CA- constraint. And rather than a list of pairs, make a table of pairs so that for each unit you have a string of units that do pair. My guess is that given an argument unit, you want a list of candidates units. (Thanks to Carl). Then generate a list of constraint violations, probably to use at argument time to ensure that you have valid input.

David Ray Russell

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to