Algorithm for solving a puzzle or game in the fewest possible moves
God's algorithm is a notion originating in discussions of ways to solve the Rubik's Cube puzzle,[1] but which can also be applied to other combinatorialpuzzles and mathematical games.[2] It refers to any algorithm which produces a solution having the fewest possible moves. The allusion to the deity is based on the notion that an omniscient being would know an optimal step from any given configuration.
^Paul Anthony Jones, Jedburgh Justice and Kentish Fire: The Origins of English in Ten Phrases and Expressions, Hachette UK, 2014 ISBN1472116224.
^See e.g. Rubik's Cubic Compendium by Ernö Rubik, Tamás Varga, Gerzson Kéri, György Marx, and Tamás Vekerdy (1987, Oxford University Press, ISBN0-19-853202-4), p. 207: "...the Pyraminx is much simpler than the Magic Cube... Nicholas Hammond has shown that God's Algorithm is at most 21 moves (including the four trivial vertex moves). [More recently, three people have found God's Algorithm. The maximal number of moves is 15 (including the four vertex moves).]"