Back to Streaming Sketching

Geometric Streams & Coresets

September 26, 2026 Wasil Zafar 21 min read

Compress geometric data while preserving objective costs.

Table of Contents

  1. Summarizing Clouds of Moving Points
  2. Coresets, Sensitivity and Geometric Objectives
  3. From Weighted Samples to Approximation
  4. Fleet Locations, Clustering and Sensor Maps
  5. Construct a Geometry-Aware Summary Plan

Summarizing Clouds of Moving Points

Imagine a delivery company receiving millions of vehicle locations. Keeping every point makes later clustering accurate but expensive. Keeping only a few uniformly sampled points is cheap but may erase a remote village containing few vehicles. A coreset is a small weighted summary designed so that every allowed candidate solution has nearly the same objective cost on the summary as on the full data.

The objective matters. For $k$-center, the cost is the largest distance from any point to its nearest chosen center. For $k$-median, distances are summed. For $k$-means, squared distances are summed. A point far from the main cloud can dominate $k$-center, influence $k$-median, and influence $k$-means even more strongly. One sample cannot be called “a coreset” without naming the objective, metric, candidate family, and approximation guarantee.

Consider one-dimensional points $P=\{0,0,1,9,10,10\}$. For one center at $c=5$, the $k$-median cost is $5+5+4+4+5+5=28$, while the $k$-means cost is $25+25+16+16+25+25=132$. Replacing the two zeros by one weighted point $(0,2)$ and the two tens by $(10,2)$ preserves both costs exactly for every center because duplicate points are identical. Replacing the whole set by its mean preserves neither objective for arbitrary centers.

Streaming coresets commonly use merge-reduce. Small batches become weighted summaries; summaries of equal scale are merged and compressed again. This resembles carrying in binary addition and bounds memory logarithmically in stream length. However, approximation errors can accumulate across levels, so the local error budget must be chosen from the desired global guarantee.

From a crowded map to a weighted geometric coreset A large point cloud is compressed into a few weighted representatives, then candidate centers are evaluated with approximately preserved cost. Streaming point cloud dense groups plus rare outlier Weighted coreset w=5w=3w=1 few points, retained weights Evaluate any allowed C cost within 1 ± ε of full data Weights preserve influence; sensitivity protects unusual points.
ConceptIntuitive meaningExact exampleNon-example or boundaryMain assumptionQuestion answered
Weighted coresetSmall weighted set preserving objective costsDuplicate point $p$ represented once with its multiplicityUnweighted centroids with no uniform guaranteeObjective, metric, and candidate family are fixedCan the full optimization be replaced by a small instance?
$k$-centerMinimize maximum client distanceOne remote point can determine radiusSum of distancesMetric and allowed centers are definedHow small can the worst service distance be?
$k$-medianMinimize weighted sum of distancesCost $\sum_p w_p d(p,C)$Squared-distance objectiveNonnegative weightsWhat centers minimize total travel?
$k$-meansMinimize weighted sum of squared distancesCost $\sum_p w_p d(p,C)^2$Maximum radiusUsually Euclidean or specified squared metricWhat centers minimize variance-like cost?
SensitivityWorst relative influence of one point over candidate solutionsIsolated point receives higher sampling probabilityDistance from the global mean aloneDenominator and zero-cost cases are handledWhich points are dangerous to miss?
Merge-reduceMerge equal-scale summaries, then compressBinary levels store at most one summary per levelUnioning summaries forever without reductionCoreset family is composable with controlled errorHow can a stream be summarized with bounded memory?
Warm-up

Summarizing Clouds of Moving Points

Use $P=\{0,0,1,9,10,10\}$ with unit weights and one candidate center $c=5$.

  1. Compute the $1$-median cost: $28$.
  2. Compute the $1$-means cost: $132$.
  3. Form weighted summary $S=\{(0,2),(1,1),(9,1),(10,2)\}$. Recompute both costs and verify they remain exactly $28$ and $132$.
  4. Replace all points by the weighted mean $(5,6)$. Its cost at $c=5$ is zero for both objectives, which does not approximate the original costs.

Reflection: why is combining exact duplicates safe for every center while replacing distinct points by their average is only tailored to special calculations?

Coresets, Sensitivity and Geometric Objectives

