The power of two choices
summary
Random peer IDs behave like 20,000 random reals in [0,1], producing a binary trie whose mean leaf depth is about log n but whose deviation is also about log n so many nodes sit at depth ~15–16 in a 20k network. Using the power of two choices (generate two IDs, keep the shallower) yields mean ≈ log n and deviation ≈ log log n, producing an almost perfectly balanced trie; Go and Python libraries are provided for simulation.
AI-written summary · about
