/// <summary> /// A* uses a best-first search and finds the least-cost path from a given initial node to one goal node (out of one or more possible goals). /// </summary> /// <param name="grid"></param> /// <param name="start"></param> /// <param name="goal"></param> /// <returns></returns> public static IEnumerable <Coordinate> Astar(this long[,] grid, Coordinate start, Coordinate goal) => grid.Astar(start, goal, (g, x) => g.Neighbors8(x));