Let $P$ be a weighted point multiset, $\mathcal C$ a family of candidate solutions, and $f(p,C)\ge0$ the contribution of point $p$ to candidate $C$. Define

$$ \operatorname{cost}_P(C)=\sum_{p\in P}w_p f(p,C). $$

A strong $\varepsilon$-coreset $S$ satisfies

$$ (1-\varepsilon)\operatorname{cost}_P(C)\le\operatorname{cost}_S(C)\le(1+\varepsilon)\operatorname{cost}_P(C) $$

for every $C\in\mathcal C$. A weak coreset may guarantee only that optimizing on $S$ yields a near-optimal solution for $P$. These are different quantifiers.

For clustering, $f(p,C)=d(p,C)^z$, where $d(p,C)=\min_{c\in C}d(p,c)$ and $z=1$ gives $k$-median while $z=2$ gives $k$-means. The $k$-center objective uses a maximum rather than a sum and generally requires different summaries. Facility location adds opening costs, so preserving assignment cost alone may not preserve the full objective.

The sensitivity of point $p$ is conceptually

$$ \sigma(p)=\sup_{C:\operatorname{cost}_P(C)>0}\frac{w_p f(p,C)}{\operatorname{cost}_P(C)}. $$

Sampling probabilities use computable upper bounds $s(p)\ge\sigma(p)$ rather than exact sensitivities. A sampled point gets inverse-probability weight so each fixed candidate’s estimated cost is unbiased. Uniform control over every candidate requires concentration plus a complexity argument for $\mathcal C$, such as a finite net, dimension, or pseudo-dimension bound.

Bounding boxes are composable exact summaries for coordinate extrema: the bounding box of a union is obtained from coordinate-wise minima and maxima of the parts. They preserve range queries of that form, not clustering costs. Mergeability is objective-specific.

Geometric Streams & Coresets: Coresets, Sensitivity and Geometric Objectives
flowchart TD
    A[Point stream P with weights] --> B[Choose objective and candidate family C]
    B --> C[Point contribution f of p and C]
    C --> D[Define cost as weighted sum]
    D --> E[Bound sensitivity of each point]
    E --> F[Sample with probability from sensitivity upper bounds]
    F --> G[Assign inverse-probability weights]
    G --> H[Concentration for one fixed candidate]
    H --> I[Uniform argument over all candidates]
    I --> J[Strong epsilon coreset]
    J --> K[Optimize weighted small instance]
    A --> L[Batch summaries]
    L --> M[Merge-reduce levels]
    M --> J
    B -. change k, metric, or exponent .-> X[Guarantee must be re-established]
    classDef navy fill:#17365D,color:#fff,stroke:#17365D;
    classDef teal fill:#147D84,color:#fff,stroke:#0D565B;
    classDef crimson fill:#C6284D,color:#fff,stroke:#861B35;
    classDef purple fill:#6C3BAA,color:#fff,stroke:#472675;
    class A,B,C,D navy;
    class E,F,G,H purple;
    class I,J,K,M teal;
    class L teal;
    class X crimson;
Sensitivity sampling model for a geometric coreset Point contributions to many candidate centers determine worst-case relative sensitivity, which drives sampling probability and inverse-probability weight. All candidates C search over allowed center sets Relative influence wₚ f(p,C)costₚ(C) take worst allowed C Sample q(p) q proportional to s(p)upper bound sensitivity Weight wₚ / mq(p)m samplescorrect selection bias Uniform accuracy needs both influence bounds and candidate-family complexity.
Definition or claimExact scopeRequired assumptionsWhat it does not implyCounterexample or consequence
Strong coresetPreserves cost for every allowed candidate $C$Fixed objective, metric, $k$, weights, and candidate familyPreserves a different objectiveA $k$-median coreset need not preserve $k$-center radius
Weak coresetOptimizing summary yields near-optimal full-data solutionSpecific optimizer-transfer theoremUniform cost preservation for arbitrary candidatesDiagnostic evaluation of other centers may be wrong
Sensitivity samplingHigh-influence points receive higher inclusion chanceValid upper bounds, inverse-probability weights, adequate sample sizeExact sensitivity is always easy to computeUnderestimated remote point is sampled too rarely
Uniform convergenceFixed-candidate concentration extends over $\mathcal C$Candidate complexity or covering boundOne fixed-center tail bound suffices automaticallyInfinite candidate family cannot use a naive finite union bound
Merge composabilityUnion of coresets summarizes union under compatible definitionsNonnegative weights and objective-additive costRepeated reduction adds no errorPer-level multiplicative errors compound
Bounding box mergeCoordinate minima and maxima merge exactlyFixed coordinates and consistent unitsClustering or density preservationSame box can contain radically different point clouds

