简体   繁体   English

Python中实现的Korf魔方求解算法?

[英]Korf's Rubik's Cube Solving Algorithm Implemented in Python?

I have been trying to find an implementation of Korf's Rubik's cube solving algorithm in python as I am making a project where I am comparing algorithm efficiency.我一直在尝试在 python 中找到 Korf 魔方求解算法的实现,因为我正在制作一个比较算法效率的项目。 Unfortunately, I haven't been able to find any implementation so far, does anyone have any examples of Korf's algorithm in Python?不幸的是,到目前为止我还没有找到任何实现,有人在 Python 中有任何 Korf 算法的例子吗?

Korf's algorithm is not the best method for an optimal solver for Rubik's cube. Korf 算法不是魔方最佳求解器的最佳方法。 It is far better to implement an algorithm which exploits the symmetries of the cube which leads to smaller sizes of the pruning tables.实现一种利用立方体对称性的算法要好得多,这会导致修剪表的尺寸更小。 Michael Reid's optimal solver algorithm is best suited. Michael Reid 的最优解算器算法最适合。 It uses phase 1 of the two-phase algorithm (which can exploit 16 cube symmetries) in three different directions to exploit all 48 cube symmetries.它在三个不同方向上使用两阶段算法的第一阶段(可以利用 16 个立方体对称性)来利用所有 48 个立方体对称性。 The pruning depth for IDA* is considerably higher than with Korf's method on average. IDA* 的修剪深度平均显着高于 Korf 方法。

I am sceptical if Python if fast enough though.我怀疑 Python 是否足够快。 I may give it a try since I implemented my two-phase algorithm in Python and it should not be too difficult to adapt this code.我可以试一试,因为我在 Python 中实现了我的两阶段算法,并且调整这段代码应该不会太难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM