#include #include #include #include typedef size_t mbglIndex; #ifndef MYISO #include #else #include "isomorphism_fixed.hpp" #endif int test_isomorphism_boost() { using namespace boost; const mbglIndex n=10; mbglIndex rp1[] = {0,4,8,12,16,20,24,28,32,36,40}; mbglIndex ci1[] = {1,3,6,7,0,2,3,4,9,4,5,1,0,1,6,7,9,2,5,1,8,2,4,7,8,9,3,0,0,8,3,5,9,5,6,7,8,2,4,6}; mbglIndex rp2[] = {0,4,8,12,16,20,24,28,32,36,40}; mbglIndex ci2[] = {1,3,5,7,0,2,3,4,9,4,6,1,0,1,6,7,1,2,5,9,8,9,4,0,8,2,3,7,0,8,3,6,9,5,6,7,8,2,4,5}; typedef adjacency_list RawGraph; RawGraph G(n), H(n); for (size_t i=0; i Graph; Graph G1(G), H1(H); typedef boost::graph_traits::vertex_descriptor vertex; vertex map[n]; printf("isomorphism(G,H): Correct initial output on different pair!\n"); if (isomorphism(G1,H1, isomorphism_map( make_iterator_property_map(map,get(vertex_index,G1))))==true) { printf("Isomorphic (incorrect)\n"); } else { printf("Not isomorphic (correct)\n"); } printf("isomorphism(G,G): Correct initial output on exact pair!\n"); if (isomorphism(G1,G1, isomorphism_map( make_iterator_property_map(map,get(vertex_index,G1))))==true) { printf("Isomorphic (correct)\n"); } else { printf("Not isomorphic (incorrect)\n"); } printf("isomorphism(G,H): INCORRECT output on the same first pair\n"); if (isomorphism(G1,H1, isomorphism_map( make_iterator_property_map(map,get(vertex_index,G1))))==true) { printf("Isomorphic (incorrect)\n"); } else { printf("Not isomorphic (correct)\n"); } printf("isomorphism(G,H): Persists after a function call...\n"); if (isomorphism(G1,H1, isomorphism_map( make_iterator_property_map(map,get(vertex_index,G1))))==true) { printf("Isomorphic (incorrect)\n"); } else { printf("Not isomorphic (correct)\n"); } printf("isomorphism(G,H): Correct again after reset map\n"); for (size_t i=0; i::null_vertex(); } if (isomorphism(G1,H1, isomorphism_map( make_iterator_property_map(map,get(vertex_index,G1))))==true) { printf("Isomorphic (incorrect)\n"); } else { printf("Not isomorphic (correct)\n"); } } int main() { test_isomorphism_boost(); }