Skip to content

Function: filterClustersBySize()

ts
function filterClustersBySize(
   clusterIds, 
   clusterSizes, 
   minSize): Uint8Array;

Defined in: src/utils/statistics.ts:243

Filters clusters by minimum size.

Returns a binary mask where vertices in clusters >= minSize survive.

Time complexity: O(V) Space complexity: O(V) for the output mask

Parameters

clusterIds

Int32Array

Per-vertex cluster IDs from findClusters

clusterSizes

Map<number, number>

Cluster ID to size map from findClusters

minSize

number

Minimum cluster size to survive

Returns

Uint8Array

Binary mask (1 = survives, 0 = filtered)

Released under the MIT License.