After initializing k cluster centers randomly, each geometry is assigned to these clusters based on the unique distance metric where the distance is an indicator of the change in computational load after assigning geometry x to cluster center y as shown in Eq. ( ). The new center for each cluster is determined by the computationally most expensive geometry within the cluster; cluster centers determine the amount of padding needed for memory alignment of interaction lists for all geometries in their cluster. After centers are updated, a new iteration is performed where each geometry is reassigned to the closest cluster. Unlike the original K-Means algorithm, the order of geometries affects the result, therefore input geometries are shuffled after each iteration for randomization. The process continues until the cluster centers do not change anymore. Also to ensure high performance, the clustering algorithm is executed multiple times starting from different random initial cluster centers and the one where the total wasted computation (which can be determined by the total amount of padding) is minimal is chosen as the final clustering of the geometries. Although the algorithm does not guarantee optimality, empirical results are satisfactory.