Generated on Wed Apr 29 2015 11:51:41 for GGL-4.1.2 by doxygen 1.8.3.1
Data Structures | Public Member Functions | Protected Types | Static Protected Member Functions
sgm::GM_vf2 Class Reference

VF2 graph isomorphism. More...

#include <GM_vf2.hh>

Inheritance diagram for sgm::GM_vf2:
Inheritance graph
[legend]

Data Structures

class  EdgeLabelComparator
 
class  NodeComparator
 

Public Member Functions

virtual size_t findMatches (const Pattern_Interface &pattern, const Graph_Interface &target, Match_Reporter &reporter, const size_t maxHits)
 
virtual size_t findMatches (const std::vector< const Pattern_Interface * > &patterns, const Graph_Interface &target, Match_Reporter &reporter, const size_t maxHits)
 
virtual size_t findMatches (const std::vector< const Pattern_Interface * > &patterns, const Graph_Interface &target, std::vector< Match_Reporter * > &reporters, const size_t maxHits)
 

Protected Types

typedef
VF2_MatchingHandler::EdgeLabel 
EdgeLabel
 
typedef
VF2_MatchingHandler::EdgeLabelVec 
EdgeLabelVec
 
typedef VF2_MatchingHandler::Label Label
 
typedef
VF2_MatchingHandler::LabelComparator 
LabelComparator
 
typedef
VF2_MatchingHandler::NodeData 
NodeData
 
typedef
VF2_MatchingHandler::NodeDataVec 
NodeDataVec
 
typedef
VF2_MatchingHandler::PatternMap 
PatternMap
 
typedef std::vector< const
Pattern_Interface * > 
PatternVec
 container of patterns to match More...
 
typedef std::vector
< Match_Reporter * > 
ReporterVec
 container of match reporters to report matches to More...
 
enum  ResultMode { FIND_ONE, FIND_ALL }
 
typedef
VF2_MatchingHandler::VF2_match_handler 
VF2_match_handler
 

Static Protected Member Functions

static bool areDegreeCompatible (const NodeDataVec &patternNodes, const NodeDataVec &targetNodes)
 
static bool fillLoader (const Graph_Interface &graph, vf2::ARGEdit &loader, PatternMap &patternLabel, NodeDataVec &nodeData, EdgeLabelVec &edgeLabels, bool isPattern)
 
template<class VF2STATE , class NODECOMPARE , class EDGECOMPARE >
static size_t findMatches (const PatternVec &pattern, const Graph_Interface &target, ReporterVec &output, const size_t maxHits)
 
static bool isApplicable (const Pattern_Interface &pattern, const Graph_Interface &target, const Match &match)
 

Detailed Description

     An sgm::GraphMatching interface implementation that uses the
     implementation of the VF-2 algorithm for its computation.
Author
Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/

Definition at line 17 of file GM_vf2.hh.

Member Typedef Documentation

Definition at line 26 of file GM_vf2.hh.

Definition at line 27 of file GM_vf2.hh.

Definition at line 22 of file GM_vf2.hh.

Definition at line 23 of file GM_vf2.hh.

Definition at line 24 of file GM_vf2.hh.

Definition at line 25 of file GM_vf2.hh.

Definition at line 28 of file GM_vf2.hh.

typedef std::vector< const Pattern_Interface* > sgm::VF2_MatchingHandler::PatternVec
protectedinherited

Definition at line 211 of file VF2_MatchingHandler.hh.

typedef std::vector< Match_Reporter* > sgm::VF2_MatchingHandler::ReporterVec
protectedinherited

Definition at line 213 of file VF2_MatchingHandler.hh.

Definition at line 29 of file GM_vf2.hh.

Member Enumeration Documentation

enum sgm::VF2_MatchingHandler::ResultMode
protectedinherited

Data type that defines the the search mode of findMatches(..) function

Enumerator
FIND_ONE 
FIND_ALL 

Definition at line 47 of file VF2_MatchingHandler.hh.

Member Function Documentation

static bool sgm::VF2_MatchingHandler::areDegreeCompatible ( const NodeDataVec patternNodes,
const NodeDataVec targetNodes 
)
staticprotectedinherited

checks whether or not the pattern is compatible with the target based on the out degree information of the nodes.

