SMT-RAT
24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
|
This class encapsulates an algorithm for enumerating all cycles. More...
#include <ForwardHyperGraph.h>
Public Member Functions | |
CycleEnumerator (const FHG &fhg, Collector &c) | |
Constructor from a graph and a collector object. More... | |
bool | findAll () |
Start the search for all cycles. Returns whether the search was finished (true) or aborted (false). More... | |
Private Types | |
using | Vertex = typename FHG::Vertex |
Type of a vertex. More... | |
Private Member Functions | |
void | unblock (Vertex v) |
Unblocks the given vertex and all vertices that depend on it. More... | |
bool | enumerate (Vertex src, Vertex v) |
Recursively enumerate all cycles that start in src and are currently in v. More... | |
Private Attributes | |
const FHG & | mGraph |
Reference to the graph we search cycles in. More... | |
std::vector< bool > | mBlocked |
Stores whether a vector is currently blocked. More... | |
std::vector< std::vector< Vertex > > | mBlockDependencies |
Stores vertex dependencies when vertices are blocked. More... | |
std::vector< typename FHG::Vertex > | mVertexStack |
Stores the current list of vertices. More... | |
std::vector< typename FHG::Edge > | mEdgeStack |
Stores the current list of edges. More... | |
Collector & | mCollector |
The callback object. More... | |
bool | mAborted |
Whether this search has been aborted by the collector. More... | |
This class encapsulates an algorithm for enumerating all cycles.
This class implements an adaption of the algorithm described in [Johnson75]. Unlike the algorithm described there, this version works on forward hypergraphs as implemented by ForwardHyperGraph.
Although the algorithm works recursively, this implementation can be used somewhat iteratively. The cycles are given to the caller using an collector functor. If this functor returns true, the search for more cycles is aborted immediately. Due to this pattern, there is no need to store the cycles within this class and thus the memory usage is minimized.
Definition at line 152 of file ForwardHyperGraph.h.
|
private |
Type of a vertex.
Definition at line 155 of file ForwardHyperGraph.h.
|
inline |
Constructor from a graph and a collector object.
Definition at line 173 of file ForwardHyperGraph.h.
|
private |
Recursively enumerate all cycles that start in src and are currently in v.
bool smtrat::CycleEnumerator< FHG, Collector >::findAll | ( | ) |
Start the search for all cycles. Returns whether the search was finished (true) or aborted (false).
|
inlineprivate |
Unblocks the given vertex and all vertices that depend on it.
Definition at line 187 of file ForwardHyperGraph.h.
|
private |
Whether this search has been aborted by the collector.
Definition at line 170 of file ForwardHyperGraph.h.
|
private |
Stores vertex dependencies when vertices are blocked.
Definition at line 162 of file ForwardHyperGraph.h.
|
private |
Stores whether a vector is currently blocked.
Definition at line 160 of file ForwardHyperGraph.h.
|
private |
The callback object.
Definition at line 168 of file ForwardHyperGraph.h.
|
private |
Stores the current list of edges.
Definition at line 166 of file ForwardHyperGraph.h.
|
private |
Reference to the graph we search cycles in.
Definition at line 157 of file ForwardHyperGraph.h.
|
private |
Stores the current list of vertices.
Definition at line 164 of file ForwardHyperGraph.h.