27 #ifndef SRC_METHODS_ANCHOR_AWARE_GED_HPP_ 28 #define SRC_METHODS_ANCHOR_AWARE_GED_HPP_ 49 template<
class UserNodeLabel,
class UserEdgeLabel>
60 enum SearchMethod_ {DFS, ASTAR};
62 enum LowerBoundMethod_ {BRANCH, BRANCH_FAST};
71 bool operator<(
const Edge_ & rhs)
const;
80 void operator=(
const SortedEdges_ & rhs);
84 std::map<GEDGraph::NodeID, std::vector<typename AnchorAwareGED<UserNodeLabel, UserEdgeLabel>::Edge_>> sorted_edges_;
93 TreeNode_(
const TreeNode_ & tree_node);
95 double lower_bound()
const;
97 void operator=(
const TreeNode_ & rhs);
99 bool operator<(
const TreeNode_ & rhs)
const;
101 void prepare_for_sibling_generation();
103 void prepare_for_child_generation();
107 void append_next_assignment(
const NodeMap & extension);
111 void set_lower_bound_to_leaf(
double lower_bound_to_leaf);
115 double induced_cost()
const;
117 const NodeMap & node_map()
const;
119 bool is_leaf_node()
const;
127 bool has_unexplored_sibling();
129 std::size_t num_unmatched_nodes_in_g()
const;
131 std::size_t num_unmatched_nodes_in_h()
const;
133 void update_original_id_of_unmatched_nodes_in_h();
141 std::vector<bool> is_matched_node_in_g_;
143 std::vector<bool> is_matched_node_in_h_;
145 std::vector<bool> is_candidate_in_h_;
147 bool dummy_node_is_candidate_in_h_;
149 std::vector<std::size_t> original_id_of_unmatched_nodes_in_h_;
151 double induced_cost_;
153 double lower_bound_to_leaf_;
155 std::size_t num_matched_nodes_in_g_;
157 std::size_t num_matched_nodes_in_h_;
170 SearchMethod_ search_method_;
172 LowerBoundMethod_ lower_bound_method_;
174 std::size_t num_threads_;
176 double time_limit_in_sec_;
178 bool map_root_to_root_;
180 std::map<GEDGraph::GraphID, SortedEdges_> sorted_edges_;
184 std::priority_queue<TreeNode_> open_;
196 virtual bool ged_parse_option_(
const std::string & option,
const std::string & arg)
final;
202 void init_graph_(
const GEDGraph & graph);
204 void generate_best_child_(
const GEDGraph & g,
const GEDGraph & h,
const TreeNode_ & tree_node);
206 void generate_best_sibling_(
const GEDGraph & g,
const GEDGraph & h,
const TreeNode_ & tree_node);
208 void generate_next_tree_node_(
const GEDGraph & g,
const GEDGraph & h, TreeNode_ & next_map,
bool update_induced_cost,
bool update_upper_bound);
Contains the standardized input data along with basic functionality.
virtual void ged_run_(const GEDGraph &g, const GEDGraph &h, Result &result) final
Runs the method with options specified by set_options().
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_init_() final
Initializes the method.
std::size_t LabelID
Internally used type of node and edge labels.
virtual std::string ged_valid_options_string_() const final
Returns string of all valid options.
The normalized input graphs used by GEDLIB. All labels are integers.
detail::GedGraphAL::edge_descriptor EdgeID
Internally used edge ID type.
Global namespace for GEDLIB.
Computes the exact graph edit distance for general edit costs.
virtual void ged_set_default_options_() final
Sets all options to default values.
std::size_t NodeID
Internally used vertex ID type.
Model
Selects a model for solving LSAPE with the Hungarian algorithm.
virtual bool ged_parse_option_(const std::string &option, const std::string &arg) final
Parses one option.