UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
IsomorphismChecker.h
1 /***************************************************************************
2  * Copyright (C) 2009 by Marvin Heumüller *
3  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
19  ***************************************************************************/
20 
21 #ifndef ALGORITHMS_HYPERGRAPHISOMORPHISM_CHECKER_H
22 #define ALGORITHMS_HYPERGRAPHISOMORPHISM_CHECKER_H
23 
24 #include "Hypergraph.h"
25 #include <list>
26 
27 namespace uncover {
28  namespace graphs {
29 
38  {
39 
40  public:
41 
45  virtual ~IsomorphismChecker();
46 
53  static bool areIsomorphic(Hypergraph const& hg1, Hypergraph const& hg2);
54 
55  private:
56 
61 
71  static bool insertIfValid(map<IDType, IDType>& forw, map<IDType, IDType>& backw, IDType id0, IDType id1);
72 
86  static bool mapping(
87  Hypergraph const& h0,
88  HGSignature& sigs0,
89  Hypergraph const& h1,
90  HGSignature& sigs1,
91  map<PartSig, std::list<IDType> >& sigs1rev,
92  map<IDType, IDType>& mappingsFor,
93  map<IDType, IDType>& mappingsBack,
94  Hypergraph::EMap::const_iterator it,
95  Hypergraph::EMap::const_iterator end);
96 
97  };
98 
99  }
100 }
101 
102 #endif
unsigned int PartSig
PartSig is a Signature of an element of a graph.
Definition: globals.h:99
static bool mapping(Hypergraph const &h0, HGSignature &sigs0, Hypergraph const &h1, HGSignature &sigs1, map< PartSig, std::list< IDType > > &sigs1rev, map< IDType, IDType > &mappingsFor, map< IDType, IDType > &mappingsBack, Hypergraph::EMap::const_iterator it, Hypergraph::EMap::const_iterator end)
Checks all possible mappings for the given parameter and returns true, if one is an isomorphism...
Definition: IsomorphismChecker.cpp:67
static bool areIsomorphic(Hypergraph const &hg1, Hypergraph const &hg2)
Returns true if the two given graphs are isomorphic.
Definition: IsomorphismChecker.cpp:38
A Hypergraph represents a graph with a unique identifier.
Definition: Hypergraph.h:35
virtual ~IsomorphismChecker()
Destroys this IsomorphismChecker.
Definition: IsomorphismChecker.cpp:36
unordered_map< IDType, PartSig > HGSignature
HGSignature represents a Signature calculated from a Hypergraph.
Definition: globals.h:105
static bool insertIfValid(map< IDType, IDType > &forw, map< IDType, IDType > &backw, IDType id0, IDType id1)
Inserts a pair of the given IDs to the given forward and backward maps if the resulting Mapping is st...
Definition: IsomorphismChecker.cpp:195
IsomorphismChecker()
This constructor cannot/should not be called.
Definition: IsomorphismChecker.cpp:34
Checks whether two given Hypergraphs are isomorphic or not.
Definition: IsomorphismChecker.h:37
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53