Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the lists of nodes and edges in Passage to SortedSets #6

Open
danielhers opened this issue Nov 12, 2015 · 0 comments
Open

Change the lists of nodes and edges in Passage to SortedSets #6

danielhers opened this issue Nov 12, 2015 · 0 comments

Comments

@danielhers
Copy link
Member

See the sortedcontainers module.

The reason create_passage, for example, takes so long, is that in _add_node and _add_edge, the whole lists of nodes and edges are sorted every time:
screenshot-4
Keeping them in a sorted set data structure would reduce the complexity from n^2 lg n to n lg n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant