On Thu, 28 Jan 2016 07:56:05 -0800 (PST), Scotty C <costo...@hotmail.com> wrote:
>you knew this was coming, right? put this into your data structure of choice: > >16 5 1 12 6 24 17 9 2 22 4 10 13 18 19 20 0 23 7 21 15 11 8 3 14 > >this is a particular 5x5 tile puzzle >(#6 in www.aaai.org/Papers/AAAI/1996/AAAI96-178.pdf) >with the blank in a position where 4 children can be made. make a child while >extracting the value of the tile being swapped with the blank. compare child >to parent for equality. repeat that for the other 3 children. >> >i experimented a bit with the byte strings yesterday. what i'm doing with the >bignums can't be done with byte strings. But the problem is that you didn't sufficiently describe the problem. Way back in this thread you implied that you had extremely large FILES containing FIXED SIZE RECORDS, from which you needed to FILTER DUPLICATE records based on the value of a FIXED SIZE KEY field. That is the basic problem description that Brandon and Neil and I all perceived. I don't like speaking for others, but it is pretty obvious from the content of their posts. I will dig up the actual quotes if you don't believe that this is what you implied. And that is a problem which is not terribly well suited to hashing and in fact does not require any hashing at all to solve. And your revised problem as stated above still does not. The obvious solution is to encode the puzzle squares in a known order into adjacent 5-bit fields. That forms a nice 128-bit value with 3 unused bits. Those values can be compared directly for equality and we're back to you don't need a hash at all. Doesn't work for 6x6? Well 36 6-bit values fit neatly into 216 bits (27 bytes). 7x7 and 8x8 fit into 448 bits (56 bytes). 9x9 and 10x10 fit into 704 bits (88 bytes). Make the puzzle size a parameter to your programs: the needed field widths and the # of relevant bytes in the resultant "key" are trivial to calculate. And you still will not need hashing to remove duplicates. 8-) George -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.