5.3. compare.hpp

Full path: graph_canon/compare.hpp

template<typename GraphL, typename IndexMapL, bool WithInEdgesL, typename GraphR, typename IndexMapR, bool WithInEdgesR, typename VertexEqual, typename EdgeEqual, typename Visitor>
bool ordered_graph_equal(const ordered_graph<GraphL, IndexMapL, WithInEdgesL> &g_left, const ordered_graph<GraphR, IndexMapR, WithInEdgesR> &g_right, VertexEqual vertex_equal, EdgeEqual edge_equal, Visitor &&visitor)

Compare two ordered graphs for equality. For labelled graphs the two binary predicates vertex_equal and edge_equal, can be used to compare labels. If the two graphs are not equal the reason is indicated by calling a corresponding member function on visitor. See graph_compare_null_visitor for the list of member functions that must exist.

template<typename GraphL, typename IndexMapL, bool WithInEdgesL, typename GraphR, typename IndexMapR, bool WithInEdgesR, typename VertexLess, typename EdgeLess, typename VertexEqual, typename EdgeEqual>
bool ordered_graph_less(const ordered_graph<GraphL, IndexMapL, WithInEdgesL> &g_left, const ordered_graph<GraphR, IndexMapR, WithInEdgesR> &g_right, VertexLess vertex_less, EdgeLess edge_less, VertexEqual vertex_equal, EdgeEqual edge_equal)

Compare two ordered graphs and return true when g_left is considered smaller than g_right. For labelled graphs the binary predicates vertex_less, edge_less, vertex_equal, and edge_equal, can be used to compare labels. The _equal and _less versions must be consistent with each other.

class graph_compare_null_visitor

A visitor class that can be used for ordered_graph_equal.

void at_num_vertices() const

Called when the two graphs have different number of vertices.

template<typename VertexL, typename VertexR>
void at_vertex_compare(VertexL, VertexR) const

Called when the user-defined vertex predicate returns false for two vertices with the same index.

template<typename VertexL, typename VertexR>
void at_out_degree(VertexL, VertexR) const

Called when two verices with the same index have different out-degrees.

template<typename EdgeL, typename EdgeR>
void at_out_edge(EdgeL, EdgeR) const

Called when two edges \((u_l, v_l)\), \((u_r, v_r)\) from the two graphs, with \(u_l\) and \(u_r\) have the same index, the edges are in the same position in their respective out-edge lists, but \(v_l\) and \(v_r\) have different index.

template<typename EdgeL, typename EdgeR>
void at_edge_compare(EdgeL, EdgeR) const

Called when two edges \((u_l, v_l)\), \((u_r, v_r)\) from the two graphs, with \(u_l\) and \(u_r\) have the same index, the edges are in the same position in their respective out-edge lists, \(v_l\) and \(v_r\) have the same index, but the user-defined predicate returns false.