From 3a4af89b667abda47a2c7c4beecf47fdf09c5f01 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Fri, 23 Oct 2020 15:25:51 +0200 Subject: [PATCH] graph: Cycle check ignores Zero entries. --- src/storm/utility/graph.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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; + } } } }