Changeset 1413:e68f0ef37e77 in lemon
 Timestamp:
 10/07/17 17:03:30 (2 years ago)
 Branch:
 default
 Phase:
 public
 Location:
 lemon
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

lemon/vf2.h
r1410 r1413 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> … … 51 50 bool operator()(typename M1::Key k1, typename M2::Key k2) const { 52 51 return _m1[k1] == _m2[k2]; 53 }54 };55 56 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 52 } 67 53 }; … … 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 … … 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 } 
lemon/vf2pp.h
r1412 r1413 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
Note: See TracChangeset
for help on using the changeset viewer.