fork download
  1. #include <boost/graph/adjacency_list.hpp>
  2. #include <boost/graph/vf2_sub_graph_iso.hpp>
  3. #include <boost/version.hpp>
  4. using namespace boost;
  5.  
  6. int main(){
  7. std::cout << "Boost version: "
  8. << BOOST_VERSION / 100000 << "." // major version
  9. << BOOST_VERSION / 100 % 1000 << "." // minor version
  10. << BOOST_VERSION % 100 // patch level
  11. << std::endl;
  12. typedef adjacency_list< setS, vecS, bidirectionalS > graph_type;
  13. // 5
  14. // 1 2
  15. // 1 3
  16. // 1 4
  17. // 4 5
  18. // Build graph1
  19. int num_vertices1 = 5;
  20. graph_type graph1(num_vertices1);
  21. add_edge(0, 1, graph1);
  22. add_edge(0, 2, graph1);
  23. add_edge(0, 3, graph1);
  24. add_edge(3, 4, graph1);
  25. // 4
  26. // 1 2
  27. // 2 3
  28. // 3 4
  29. // Build graph2
  30. int num_vertices2 = 4;
  31. graph_type graph2(num_vertices2);
  32. add_edge(0, 1, graph2);
  33. add_edge(1, 2, graph2);
  34. add_edge(2, 3, graph2);
  35.  
  36. vf2_print_callback< graph_type, graph_type > callback(graph1, graph2);
  37. vf2_subgraph_iso(graph1, graph2, callback);
  38. return 0;
  39. }
  40.  
Success #stdin #stdout 0.01s 5528KB
stdin
Standard input is empty
stdout
Boost version: 1.65.1