diff --git a/src/storm/utility/graph.cpp b/src/storm/utility/graph.cpp index 4fd5487c5..dc8acb4f3 100644 --- a/src/storm/utility/graph.cpp +++ b/src/storm/utility/graph.cpp @@ -141,12 +141,14 @@ namespace storm { if (unexploredStates.get(state)) { unexploredStates.set(state, false); for (auto const& entry : transitionMatrix.getRowGroup(state)) { - if (unexploredStates.get(entry.getColumn())) { - dfsStack.push_back(entry.getColumn()); - } else { - if (!acyclicStates.get(entry.getColumn())) { - // The state has been visited before but is not known to be acyclic. - return true; + if (!storm::utility::isZero(entry.getValue())) { + if (unexploredStates.get(entry.getColumn())) { + dfsStack.push_back(entry.getColumn()); + } else { + if (!acyclicStates.get(entry.getColumn())) { + // The state has been visited before but is not known to be acyclic. + return true; + } } } }