Repository navigation
optimize KBestHaplotypeFinder a bit more - #5554
Merged
Merged
Conversation
takutosato
approved these changes
Jan 2, 2019
takutosato
left a comment
Contributor
There was a problem hiding this comment.
I speculate that adding an integer member to SeqVertex would be a tiny bit cleaner and faster than using a hashmap of vertices. But you probably already thought of this, and I do see the downside in introducing a new mutable member to the class.
Contributor
Author
|
I think you're right, but speed is not an issue here and I don't want to touch anything deep in the graph code. . . for now, at least. |
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.
@takutosato The new
KBestHaplotypeFinderalgorithm implements the k shortest paths generalization of Dijkstra's algorithm as described in https://en.wikipedia.org/wiki/K_shortest_path_routing. It was, however, missing the condition in the 6th-to-last lineif count_u ≤ K, which ignores a vertex if the k best paths through it have already been found. This PR puts in that condition, reducing memory usage.No need to review before January 2!