Nonparametric methods for determining filaments of galaxies