Solves the percolation problem, given an N x N set of sites