test if equally close node has a better g cost