The coreset invariant is uniform objective preservation: one weighted summary must approximate the cost of every allowed candidate, not just the solution used to build it. Sensitivity controls pointwise influence; candidate-family complexity converts fixed-candidate concentration into that uniform guarantee.

From Weighted Samples to Approximation

Suppose $m$ points are sampled independently with probability $q(p)$ and a selected copy of $p$ receives weight $w_p/(m q(p))$. For fixed $C$, one draw contributes $w_p f(p,C)/(m q(p))$. Summing $m$ draws gives expectation $\operatorname{cost}_P(C)$. Sensitivity-based probabilities bound each normalized contribution relative to the total cost, allowing concentration.

Uniform approximation needs more than unbiasedness. If candidate solutions are finite, a union bound may suffice. For continuous center locations, the proof uses geometric discretization or statistical dimension. Sample size depends on total sensitivity $S=\sum_p s(p)$, error $\varepsilon$, failure probability $\delta$, and complexity of the candidate family. Exact formulas vary by objective and construction.

Merge-reduce uses composability. If $S_1$ and $S_2$ each approximate their batches for every candidate, then their weighted union approximates the union because costs add. Reducing that union introduces another error. Along a path of $L$ reductions, factors like $(1\pm\eta)^L$ accumulate, so choosing $\eta$ on the order of $\varepsilon/L$ keeps global distortion near $\varepsilon$.

This logic can fail with negative weights, incompatible metrics, or summaries constructed for different $k$. It can also fail operationally when floating-point weights overflow or when late data are merged into the wrong window. The algebra of composition assumes the metadata has the same meaning.

Merge-reduce hierarchy for streaming coresets Small batches become level-zero summaries. Equal-level summaries merge and reduce upward, so only one summary per binary level remains while approximation error is budgeted along each path. Point batches batch 1batch 2batch 3batch 4 merge + reducemerge + reduce merge + reduce Error budget per reduction ηpath factor approximately (1 ± η)ᴸ level 0level 2
Geometric Streams & Coresets: From Weighted Samples to Approximation
flowchart TD
    A[Valid sensitivity upper bounds] --> B[Set sampling probabilities]
    B --> C[Sample and inverse-probability reweight]
    C --> D[Unbiased cost for one fixed candidate]
    D --> E[Bound each normalized contribution]
    E --> F[Apply concentration]
    F --> G[Control all candidates by complexity argument]
    G --> H[Strong local coreset]
    H --> I[Merge summaries of equal scale]
    I --> J[Cost additivity preserves local approximation]
    J --> K[Reduce merged weighted set]
    K --> L[Compose errors along hierarchy]
    L --> M[Global streaming coreset]
    A -. sensitivity underestimated .-> X[Rare influential point can be missed]
    K -. negative or incompatible weights .-> Y[Composition proof fails]
    classDef navy fill:#17365D,color:#fff,stroke:#17365D;
    classDef teal fill:#147D84,color:#fff,stroke:#0D565B;
    classDef crimson fill:#C6284D,color:#fff,stroke:#861B35;
    classDef purple fill:#6C3BAA,color:#fff,stroke:#472675;
    class A,B,C navy;
    class D,E,F,G purple;
    class H,I,J,K,L,M teal;
    class X,Y crimson;
Worked Derivation

From Weighted Samples to Approximation

Suppose a stream uses $L=4$ merge-reduce levels and each reduction produces a strong $\eta$-coreset.

  1. Along a worst-case path, the upper cost factor is $(1+\eta)^4$ and the lower factor is $(1-\eta)^4$.
  2. If $\eta=0.02$, the upper factor is about $1.0824$ and the lower factor is about $0.9224$. Thus a local $2\%$ error does not remain $2\%$ globally.
  3. If the global target is about $10\%$, $\eta=0.02$ is acceptable for this simple bound. Verify both sides rather than checking only the upper factor.
  4. If $L$ grows with stream length, choose level budgets from the maximum depth or use a nonuniform allocation whose composed product meets the contract.

