Dijkstra's wastes memory and time queuing nodes already in the queue#11
Open
damium wants to merge 3 commits intonanodeath:masterfrom
Open
Dijkstra's wastes memory and time queuing nodes already in the queue#11damium wants to merge 3 commits intonanodeath:masterfrom
damium wants to merge 3 commits intonanodeath:masterfrom
Conversation
Owner
|
@damium Sorry I suck, I first looked at this quite a while ago but forgot to respond. Can you explain why you added the Graph#replaceNode method? You're not actually using it. Regarding the extra-nodes-trimming, I think that part looks good. I think the complexity adding that sort of functionality to the queue would be inappropriate, given it's supposed to be just a plain priority queue. |
Author
|
I'm using the replaceNode method in another project so it was mainly for my use there and was added after I opened the pull request for the original fix. I'm not sure if it would be generally useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It also causes problems when using a function to filter and gather info as nodes are in the visited list more than once. If a node is already in the queue it should look to see which path is shorter and select it.
I'm not positive that this is the best place for the fix, possibly it would be cleaner to apply it to the queue itself.