GEDLIB  1.0
simulated_annealing.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_SIMULATED_ANNEALING_HPP_
28 #define SRC_METHODS_SIMULATED_ANNEALING_HPP_
29 
30 namespace ged {
31 
55 template<class UserNodeLabel, class UserEdgeLabel>
56 class SimulatedAnnealing : public GEDMethod<UserNodeLabel, UserEdgeLabel> {
57 
58 public:
59 
60  virtual ~SimulatedAnnealing();
61 
63 
64 private:
65 
67 
68  std::string lsape_method_name_;
69 
70  std::string lsape_method_options_;
71 
72  GEDMethod<UserNodeLabel, UserEdgeLabel> * lower_bound_method_;
73 
74  std::string lower_bound_method_name_;
75 
76  std::string lower_bound_method_options_;
77 
78  std::size_t num_threads_;
79 
80  std::size_t num_iterations_;
81 
82  double start_probability_;
83 
84  double end_probability_;
85 
86  // Member functions inherited from GEDMethod.
87 
88  virtual void ged_init_() final;
89 
90  virtual void ged_run_(const GEDGraph & g, const GEDGraph & h, Result & result) final;
91 
92  virtual bool ged_parse_option_(const std::string & option, const std::string & arg) final;
93 
94  virtual std::string ged_valid_options_string_() const final;
95 
96  virtual void ged_set_default_options_() final;
97 
98  // Private helper member functions.
99 
100  void generate_candidate_(const GEDGraph & g, const GEDGraph & h, const DMatrix & lsape_instance, const std::vector<std::size_t> & current_order,
101  std::vector<std::size_t> & candidate_order, NodeMap & candidate_node_map) const;
102 
103 };
104 
105 }
106 
107 #endif /* SRC_METHODS_SIMULATED_ANNEALING_HPP_ */
Contains the standardized input data along with basic functionality.
Definition: ged_data.hpp:55
virtual void ged_run_(const GEDGraph &g, const GEDGraph &h, Result &result) final
Runs the method with options specified by set_options().
A class for node maps.
Definition: node_map.hpp:43
A wrapper structure for the result of calls to ged::GEDMethod::run_as_util() and ged::GEDMethod::ged_...
Definition: result.hpp:38
Abstract class for the (suboptimal) computation of the graph edit distance.
Definition: ged_method.hpp:40
virtual void ged_init_() final
Initializes the method.
virtual void ged_set_default_options_() final
Sets all options to default values.
Abstract class for methods that use lossy transformations to LSAPE for approximating the graph edit d...
The normalized input graphs used by GEDLIB. All labels are integers.
Definition: ged_graph.hpp:104
virtual bool ged_parse_option_(const std::string &option, const std::string &arg) final
Parses one option.
Global namespace for GEDLIB.
virtual std::string ged_valid_options_string_() const final
Returns string of all valid options.
Uses LSAPE instances to approximate GED via simulated annealing.