DBSCAN implementation in C