GEDLIB  1.0
f2.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2018 by David B. Blumenthal *
4  * *
5  * This file is part of GEDLIB. *
6  * *
7  * GEDLIB is free software: you can redistribute it and/or modify it *
8  * under the terms of the GNU Lesser General Public License as published *
9  * by the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * GEDLIB is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU Lesser General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with GEDLIB. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 
27 #ifndef SRC_METHODS_F2_HPP_
28 #define SRC_METHODS_F2_HPP_
29 
30 namespace ged {
31 
41 template<class UserNodeLabel, class UserEdgeLabel>
42 class F2 : public MIPBasedMethod<UserNodeLabel, UserEdgeLabel> {
43 
44 public:
45 
46  virtual ~F2();
47 
48  F2(const GEDData<UserNodeLabel, UserEdgeLabel> & ged_data);
49 
50 private:
51 
52  std::map<NodeMap::Assignment, GRBVar> x_;
53 
54  std::map<std::pair<GEDGraph::EdgeID, GEDGraph::EdgeID>, GRBVar> y_;
55 
56  // Virtual member functions inherited from MIPBasedMethod.
57 
58  virtual void mip_populate_model_(const GEDGraph & g, const GEDGraph & h, GRBModel & model) final;
59 
60  virtual void mip_model_to_node_map_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, NodeMap & node_map) final;
61 
62  virtual bool mip_model_to_lsape_projection_problem_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, DMatrix & lsape_instance) final;
63 
64  // Private helper function.
65 
66  char variable_type_() const;
67 
68 };
69 
70 }
71 
72 #endif /* SRC_METHODS_F2_HPP_ */
Contains the standardized input data along with basic functionality.
Definition: ged_data.hpp:55
A class for node maps.
Definition: node_map.hpp:43
virtual void mip_populate_model_(const GEDGraph &g, const GEDGraph &h, GRBModel &model) final
Runs the local search from an initial node map.
Definition: f2.ipp:46
virtual void mip_model_to_node_map_(const GEDGraph &g, const GEDGraph &h, GRBModel &model, NodeMap &node_map) final
Given a, possibly sub-optimally, solved unrelaxed model, this method constructs a node map and sets i...
Definition: f2.ipp:159
The normalized input graphs used by GEDLIB. All labels are integers.
Definition: ged_graph.hpp:104
virtual bool mip_model_to_lsape_projection_problem_(const GEDGraph &g, const GEDGraph &h, GRBModel &model, DMatrix &lsape_instance) final
Given a, possibly sub-optimally, solved model, this method constructs an LSAPE instance for projectin...
Definition: f2.ipp:199
Global namespace for GEDLIB.
Mixed integer linear programming formulation of the graph edit distance.
Definition: f2.hpp:42
Abstract class for methods that use mixed integer linear programming for exactly or approximatively c...