GEDLIB  1.0
Private Member Functions | List of all members
ged::RingML< UserNodeLabel, UserEdgeLabel > Class Template Reference

Uses ring structures for defining feature vectors for node edit operations. More...

#include <ring_ml.hpp>

Inheritance diagram for ged::RingML< UserNodeLabel, UserEdgeLabel >:
Inheritance graph
[legend]

Private Member Functions

virtual void ml_init_graph_ (const GEDGraph &graph) final
 Initializes global variables for one graph. More...
 
virtual void ml_set_default_options_ () final
 Sets all options that are not among the ones shared by all derived classes of ged::MLBasedMethod to default values. More...
 
virtual std::string ml_valid_options_string_ () const final
 Returns string of all valid options that are not among the ones shared by all derived classes of ged::MLBasedMethod. More...
 
virtual bool ml_parse_option_ (const std::string &option, const std::string &arg) final
 Parses one option that is not among the ones shared by all derived classes of ged::MLBasedMethod. More...
 
virtual void ml_init_feature_variables_ (const GEDGraph &g, const GEDGraph &h, std::size_t num_threads) final
 Initializes variables that are used for populating the feature vectors of assignments between two input graphs. More...
 
virtual void ml_populate_substitution_feature_vector_ (const GEDGraph &g, const GEDGraph &h, GEDGraph::NodeID i, GEDGraph::NodeID k, std::vector< double > &feature_vector) final
 Computes substitution feature vector. More...
 
virtual void ml_populate_deletion_feature_vector_ (const GEDGraph &g, GEDGraph::NodeID i, std::vector< double > &feature_vector) final
 Computes deletion feature vector. More...
 
virtual void ml_populate_insertion_feature_vector_ (const GEDGraph &h, GEDGraph::NodeID k, std::vector< double > &feature_vector) final
 Computes insertion feature vector. More...
 
virtual std::size_t ml_get_num_features_ () final
 Returns the number of features. More...
 
virtual void ml_init_for_num_features_ () final
 Initializes the derived class for running with feature vectors of size ged::MLBasedMethod::num_features_. More...
 

Additional Inherited Members

- Public Member Functions inherited from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >
double predict (const GEDGraph &g, const GEDGraph &h, const NodeMap::Assignment &assignment)
 Predicts the type of a node assignment. More...
 
- Public Member Functions inherited from ged::LSAPEBasedMethod< UserNodeLabel, UserEdgeLabel >
virtual ~LSAPEBasedMethod ()=0
 Pure virtual destructor. More...
 
 LSAPEBasedMethod (const GEDData< UserNodeLabel, UserEdgeLabel > &ged_data)
 Constructor. More...
 
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 instance. More...
 
void populate_instance (const GEDGraph &g, const GEDGraph &h, DMatrix &lsape_instance)
 Populates the LSAPE instance. More...
 
- Public Member Functions inherited from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >
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 NodeMapget_node_map () const
 Returns a graph matching. More...
 
- Protected Attributes inherited from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >
std::size_t num_features_
 The size of the feature vectors.
 
- Protected Attributes inherited from ged::LSAPEBasedMethod< UserNodeLabel, UserEdgeLabel >
LSAPESolver::Model lsape_model_
 Specifies model for optimal LSAPE solver.
 
LSAPESolver::GreedyMethod greedy_method_
 Specifies method for greedy LSAPE solver.
 
bool compute_lower_bound_
 Flag that should be set to true if and only if the method computes a lower bound.
 
bool solve_optimally_
 Flag that equals true if an optimal LSAPE solver is used and false if a greedy method is employed.
 
std::size_t num_threads_
 The number of threads to be used.
 
- Protected Attributes inherited from ged::GEDMethod< UserNodeLabel, UserEdgeLabel >
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.
 

Detailed Description

template<class UserNodeLabel, class UserEdgeLabel>
class ged::RingML< UserNodeLabel, UserEdgeLabel >

Uses ring structures for defining feature vectors for node edit operations.

Implements the ring based feature vectors suggested in:

Supports the following option in addition to the ones supported by ged::MLBasedMethod:

--<option> <arg> modified parameter default more information
--led-method LSAPE_OPTIMAL|LSAPE_GREEDY|GAMMA method for computing the layer distances LSAPE_OPTIMAL see PR paper
if not GAMMA, the method --sort-method has no effect
--sort-method STD|COUNTING the employed sorting algorithm COUNTING ged::util::counting_sort()
use counting sort if the number of different edge labels is constant
--topological-features TRUE|FALSE decides whether to include features for representing the topologies of the graphs TRUE see PR paper
--global-features TRUE|FALSE decides whether to include features for representing global properties of the graphs TRUE see PR paper

Definition at line 48 of file ring_ml.hpp.

Member Function Documentation

◆ ml_get_num_features_()