Assumption-breaking variation: one level builds a $k$-median coreset and the next treats it as a $k$-means coreset. Cost additivity still holds algebraically, but the local preservation premise is for the wrong function, so the global conclusion is invalid.

Analytical toolWhat it establishesAssumptionsTightness or limitationRepresentative failure case
Inverse-probability weightingFixed-candidate cost estimator is unbiasedPositive known sampling probabilitiesNo concentration or uniform guarantee aloneOne rare sample receives enormous weight
Sensitivity upper boundsLimits normalized influence of each drawBounds dominate true sensitivitiesLoose bounds increase sample sizeUnderestimated outlier destroys accuracy
Concentration inequalityHigh-probability error for one candidate or controlled classBounded/subexponential contributions and sample assumptionsConstants depend on distributionHeavy reweighting creates high variance
Candidate complexityExtends fixed-candidate control uniformlyFinite net, dimension, or pseudo-dimension theoremObjective-specificNaive union bound over uncountably many centers
ComposabilityUnion of compatible strong coresets summarizes unionAdditive nonnegative objective costsDoes not remove prior errorMixing different metrics or $k$ values
Merge-reduce accountingBounds memory and accumulated errorKnown hierarchy depth and per-level guaranteesMultiplicative factors can be conservativeReusing full $\varepsilon$ at every level
Exact geometric envelopePreserves specific extrema without probabilityConsistent coordinate systemWeak for clusteringSame box hides multimodal and uniform data

Fleet Locations, Clustering and Sensor Maps

For an approachable delivery problem, weighted coresets can summarize stops before testing depot locations. $k$-median matches total travel distance; $k$-center matches worst service radius; $k$-means emphasizes squared displacement. Selecting the wrong objective may satisfy a theorem and still violate the business goal.

For a fleet at scale, edge devices can build local coresets, which are merged centrally if they share coordinate reference systems, time windows, weights, objective, and parameters. Location uncertainty and map-network distance complicate the Euclidean model. A coreset for latitude/longitude Euclidean distance is not automatically valid for road travel time.

For sensor maps, a bounding box summarizes extrema exactly, while clustering coresets represent spatial density or facility cost. Missing sensors, duplicate telemetry, drift, and varying measurement reliability require explicit weights and population semantics.

Adversarial cases include a rare distant group omitted by uniform sampling, injected extreme points that dominate sensitivity, and clients adapting points after public randomness is known. Per-group coverage, robust objectives, bounded contributions, seed policies, and exact audit samples may be needed beyond the mathematical coreset guarantee.

Geometry-aware streaming coreset pipeline and trust boundaries Location events are normalized into weighted points, summarized locally, merged and reduced, optimized, and audited. Warnings mark coordinate, objective, and representation failures. Point eventslocation + weighttime + identity NormalizeCRS + unitsdeduplicate Coresetsensitivity + weightsmerge-reduce Optimizecenters / facilitiesweighted objective Auditfull-datasample Coordinate riskCRS, road vs Euclidean Summary riskrare points, error depth Objective riskwrong cost or constraints The theorem begins only after geometry and objective are correctly defined.
Case Study

Fleet Locations, Clustering and Sensor Maps: Geometric Streams & Coresets

A food bank considers one collection point for households at positions $0,1,2,9,10$ on a road.

  1. For $k$-median, the optimal center is median $2$ with cost $2+1+0+7+8=18$.
  2. For $k$-means, the mean is $4.4$; evaluate squared cost to understand why the center shifts toward the distant pair.
  3. For $k$-center, any center around $5$ minimizes maximum distance at about $5$ in the continuous-center model.
  4. These objectives recommend different facilities. A coreset must preserve the chosen one.
  5. Compare uniform sample $\{0,1,2\}$, which erases the distant community, with weighted summary $\{(1,3),(9.5,2)\}$. The latter is intuitive but must still be evaluated against multiple candidates; appearance is not a proof.

Success criteria: compute each objective’s recommended center/cost under the declared continuous-center model and test at least five candidate centers on both full and summarized data.

Production

Fleet Locations, Clustering and Sensor Maps: Geometric Streams & Coresets

