@sullen warren
I am attempting to create a rubik's cube solver in C#. The best way to do this is to code a IDA* search, with heuristics guiding it To do this I must build 3 Pattern Databases, one for the corners and 2 for each set of 6 edges. At every level, whenever a new corner/edge state is reached, the number of moves away from the original solved state it is, is then stored in a hashtable, which I have as an array of bytes at the moment for memory's sake. For corners there are 88179840 possible cornerStates, as each corner cubie can be placed in 8 different position, with 3 orientations. The position and orientation of the 8th corner cubie is determined by those already in place, so the formula is 8!/1! x 3^7. For both sets of 6 edges, there are 42577920 possible states. This time i believe the formula is 12!/6! x 2^6, as each edge cubie can go into 12 possible slots, but only 6 will be filled up by the end. Each also has 2 possible orientations. Richard Korf carried this out in 1990 or something, and after reading his paper i attempted it myself. However, after populating all 3 of my PDBs, I have encountered several problems. The first is that in Korf's paper, he states "Since this value ranges from zero to eleven" for number of moves from a solved state, for every corner state. For edge databases, "Number of moves needed to solve them ranges from 0 to 10". However, after populating my tables I have gotten these results (attached images). These are incorrect, firstly because all 3 tables have gone over the limit of 10 moves, and also the edge tables are not being populated correctly. However, I believe that my hash functions are perfect, so do not understand why it is not at least assigning the edge states correctly. Link to original paper: https://www.cs.princeton.edu/courses/archive/fall06/cos402/papers/korfrubik.pdf
My code:
https://srcb.in/uHPMgKaEDz (had to combine to one file to stay under file limit)Its a lot to ask but any help would be enormously appreciated