Fast algorithm to find closed knight's tour -
i'm learning knight's tour algorithm. implemented using rescursive fine take long time , not closed tour.
now, i'm finding fast algorithm finding closed tour. can recommend me algorithm?
update: have readed somewhere heuristic find closed knight tour this: min[f(x, y)]
f(x,y) set of f(x,y)=min(x-1, n-x) + min(y-1, n-y)
, (x, y)
position of next step , n
size of chess board. how use heuristic?
the knight's tour problem in fact finding hamiltonian cycle in corresponding graph, known np-hard, problem may hard solve.
however, there several heuristics allow perform fast lookup. 1 of such heuristics warnsdorff's rule:
on each step move square, less possible moves available. if there several such squares, move 1 of them.
it's heuristics, , long time has been considered in fact solution knight's path problem, , examples showing second part of rule may lead incorrect decision found later computer usage.
Comments
Post a Comment