Computer Chess Club Archives




Subject: Re: mtd(f) and null move

Author: Tord Romstad

Date: 05:06:36 03/12/04

Go up one level in this thread

On March 11, 2004 at 19:40:01, Peter Alloysius wrote:

>could null move used in mtd(f)?

Yes.  I use the null move in my MTD(f) engine, and my impression is that
most others also use it.  The implementation is straightforward, you can
do it almost exactly like in a PVS search.

A problem is that null moves cause search inconsistencies.  This happens
in PVS as well, but the problem is more frequent in MTD(f).

Here is a very simplified pseudo-code version of my search:

int search(int gamma, int depth) {
  int g, value, null_value;
  move_t *m;

  if(depth < PLY) return qsearch(gamma, depth);

  value = evaluate();

  R = choose_reduction_factor();

  if(R && !check && value-biggest_hanging_piece_value >= gamma) {
    null_value = -search(-gamma+1, depth - (R+1)*PLY);
    if(null_value >= gamma) return null_value;

  g = -INFINITY;
  for(m = pick_move(); m!=NULL; m = pick_move()) {
    value = -search(-gamma+1, depth-PLY);

    if(value > g) g = value;
    if(value >= gamma) break;

  return g;


This page took 0.04 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.