DBSCAN (for density-based spatial clustering of applications with noise) is a data clustering algorithm proposed by Martin Ester, Hans-Peter Kriegel, Jörg Sander and Xiaowei Xu in 1996. It is a density-based clustering algorithm because it finds a number of clusters starting from the estimated density distribution of corresponding nodes.
The given code implements the DBSCAN Algorithm as specified in the book - Introduction to Data Mining by Tan, Steinbach and Kumar. You can study more about the algorithm in the book or other online materials.