src/work/marci/bfs_dfs.h
changeset 755 a8c2e828ce0b
parent 650 588ff2ca55bd
child 774 4297098d9677
equal deleted inserted replaced
4:47960420c4f9 5:c7d5832d0569
   149     DistMap& dist;
   149     DistMap& dist;
   150   public:
   150   public:
   151     /// The algorithm will search in a bfs order for 
   151     /// The algorithm will search in a bfs order for 
   152     /// the nodes which are \c false initially. 
   152     /// the nodes which are \c false initially. 
   153     /// The constructor makes no initial changes on the maps.
   153     /// The constructor makes no initial changes on the maps.
   154     Bfs<Graph, ReachedMap, PredMap, DistMap>(const Graph& _graph, ReachedMap& _reached, PredMap& _pred, DistMap& _dist) : BfsIterator<Graph, ReachedMap>(_graph, _reached), pred(&_pred), dist(&_dist) { }
   154     Bfs<Graph, ReachedMap, PredMap, DistMap>(const Graph& _graph, ReachedMap& _reached, PredMap& _pred, DistMap& _dist) : 
       
   155       BfsIterator<Graph, ReachedMap>(_graph, _reached), 
       
   156       pred(_pred), dist(_dist) { }
   155     /// \c s is marked to be reached and pushed in the bfs queue.
   157     /// \c s is marked to be reached and pushed in the bfs queue.
   156     /// If the queue is empty, then the first out-edge is processed.
   158     /// If the queue is empty, then the first out-edge is processed.
   157     /// If \c s was not marked previously, then 
   159     /// If \c s was not marked previously, then 
   158     /// in addition its pred is set to be \c INVALID, and dist to \c 0. 
   160     /// in addition its pred is set to be \c INVALID, and dist to \c 0. 
   159     /// if \c s was marked previuosly, then it is simply pushed.
   161     /// if \c s was marked previuosly, then it is simply pushed.
   294     PredMap& pred;
   296     PredMap& pred;
   295   public:
   297   public:
   296     /// The algorithm will search in a dfs order for 
   298     /// The algorithm will search in a dfs order for 
   297     /// the nodes which are \c false initially. 
   299     /// the nodes which are \c false initially. 
   298     /// The constructor makes no initial changes on the maps.
   300     /// The constructor makes no initial changes on the maps.
   299     Dfs<Graph, ReachedMap, PredMap>(const Graph& _graph, ReachedMap& _reached, PredMap& _pred) : DfsIterator<Graph, ReachedMap>(_graph, _reached), pred(&_pred) { }
   301     Dfs<Graph, ReachedMap, PredMap>(const Graph& _graph, ReachedMap& _reached, PredMap& _pred) : DfsIterator<Graph, ReachedMap>(_graph, _reached), pred(_pred) { }
   300     /// \c s is marked to be reached and pushed in the bfs queue.
   302     /// \c s is marked to be reached and pushed in the bfs queue.
   301     /// If the queue is empty, then the first out-edge is processed.
   303     /// If the queue is empty, then the first out-edge is processed.
   302     /// If \c s was not marked previously, then 
   304     /// If \c s was not marked previously, then 
   303     /// in addition its pred is set to be \c INVALID. 
   305     /// in addition its pred is set to be \c INVALID. 
   304     /// if \c s was marked previuosly, then it is simply pushed.
   306     /// if \c s was marked previuosly, then it is simply pushed.