[Lemon-commits] Peter Kovacs: Remove unused auxiliary class in V...

Lemon HG hg at lemon.cs.elte.hu
Wed Oct 17 23:21:03 CEST 2018


details:   http://lemon.cs.elte.hu/hg/lemon/rev/e68f0ef37e77
changeset: 1413:e68f0ef37e77
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Sat Oct 07 17:03:30 2017 +0200
description:
	Remove unused auxiliary class in Vf2 (#597)

diffstat:

 lemon/vf2.h   |  27 ++++-----------------------
 lemon/vf2pp.h |   2 +-
 2 files changed, 5 insertions(+), 24 deletions(-)

diffs (71 lines):

diff --git a/lemon/vf2.h b/lemon/vf2.h
--- a/lemon/vf2.h
+++ b/lemon/vf2.h
@@ -24,7 +24,6 @@
 
 #include <lemon/core.h>
 #include <lemon/concepts/graph.h>
-#include <lemon/dfs.h>
 #include <lemon/bfs.h>
 #include <lemon/bits/vf2_internals.h>
 
@@ -54,19 +53,6 @@
       };
 
       template <class G>
-      class DfsLeaveOrder : public DfsVisitor<G> {
-        const G &_g;
-        std::vector<typename G::Node> &_order;
-        int i;
-      public:
-        DfsLeaveOrder(const G &g, std::vector<typename G::Node> &order)
-          : i(countNodes(g)), _g(g), _order(order) { }
-        void leave(const typename G::Node &node) {
-          _order[--i]=node;
-        }
-      };
-
-      template <class G>
       class BfsLeaveOrder : public BfsVisitor<G> {
         int i;
         const G &_g;
@@ -122,7 +108,7 @@
     //if and only if the two nodes are equivalent
     NEQ _nEq;
 
-    //Current depth in the DFS tree.
+    //Current depth in the search tree
     int _depth;
 
     //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,
@@ -233,15 +219,10 @@
     }
 
     void initOrder() {
-      // we will find pairs for the nodes of g1 in this order
-
-      // bits::vf2::DfsLeaveOrder<G1> v(_g1,_order);
-      //   DfsVisit<G1,bits::vf2::DfsLeaveOrder<G1> >dfs(_g1, v);
-      //   dfs.run();
-
-      //it is more efficient in practice than DFS
+      //determine the order in which we will find pairs for the nodes of g1
+      //BFS order is more efficient in practice than DFS
       bits::vf2::BfsLeaveOrder<G1> v(_g1,_order);
-      BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> >bfs(_g1, v);
+      BfsVisit<G1,bits::vf2::BfsLeaveOrder<G1> > bfs(_g1, v);
       bfs.run();
     }
 
diff --git a/lemon/vf2pp.h b/lemon/vf2pp.h
--- a/lemon/vf2pp.h
+++ b/lemon/vf2pp.h
@@ -72,7 +72,7 @@
     //The graph into which g1 is to be embedded
     const G2 &_g2;
 
-    //Current depth in the search tree.
+    //Current depth in the search tree
     int _depth;
 
     //The current mapping. _mapping[v1]=v2 iff v1 has been mapped to v2,


More information about the Lemon-commits mailing list