Finding the most natural route between two points on the grid

How can I find the most natural route (something a person can do) between two points, assuming I have an array of bytes, with each bit representing a square of a fixed size and indicating whether it is accessible or not? For example, assuming the array represents the following grid:enter image description here

If the gray squares cannot intersect, I need an algorithm that finds the path indicated by the orange squares, and not the one represented by the brown squares.

, , , , . ( ). , , .

EDIT: , , "". , , , .

+4
3

A * - , , "" .

, :

/* "Octile" heuristic */
int h(node n)
{
  int dx = abs(n.x - goal.x);
  int dy = abs(n.y - goal.y);

  if (dx > dy)
    return 14 * dy + 10 * (dx - dy);
  else
    return 14 * dx + 10 * (dy - dx);
}

: SW, SW, SW, W, W, W , SW, W, SW, W, SW, W ( ).

( ).

Amit ( *).

+2
+2

, - .

8 . , ( 0). ( 45, 90 135 , , ). ( N S, W E, SW NE ..). ( / , , ).

A * . , "" "".

+2

All Articles