Can someone explain the Nielson sequence in the 8 puzzle more clearly?

I am learning the A * algorithm on an 8-puzzle.

I have no questions about A *, but there are some for the heuristic evaluation - the Nilsson sequence evaluation.

Web pages Justin Heyes-Jones - Algorithm A * explains A * very clearly. It has an image for Nilsson sequence ratings.

Nilsson's sequence scores

It explains:

Nilsson Sequence Evaluation

Tile in the center of counting 1 (as it should be empty)

For each tile not in the center, if the tile clockwise to it is not the one that should be clockwise to it, then a rating of 2.

Multiply this sequence by three, and finally add the total distance needed to move each tile to the correct position.

I can not understand the above steps for calculating points.

, , h = 17?

0 A C

H B D

G F E

, ,

B , 1

for each title not in the center, if the **tile** clockwise to **it** is not the one that should be clockwise to it then score 2. , .

title?

it?

it (B )? ?

, A, So C A, 2. B A, , ?

+3
1

:

0 1 2
7 8 3
6 5 4

N (x) x.

:

for each tile x in (A,B,C,...,H)
    score += distance from N(x) to the correct square for tile x
    if N(x)==8  # i.e. the tile is in the center
       score += 3*1
    else if N(next(x))!= (N(x)+1)%8
       score += 3*2

next (x) x , .. next (A) = B, next (B) = C,.., next (G) = H, next (H) = A

, :

  • (N (x) +1)% 8, ..
  • " "
  • A. C A, 2. C, D A, . D, E, F, G, , H, 0, 4. 1, B , 5. 3, 15. 1, B , 1, A , 17.
+5

All Articles