Use BFS to find the shortest path through a matrix

Given a matrix of NxN, with obstacles, find the shortest path through.