27 #ifndef SRC_METHODS_LSAPE_BASED_METHOD_HPP_ 28 #define SRC_METHODS_LSAPE_BASED_METHOD_HPP_ 55 template<
class UserNodeLabel,
class UserEdgeLabel>
122 enum CentralityMethod_ {NONE, DEGREE, EIGENVECTOR, PAGERANK};
124 CentralityMethod_ centrality_method_;
126 double centrality_weight_;
128 std::map<GEDGraph::GraphID, std::vector<double>> centralities_;
130 int max_num_solutions_;
138 virtual bool ged_parse_option_(
const std::string & option,
const std::string & arg)
final;
146 void init_graph_(
const GEDGraph & graph);
148 void init_centralities_(
const GEDGraph & graph);
152 void compute_eigenvector_with_largest_eigenvalue_(
const DMatrix & symmetric_matrix, std::vector<double> & eigenvector,
double & eigenvalue);
void populate_instance_and_run_as_util(const GEDGraph &g, const GEDGraph &h, Result &result, DMatrix &lsape_instance)
Runs the method with options specified by set_options() and provides access to constructed LSAPE inst...
virtual bool lsape_parse_option_(const std::string &option, const std::string &arg)
Parses one option that is not among the ones shared by all derived classes of ged::LSAPEBasedMethod.
virtual void lsape_set_default_options_()
Sets all options that are not among the ones shared by all derived classes of ged::LSAPEBasedMethod t...
Contains the standardized input data along with basic functionality.
virtual ~LSAPEBasedMethod()=0
Pure virtual destructor.
std::size_t num_threads_
The number of threads to be used.
virtual std::string lsape_valid_options_string_() const
Returns string of all valid options that are not among the ones shared by all derived classes of ged:...
GreedyMethod
Selects a greedy method.
virtual double lsape_lower_bound_scaling_factor_(const GEDGraph &g, const GEDGraph &h)
Returns scaling factor for lower bound.
A wrapper structure for the result of calls to ged::GEDMethod::run_as_util() and ged::GEDMethod::ged_...
Abstract class for the (suboptimal) computation of the graph edit distance.
virtual void ged_set_default_options_() final
Sets all options to default values.
virtual void lsape_default_post_graph_init_()
Default initializes the method at runtime after initializing the global variables for the graphs...
bool solve_optimally_
Flag that equals true if an optimal LSAPE solver is used and false if a greedy method is employed...
virtual void ged_init_() final
Initializes the method.
bool compute_lower_bound_
Flag that should be set to true if and only if the method computes a lower bound. ...
LSAPESolver::Model lsape_model_
Specifies model for optimal LSAPE solver.
Abstract class for methods that use lossy transformations to LSAPE for approximating the graph edit d...
void populate_instance(const GEDGraph &g, const GEDGraph &h, DMatrix &lsape_instance)
Populates the LSAPE instance.
The normalized input graphs used by GEDLIB. All labels are integers.
virtual void lsape_init_graph_(const GEDGraph &graph)
Initializes global variables for one graph.
Global namespace for GEDLIB.
virtual void lsape_populate_instance_(const GEDGraph &g, const GEDGraph &h, DMatrix &lsape_instance)
Populates the LSAPE instance.
virtual void lsape_pre_graph_init_(bool called_at_runtime)
Initializes the method at runtime or during initialization before initializing the global variables f...
virtual std::string ged_valid_options_string_() const final
Returns string of all valid options.
virtual void ged_run_(const GEDGraph &g, const GEDGraph &h, Result &result) final
Runs the method with options specified by set_options().
LSAPESolver::GreedyMethod greedy_method_
Specifies method for greedy LSAPE solver.
Model
Selects a model for solving LSAPE with the Hungarian algorithm.
virtual void lsape_init_()
Initializes the method after initializing the global variables for the graphs.
LSAPEBasedMethod(const GEDData< UserNodeLabel, UserEdgeLabel > &ged_data)
Constructor.
virtual bool ged_parse_option_(const std::string &option, const std::string &arg) final
Parses one option.