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

Implement GCC algorithm in native Postgres #70

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Conversation

jjnesbitt
Copy link
Member

Since we're dealing with larger networks now (i.e. the boston roads dataset), the current algorithm for finding the GCC doesn't perform well enough. An example query on the boston roads dataset takes ~46 seconds. That same query takes ~40ms with this native Postgres query.

@annehaley PTAL and let me know if this maintains the same semantics as the original query.

@jjnesbitt jjnesbitt requested a review from annehaley September 25, 2024 20:17
@jjnesbitt jjnesbitt force-pushed the postgres-gcc-query branch 3 times, most recently from bcf5cc9 to 93c53a9 Compare September 25, 2024 20:31
Copy link
Collaborator

@annehaley annehaley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive time delta. The original implementation was done with networkx, so I'm not sure about the semantics of the previous algorithm. This new method seems reasonable. Could you either remove the old get_gcc method from the Network model or move this logic there?

@jjnesbitt jjnesbitt merged commit 3bf0d01 into master Oct 1, 2024
4 checks passed
@jjnesbitt jjnesbitt deleted the postgres-gcc-query branch October 1, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants