--- /usr/include/boost/graph/isomorphism.hpp 2012-12-22 16:14:35.897115132 +0100 +++ isomorphism.hpp 2013-01-04 01:36:18.227494315 +0100 @@ -222,7 +222,7 @@ recur: if (iter != ordered_edges.end()) { i = source(*iter, G1); - j = target(*iter, G2); + j = target(*iter, G1); if (dfs_num[i] > dfs_num_k) { G2_verts = vertices(G2); while (G2_verts.first != G2_verts.second) { @@ -310,8 +310,8 @@ if (k.empty()) return false; const match_continuation& this_k = k.back(); switch (this_k.position) { - case match_continuation::pos_G2_vertex_loop: {G2_verts = this_k.G2_verts; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*G2_verts.first] = false; i = source(*iter, G1); j = target(*iter, G2); goto G2_loop_k;} - case match_continuation::pos_fi_adj_loop: {fi_adj = this_k.fi_adj; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*fi_adj.first] = false; i = source(*iter, G1); j = target(*iter, G2); goto fi_adj_loop_k;} + case match_continuation::pos_G2_vertex_loop: {G2_verts = this_k.G2_verts; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*G2_verts.first] = false; i = source(*iter, G1); j = target(*iter, G1); goto G2_loop_k;} + case match_continuation::pos_fi_adj_loop: {fi_adj = this_k.fi_adj; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*fi_adj.first] = false; i = source(*iter, G1); j = target(*iter, G1); goto fi_adj_loop_k;} case match_continuation::pos_dfs_num: {k.pop_back(); goto return_point_false;} default: { BOOST_ASSERT(!"Bad position"); @@ -378,6 +378,25 @@ const Graph& m_g; }; + template + size_t get_num_vertices(const Graph& g) + { + size_t n = 0; + typename boost::graph_traits::vertex_iterator v, v_end; + for(tie(v, v_end) = vertices(g); v != v_end; ++v) + n++; + return n; + } + + template + size_t get_num_edges(const Graph& g) + { + size_t n = 0; + typename boost::graph_traits::edge_iterator e, e_end; + for(tie(e, e_end) = edges(g); e != e_end; ++e) + n++; + return n; + } template )); BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept )); BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); - BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept )); + //BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept )); typedef typename graph_traits::vertex_descriptor vertex1_t; typedef typename graph_traits::vertex_descriptor vertex2_t; @@ -407,7 +426,7 @@ // Property map requirements BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); typedef typename property_traits::value_type IsoMappingValue; - BOOST_STATIC_ASSERT((is_same::value)); + BOOST_STATIC_ASSERT((is_convertible::value)); BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits::value_type IndexMap1Value; @@ -417,9 +436,9 @@ typedef typename property_traits::value_type IndexMap2Value; BOOST_STATIC_ASSERT((is_convertible::value)); - if (num_vertices(G1) != num_vertices(G2)) + if (get_num_vertices(G1) != get_num_vertices(G2)) return false; - if (num_vertices(G1) == 0 && num_vertices(G2) == 0) + if (get_num_vertices(G1) == 0 && get_num_vertices(G2) == 0) return true; detail::isomorphism_algo