Clustering for inventory control systems