The k-center problem #
Given points with a distance d : V → V → α and a number k, the k-center problem asks for a
set S of at most k centers minimizing the largest distance from a point to its nearest center
([WS11], Section 2.2). This module defines the objective and proves the packing
lower bound shared by the 2-approximation algorithms.
Model #
Distances take values in a linear order α; the bounds additionally use a semiring structure
(ℕ, ℚ, ℝ, …) to write 2 * r. No metric axioms are part of the definitions: the results
that need them take symmetry d x y = d y x and the triangle inequality d x z ≤ d x y + d y z
as hypotheses, so a Mathlib PseudoMetricSpace instantiates them with dist. The distance from
a point to a set of centers lives in WithTop α and is ⊤ for the empty set.
The radius and the optimum are defined on a finite nonempty type of points, with centers allowed
anywhere among them. The optimum ranges over center sets of at most k points; when
k ≤ Fintype.card V some set of exactly k points attains it
(exists_card_eq_radius_eq_optRadius), so this is the same optimum as over sets of exactly k
points, as in [WS11], because padding a set of centers never increases its radius
(radius_anti).
Main definitions #
Cslib.Algorithms.Lean.KCenter.centerDist: the distanced(v, S)from a point to its nearest center.Cslib.Algorithms.Lean.KCenter.radius: the radiusmax_v d(v, S)of a set of centers.Cslib.Algorithms.Lean.KCenter.optRadius: the optimal radius over at mostkcenters.
Main results #
centerDist_le_coe_iff,coe_lt_centerDist_iff,centerDist_lt_coe_iff:d(v, S)compared with a value.radius_le_coe_iff,optRadius_le_iff,le_optRadius_iff,exists_radius_eq_optRadius: the radius and the optimum compared with a value; the optimum is attained.exists_card_eq_radius_eq_optRadius: fork ≤ |V|the optimum is attained by exactlykcenters.radius_anti,optRadius_antitone,optRadius_zero,optRadius_lt_top: monotonicity and the degenerate cases.length_le_card_of_pairwise_lt: packing: points pairwise farther than2 rapart need distinct centers withinr.lt_optRadius_of_pairwise_lt:k + 1points pairwise farther than2 rapart force an optimal radius abover.
References #
Distance to a set of centers #
The distance d(v, S) = min_{c ∈ S} d v c from v to its nearest center in S, in
WithTop α. It is ⊤ when S is empty.
Instances For
d(v, S) ≤ r exactly when some center of S is within r of v.
r < d(v, S) exactly when every center of S is farther than r from v.
d(v, S) < r exactly when some center of S is closer than r to v.
A point is at most as far from a set as from each of its centers.
Adding centers brings every point closer.
Packing #
Packing ([WS11], proof of Theorem 2.3): if every entry of a list M is
within r of a center of C, and the entries of M are pairwise farther than 2 r apart, then
M has at most |C| entries. By the triangle inequality, two points within r of the same
center are at most 2 r apart.
Radius and optimum on a finite space #
The radius max_v d(v, S) of a set S of centers in a finite space: the largest distance
from a point to its nearest center. It is ⊤ exactly when S is empty.
Instances For
The optimal k-center radius min_{|S| ≤ k} radius S of a finite space. It is ⊤ exactly
when k = 0.
Instances For
Exactly k centers suffice: when k ≤ |V|, some set of exactly k centers attains the
optimal radius over at most k centers, since padding a set of centers never increases its radius
(radius_anti). So optRadius agrees with the optimum over sets of exactly k points used in
[WS11], Section 2.2.
Allowing more centers never increases the optimal radius.
Without centers, the radius is ⊤.
A lower bound on the optimum ([WS11], proof of Theorem 2.3): if more than
k points are pairwise farther than 2 r apart, every set of at most k centers has radius
greater than r.