-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(core): Add maxfrontiersize to shortest path query #9382
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this change
@harshil-goel Is "heap" the best term for this? Is it the max number of nodes to be considered? Maybe "maxnodes"? |
@mangalaman93 @matthewmcneely What term do you think works well: |
I like "frontier size", that lines up nicely with terminology that I've encountered over the years. |
d1d123e
to
2c27f2e
Compare
2c27f2e
to
1f23a30
Compare
Currently we use dijkstra's algorithm to find shortest path. Sometimes the heap could grow indefinitely, which would slow down the query significantly and cause dgraph to go out of memory. This would only happen in very specific instances depending upon the graph. To fix this, we are introducing a new argument, maxfrontiersize in shortest path query. This would limit the size of the heap fixing the issue.
New query would look like:
Fixes: #9333