# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1507388610 -7200
# Node ID e68f0ef37e77b716871c4f7917d8879a3fe45846
# Parent 3ca508482e4c47ce402773e7bb3cf3ab9c62e983
Remove unused auxiliary class in Vf2 (#597)
diff --git a/lemon/vf2.h b/lemon/vf2.h
a
|
b
|
|
24 | 24 | |
25 | 25 | #include <lemon/core.h> |
26 | 26 | #include <lemon/concepts/graph.h> |
27 | | #include <lemon/dfs.h> |
28 | 27 | #include <lemon/bfs.h> |
29 | 28 | #include <lemon/bits/vf2_internals.h> |
30 | 29 | |
… |
… |
|
54 | 53 | }; |
55 | 54 | |
56 | 55 | template <class G> |
57 | | class DfsLeaveOrder : public DfsVisitor<G> { |
58 | | const G &_g; |
59 | | std::vector<typename G::Node> &_order; |
60 | | int i; |
61 | | public: |
62 | | DfsLeaveOrder(const G &g, std::vector<typename G::Node> &order) |
63 | | : i(countNodes(g)), _g(g), _order(order) { } |
64 | | void leave(const typename G::Node &node) { |
65 | | _order[--i]=node; |
66 | | } |
67 | | }; |
68 | | |
69 | | template <class G> |
70 | 56 | class BfsLeaveOrder : public BfsVisitor<G> { |
71 | 57 | int i; |
72 | 58 | const G &_g; |
… |
… |
|
122 | 108 | //if and only if the two nodes are equivalent |
123 | 109 | NEQ _nEq; |
124 | 110 | |
125 | | //Current depth in the DFS tree. |
| 111 | //Current depth in the search tree |
126 | 112 | int _depth; |
127 | 113 | |
128 | 114 | //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2, |
… |
… |
|
233 | 219 | } |
234 | 220 | |
235 | 221 | void initOrder() { |
236 | | // we will find pairs for the nodes of g1 in this order |
237 | | |
238 | | // bits::vf2::DfsLeaveOrder<G1> v(_g1,_order); |
239 | | // DfsVisit<G1,bits::vf2::DfsLeaveOrder<G1> >dfs(_g1, v); |
240 | | // dfs.run(); |
241 | | |
242 | | //it is more efficient in practice than DFS |
| 222 | //determine the order in which we will find pairs for the nodes of g1 |
| 223 | //BFS order is more efficient in practice than DFS |
243 | 224 | bits::vf2::BfsLeaveOrder<G1> v(_g1,_order); |
244 | | BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> >bfs(_g1, v); |
| 225 | BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> > bfs(_g1, v); |
245 | 226 | bfs.run(); |
246 | 227 | } |
247 | 228 | |
diff --git a/lemon/vf2pp.h b/lemon/vf2pp.h
a
|
b
|
|
72 | 72 | //The graph into which g1 is to be embedded |
73 | 73 | const G2 &_g2; |
74 | 74 | |
75 | | //Current depth in the search tree. |
| 75 | //Current depth in the search tree |
76 | 76 | int _depth; |
77 | 77 | |
78 | 78 | //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2, |