template<class UserNodeLabel , class UserEdgeLabel >
std::size_t ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_get_num_features_ ( )
finalprivatevirtual

Returns the number of features.

Returns
Size of the feature vectors employed by the derived class.
Note
Must be overridden by derived classes.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 211 of file ring_ml.ipp.

◆ ml_init_feature_variables_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_init_feature_variables_ ( const GEDGraph g,
const GEDGraph h,
std::size_t  num_threads 
)
finalprivatevirtual

Initializes variables that are used for populating the feature vectors of assignments between two input graphs.

Parameters
[in]gInput graph.
[in]hInput graph.
[in]num_threadsThe number of available threads.
Note
Must be overridden by derived classes that require initialization of variables used for populating the feature vectors of assignments between two input graphs.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 136 of file ring_ml.ipp.

◆ ml_init_for_num_features_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_init_for_num_features_ ( )
finalprivatevirtual

Initializes the derived class for running with feature vectors of size ged::MLBasedMethod::num_features_.

Note
Must be overridden by derived classes that can be set up with features vectors of various sizes.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 192 of file ring_ml.ipp.

◆ ml_init_graph_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_init_graph_ ( const GEDGraph graph)
finalprivatevirtual

Initializes global variables for one graph.

Parameters
[in]graphGraph for which the global variables have to be initialized.
Note
Must be overridden by derived classes that require to initialize custom global variables.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 53 of file ring_ml.ipp.

◆ ml_parse_option_()

template<class UserNodeLabel , class UserEdgeLabel >
bool ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_parse_option_ ( const std::string &  option,
const std::string &  arg 
)
finalprivatevirtual

Parses one option that is not among the ones shared by all derived classes of ged::MLBasedMethod.

Parameters
[in]optionThe name of the option.
[in]argThe argument of the option.
Returns
Returns true if option is a valid option name for the method and false otherwise.
Note
Must be overridden by derived classes that have options that are not among the ones shared by all derived classes of ged::MLBasedMethod.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 77 of file ring_ml.ipp.

◆ ml_populate_deletion_feature_vector_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_populate_deletion_feature_vector_ ( const GEDGraph g,
GEDGraph::NodeID  i,
std::vector< double > &  feature_vector 
)
finalprivatevirtual

Computes deletion feature vector.

Parameters
[in]gInput graph.
[in]iID of node in g that has to be deleted.
[out]feature_vectorReturn variable. Empty when called. Must be of size ged::MLBasedMethod::num_features_ when exiting.
Note
Must be overridden by derived classes.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 168 of file ring_ml.ipp.

◆ ml_populate_insertion_feature_vector_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_populate_insertion_feature_vector_ ( const GEDGraph h,
GEDGraph::NodeID  k,
std::vector< double > &  feature_vector 
)
finalprivatevirtual

Computes insertion feature vector.

Parameters
[in]hInput graph.
[in]kID of node in h that has to be inserted.
[out]feature_vectorReturn variable. Empty when called. Must be of size ged::MLBasedMethod::num_features_ when exiting.
Note
Must be overridden by derived classes.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 180 of file ring_ml.ipp.

◆ ml_populate_substitution_feature_vector_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_populate_substitution_feature_vector_ ( const GEDGraph g,
const GEDGraph h,
GEDGraph::NodeID  i,
GEDGraph::NodeID  k,
std::vector< double > &  feature_vector 
)
finalprivatevirtual

Computes substitution feature vector.

Parameters
[in]gInput graph.
[in]hInput graph.
[in]iID of node in g that has to be substituted.
[in]kID of node in h that has to be substituted.
[out]feature_vectorReturn variable. Empty when called. Must be of size ged::MLBasedMethod::num_features_ when exiting.
Note
Must be overridden by derived classes.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 155 of file ring_ml.ipp.

◆ ml_set_default_options_()

template<class UserNodeLabel , class UserEdgeLabel >
void ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_set_default_options_ ( )
finalprivatevirtual

Sets all options that are not among the ones shared by all derived classes of ged::MLBasedMethod to default values.

Note
Must be overridden by derived classes that have options that are not among the ones shared by all derived classes of ged::MLBasedMethod.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 60 of file ring_ml.ipp.

◆ ml_valid_options_string_()

template<class UserNodeLabel , class UserEdgeLabel >
std::string ged::RingML< UserNodeLabel, UserEdgeLabel >::ml_valid_options_string_ ( ) const
finalprivatevirtual

Returns string of all valid options that are not among the ones shared by all derived classes of ged::MLBasedMethod.

Returns
String of the form "[--<option> <arg>] [...]".
Note
Must be overridden by derived classes that have options that are not among the ones shared by all derived classes of ged::MLBasedMethod.

Reimplemented from ged::MLBasedMethod< UserNodeLabel, UserEdgeLabel >.

Definition at line 70 of file ring_ml.ipp.


The documentation for this class was generated from the following files: