Situation: I am trying to translate the A * algorithm into C ++ code, where diagonal movement is allowed, but I have strange behavior.
My question : Is it also necessary to take into account diagonal costs, even if there is no diagonal movement. When I do calculations without a diagonal value (with a “heuristic” coefficient of 10), I always have the same indicator of 80 (you can see it in the second figure, where I calculate fscore, gscore and hscore), and it seems really strange for me. Because of this (almost all nodes with fscore 80), the algorithm does not work because many nodes have the same smallest fscore of 80.
Or is this normal behavior, and implementing an A * star without a diagonal should do a lot more work (because more nodes have the same fscore minimum)?


I don’t think this question has anything to do with my code than with my reasoning, but I post it anyway:
pathFind.cpp
#include "pathFind.h"
node.cpp
#include "node.h"
c ++ a-star path-finding
Thomas
source share