GEDLIB  1.0
hybrid.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_HYBRID_HPP_
28 #define SRC_METHODS_HYBRID_HPP_
29 
30 namespace ged {
31 
46 template<class UserNodeLabel, class UserEdgeLabel>
47 class Hybrid : public GEDMethod<UserNodeLabel, UserEdgeLabel> {
48 
49 public:
50 
51  virtual ~Hybrid();
52 
54 
55 private:
56 
57  typedef typename std::vector<typename Partition<UserNodeLabel, UserEdgeLabel>::Substruct_>::const_iterator SubstructItr_;
58 
59  LSAPESolver::Model lsape_model_;
60 
61  std::size_t num_threads_;
62 
63  double time_limit_in_sec_;
64 
65  // Member functions inherited from GEDMethod.
66 
67  virtual void ged_run_(const GEDGraph & g, const GEDGraph & h, Result & result) final;
68 
69  virtual void ged_set_default_options_() final;
70 
71  virtual bool ged_parse_option_(const std::string & option, const std::string & arg) final;
72 
73  virtual std::string ged_valid_options_string_() const final;
74 
75  // Private helper member functions.
76  bool branch_uniform_dfs_(const Timer & timer, const std::string & options, GEDGraph & g, GEDGraph & h, SubstructItr_ current_substruct, SubstructItr_ end_substructs, double & lower_bound);
77 
78  std::string to_string_(LSAPESolver::Model lsape_model);
79 
80 };
81 
82 }
83 
84 #endif /* SRC_METHODS_HYBRID_HPP_ */
Contains the standardized input data along with basic functionality.
Definition: ged_data.hpp:55
virtual bool ged_parse_option_(const std::string &option, const std::string &arg) final
Parses one option.
Definition: hybrid.ipp:104
A timer class that can be used by methods that support time limits.
Definition: timer.hpp:38
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_set_default_options_() final
Sets all options to default values.
Definition: hybrid.ipp:88
virtual void ged_run_(const GEDGraph &g, const GEDGraph &h, Result &result) final
Runs the method with options specified by set_options().
Definition: hybrid.ipp:49
virtual std::string ged_valid_options_string_() const final
Returns string of all valid options.
Definition: hybrid.ipp:97
The normalized input graphs used by GEDLIB. All labels are integers.
Definition: ged_graph.hpp:104
Computes a lower bound for uniform edit costs.
Definition: hybrid.hpp:47
Global namespace for GEDLIB.
Model
Selects a model for solving LSAPE with the Hungarian algorithm.