DBSCAN algorithm (from the trial round)