getPoint(0, 0); $endPosition = $grid->getPoint(count($map) - 1, count($map[0]) - 1); $astar = new BlackScorp\Astar\Astar($grid); $nodes = $astar->search($startPosition,$endPosition); if(count($nodes) === 0){ echo "Path not found"; }else{ foreach($nodes as $node){ echo sprintf('%s / %s : %s %s', $node->getX(), $node->getY(), $node->getScore(), "\n"); } echo $node->getTotalScore(); }