GEDLIB  1.0
compact_mip.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_COMPACT_MIP_HPP_
28 #define SRC_METHODS_COMPACT_MIP_HPP_
29 
30 
31 namespace ged {
32 
42 template<class UserNodeLabel, class UserEdgeLabel>
43 class CompactMIP : public MIPBasedMethod<UserNodeLabel, UserEdgeLabel> {
44 
45 public:
46 
47  virtual ~CompactMIP();
48 
50 
51 private:
52 
53  std::map<NodeMap::Assignment, GRBVar> x_;
54 
55  std::map<NodeMap::Assignment, GRBVar> z_;
56 
57  // Virtual member functions inherited from MIPBasedMethod.
58 
59  virtual void mip_populate_model_(const GEDGraph & g, const GEDGraph & h, GRBModel & model) final;
60 
61  virtual void mip_model_to_node_map_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, NodeMap & node_map) final;
62 
63  virtual bool mip_model_to_lsape_projection_problem_(const GEDGraph & g, const GEDGraph & h, GRBModel & model, DMatrix & lsape_instance) final;
64 
65  // Private helper function.
66 
67  char variable_type_() const;
68 
69 };
70 
71 }
72 
73 
74 #endif /* SRC_METHODS_COMPACT_MIP_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_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...
Mixed integer linear programming formulation of the graph edit distance.
Definition: compact_mip.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: compact_mip.ipp:47
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...
Abstract class for methods that use mixed integer linear programming for exactly or approximatively c...