Skip to content

Exact polynomial-time algorithms for weighted partial K-means with individual exclusion costs

Jiayi Yu, Baisuo Jin

math.OC

Abstract

Dupin and Nielsen (2023) established polynomial-time solvability for one-dimensional unweighted partial k-means, but left the computational complexity of the weighted case as an open problem. We resolve this question by developing exact polynomial-time algorithms for a more general weighted clustering problem, in which each observation is either assigned to one of at most K centers or excluded at an individual cost, subject to prescribed lower and upper bounds on the number of retained observations. This framework also captures weighted least-squares projection onto vectors with bounded support and a bounded number of distinct nonzero entries, a formulation motivated by categorical regression with unequal category frequencies. Although the ordering property established by Dupin and Nielsen enables an interval dynamic program, the computation of optimal single-center interval costs remains combinatorially nontrivial under unequal weights. We overcome this difficulty by expressing retention gains as quadratic functions of the center and developing a direct scan based on their pairwise intersections. We further accelerate this algorithm through adjacent exchanges and a shared global intersection list, reducing the cost of computing all interval costs to O(p4)O(p^4) operations, where p is the number of observations. Combined with the interval dynamic program, the resulting algorithm solves the overall problem in O(p4+Kp2U2)O(p^4+Kp^2U^2) operations, where U is the upper bound on the number of retained observations. For rational input data, we further establish polynomial bit-time solvability.

Create a lesson

Metadata

Categories
math.OC, cs.DS