spreadlab/internal
Justin Visser e73db0bdd4 refactor engine: decompose Holme-Kim into builder methods
The generator's working state (graph, attachment pool, rng) moves into
a holmeKimBuilder struct so each algorithm step is a small named
method: attachNewNode, link, pickMutualFriend, degreeProportionalSample.
Max nesting drops from five levels to two. The RNG call order is
untouched, and the golden test (99/70/7 reached) plus the fixed-seed
determinism test prove behaviour is bit-for-bit identical.
Go bits: pointer receivers ((b *holmeKimBuilder)) let methods mutate
the builder; (value, ok) multiple returns are the idiom for 'may not
exist', as in pickMutualFriend.
2026-06-10 12:37:57 +02:00
..
engine refactor engine: decompose Holme-Kim into builder methods 2026-06-10 12:37:57 +02:00