GEDLIB
1.0
|
Contains the standardized input data along with basic functionality. More...
#include <ged_data.hpp>
Public Member Functions | |
~GEDData () | |
Destructor. | |
std::size_t | num_graphs () const |
Returns the number of graphs. More... | |
const GEDGraph & | graph (GEDGraph::GraphID graph_id) const |
Provides access to a graph. More... | |
bool | shuffled_graph_copies_available () const |
Checks if shuffled graph copies are available. More... | |
std::size_t | num_graphs_without_shuffled_copies () const |
Returns the number of graphs in the instance without the shuffled copies. More... | |
GEDGraph::GraphID | id_shuffled_graph_copy (GEDGraph::GraphID graph_id) const |
Returns ID of a graph's shuffled copy. More... | |
bool | is_shuffled_graph_copy (GEDGraph::GraphID graph_id) const |
Checks if a graph is a shuffled copy of another graph. More... | |
std::vector< GEDGraph >::const_iterator | begin () const |
Provides access to the graphs contained in the instance. More... | |
std::vector< GEDGraph >::const_iterator | end () const |
Provides access to the graphs contained in the instance. More... | |
std::size_t | num_node_labels () const |
Returns the number of node labels. More... | |
std::size_t | num_edge_labels () const |
Returns the number of edge labels. More... | |
std::size_t | max_num_nodes () const |
Returns maximal number of nodes. More... | |
std::size_t | max_num_edges () const |
Returns maximal number of nodes. More... | |
double | node_cost (LabelID label1, LabelID label2) const |
Returns node relabeling, insertion, or deletion cost. More... | |
void | vectorize_node_label (LabelID node_label, std::vector< double > &vector_representation) const |
Computes a node label's representation as a real-valued vector. More... | |
double | edge_cost (LabelID label1, LabelID label2) const |
Returns edge relabeling, insertion, or deletion cost. More... | |
void | vectorize_edge_label (LabelID edge_label, std::vector< double > &vector_representation) const |
Computes an edge label's representation as a real-valued vector. More... | |
void | save_node_map (const std::string &filename, GEDGraph::NodeID g_id, GEDGraph::NodeID h_id, const NodeMap &node_map, bool append=true) const |
Saves a node map. More... | |
void | load_node_map (const std::string &filename, GEDGraph::NodeID g_id, GEDGraph::NodeID h_id, NodeMap &node_map) const |
Loads a node map from a file. More... | |
void | compute_induced_cost (const GEDGraph &g, const GEDGraph &h, NodeMap &node_map) const |
Computes the edit cost between two graphs induced by a node map. More... | |
double | swap_cost (const GEDGraph &g, const GEDGraph &h, const NodeMap::Assignment &assignment_1, const NodeMap::Assignment &assignment_2, NodeMap &node_map) const |
Computes the cost of swapping two assignments in a node map while leaving the node map unchanged. More... | |
void | swap_assignments (const NodeMap::Assignment &assignment_1, const NodeMap::Assignment &assignment_2, double swap_cost, NodeMap &node_map) const |
Swaps two assignments in a node map. More... | |
bool | quasimetric_costs () const |
Checks if the edit costs are quasimetric. More... | |
bool | quasimetric_costs (const GEDGraph &g, const GEDGraph &h) const |
Checks if the edit costs between two graphs are quasimetric. More... | |
double | max_node_edit_cost () const |
Returns the maximal node edit cost between any two graphs contained in the instance. More... | |
double | max_edge_edit_cost () const |
Returns the maximal edge edit cost between any two graphs contained in the instance. More... | |
double | max_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the maximal edit cost between two graphs. More... | |
double | min_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the minimal edit cost between two graphs. More... | |
double | max_node_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the maximal node edit cost between two graphs. More... | |
double | min_node_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the minimal node edit cost between two graphs. More... | |
double | max_edge_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the maximal edge edit cost between two graphs. More... | |
double | min_edge_edit_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the minimal edge edit cost between two graphs. More... | |
double | max_node_del_cost (const GEDGraph &graph) const |
Returns the maximal cost of deleting a node contained in a graph. More... | |
double | min_node_del_cost (const GEDGraph &graph) const |
Returns the minimal cost of deleting a node contained in a graph. More... | |
double | mean_node_del_cost (const GEDGraph &graph) const |
Returns the mean cost of deleting a node contained in a graph. More... | |
double | max_node_ins_cost (const GEDGraph &graph) const |
Returns the maximal cost of inserting a node contained in a graph. More... | |
double | min_node_ins_cost (const GEDGraph &graph) const |
Returns the minimal cost of inserting a node contained in a graph. More... | |
double | mean_node_ins_cost (const GEDGraph &graph) const |
Returns the mean cost of inserting a node contained in a graph. More... | |
double | max_node_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the maximal cost of substituting a node contained in a graph by a node contained in another graph. More... | |
double | min_node_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the minimal cost of substituting a node contained in a graph by a node contained in another graph. More... | |
double | mean_node_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the mean cost of substituting a node contained in a graph by a node contained in another graph. More... | |
double | max_edge_del_cost (const GEDGraph &graph) const |
Returns the maximal cost of deleting a edge contained in a graph. More... | |
double | min_edge_del_cost (const GEDGraph &graph) const |
Returns the minimal cost of deleting a edge contained in a graph. More... | |
double | mean_edge_del_cost (const GEDGraph &graph) const |
Returns the mean cost of deleting a edge contained in a graph. More... | |
double | max_edge_ins_cost (const GEDGraph &graph) const |
Returns the maximal cost of inserting a edge contained in a graph. More... | |
double | min_edge_ins_cost (const GEDGraph &graph) const |
Returns the minimal cost of inserting a edge contained in a graph. More... | |
double | mean_edge_ins_cost (const GEDGraph &graph) const |
Returns the mean cost of inserting a edge contained in a graph. More... | |
double | max_edge_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the maximal cost of substituting a edge contained in a graph by a edge contained in another graph. More... | |
double | min_edge_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the minimal cost of substituting a edge contained in a graph by a edge contained in another graph. More... | |
double | mean_edge_subs_cost (const GEDGraph &g, const GEDGraph &h) const |
Returns the mean cost of substituting a edge contained in a graph by a edge contained in another graph. More... | |
Contains the standardized input data along with basic functionality.
All derived classes of ged::GEDMethod access the input graphs and their edit costs via this class.
Definition at line 55 of file ged_data.hpp.
std::vector< GEDGraph >::const_iterator ged::GEDData< UserNodeLabel, UserEdgeLabel >::begin | ( | ) | const |
Provides access to the graphs contained in the instance.
Definition at line 386 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::compute_induced_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h, | ||
NodeMap & | node_map | ||
) | const |
Computes the edit cost between two graphs induced by a node map.
[in] | g | Input graph. |
[in] | h | Input graph. |
[in,out] | node_map | Node map whose induced edit cost is to be computed. |
Definition at line 540 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::edge_cost | ( | LabelID | label1, |
LabelID | label2 | ||
) | const |
Returns edge relabeling, insertion, or deletion cost.
[in] | label1 | First edge label. |
[in] | label2 | Second edge label. |
label1
and label2
are both different from ged::dummy_label(), edge insertion cost if label1
equals ged::dummy_label and label2
does not, edge deletion cost if label1
does not equal ged::dummy_label and label2
does, and 0 otherwise. Definition at line 428 of file ged_data.ipp.
std::vector< GEDGraph >::const_iterator ged::GEDData< UserNodeLabel, UserEdgeLabel >::end | ( | ) | const |
Provides access to the graphs contained in the instance.
Definition at line 393 of file ged_data.ipp.
const GEDGraph & ged::GEDData< UserNodeLabel, UserEdgeLabel >::graph | ( | GEDGraph::GraphID | graph_id | ) | const |
Provides access to a graph.
[in] | graph_id | The ID of the graph. |
graph_id
. Definition at line 325 of file ged_data.ipp.
GEDGraph::GraphID ged::GEDData< UserNodeLabel, UserEdgeLabel >::id_shuffled_graph_copy | ( | GEDGraph::GraphID | graph_id | ) | const |
Returns ID of a graph's shuffled copy.
[in] | graph_id | The ID of the graph. |
graph_id
. Definition at line 366 of file ged_data.ipp.
bool ged::GEDData< UserNodeLabel, UserEdgeLabel >::is_shuffled_graph_copy | ( | GEDGraph::GraphID | graph_id | ) | const |
Checks if a graph is a shuffled copy of another graph.
[in] | graph_id | The ID of the graph. |
true
if the graph with ID graph_id
is the shuffled copy of another graph. Definition at line 379 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::load_node_map | ( | const std::string & | filename, |
GEDGraph::NodeID | g_id, | ||
GEDGraph::NodeID | h_id, | ||
NodeMap & | node_map | ||
) | const |
Loads a node map from a file.
[in] | filename | Name of a file which contains a node map between the graphs with IDs g_id and h_id . |
[in] | g_id | ID of a graph. |
[in] | h_id | ID of a graph. |
[out] | node_map | Node map between the graphs with IDs g_id and h_id populated by the method. |
g_id
and h_id
, the first node map is loaded. Definition at line 501 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edge_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the maximal cost of deleting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 919 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edge_edit_cost | ( | ) | const |
Returns the maximal edge edit cost between any two graphs contained in the instance.
Definition at line 903 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edge_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the maximal edge edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 1037 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edge_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the maximal cost of inserting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 955 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edge_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the maximal cost of substituting a edge contained in a graph by a edge contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a edge contained in h
. Definition at line 859 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the maximal edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 991 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_node_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the maximal cost of deleting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 743 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_node_edit_cost | ( | ) | const |
Returns the maximal node edit cost between any two graphs contained in the instance.
Definition at line 727 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_node_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the maximal node edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 1017 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_node_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the maximal cost of inserting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 779 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_node_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the maximal cost of substituting a node contained in a graph by a node contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a node contained in h
. Definition at line 815 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_num_edges | ( | ) | const |
Returns maximal number of nodes.
Definition at line 421 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::max_num_nodes | ( | ) | const |
Returns maximal number of nodes.
Definition at line 414 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_edge_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the mean cost of deleting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 930 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_edge_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the mean cost of inserting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 977 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_edge_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the mean cost of substituting a edge contained in a graph by a edge contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a edge contained in h
. Definition at line 887 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_node_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the mean cost of deleting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 765 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_node_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the mean cost of inserting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 801 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::mean_node_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the mean cost of substituting a node contained in a graph by a node contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a node contained in h
. Definition at line 843 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_edge_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the minimal cost of deleting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 944 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_edge_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the minimal edge edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 1047 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_edge_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the minimal cost of inserting a edge contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 966 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_edge_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the minimal cost of substituting a edge contained in a graph by a edge contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a edge contained in h
. Definition at line 872 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the minimal edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 1004 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_node_del_cost | ( | const GEDGraph & | graph | ) | const |
Returns the minimal cost of deleting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 754 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_node_edit_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the minimal node edit cost between two graphs.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
and h
. Definition at line 1027 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_node_ins_cost | ( | const GEDGraph & | graph | ) | const |
Returns the minimal cost of inserting a node contained in a graph.
[in] | graph | Input graph. |
graph
. Definition at line 790 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::min_node_subs_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Returns the minimal cost of substituting a node contained in a graph by a node contained in another graph.
[in] | g | Input graph. |
[in] | h | Input graph. |
g
by a node contained in h
. Definition at line 828 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::node_cost | ( | LabelID | label1, |
LabelID | label2 | ||
) | const |
Returns node relabeling, insertion, or deletion cost.
[in] | label1 | First node label. |
[in] | label2 | Second node label. |
label1
and label2
are both different from ged::dummy_label(), node insertion cost if label1
equals ged::dummy_label and label2
does not, node deletion cost if label1
does not equal ged::dummy_label and label2
does, and 0 otherwise. Definition at line 454 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::num_edge_labels | ( | ) | const |
Returns the number of edge labels.
Definition at line 407 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::num_graphs | ( | ) | const |
Returns the number of graphs.
Definition at line 318 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::num_graphs_without_shuffled_copies | ( | ) | const |
Returns the number of graphs in the instance without the shuffled copies.
Definition at line 359 of file ged_data.ipp.
std::size_t ged::GEDData< UserNodeLabel, UserEdgeLabel >::num_node_labels | ( | ) | const |
Returns the number of node labels.
Definition at line 400 of file ged_data.ipp.
bool ged::GEDData< UserNodeLabel, UserEdgeLabel >::quasimetric_costs | ( | ) | const |
Checks if the edit costs are quasimetric.
true
if the edit costs are quasimetric and false
otherwise. Definition at line 669 of file ged_data.ipp.
bool ged::GEDData< UserNodeLabel, UserEdgeLabel >::quasimetric_costs | ( | const GEDGraph & | g, |
const GEDGraph & | h | ||
) | const |
Checks if the edit costs between two graphs are quasimetric.
[in] | g | Input graph. |
[in] | h | Input graph. |
true
if the edit costs between the graphs g
and h
quasimetric and false
otherwise. Definition at line 690 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::save_node_map | ( | const std::string & | filename, |
GEDGraph::NodeID | g_id, | ||
GEDGraph::NodeID | h_id, | ||
const NodeMap & | node_map, | ||
bool | append = true |
||
) | const |
Saves a node map.
[in] | filename | Name of the file where the node map should be saved. |
[in] | g_id | ID of a graph. |
[in] | h_id | ID of a graph. |
[in] | node_map | Node map between the graphs with IDs g_id and h_id . |
[in] | append | Boolean true if the node map should be appended to the file and false if the file should be overridden. |
Definition at line 480 of file ged_data.ipp.
bool ged::GEDData< UserNodeLabel, UserEdgeLabel >::shuffled_graph_copies_available | ( | ) | const |
Checks if shuffled graph copies are available.
true
if shuffled graph copies are available. Definition at line 352 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::swap_assignments | ( | const NodeMap::Assignment & | assignment_1, |
const NodeMap::Assignment & | assignment_2, | ||
double | swap_cost, | ||
NodeMap & | node_map | ||
) | const |
Swaps two assignments in a node map.
assignment_1 | First assignment. |
assignment_2 | Second assignment. |
swap_cost | The cost of swapping assignment_1 and assignment_2 in node_map . Can be computed by call to swap_cost(). |
node_map | The node map. Must contain the assignment_1 and assignment_2 in its relational representation. |
Definition at line 656 of file ged_data.ipp.
double ged::GEDData< UserNodeLabel, UserEdgeLabel >::swap_cost | ( | const GEDGraph & | g, |
const GEDGraph & | h, | ||
const NodeMap::Assignment & | assignment_1, | ||
const NodeMap::Assignment & | assignment_2, | ||
NodeMap & | node_map | ||
) | const |
Computes the cost of swapping two assignments in a node map while leaving the node map unchanged.
[in] | g | Input graph. |
[in] | h | Input graph. |
[in] | assignment_1 | First assignment. |
[in] | assignment_2 | Second assignment. |
[in] | node_map | The node map. Must contain the assignment_1 and assignment_2 in its relational representation. |
assignment_1
and assignment_2
in node_map
. Definition at line 570 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::vectorize_edge_label | ( | LabelID | edge_label, |
std::vector< double > & | vector_representation | ||
) | const |
Computes an edge label's representation as a real-valued vector.
[in] | edge_label | An edge label. |
[out] | vector_representation | The edge label's vector representation. |
vector_representation
is empty. Definition at line 447 of file ged_data.ipp.
void ged::GEDData< UserNodeLabel, UserEdgeLabel >::vectorize_node_label | ( | LabelID | node_label, |
std::vector< double > & | vector_representation | ||
) | const |
Computes a node label's representation as a real-valued vector.
[in] | node_label | A node label. |
[out] | vector_representation | The node label's vector representation. |
vector_representation
is empty. Definition at line 473 of file ged_data.ipp.