I have a fairly typical constraint satisfaction problem (CSP) and I expected to be able to find a Perl module to help me solve it. No such luck --- either it doesn't exist or I haven't yet found the correct set of search terms.

Here is the problem:

Find a set of B-bit integers such that: the size of the set is at least S AND for every pair (x, y) where y!=x, of set elements, w(x^y) >= W. Here, w(x) is defined as the number of non-zero bits in x.
For concreteness, let B=12, W=5 and S=20. This is an acceptable set:
{0xF7D, 0x473, 0x585, 0x3EB, 0x22E, 0xADA, 0xDE0, 0x906, 0x1FC, 0x310, 0x6D4, 0x01D, 0xF43, 0xA21, 0xFB6, 0x93B, 0xE8F, 0x448, 0x8E7, 0x6B9, 0x59A}
because it has 21 values and 21 >= S.

http://www.win.tue.nl/~aeb/codes/binary-1.html implies that the largest possible acceptable set has 32 members.

A simple-minded approach of choosing random integers in the range 0 ... 0xfff and testing for consistency with previously chosen integers has found sets with 24 members.

Question: can anyone point me to a module / script which can find significantly larger acceptable sets in a reasonable amount of computation. Brute force searching of a (2<<12)<<32 sized space is not reasonable!

Paul


In reply to Code for Constraint Satisfaction Problems by Xilman

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.