Its a little bit example to minimize time of clustering in cpp.
this code is 2 years old so dataset is missing, you can change it according to your requirments and it is highly optimized on my computer clusters are made on the given value of the cp and density you can also visualize the clusters by using your libraries.
sorting technique could be changed on your requirments and on your dataset.
you can also use threading ,openmp or others libraries to maximize the output and reduce the time.