A mobility platform receives $20$ million GPS points per minute from $200$ regions. It needs hourly $k$-median and $k$-means analyses for $k\le100$, global cost error below $5\%$, critical-region error below $8\%$, and summaries under 2 GB. Some devices duplicate points, upload late, or report mixed coordinate systems.

Design: canonicalize coordinates into a metric appropriate to the decision; deduplicate by event identity; define event-time windows and weights; build local objective-specific sensitivity coresets; merge-reduce with per-level error budgets derived from maximum hierarchy depth; and retain stratified audit samples for regions and rare mobility modes. Build separate summaries if both median and means objectives are required by the available theorem.

Evidence: exact costs on sampled windows; uniform candidate tests, not only the chosen optimum; per-region distortion; rare/outlier inclusion; depth-wise error; weight and precision ranges; late-data corrections; merge-order tests; runtime, memory, and network cost; and adversarial injected points.

Risks: latitude/longitude Euclidean distance misstates travel, local summaries use incompatible versions, uniform sampling misses remote users, and repeated reduction compounds error. Metadata validation and a degraded state are preferable to merging incompatible summaries.

Decision: deploy only if upper confidence bounds meet both global and regional objectives across merge orders and time windows. Verify final candidate centers against a larger raw sample before operational placement decisions.

Construct a Geometry-Aware Summary Plan

Begin with the decision, not the compression. Define points, weights, metric, time window, candidate centers, constraints, objective exponent, and error quantifiers. Then choose sensitivity sampling, deterministic geometric summaries, or merge-reduce and show exactly how local guarantees compose.

Practice

Practice: Construct a Geometry-Aware Summary Plan

Use weighted points $P=\{(0,2),(2,1),(8,1),(10,2)\}$ on the real line, where each pair is $(position,weight)$.

Tier 1 — Definitions. Define strong and weak coresets, sensitivity, $k$-center, $k$-median, $k$-means, facility location, bounding box, and merge-reduce. State which objectives are sums and which use a maximum.

Tier 2 — Costs. At center $c=5$, compute weighted $1$-median cost $2\cdot5+1\cdot3+1\cdot3+2\cdot5=26$ and weighted $1$-means cost $2\cdot25+9+9+2\cdot25=118$. Verify the bounding box is $[0,10]$ but cannot determine either cost.

Tier 3 — Weighting. Expand the weights conceptually into duplicates and confirm the costs. Explain why dropping weights changes the represented population. Construct a duplicate-compressed coreset that is exact.

Tier 4 — Counterexamples. Give: two clouds with the same bounding box but different clustering costs; a remote point missed by uniform sampling; a summary valid for $k$-median but tested as $k$-means; and four merge levels each using the full global error budget.

Tier 5 — Error composition. For $L=5$ levels and local error $\eta=0.01$, calculate $(1+\eta)^5$ and $(1-\eta)^5$. Decide whether the resulting interval meets a $6\%$ global target.

Tier 6 — Professional artifact. Write a coreset contract with coordinate system, metric, weights, time semantics, objective, $k$, strong/weak guarantee, $\varepsilon$, $\delta$, sensitivity bounds, candidate complexity, batch size, hierarchy depth, local budgets, precision, merge metadata, regional audits, and fallback.

Debugging prompts: if rare regions vanish, inspect sensitivity and stratification; if costs drift with merge order, inspect metadata and error depth; if weights explode, inspect tiny sampling probabilities; if centers look plausible but costs fail, test many candidates; if road decisions fail, inspect the metric.

Stretch goal: compare one summary intended for $k\le100$ with separate summaries per $k$. Discuss size, flexibility, theorem scope, and operational versioning.

Rubric (10 points): definitions and scopes 2; weighted costs 2; valid counterexamples 2; error composition 2; measurable summary contract 2. Full credit requires separating representational error, sampling error, optimization error, and merge-reduce accumulation.

Decision checklist: define geometry, population, weights, objective, candidate family, $k$, time window, and error; protect sensitive points; preserve weights; budget every reduction level; version merge metadata; and audit many candidates and critical slices. A bounding box is not a clustering coreset, unbiased sampling is not uniform cost preservation, and a coreset for one objective is not automatically reusable for another. These ideas connect streaming geometry to distributed summaries, facility-location optimization, robust clustering, and communication-efficient learning.

Next in the Series

In Distributed, Parallel & Mergeable Sketches, we'll explore Scale sketches across partitions without changing their meaning..