20 #ifndef STDMATCHFINDER_H_
21 #define STDMATCHFINDER_H_
23 #include "../basic_types/globals.h"
24 #include "../graphs/AnonHypergraph.h"
25 #include "../graphs/Mapping.h"
28 namespace rule_engine {
115 unordered_set<IDType>& mappableEdges,
118 shared_ptr<vector<graphs::Mapping>> foundMappings)
const;
162 shared_ptr<vector<graphs::Mapping>> foundMappings)
const;
178 vector<IDType>& isolatedNodes,
179 size_t isolatedNodesPos,
180 vector<IDType>& targets,
181 unordered_set<IDType>& noTargets,
183 shared_ptr<vector<graphs::Mapping>> allMappings)
const;
195 vector<IDType>& targets,
197 shared_ptr<vector<graphs::Mapping>> allMappings)
const;
void setInjectivity(bool injective)
Sets whether this matcher should generate injective matches or not.
Definition: StdMatchFinder.cpp:36
StdMatchFinder provides a simple algorithm which takes two arbitrary graphs and calculates all matchi...
Definition: StdMatchFinder.h:38
bool stopsOnFirstFind() const
Returns whether the matcher will stop after finding the first match.
Definition: StdMatchFinder.cpp:48
void setStopOnFirstFind(bool stopFast)
Sets whether this matcher should stop after the first matching found.
Definition: StdMatchFinder.cpp:44
This is the data structure representing a morphism mapping from a graph to another graph...
Definition: Mapping.h:36
void mapEdges(graphs::AnonHypergraph const &source, graphs::AnonHypergraph const &target, size_t edgesToGo, unordered_set< IDType > &mappableEdges, graphs::Mapping ¤tMapping, graphs::Mapping &revCurrentMapping, shared_ptr< vector< graphs::Mapping >> foundMappings) const
Maps all edges of the target graph recursively to all edges of the source graph, including the induce...
Definition: StdMatchFinder.cpp:81
bool matchesInjectively() const
Returns whether this matcher generates injective or non-injective matches.
Definition: StdMatchFinder.cpp:40
bool isMapPossible(graphs::AnonHypergraph const &source, IDType srcEdge, graphs::AnonHypergraph const &target, IDType tarEdge, graphs::Mapping ¤tMapping, graphs::Mapping &revCurrentMapping) const
Checks if a given edge of the source graph can be mapped to a given edge of the target graph...
Definition: StdMatchFinder.cpp:220
void enumAllIsoNodesInj(vector< IDType > &isolatedNodes, size_t isolatedNodesPos, vector< IDType > &targets, unordered_set< IDType > &noTargets, graphs::Mapping ¤tMapping, shared_ptr< vector< graphs::Mapping >> allMappings) const
This method recursively enumerates through all possibilities to map the isolated nodes injectively to...
Definition: StdMatchFinder.cpp:345
StdMatchFinder(bool injective=false, bool stopFast=false)
Generates a new instance of StdMatchFinder.
Definition: StdMatchFinder.cpp:32
void enumAllIsoNodesNonInj(vector< IDType > &isolatedNodes, vector< IDType > &targets, graphs::Mapping ¤tMapping, shared_ptr< vector< graphs::Mapping >> allMappings) const
Enumerates through all possibilities to map the isolated nodes non-injectively to the target graph...
Definition: StdMatchFinder.cpp:367
IDType getNewEntryPoint(graphs::AnonHypergraph const &source, graphs::Mapping const ¤tMapping) const
Searched for an unmapped edge in the source graph according to a simple optimization criterion...
Definition: StdMatchFinder.cpp:204
bool stopOnFirstFind
Stores whether the matcher should stop after finding at least one match.
Definition: StdMatchFinder.h:209
An AnonHypergraph is a data structure storing a hypergraph.
Definition: AnonHypergraph.h:43
bool matchInjective
Stores whether the used matches should injective or not.
Definition: StdMatchFinder.h:204
shared_ptr< vector< graphs::Mapping > > findMatches(graphs::AnonHypergraph const &source, graphs::AnonHypergraph const &target) const
This method takes two graphs and calculates all matches from the source to the target graph...
Definition: StdMatchFinder.cpp:52
shared_ptr< vector< graphs::Mapping > > mapIsolatedNodes(graphs::AnonHypergraph const &source, graphs::AnonHypergraph const &target, shared_ptr< vector< graphs::Mapping >> foundMappings) const
Maps all isolated notes of the source graph to the target graph.
Definition: StdMatchFinder.cpp:265
virtual ~StdMatchFinder()
Destroys the current instance of StdMatchFinder.
Definition: StdMatchFinder.cpp:34
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53