mirror of
https://github.com/Graphify-Labs/graphify.git
synced 2026-09-14 19:34:09 +08:00
f5f3a1cc59
Follow-up to the file-ordering fix. The from-scratch build writes each node's community field straight from cluster()'s enumerate() after a STABLE size-sort, so the hundreds of equal-sized small communities in a sparse graph were ordered by the partitioner's (not seed-stable) enumeration order. Their integer IDs permuted run-to-run, which reads as 77-88% "community churn" in a per-node cid diff even though the actual grouping is reproducible. Add a tuple(sorted(nodes)) tiebreak to make the sort a total order, so an identical grouping always yields identical community IDs. Verified: with the partition returned in shuffled order across 5 runs, the node->cid map is now identical. (A separate ~0.06% community-count drift remains - likely non-canonical edge weights upstream - tracked separately.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>