Percolation technique for galaxy clustering