Tuesday, January 15, 2013

Hoopla! » Graph Traversal: solving the 8-puzzle with basic A.I.

Hoopla! » Graph Traversal: solving the 8-puzzle with basic A.I.: "Here’s the simplest way we can find the right node on the given tree.

best = nil
def walk(node)
best = node if best.nil? || node > best
node.children.each {|child| walk child }
end
walk root"

'via Blog this'