This is a pathfinder. Simply click to place the start point and click again to place the end point. A path will be drawn avoiding all black squares. Do not place the circles outside the grid, it won't work then.
Same algorithm (Breadth first search) but now with a visualisation so you can see how it works :) Interesting fact: Once you've picked a final location, this algorithm can actually path to it from *any* starting location using the map it generates. So its very useful if you always have to get to the same spot from different starting locations.