Closed AntoineBut closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.28%. Comparing base (
afb8245
) to head (b42ab1f
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Failures on nightly are expected
Addresses #370.
This implementation has $O(N)$ runtime, while the previous implementation had $O(N^2)$ runtime.
The optimization comes from storing all edges added at each iteration in an indexed table, allowing to draw a random edge in $O(1)$ time, while the previous implementation had to go through (on average) half on the nodes in order to draw a random edge, which takes $O(N)$ time.
On my computer, this implementation uses approximately 16% more memory.
It runs faster than the previous one even on small graphs ($N = 100$).