stdcpp/tsrc/Boost_test/graph/src/isomorphism.cpp
changeset 22 ddc455616bd6
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 57 2efc27d87e1c
equal deleted inserted replaced
18:47c74d1534e1 22:ddc455616bd6
   116     put(vertex_index_t(), g2, *v, v_idx++);
   116     put(vertex_index_t(), g2, *v, v_idx++);
   117   }
   117   }
   118 
   118 
   119   std::map<graph1::vertex_descriptor, graph2::vertex_descriptor> mapping;
   119   std::map<graph1::vertex_descriptor, graph2::vertex_descriptor> mapping;
   120 
   120 
   121   bool isomorphism_correct;
   121   bool isomorphism_correct = true;
   122   clock_t start = clock();
   122   clock_t start = clock();
       
   123   
       
   124   isomorphism_correct = isomorphism(g1, g2, isomorphism_map(make_assoc_property_map(mapping)));
   123  
   125  
   124   BOOST_CHECK(isomorphism_correct = isomorphism
   126   BOOST_CHECK(isomorphism_correct);
   125                (g1, g2, isomorphism_map(make_assoc_property_map(mapping))));
       
   126               
   127               
   127   clock_t end = clock();
   128   clock_t end = clock();
   128 
   129 
   129   std::cout << "Elapsed time (clock cycles): " << (end - start) << std::endl;
   130   std::cout << "Elapsed time (clock cycles): " << (end - start) << std::endl;
   130 
   131 
   131   bool verify_correct;
   132   bool verify_correct = true;
   132   BOOST_CHECK(verify_correct =
   133   
   133              verify_isomorphism(g1, g2, make_assoc_property_map(mapping)));
   134   verify_correct = verify_isomorphism(g1, g2, make_assoc_property_map(mapping));
       
   135   
       
   136   BOOST_CHECK(verify_correct);
   134 
   137 
   135   if (!isomorphism_correct || !verify_correct) {
   138   if (!isomorphism_correct || !verify_correct) {
   136     // Output graph 1
   139     // Output graph 1
   137     {
   140     {
   138       std::ofstream out("isomorphism_failure.bg1");
   141       std::ofstream out("isomorphism_failure.bg1");