Skip to content

Commit

Permalink
Merge pull request #8 from algbio/fix_bug_one_vertex_path
Browse files Browse the repository at this point in the history
Fix bug one vertex path
  • Loading branch information
elarielcl authored Nov 22, 2022
2 parents 59c9c67 + e7dde22 commit 6741b94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/AlignmentGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,8 +1301,12 @@ std::vector<std::vector<size_t>> AlignmentGraph::greedyCover(size_t cid) const {
exit(0);
}
std::vector<size_t> tmp, path;
for (size_t i = best.second; d[i].second != i || i != tmp.back(); i = d[i].second)
tmp.push_back(i);
if (best.second == d[best.second].second) {
tmp.push_back(best.second);
} else {
for (size_t i = best.second; d[i].second != i || i != tmp.back(); i = d[i].second)
tmp.push_back(i);
}
std::reverse(tmp.begin(), tmp.end());
size_t l = 0, r = tmp.size() - 1;
while (covered[tmp[l]]) l++;
Expand Down

0 comments on commit 6741b94

Please sign in to comment.