1.1 --- a/lemon/vf2.h Sat Oct 07 16:22:04 2017 +0200
1.2 +++ b/lemon/vf2.h Sat Oct 07 17:03:30 2017 +0200
1.3 @@ -24,7 +24,6 @@
1.4
1.5 #include <lemon/core.h>
1.6 #include <lemon/concepts/graph.h>
1.7 -#include <lemon/dfs.h>
1.8 #include <lemon/bfs.h>
1.9 #include <lemon/bits/vf2_internals.h>
1.10
1.11 @@ -54,19 +53,6 @@
1.12 };
1.13
1.14 template <class G>
1.15 - class DfsLeaveOrder : public DfsVisitor<G> {
1.16 - const G &_g;
1.17 - std::vector<typename G::Node> &_order;
1.18 - int i;
1.19 - public:
1.20 - DfsLeaveOrder(const G &g, std::vector<typename G::Node> &order)
1.21 - : i(countNodes(g)), _g(g), _order(order) { }
1.22 - void leave(const typename G::Node &node) {
1.23 - _order[--i]=node;
1.24 - }
1.25 - };
1.26 -
1.27 - template <class G>
1.28 class BfsLeaveOrder : public BfsVisitor<G> {
1.29 int i;
1.30 const G &_g;
1.31 @@ -122,7 +108,7 @@
1.32 //if and only if the two nodes are equivalent
1.33 NEQ _nEq;
1.34
1.35 - //Current depth in the DFS tree.
1.36 + //Current depth in the search tree
1.37 int _depth;
1.38
1.39 //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
1.40 @@ -233,15 +219,10 @@
1.41 }
1.42
1.43 void initOrder() {
1.44 - // we will find pairs for the nodes of g1 in this order
1.45 -
1.46 - // bits::vf2::DfsLeaveOrder<G1> v(_g1,_order);
1.47 - // DfsVisit<G1,bits::vf2::DfsLeaveOrder<G1> >dfs(_g1, v);
1.48 - // dfs.run();
1.49 -
1.50 - //it is more efficient in practice than DFS
1.51 + //determine the order in which we will find pairs for the nodes of g1
1.52 + //BFS order is more efficient in practice than DFS
1.53 bits::vf2::BfsLeaveOrder<G1> v(_g1,_order);
1.54 - BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> >bfs(_g1, v);
1.55 + BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> > bfs(_g1, v);
1.56 bfs.run();
1.57 }
1.58
2.1 --- a/lemon/vf2pp.h Sat Oct 07 16:22:04 2017 +0200
2.2 +++ b/lemon/vf2pp.h Sat Oct 07 17:03:30 2017 +0200
2.3 @@ -72,7 +72,7 @@
2.4 //The graph into which g1 is to be embedded
2.5 const G2 &_g2;
2.6
2.7 - //Current depth in the search tree.
2.8 + //Current depth in the search tree
2.9 int _depth;
2.10
2.11 //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,