27 #ifndef SRC_METHODS_IPFP_HPP_ 28 #define SRC_METHODS_IPFP_HPP_ 63 template<
class UserNodeLabel,
class UserEdgeLabel>
74 enum QuadraticModel_ {C_QAP, B_QAP, QAPE, QAP};
84 double operator() (std::size_t row_1, std::size_t col_1, std::size_t row_2, std::size_t col_2)
const;
86 double operator() (std::size_t row, std::size_t col)
const;
88 std::size_t num_rows()
const;
90 std::size_t num_cols()
const;
92 std::size_t num_nodes_g()
const;
94 std::size_t num_nodes_h()
const;
98 double quadratic_cost_qap_(std::size_t row_1, std::size_t col_1, std::size_t row_2, std::size_t col_2)
const;
100 double quadratic_cost_b_qap_(std::size_t row_1, std::size_t col_1, std::size_t row_2, std::size_t col_2)
const;
102 double quadratic_cost_qape_(std::size_t row_1, std::size_t col_1, std::size_t row_2, std::size_t col_2)
const;
104 double quadratic_cost_c_qap_(std::size_t row_1, std::size_t col_1, std::size_t row_2, std::size_t col_2)
const;
112 std::size_t num_nodes_g_;
114 std::size_t num_nodes_h_;
116 double translation_factor_;
119 QuadraticModel_ quadratic_model_;
125 std::size_t max_itrs_;
127 double time_limit_in_sec_;
131 QAPInstance_ qap_instance_;
141 virtual bool ls_parse_option_(
const std::string & options,
const std::string & arg)
final;
147 void node_map_to_matrix_(
const NodeMap & node_map,
DMatrix & matrix)
const;
149 double compute_induced_linear_cost_(
const QAPInstance_ & qap_instance,
const DMatrix & x)
const;
151 double compute_induced_linear_cost_(
const QAPInstance_ & qap_instance,
const LSAPSolver & solver)
const;
153 double compute_induced_linear_cost_(
const QAPInstance_ & qap_instance,
const LSAPESolver & solver)
const;
155 double compute_induced_quadratic_cost_(
const QAPInstance_ & qap_instance,
const LSAPSolver & solver)
const;
157 double compute_induced_quadratic_cost_(
const QAPInstance_ & qap_instance,
const LSAPESolver & solver)
const;
159 void solve_linear_problem_(
const QAPInstance_ & qap_instance,
LSAPSolver & solver,
160 double & min_linear_problem,
double & linear_cost_b,
double & overall_cost_b,
DMatrix & b)
const;
162 void solve_linear_problem_(
const QAPInstance_ & qap_instance,
LSAPESolver & solver,
163 double & min_linear_problem,
double & linear_cost_b,
double & overall_cost_b,
DMatrix & b)
const;
169 void init_linear_cost_matrix_(
const QAPInstance_ & qap_instance,
DMatrix & linear_cost_matrix)
const;
171 void init_next_linear_problem_(
const QAPInstance_ & qap_instance,
const DMatrix & x,
const DMatrix & linear_cost_matrix,
DMatrix & linear_problem)
const;
173 bool termination_criterion_met_(
const Timer & timer,
const double & alpha,
const double & min_linear_problem,
const std::size_t & current_itr,
double lower_bound,
double upper_bound)
const;
Abstract class for methods that use variants of local search for upper bounding the graph edit distan...
Contains the standardized input data along with basic functionality.
This class solves LSAPE instances by calling the library lsape available at https://bougleux.users.greyc.fr/lsape/.
A timer class that can be used by methods that support time limits.
virtual bool ls_parse_option_(const std::string &options, const std::string &arg) final
Parses one option that is not among the ones shared by all derived classes of ged::LSBasedMethod.
virtual void ls_set_default_options_() final
Sets all options that are not among the ones shared by all derived classes of ged::LSBasedMethod to d...
void ls_run_from_initial_solution_(const GEDGraph &g, const GEDGraph &h, double lower_bound, const NodeMap &initial_node_map, NodeMap &output_node_map) final
Runs the local search from an initial node map.
virtual std::string ls_valid_options_string_() const final
Returns string of all valid options that are not among the ones shared by all derived classes of ged:...
The normalized input graphs used by GEDLIB. All labels are integers.
Global namespace for GEDLIB.
This class solves LSAP instances by calling the library lsape available at https://bougleux.users.greyc.fr/lsape/.
void init()
Initializes the method with options specified by set_options().
virtual void ls_runtime_init_(const GEDGraph &g, const GEDGraph &h) final
Initializes the method for a run between two graphs.
Computes an upper bound for general edit costs.
Model
Selects a model for solving LSAPE with the Hungarian algorithm.