I presently have implemented iterative deepening (ID) with aspiration windows (pv of previous iteration is tried first, but otherwise hash best move is tried first if I'm not following the pv anymore). That works great.
I also have PVS implemented, and although I've been tempted to remove it from time to time, I still have it in there, I just can't seem to let go of it.
Now I want to implement Internal Iterative Deepening (IID). My understanding is if you don't have a hash best move, then do a cheap shallow search, e.g. Depth - 2, to try to get a best move that way, and if you do, sort that first. Seems simple in principle. Presumably, the cost of the shallow search is offet by the benefit of better move ordering.
My VB code for IID looks like this:
Code: Select all
'if no best move from hash, do a cheap shallow search to see if I can get a best move that way
If uiBestMove = 0 AndAlso iDepth > 2 AndAlso Not (fINNULLMOVE) Then
iVal = -iAlphaBeta(iDepth - 1 - 2, -iBeta, -iAlpha, tLocalPV)
If tLocalPV.iMoveCnt > 0 Then
uiBestMove = tLocalPV.aPVmoves(0)
End If
End If
This seems to help dramatically in some cases - I still need to further test, but I want to make sure I'm being smart about when/how to use IID. For example, should I use iDepth > 5 instead? Also, in googling around, I saw someone explain that this should only be used on PV nodes, but I don't understand that statement - a PV node is a node whose score is > Alpha (it won't fail low) - how could you know the node is a PV node unless you've tried a few moves to get a score > Alpha first? And you don't want to try the children moves until you've sorted them. I must be misunderstanding what is meant by a PV Node....
thanks for any clarification you can give me