回楼上
把-1去掉不行,我后来试的另一个打乱出现了两个16步解,而且第二个是在threshold=15的时候第一阶段16步,第二阶段0步回复 91# 的帖子
伪码是这样的:maxLength=9999function Kociemba ( position p)
for depth d from 0 to maxLength
Phase1search( p; d )
endfor
endfunction
function Phase1search( position p; depth d )
if d=0 then
if subgoal reached and last move was a quarter turn of R, L, F, or B then
Phase2start( p )
endif
elseif d>0 then
if prune1<=d then
for each available move m
Phase1search( result of m applied to p; d-1 )
endfor
endif
endif
endfunction
function Phase2start ( position p)
for depth d from 0 to maxLength - currentDepth
Phase2search( p; d )
endfor
endfunction
function Phase2search( position p; depth d )
if d=0 then
if solved then
Found a solution!
maxLength = currentDepth-1
endif
elseif d>0 then
if prune2<=d then
for each available move m
Phase2search( result of m applied to p; d-1 )
endfor
endif
endif
endfunction 不是去掉-1。我想我要慢慢理解这个2-phase。 支持一下,虽然看不懂。。。 感谢楼主。在8年前就研究了。我这小小辈学习呢。:lol:lol:lol不过现在我用VS2017编译是出好多错误的, 支持支持楼主呢:lol