WeightedRandom.Backend.WalkerAlias (weighted_random v1.0.0-rc.1)

Copy Markdown View Source

This is my implementation of the Walker Alias Method.

I have changed several aspects of the original algorithm in order to make it more idiomatically elixir, and more readable for programmers.

I suspect it also has performance improvements over similar elixir libraries because of those choices, although I have not yet benchmarked to test it.