GEDLIB  1.0
f1.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_F1_HPP_
28 #define SRC_METHODS_F1_HPP_
29 
30 namespace ged {
31 
41 template<class UserNodeLabel, class UserEdgeLabel>
42 class F1 : public MIPBasedMethod<UserNodeLabel, UserEdgeLabel> {
43 
44 public:
45 
46  virtual ~F1();
47 
48  F1(const GEDData<UserNodeLabel, UserEdgeLabel> & ged_data);
49 
50 private:
51 
52  std::map<std::pair<GEDGraph::NodeID, GEDGraph::NodeID>, GRBVar> x_;
53 
54  std::map<std::pair<GEDGraph::EdgeID, GEDGraph::EdgeID>, GRBVar> y_;
55 
56  std::vector<GRBVar> u_;
57 
58  std::vector<GRBVar> v_;
59 
60  std::map<GEDGraph::EdgeID, GRBVar> e_;
61 
62  std::map<GEDGraph::EdgeID, GRBVar> f_;
63 
64  // Virtual member functions inherited from MIPBasedMethod.
65 
66  virtual void mip_populate_model_(const GEDGraph & g, const GEDGraph & h, GRBModel & model) final;
67 
68  virtual void mip_model_to_node_map_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, NodeMap & node_map) final;
69 
70  virtual bool mip_model_to_lsape_projection_problem_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, DMatrix & lsape_instance) final;
71 
72  // Private helper function.
73 
74  char variable_type_() const;
75 
76 };
77 
78 }
79 
80 
81 #endif /* SRC_METHODS_F1_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
Mixed integer linear programming formulation of the graph edit distance.
Definition: f1.hpp:42
virtual void mip_populate_model_(const GEDGraph &g, const GEDGraph &h, GRBModel &model) final
Runs the local search from an initial node map.
Definition: f1.ipp:51
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: f1.ipp:175
The normalized input graphs used by GEDLIB. All labels are integers.
Definition: ged_graph.hpp:104
Global namespace for GEDLIB.
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: f1.ipp:209
Abstract class for methods that use mixed integer linear programming for exactly or approximatively c...