Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. README file for optimal Rubik's cube solver
  2. 1. Preliminaries.
  3. After you gunzip and untar the file you should have (besides the
  4. tar file) three files:
  5. % ls -l
  6. -rw------- 1 501 100 4629 2004-06-03 00:05 README
  7. -rw------- 1 501 100 133158 2004-06-03 00:05 optimal.c
  8. -rw------- 1 501 100 20552 2004-06-03 00:05 twist.c
  9. README is the file you are presently examining. optimal.c is the
  10. source code for the optimal solver. twist.c is the source code to
  11. a related utility (see below).
  12. 2. System requirements
  13. At least 80Mb RAM for the optimal cube solver. With less than 80Mb
  14. it probably won't run at any reasonable speed. I'm not even sure it
  15. will run well with 80Mb, so 88Mb or 96Mb is preferred.
  16. If you get it running on your system, I would appreciate if you let me
  17. know, so that I know it works on that type of system. Please send me
  18. e-mail to let me know that you have it working!!
  19. The program was developed on a Linux system, but should use only
  20. ANSI standard C.
  21. 3. Compiling the optimal solver
  22. The source file is optimal.c . It is presently configured to search by
  23. quarter turns. If you want to search by face turns, change line #5 to
  24. #define USE_METRIC FACE_TURN_METRIC
  25. You can also change the value of SEARCH_LIMIT if you desire.
  26. This will limit how far the program searches. The default value of 0
  27. means no limit.
  28. My preferred method of compilation is
  29. % gcc -Wall -O2 optimal.c
  30. but feel free to use something else.
  31. 4. Startup time
  32. Startup time is significant. On my processor (200 MHz PentiumPro), it
  33. takes about 11 minutes to generate all the tables. While it's working
  34. on this, be sure to read the next section about input format.
  35. This is greatly reduced on newer computers. On a 933MHz P3, it should
  36. only take 2 or 3 minutes.
  37. 5. Input to the optimal solver
  38. A solved cube is represented as
  39. UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR
  40. To input a scrambled cube, first give the cubie that's in the UF location,
  41. then the cubie in the UR location, and so forth, according to this list
  42. above. For example, "cube in a cube" would be
  43. UF UR RD RB LU LF DB DL FR UB DF BL UFR RFD RDB RBU LFU LUB DLB LDF
  44. This input should all be on one line. Some people have expressed their
  45. displeasure with this system. I can't say I disagree, but I can't think
  46. of any system that's easy. So your ideas here would be useful. Read on
  47. to the next section about using "twist.c" to convert a sequence of twists
  48. into a cube in the desired format.
  49. Sequences that are produced as output solve the cube from the input state.
  50. You may also interrupt a search by typing Ctrl-C . Instead of exiting,
  51. it will prompt you for another cube. (To exit, type Ctrl-D .)
  52. 6. Using "twist.c"
  53. This is just a hack. Input to this program is a sequence of twists, all
  54. on one line. It outputs two cubes, the position created by applying the
  55. sequence to a solved cube, and the inverse position. The twists should
  56. be in the form F F2 F' etc. this program doesn't require any
  57. optimization. I compile it using
  58. % gcc -o twist.out -Wall twist.c
  59. 7. Miscellaneous
  60. The number of nodes overflows on long searches. With gcc this can be
  61. fixed by changing the global variable n_nodes to type long long int.
  62. 8. To do list
  63. a. Experiment with other "pattern databases."
  64. b. Perhaps unroll subfunctions in initialize_distance_table
  65. to reduce startup time.
  66. c. Consider solving the inverse position if this is a little
  67. bit easier
  68. 9. Changes since last version
  69. The main change is that I have implemented automatic symmetry reductions.
  70. This means that the program will analyze the symmetry of the input
  71. position, and use this to reduce the search space. If you input a
  72. position with 12-fold symmetry, it will run 12 times as fast.
  73. This feature is turned on by default. You can turn it off by #define-ing
  74. the symbol USE_SYMMETRY to 0 .
  75. Some other minor things: fixed a bug in twist.c when there's white
  76. space at the end of the input line. I also reverted to new-style
  77. function declarations. And the program should run fine without needing
  78. excess stack space.
  79. 10. Feedback
  80. e-mail me with any questions, comments, etc. at reid@math.ucf.edu .
  81. Currently, there is a pointer to the files on the web page
  82. http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html
  83. Good luck, and enjoy the program. If you make any interesting discoveries
  84. with the program, please share them with me and the cube-lovers mailing list.
  85. June 3, 2004