TAILLE wrote:Hi Rein,
Rein Halbersma wrote:
From your previous posts, I gather that you do not modify the hash table in any way, and only store additional information in the search. I know that this will solve the "draw-first" case of the GHI problem, and the implementation is very easy. But did you also solve the "draw-last" case of the GHI-problem? For a good explanation of those cases see Kishimoto's thesis or the attached paper by Campbell.
I already know this thesis but I have to confess that I do not quite understand this "draw-last" case. Two lines are described:
line A : X ...Y...X...
line B : X.......Y....
If you first explore line B and you discover a win, that means that after lineB moves X.......Y you discovered a path to the win avoiding position X and that means that lineA up to Y is also a win isn't it.
Can you clarify the problem?
In the Campbell paper, the lines are slightly different to what you sketch:
line A: root ... X ... Y ... X
line B: root ........Y.....X...
If you search A before B, you can detect the repetition of X, and flag all intermediate positions such as Y. If you then search B and find Y, then you can prevent line B from falsely returning a draw score. This is called the draw-first case. I suppose that this is at least part of your algorithm.
However, if you now search B before A, you will have stored a score for Y in the hash table (there are no repetitions in B). Then you search A and if you encounter Y, you will use the hash table score and you will miss the repetition. It seems impossible to detect this using search tree information when you reach Y in line A.
The Kishimoto-Muller solution solves this by storing path information in the hash table. In particular, if X was proven to be a win/loss in line B, it will use the hash table in line A on the first occurance of position X, and then it will first try the stored hash move of X, and this will prevent the exploration of Y and the second occurance of X in line A.
Note that Campbell claims that the draw-last case is not a problem if B's score is not smaller than a draw. So depending on the score of line B, and also depending on the depth where you will find Y in lines A and B, draw-last could be a problem.
You clearly understand my problem. My algorithm is not intending to solve only the loop detection problem. The major point was to build a algorithm that greatly improves the global performances of the program when kings are present in both sides. It was for me a known weakness of Damy because my previous algorithm was optimised for positions with only men and positions with kings on one side only.
I am now running a lot of tests to validate my new specific approach and I will soon be able to give you some results.
Can you tell me what kind of inefficiencies there are when both sides have multiple kings? It seems that this should not be much different from say rook endgames in chess? I don't think the chess people have special code to handle this situation.