A* path finding algorithm on Matrix object.
Move cursor to search for new path.