k shortest path does not return the shortest path when using MaxFrontierSize
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 21.8k
- Forks
- 1.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 9
Description
Describe the bug
In https://github.com/dgraph-io/dgraph/issues/9333 a new Feature got introduced called MaxFrontierSize, which limits memory usage in case of high density graphs. This causes a algorithmic issue, because the "best" node is droped from the priority queue when the MaxFrontierSize is triggered.
This causes a nearly 100% to not get the shortest path ever.
To Reproduce
Steps to reproduce the behavior:
- run shortest path query with numpath = 1 to get the shortest path
- run the same query with numpath > 1 with MaxFrontierSize low enough to get triggered on your data set
- Compare Paths
Expected behavior
numpaths > 1 should return the somewhat shortest paths, possibly even the correct shortest paths
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Start by locating the shortest-path implementation and the MaxFrontierSize handling, then reproduce the comparison with numpath=1 and numpath>1 using a low frontier limit. Done means the multi-path query returns the shortest path, or the expected near-shortest behavior, without the best node being improperly discarded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100