feat(graph): implement round-based topological sort#201
Conversation
Replace sortNodeIDs() single-queue Kahn's algorithm with round-based collection. Each round gathers all zero-in-degree nodes, sorts them alphabetically within the round, then advances. This ensures nodes at the same dependency depth are grouped together rather than being interleaved with deeper nodes via global alphabetical ordering.
✅ Deploy Preview for devsydev canceled.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 21 minutes and 51 seconds.Comment |
Summary
Replaces the
sortNodeIDs()single-queue Kahn's algorithm with a round-based topological sort. Each round collects all nodes with in-degree 0, sorts them alphabetically within the round, appends them to the result, then decrements neighbors' in-degrees. This groups nodes at the same dependency depth together rather than interleaving them via global alphabetical ordering.Adds two new test cases verifying round-based behavior: a simple 3-node case (A→B + standalone C produces [A, C, B]) and a multi-level case with a shared sink node.