Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
StronglyConnectedComponentDecomposition.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <vector>
5
10namespace storm {
11
12namespace storage {
13
14template<typename ValueType>
15class SparseMatrix;
16
43
50 void initialize(uint64_t numStates);
51 bool hasPreorderNumber(uint64_t stateIndex) const;
52 std::vector<uint64_t> preorderNumbers, recursionStateStack, s, p;
53};
54
59 void initialize(uint64_t numStates, bool computeSccDepths);
60 bool stateHasScc(uint64_t stateIndex) const;
61 uint64_t sccCount;
62 std::vector<uint64_t> stateToSccMapping;
64 std::optional<std::vector<uint64_t>> sccDepths;
65};
66
77template<typename ValueType>
80
92template<typename ValueType>
95
99template<typename ValueType>
100class StronglyConnectedComponentDecomposition : public Decomposition<StronglyConnectedComponent> {
101 public:
106
117
124
131
138
145
149 bool hasSccDepth() const;
150
157 uint_fast64_t getSccDepth(uint_fast64_t const& sccIndex) const;
158
162 uint_fast64_t getMaxSccDepth() const;
163
170 std::vector<uint64_t> computeStateToSccIndexMap(uint64_t numberOfStates) const;
171
172 private:
173 /*
174 * Performs the SCC decomposition of the given block in the given model. As a side-effect this fills
175 * the vector of blocks of the decomposition.
176 *
177 * @param transitionMatrix The transition matrix of the system to decompose.
178 */
179 void performSccDecomposition(storm::storage::SparseMatrix<ValueType> const& transitionMatrix,
181
182 std::optional<std::vector<uint_fast64_t>> sccDepths;
183};
184} // namespace storage
185} // namespace storm
Helper class that optionally holds a reference to an object of type T.
Definition OptionalRef.h:48
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
This class represents the decomposition of a model into blocks which are of the template type.
A class that holds a possibly non-square matrix in the compressed row storage format.
This class represents the decomposition of a graph-like structure into its strongly connected compone...
StronglyConnectedComponentDecomposition & operator=(StronglyConnectedComponentDecomposition const &other)
Assigns the contents of the given SCC decomposition to the current one by copying its contents.
uint_fast64_t getSccDepth(uint_fast64_t const &sccIndex) const
Gets the depth of the SCC with the given index.
std::vector< uint64_t > computeStateToSccIndexMap(uint64_t numberOfStates) const
Computes a vector that for each state has the index of the scc of that state in it.
bool hasSccDepth() const
Retrieves whether SCCDepths have been computed during construction of this.
uint_fast64_t getMaxSccDepth() const
Gets the maximum depth of an SCC.
void performSccDecomposition(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, StronglyConnectedComponentDecompositionOptions const &options, SccDecompositionResult &result)
Computes an SCC decomposition for the given matrix and options.
LabParser.cpp.
Definition cli.cpp:18
Holds temporary computation data used during the SCC decomposition algorithm.
Holds the result data of the implemented SCC decomposition algorithm.
std::vector< uint64_t > stateToSccMapping
Number of found SCCs.
void initialize(uint64_t numStates, bool computeSccDepths)
storm::storage::BitVector nonTrivialStates
Mapping from states to the SCC it belongs to.
uint64_t sccCount
True if an SCC is associated to the given state.
std::optional< std::vector< uint64_t > > sccDepths
Keep track of trivial states (singleton SCCs without selfloop).
StronglyConnectedComponentDecompositionOptions & computeSccDepths(bool value=true)
Sets if scc depths can be retrieved.
StronglyConnectedComponentDecompositionOptions & dropNaiveSccs(bool value=true)
Sets if trivial SCCs (i.e. SCCs consisting of just one state without a self-loop) are to be kept in t...
StronglyConnectedComponentDecompositionOptions & forceTopologicalSort(bool value=true)
Enforces that the returned SCCs are sorted in a topological order.
StronglyConnectedComponentDecompositionOptions & subsystem(storm::storage::BitVector const &subsystem)
Sets a bit vector indicating which subsystem to consider for the decomposition into SCCs.
StronglyConnectedComponentDecompositionOptions & choices(storm::storage::BitVector const &choices)
Sets a bit vector indicating which choices of the states are contained in the subsystem.
StronglyConnectedComponentDecompositionOptions & onlyBottomSccs(bool value=true)
Sets if only bottom SCCs, i.e. SCCs in which all states have no way of leaving the SCC),...