#include <DFS_ApplyRule.hh>
Data Structures | |
class | DFS_ABORTION |
Dummy class to trigger DFS abortion via exception handling. More... | |
class | DFS_Visitor |
Public Types | |
typedef std::vector< const Graph * > | SearchTrace |
Container that stores a DFS trace. More... | |
Public Member Functions | |
void | add (const Graph &graph) |
DFS_ApplyRule () | |
bool | findSolution (const std::vector< Rule > &rules, const Graph &startGraph, Graph_Storage &solutionStorage, DFS_Visitor &visitor, SearchTrace *searchTrace=NULL, const bool doSymmBreak=true, sgm::SubGraphMatching *sgm=NULL) |
virtual | ~DFS_ApplyRule () |
Destruction. More... | |
Protected Attributes | |
SearchTrace | currentTrace |
the current trace maintained by the current search More... | |
SearchTrace * | finalTrace |
the final trace to be filled if non-NULL More... | |
std::vector < sgm::Match_Reporter * > | reporter |
the match reporter to be informed about each match More... | |
std::vector< const sgm::Pattern_Interface * > | rulePattern |
the rule pattern currently applied More... | |
sgm::SubGraphMatching * | sgm |
the sub graph matcher currently used More... | |
bool | solutionFound |
whether or not a solution was found during this search More... | |
Graph_Storage * | solutionStorage |
the solution storage currently used More... | |
DFS_Visitor * | visitor |
the DFS visitor currently used More... | |
Depths-First-Search for graph grammars
A generic Depths-First-Search (DFS) implementation that performs a recursive graph grammar rule application, i.e. it starts a new iteration of rule matching and application for each reported result graph of the last iteration. The recursion end is to be defined by an instance of the RecursionEnd.
Definition at line 29 of file DFS_ApplyRule.hh.
typedef std::vector< const Graph* > ggl::DFS_ApplyRule::SearchTrace |
Definition at line 63 of file DFS_ApplyRule.hh.
ggl::DFS_ApplyRule::DFS_ApplyRule | ( | ) |
Construction
|
virtual |
|
virtual |
The Graph_Storage interface is used to trigger a new DFS iteration. Thus, each added graph is checked if the DFS is to be aborted or not. In case the search is to be extended, another rule application iteration is started.
graph | the graph that might start another DFS iteration or is either a solution or DFS dead end. |
Implements ggl::Graph_Storage.
bool ggl::DFS_ApplyRule::findSolution | ( | const std::vector< Rule > & | rules, |
const Graph & | startGraph, | ||
Graph_Storage & | solutionStorage, | ||
DFS_Visitor & | visitor, | ||
SearchTrace * | searchTrace = NULL , |
||
const bool | doSymmBreak = true , |
||
sgm::SubGraphMatching * | sgm = NULL |
||
) |
Performs a DFS when applying the given rule onto the defined start graph.
rules | the rules to apply |
startGraph | the start graph for the DFS |
solutionStorage | the container where to report the solution to |
visitor | the visitor instance that guides the DFS. Each result graph is checked with the visitor to decide if a solution was found, a trace back is needed or further DFS is to be done. |
searchTrace | if non-NULL, DFS will copy the trace of the DFS search to the container, i.e. the sequence of graphs generated along the search |
doSymmBreak | whether or not symmetry breaking should be done |
sgm | the sub graph matcher to be used; if NULL an sgm::SGM_vf2 object is used per default |
|
protected |
Definition at line 134 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 132 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 130 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 122 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 128 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 136 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 124 of file DFS_ApplyRule.hh.
|
protected |
Definition at line 126 of file DFS_ApplyRule.hh.