Repository navigation
Slimfly ring - #8118
Slimfly ring #8118sean-chernov wants to merge 10 commits into
Conversation
|
Hello, I'm currently holding off on editing init.py and the documentation until I understand better how you'd prefer those changes structured. If either (or both) PRs are accepted, I’d be happy to create a dedicated category for low-diameter network topologies and include both there. Also, just a quick reminder that there's an earlier PR open for k-lift as well — I’ll wait for feedback across all of these before proceeding further. Thanks for your time and guidance! |
rossbar
left a comment
There was a problem hiding this comment.
The test failures here look real so let's get those addressed before diving any deeper.
From a big-picture perspective this seems to fall in the same category as the ER/k-lift PR's i.e. the high-level discussion of how these types of generators fit in the library, but that discussion has already largely been started in other threads!
| # Move prime_factors inside the test function or make it a helper function if needed. | ||
| # It's not general utility, so keeping it closer to where it's used. | ||
| def _prime_factors_for_test(n): | ||
| """Return the list of prime divisors of n.""" | ||
| factors = [] | ||
| while n % 2 == 0: | ||
| factors.append(2) | ||
| n //= 2 | ||
| for i in range(3, int(np.sqrt(n)) + 1, 2): | ||
| while n % i == 0: | ||
| factors.append(i) | ||
| n //= i | ||
| if n > 1: | ||
| factors.append(n) | ||
| return factors |
There was a problem hiding this comment.
Even though it's a private function, I think it'd be better to import it from it's original definition. Keeping multiple copies of a function definition around is a recipe for them falling out-of-sync over time!
|
Updated this PR to pass all checks. The main issue was the expectation we set in the example (which included a comment in addition to the expected value). |
|
Hi! Just wanted to check in. Are there any further changes you'd like me to make (aside from the final placement), or at this point is it more a question of whether the PR fit within NetworkX? Happy to adjust if needed! |
This module implements the Slim Fly network topology using the
McKay–Miller–Širáň (MMS) method with a primitive root over a commutative ring ℤ/qℤ.
Unlike the GF-based construction, this approach may not always achieve diameter 2,
but still yields low-diameter, high-connectivity graphs.