I'm wondering how I can find the path with minimum number of "bending" points (like the ones shown in red) between two given squares ("Start" and "Finish"). The board has some impediments or broken squares on it (Black squares).
I tried to run a BFS algorithm and find all of the minimum cost paths and then pick up the one with minimum bending points, but this won't give us the optimal answer.
Is there a way to efficiently solve this problem?
Motivation: I was trying to solve a computer game using A* algorithm, and I figured out I can use the solution to this problem as a heuristic function to solve the game.