Automatic network clustering via density-constrained optimizationwith grouping operator