Skip to content

Dijkstra: add early termination, maxNodes parameter, and path cap#11

Open
calculon102 wants to merge 1 commit into
fisharebest:mainfrom
calculon102:dijkstra-improvements
Open

Dijkstra: add early termination, maxNodes parameter, and path cap#11
calculon102 wants to merge 1 commit into
fisharebest:mainfrom
calculon102:dijkstra-improvements

Conversation

@calculon102

Copy link
Copy Markdown
  • Return processed node from processNextNodeInQueue() for caller awareness
  • Early termination when target node is dequeued from priority queue
  • Optional maxNodes parameter to limit queue processing
  • Cap extractPaths() at 100 paths to prevent exponential explosion
  • Add accompanying unit tests for all new features

Motivation:
I use webtrees at https://stammbaum.grossgasteiger.de and have several thousand entries. The relation search stuck in never ending loops when search for relations of nodes far away, so I digged into this Dijkstra implementation. These fixes solved my problems

- Return processed node from processNextNodeInQueue() for caller awareness
- Early termination when target node is dequeued from priority queue
- Optional maxNodes parameter to limit queue processing
- Cap extractPaths() at 100 paths to prevent exponential explosion
- Add accompanying unit tests for all new features
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.

1 participant