Browse Source

SCCDecomposition: Fixed topological sort of SCCs connected via '0'-valued transitions

tempestpy_adaptions
TimQu 6 years ago
parent
commit
dbc465b9de
  1. 4
      src/storm/storage/StronglyConnectedComponentDecomposition.cpp

4
src/storm/storage/StronglyConnectedComponentDecomposition.cpp

@ -324,12 +324,14 @@ namespace storm {
successorSCCs.clear();
for (auto const& state : currentScc) {
for (auto const& entry : transitions.getRowGroup(state)) {
if (!storm::utility::isZero(entry.getValue())) {
auto const& successorSCC = sccIndices[entry.getColumn()];
if (successorSCC != currentSccIndex && unsortedSCCs.get(successorSCC)) {
successorSCCs.insert(successorSCC);
}
}
}
}
sccStack.insert(sccStack.end(), successorSCCs.begin(), successorSCCs.end());
}
@ -345,12 +347,14 @@ namespace storm {
uint32_t& currentChainSize = chainSizes[currentSccIndex];
for (auto const& state : scc) {
for (auto const& entry : transitions.getRowGroup(state)) {
if (!storm::utility::isZero(entry.getValue())) {
auto const& successorSCC = sccIndices[entry.getColumn()];
if (successorSCC != currentSccIndex) {
currentChainSize = std::max(currentChainSize, chainSizes[successorSCC] + 1);
}
}
}
}
*longestChainSize = std::max<uint64_t>(*longestChainSize, currentChainSize);
}

Loading…
Cancel
Save