Skip to content

Commit

Permalink
fix tarjan algorithm (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
edogawashinichi authored Apr 2, 2024
1 parent 994e9b9 commit d2de092
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/CXXGraph/Graph/Algorithm/Tarjan_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ const TarjanResult<T> Graph<T>::tarjan(const unsigned int typeMask) const {
// it's not allowed to go through the previous edge back
// for a directed graph, it's also not allowed to visit
// a node that is not in stack
lowestDisc[curNode->getId()] =
std::min(lowestDisc[curNode->getId()],
lowestDisc[neighborNode->getId()]);
lowestDisc[curNode->getId()] = std::min(lowestDisc[curNode->getId()], discoveryTime[neighborNode->getId()]);
}
}
}
Expand Down Expand Up @@ -195,4 +193,4 @@ const TarjanResult<T> Graph<T>::tarjan(const unsigned int typeMask) const {
return result;
}
} // namespace CXXGraph
#endif // __CXXGRAPH_TARJAN_IMPL_H__
#endif // __CXXGRAPH_TARJAN_IMPL_H__

0 comments on commit d2de092

Please sign in to comment.