I have working A* algorithm, but I want to improve it. It finds the shortest path and everything appears as it should. The problem is that I want for route to keep distance (1 empty node or more) from non-walkable grid cells.
Any ideas how to solve this problem?
How it looks now:

What I want to do:
