Your implementation is now very clear for me and obviously you know perfectly its weaknesses!Rein Halbersma wrote:1) White can reach square 16 in 2 moves (27-21-16) and black only in 3 (1-7-11-16), so 16 is assigned to white. If Black would have 1 on 7 already, 16 would be neutral, if 1 was on 11 already, 16 would be assigned to black. As soon as black actually reaches 16 in the search, square 21 becomes neutral (both white and black have 2 pieces adjacent to it).TAILLE wrote: I have several questions concerning the building of this diagram but let's begin by two basic ones:
1) How do you decide to assign square 16 to white?
2) Will the calculation of this diagram change if, in the original position, I move the white man on square 43 to the square 44 as in the following diagram:
2) The answer is "no", but I know it should be "yes". This is a weakness in the current algorithm.
Rein
In my approach, and taking the white point of view, I consider that any white move (except a move towards the edge, like 30-25 or 21-16) towards the half upper part of the board is dangerous. The move 27-21 is then assumed unsafe and, as a consequence, square 21 is neutral and square 16 is a black one.Rein Halbersma wrote: How does your algorithm assign square 16 to black? Does it "see" that white cannot safely do 27-21-16?
Rein
In order to give square 21 to white I have to wait for the move 27-21 in the dynamic search.
Yes Rein a number of problems have to be resolved like the three other following onesRein Halbersma wrote: Generally, there are several things that needs to be resolved to make this algorithm work:
1) determining whether a square can be "safely" reached first by a color: I use parallel bitshifts and majority rule to determine that
2) translating reachable squares to the maximally advanced position: this is the most tricky part because my current implementation does not take into account two crucial ingredients
a) left/right imbalance (the example of moving piece on 43 -> 44 is not correctly handled)
b) obstruction of own/enemy pieces (because I do simultaneous bitshifts)
3) assigning scores to current position and maximally advanced position: I used to simply count number of controlled squares and let each square count for 2 tempi, but now I think that N most advanced squares should count (for position with N pieces for each color)
I don't know how sensitive the playing strength is on these issues. I think that the dynamic search should take care of these subtleties: this is a static analysis and it's impossible to get it 100% right. Perhaps Ed can join the discussion as he has also implemented this algorithm but in a slightly different way.
Rein

of course it is only a part of a classical position. In this position you see the possibility 47-41-36-31 that gives 3 tempi but if in the position above the white man is on square 48 instead en 47 then this possibility disappear.

In this position I can understand that white could (?) control one of the squares 22, 23 or 24 but it would be completly incorrect to conclude that white controls all these 3 squares due to the only man on currently on square 33.

In this position and considering square 11, though black has 2 men against one, the square 11 is neutral isn't it?