Parameters
patternNodesthe node data of the pattern
targetNodesthe node data of the target
Returns
true, if the pattern node degree distribution is compatible with the distribution of the target; false otherwise
static bool sgm::VF2_MatchingHandler::fillLoader ( const Graph_Interface graph,
vf2::ARGEdit &  loader,
PatternMap patternLabel,
NodeDataVec nodeData,
EdgeLabelVec edgeLabels,
bool  isPattern 
)
staticprotectedinherited

Static function that is used by findMatches to fill the internally used ARGEdit objects.

Parameters
graphthe graph to be 'filled' into the loader
loaderthe loader to fill
patternLabelthe already known labels from the graph
nodeDatathe container that will hold the node data.
edgeLabelsthe container that will hold all edge labels.
isPatternIf true, than graph will be used to fill patternLabel and all nodes and edges in the loader will get a label. If false, only known label from the pattern graph are set in the loader, all other are set to NULL.
Returns
false if isPattern == false and at least one label in the graph is not present in patternLabel, true otherwise
virtual size_t sgm::GM_vf2::findMatches ( const Pattern_Interface pattern,
const Graph_Interface target,
Match_Reporter reporter,
const size_t  maxHits 
)
virtual

Performs exact graph matching to find maxHits occurrences of the pattern graph within the target graph. Each hit is reported to the Match_Reporter object.

Parameters
patternthe pattern graph to search for
targetthe graph to search the pattern within
reporterall hits are reported to that object
maxHitsthe maximal number of hits to find
Returns
the number of exact matches found

Implements sgm::GraphMatching.

virtual size_t sgm::GM_vf2::findMatches ( const std::vector< const Pattern_Interface * > &  patterns,
const Graph_Interface target,
Match_Reporter reporter,
const size_t  maxHits 
)
virtual

Performs exact graph matching to find maxHits occurrences of the pattern graphs within the target graph. Each hit is reported to the Match_Reporter object. NOTE, the first maxHits matches of the pattern graphs according to their order in the patterns container are reported, i.e. first all occurrences of the first pattern are identified. If this does not exceed the maxHits limit, the next pattern is matched and so on until either no pattern is left or the maxHits limit is exceeded.

Parameters
patternsthe container of the pattern graphs to search for
targetthe graph to search the pattern within
reporterall hits are reported to that object
maxHitsthe maximal number of hits to find
Returns
the number of exact matches found

Implements sgm::GraphMatching.

virtual size_t sgm::GM_vf2::findMatches ( const std::vector< const Pattern_Interface * > &  patterns,
const Graph_Interface target,
std::vector< Match_Reporter * > &  reporters,
const size_t  maxHits 
)
virtual

Performs exact graph matching to find maxHits occurrences of the pattern graphs within the target graph. Each hit is reported to the Match_Reporter object. NOTE, the first maxHits matches of the pattern graphs according to their order in the patterns container are reported, i.e. first all occurrences of the first pattern are identified. If this does not exceed the maxHits limit, the next pattern is matched and so on until either no pattern is left or the maxHits limit is exceeded.

Parameters
patternsthe container of the pattern graphs to search for
targetthe graph to search the pattern within
reporterseach hit is reported to the corresponding object, the container has to have the same length as patterns
maxHitsthe maximal number of hits to find
Returns
the number of exact matches found

Implements sgm::GraphMatching.

template<class VF2STATE , class NODECOMPARE , class EDGECOMPARE >
static size_t sgm::VF2_MatchingHandler::findMatches ( const PatternVec pattern,
const Graph_Interface target,
ReporterVec output,
const size_t  maxHits 
)
staticprotectedinherited

Performs exact sub-graph matching to find all occurences of the pattern graph within the target graph. Each hit is reported to the Match_Reporter object.

Parameters
patternthe container of pattern graphs to search for
targetthe graph to search the pattern within
outputcontainer of match reporters, one for each pattern to match, all hits of each pattern are reported to the according output object
maxHitsthe maximal number of matches to find
Returns
the number of exact matches found
static bool sgm::VF2_MatchingHandler::isApplicable ( const Pattern_Interface pattern,
const Graph_Interface target,
const Match match 
)
staticprotectedinherited

Checks whether or not a given pattern match fulfills the additional matching constraints requested by the pattern.

Parameters
patternthe pattern to be found
targetthe graph the left side was found within, i.e. in that the rule should be applied
matchcontains the indices of the matched left side nodes in the target graph. match[i] corresponds to the mapping of the i-th vertex in the leftSide graph.

The documentation for this class was generated from the following file: