Skip to content

Conversation

@hr-alebel
Copy link

The backpressure mechanism should prevent dropping possible paths from the priority queue, by not filling the queue when there is too much in it.

Description

#9333 Here an issue was fixed that could in some cases cause an out of memory when doing a kshortestPath search. In short if the graph is very intertwined with a lot of edges between a smaller set of nodes (currently 140k edges over 10k nodes) a simple search with weights active can cause OOM due to the adjacency map overflowing the priorityqueue.

This was somewhat fixed by #9382 which introduced an interesting bug that only now got noticed.

When the MaxFrontierSize is reached a pop is called on the queue, which actually drops the shortest element, meaning that in case of a depth>1 search with active and triggered MaxFrontierSize it is unlikely to get the actual shortest path.

As that is an algorithmic issue and cant really be fixed that easily.

So the PR is aiming at actually slowing the neighbour search down to give the algorithm time to clear the queue off items that are over the bounds of depth or maxweight. In case of no constraints on the paths it is expected to have a high memory usage hence usage of MaxFrontierSize will in any way cause misses.

Checklist

  • The PR title follows the
    Conventional Commits syntax, leading
    with fix:, feat:, chore:, ci:, etc.
  • Code compiles correctly and linting (via trunk) passes locally

The backpressure mechanism should prevent dropping possible paths from the priority queue, by not filling the queue when there is too much in it.
@hr-alebel hr-alebel requested a review from a team as a code owner January 26, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant