I tried to follow this article with the following example, but in my attempts it always ends up with a dead end.
If we take G being 10 in a straight line or 14 in a diagonal, and H the distance in horizontal or vertical to the target point, then we restart this search for every tile that is the nearest one to the target point.
I have this result: if we take one or the other direction with 54, it ends up with a dead end. For example, if we go up from 40 to 54, then to 60, when we restart the search with G and H, it ends up with "4" (second shema) and comes back in a dead end:
Why does this happen and how can I solve it?
I also looked at the wiki, but I did not understand the system with the colors and the code shown.