This version of PVS is now also used at CPW. I wonder why the research is with alpha as a lower bound, rather than score. I.e. whySven Schüle wrote:Gian-Carlo Pascutto wrote:Yes. Maybe we should repost the code with the 2 bugfixesSvenCode: Select all
Call from root: rootscore = PVS(-infinite,infinite,depthleft); int PVS(alfa,beta,depthleft) { if( depthleft <= 0 ) return qsearch(alfa,beta); // using fail soft with negamax: bestscore = -PVS(-beta,-alfa,depthleft-1); if( bestscore > alfa ) { if( bestscore >= beta ) return bestscore; alfa = bestscore; } for( all remaining moves ) { score = -PVS(-alfa-1,-alfa,depthleft-1); if( score > alfa && score < beta ) { // research with window [alfa;beta] score = -PVS(-beta,-alfa,depthleft-1); if( score > alfa ) alfa = score; } if( score > bestscore ) { if( score >= beta ) return score; bestscore = score; } } return bestscore; }
Code: Select all
// research with window [alfa;beta]
score = -PVS(-beta,-alfa,depthleft-1);
Code: Select all
// research with window [score;beta]
score = -PVS(-beta,-score,depthleft-1);