3 #include <boost/graph/isomorphism.hpp>
15 typedef boost::adjacency_list <boost::vecS, boost::vecS, boost::undirectedS>
graph_t;
25 typedef std::pair <int, int> E;
28 { E(0, 5), E(0, 8), E(0, 9), E(1, 5), E(1, 6), E(1, 9), E(2, 6), E(2, 7), E(2, 9), E(3, 7), E(3, 8), E(3, 9), E(4, 5), E(4, 6), E(4, 7),
30 g1 =
graph_t(&g1_edges[0], &g1_edges[0] +
sizeof(g1_edges) /
sizeof(E), 10);
33 { E(0, 5), E(0, 8), E(0, 9), E(1, 5), E(1, 6), E(1, 8), E(2, 6), E(2, 7), E(2, 9), E(3, 7), E(3, 8), E(3, 9), E(4, 5), E(4, 6), E(4, 7) };
34 g2 =
graph_t(&g2_edges[0], &g2_edges[0] +
sizeof(g2_edges) /
sizeof(E), 10);
60 template <
typename Graph>
63 return boost::isomorphism(graph, instance().g1) || boost::isomorphism(graph, instance().g2);
78 template <
typename MatrixType>
79 inline bool is_r10(MatrixType matrix)
81 if (matrix.size1() != 5 || matrix.size2() != 5)
86 for (
size_t row = 0; row < 5; ++row)
88 for (
size_t column = 0; column < 5; ++column)
90 if (matrix(row, column))
92 boost::add_edge(boost::vertex(row, graph), boost::vertex(5 + column, graph), graph);
static bool is_r10_graph(const Graph &graph)
Definition: r10.hpp:61
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS > graph_t
Definition: r10.hpp:15
Definition: algorithm.hpp:14
bool is_r10(MatrixType matrix)
Definition: r10.hpp:79