I'm using A-star algorythm in my game, and if no path exists it starts checking too many nodes (the grid is quite big) so, as I see it, I need to check if any path exists first. Not to find the actual path, just check if it exists or not. The only algorythm I can come up with is to recursively floodfill a bool matrix. There should be a better way, right?
Optional question: if no path exists to the target cell, how do I find a cell that is accessible (path does exist) and closest possible to the original target?
A* does exactly that... so no there is no significantly better way around (links to articles can be found in http://en.wikipedia.org/wiki/Shortest_path_problem)
If you can do pre-processing you can color all points so pairs that can be reached are colored the same. Than later when you get 2 points if color is different than there is no path.
To find closes point you can measure radius of points with the same color and than start finding path that reaches as close as that radius.