pyphi.parallel.chunking.cost_balanced_partition#
- pyphi.parallel.chunking.cost_balanced_partition(weights, k)[source]#
Greedily LPT-pack item indices into
min(k, n)cost-balanced bins.Sorts indices by weight descending and assigns each to the currently lightest bin. Non-positive / non-finite weights are clamped to a small epsilon so every item still lands in exactly one bin.