GEDLIB
1.0
|
Abstract class for methods that use variants of local search for upper bounding the graph edit distance. More...
#include <ls_based_method.hpp>
Public Member Functions | |
virtual | ~LSBasedMethod ()=0 |
Pure virtual destructor. More... | |
LSBasedMethod (const GEDData< UserNodeLabel, UserEdgeLabel > &ged_data) | |
Constructor. More... | |
![]() | |
virtual | ~GEDMethod ()=0 |
Pure virtual destructor. More... | |
GEDMethod (const GEDData< UserNodeLabel, UserEdgeLabel > &ged_data) | |
Constructor. More... | |
void | set_options (const std::string &options) |
Sets the options of the method. More... | |
void | run (GEDGraph::GraphID g_id, GEDGraph::GraphID h_id) |
Runs the method with options specified by set_options(). More... | |
void | run_as_util (const GEDGraph &g, const GEDGraph &h, Result &result) |
Runs the method with options specified by set_options(). More... | |
void | init () |
Initializes the method with options specified by set_options(). | |
double | get_upper_bound () const |
Returns an upper bound. More... | |
double | get_lower_bound () const |
Returns a lower bound. More... | |
Seconds | get_runtime () const |
Returns the runtime. More... | |
Seconds | get_init_time () const |
Returns the initialization time. More... | |
const NodeMap & | get_node_map () const |
Returns a graph matching. More... | |
Protected Attributes | |
std::size_t | num_threads_ |
The number of threads to be used. | |
![]() | |
bool | initialized_ |
A flag that equals true if init() has been called and false otherwise. | |
const GEDData< UserNodeLabel, UserEdgeLabel > & | ged_data_ |
The data on which the method is run. | |
Private Member Functions | |
virtual void | ged_init_ () final |
Initializes the method. More... | |
virtual void | ged_run_ (const GEDGraph &g, const GEDGraph &h, Result &result) final |
Runs the method with options specified by set_options(). More... | |
virtual bool | ged_parse_option_ (const std::string &option, const std::string &arg) final |
Parses one option. More... | |
virtual std::string | ged_valid_options_string_ () const final |
Returns string of all valid options. More... | |
virtual void | ged_set_default_options_ () final |
Sets all options to default values. More... | |
virtual void | ls_run_from_initial_solution_ (const GEDGraph &g, const GEDGraph &h, double lower_bound, const NodeMap &initial_node_map, NodeMap &output_node_map) |
Runs the local search from an initial node map. More... | |
virtual void | ls_init_ () |
Initializes the method. More... | |
virtual void | ls_runtime_init_ (const GEDGraph &g, const GEDGraph &h) |
Initializes the method for a run between two graphs. More... | |
virtual bool | ls_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::LSBasedMethod. More... | |
virtual std::string | ls_valid_options_string_ () const |
Returns string of all valid options that are not among the ones shared by all derived classes of ged::LSBasedMethod. More... | |
virtual void | ls_set_default_options_ () |
Sets all options that are not among the ones shared by all derived classes of ged::LSBasedMethod to default values. More... | |
Abstract class for methods that use variants of local search for upper bounding the graph edit distance.
All derived methods support the following options:
--<option> <arg> | modified parameter | default | more information |
---|---|---|---|
--initialization-method BIPARTITE_ML|BIPARTITE|BRANCH_FAST|BRANCH_UNIFORM|BRANCH|NODE|RING_ML|RING|SUBGRAPH|WALKS|RANDOM | method for computing the initial solution | RANDOM | if RANDOM , the option --initialization-options has no effect |
--initialization-options '[–<option> <arg>] [...]' | options string passed to the initialization method | '' | ged::BipartiteML, ged::Bipartite, ged::BranchFast, ged::BranchUniform, ged::Branch, ged::Node ged::RingML, ged::Ring, ged::Subgraph, ged::Walks |
--lower-bound-method BRANCH|BRANCH_FAST|BRANCH_TIGHT|NONE | method for computing lower bound used as a termination criterion | NONE | if NONE , the lower bound computed by the initialization method is used |
--random-substitution-ratio <convertible to double between 0 and 1> | ratio of node substitutions in randomly constructed initial solutions | 1 | n.a |
--initial-solutions <convertible to int greater 0> | number of initial solutions | 1 | if greater 1 and if a non-random initialization method is chosen, those initial solution that cannot be computed non-randomly because the initialization method does not yield enough solutions are computed randomly |
--ratio-runs-from-initial-solutions <convertible to double greater 0 and smaller equal 1> | determines number of runs from initial solutions | 1 | if set to r and --initial-solutions is set to k , all remaining initial solutions are discarded as soon as r * k runs have been completed |
--threads <convertible to int greater 0> | number of threads | 1 | used for initializing the initialization method and for parallelly running local searches from several initial solutions |
--num-randpost-loops <convertible to int greater equal 0> | number of loops of RANDPOST algorithm | 0 | https://doi.org/10.1007/978-3-319-97785-0_44 |
--max-randpost-retrials <convertible to int greater equal 0> | number of times the RANDPOST algorithm flattens the probability distribution if it encounters already converged solutions | 10 | https://doi.org/10.1007/978-3-319-97785-0_44 |
--randpost-penalty <convertible to double between 0 and 1> | if set value close to 1 , expensive solutions count less for constructing the counts matrix | 0 | n.a. |
--randpost-decay <convertible to double between 0 and 1> | if set value close to 0 , previous iterations contribute less when constructing the counts matrix | 1 | n.a. |
--log <file name> | name of log-file for RANDPOST | "" | if not empty, a log-file for RANDPOST is created |
--randomness REAL|PSEUDO | use real randomness or pseudo randomness | REAL | n.a. |
Definition at line 52 of file ls_based_method.hpp.
|
pure virtual |
Pure virtual destructor.
Definition at line 35 of file ls_based_method.ipp.
ged::LSBasedMethod< UserNodeLabel, UserEdgeLabel >::LSBasedMethod | ( | const GEDData< UserNodeLabel, UserEdgeLabel > & | ged_data | ) |
Constructor.
[in] | ged_data | The instance on which the method should be run. |
Definition at line 42 of file ls_based_method.ipp.
|
finalprivatevirtual |
Initializes the method.
Reimplemented from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >.
Definition at line 63 of file ls_based_method.ipp.
|
finalprivatevirtual |
Parses one option.
[in] | option | The name of the option. |
[in] | arg | The argument of the option. |
true
if option
is a valid option name for the method and false
otherwise. Reimplemented from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >.
Definition at line 157 of file ls_based_method.ipp.
|
finalprivatevirtual |
Runs the method with options specified by set_options().
[in] | g | Input graph. |
[in] | h | Input graph. |
[out] | result | Result variable. |
Reimplemented from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >.
Definition at line 76 of file ls_based_method.ipp.
|
finalprivatevirtual |
Sets all options to default values.
Reimplemented from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >.
Definition at line 382 of file ls_based_method.ipp.
|
finalprivatevirtual |
Returns string of all valid options.
[–<option> <arg>] [...]
. Reimplemented from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >.
Definition at line 372 of file ls_based_method.ipp.
|
privatevirtual |
Initializes the method.
Definition at line 619 of file ls_based_method.ipp.
|
privatevirtual |
Parses one option that is not among the ones shared by all derived classes of ged::LSBasedMethod.
[in] | option | The name of the option. |
[in] | arg | The argument of the option. |
option
is a valid option name for the method and false otherwise. Reimplemented in ged::IPFP< UserNodeLabel, UserEdgeLabel >, ged::BPBeam< UserNodeLabel, UserEdgeLabel >, and ged::Refine< UserNodeLabel, UserEdgeLabel >.
Definition at line 629 of file ls_based_method.ipp.
|
privatevirtual |
Runs the local search from an initial node map.
[in] | g | Input graph. |
[in] | h | Input graph. |
[in] | lower_bound | A lower bound for GED which can be used as a termination criterion. |
[in] | initial_node_map | Initial node map. |
[out] | output_node_map | Node map constructed by local search. |
Reimplemented in ged::IPFP< UserNodeLabel, UserEdgeLabel >, ged::BPBeam< UserNodeLabel, UserEdgeLabel >, and ged::Refine< UserNodeLabel, UserEdgeLabel >.
Definition at line 614 of file ls_based_method.ipp.
|
privatevirtual |
Initializes the method for a run between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
Reimplemented in ged::IPFP< UserNodeLabel, UserEdgeLabel >.
Definition at line 624 of file ls_based_method.ipp.
|
privatevirtual |
Sets all options that are not among the ones shared by all derived classes of ged::LSBasedMethod to default values.
Reimplemented in ged::IPFP< UserNodeLabel, UserEdgeLabel >, ged::BPBeam< UserNodeLabel, UserEdgeLabel >, and ged::Refine< UserNodeLabel, UserEdgeLabel >.
Definition at line 643 of file ls_based_method.ipp.
|
privatevirtual |
Returns string of all valid options that are not among the ones shared by all derived classes of ged::LSBasedMethod.
Reimplemented in ged::IPFP< UserNodeLabel, UserEdgeLabel >, ged::BPBeam< UserNodeLabel, UserEdgeLabel >, and ged::Refine< UserNodeLabel, UserEdgeLabel >.
Definition at line 636 of file ls_based_method.ipp.