Repository navigation
perf: break citation cycles one tangle at a time - #48
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47
What
acyclicbreaks each strongly connected component in one pass. It lays the component's works out newest first and keeps only the citations running forward in that order, so a citation of a later work, the one most at odds with publication order, is still what goes first. Among works of the same year, the one its peers cite most is placed as the earliest.Why
The old loop ran
find_cycleover the whole ancestry once per removed edge. Every ranking on the expanded snapshot paid for that, including each/lineagerequest.It removes slightly more edges than before, 237 against 202 of GraphSAGE's roughly 40,000. The old loop's picks among same-year cycles depended on the order
find_cyclehappened to walk. The result is a DAG either way.Verify
uv run pytest tests/test_score.py tests/test_originators.py tests/test_api.py curl localhost:8000/lineage/gnn/W2624431344 # well under a secondGenerated with Claude Code