Grouping (γ) algorithm based on TPMMS