COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bfs.h

    r764 r525  
    4848    ///The type of the map that stores the predecessor
    4949    ///arcs of the shortest paths.
    50     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     50    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    5252    ///Instantiates a \c PredMap.
     
    6363
    6464    ///The type of the map that indicates which nodes are processed.
    65     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    66     ///By default it is a NullMap.
     65    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    6766    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    6867    ///Instantiates a \c ProcessedMap.
     
    8382
    8483    ///The type of the map that indicates which nodes are reached.
    85     ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     84    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8685    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    8786    ///Instantiates a \c ReachedMap.
     
    9897
    9998    ///The type of the map that stores the distances of the nodes.
    100     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     99    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    101100    typedef typename Digraph::template NodeMap<int> DistMap;
    102101    ///Instantiates a \c DistMap.
     
    227226    ///\ref named-templ-param "Named parameter" for setting
    228227    ///\c PredMap type.
    229     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     228    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    230229    template <class T>
    231230    struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
     
    247246    ///\ref named-templ-param "Named parameter" for setting
    248247    ///\c DistMap type.
    249     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     248    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    250249    template <class T>
    251250    struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
     
    267266    ///\ref named-templ-param "Named parameter" for setting
    268267    ///\c ReachedMap type.
    269     ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     268    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    270269    template <class T>
    271270    struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
     
    287286    ///\ref named-templ-param "Named parameter" for setting
    288287    ///\c ProcessedMap type.
    289     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     288    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    290289    template <class T>
    291290    struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
     
    415414    ///The simplest way to execute the BFS algorithm is to use one of the
    416415    ///member functions called \ref run(Node) "run()".\n
    417     ///If you need better control on the execution, you have to call
    418     ///\ref init() first, then you can add several source nodes with
     416    ///If you need more control on the execution, first you have to call
     417    ///\ref init(), then you can add several source nodes with
    419418    ///\ref addSource(). Finally the actual path computation can be
    420419    ///performed with one of the \ref start() functions.
     
    739738    ///@{
    740739
    741     ///The shortest path to the given node.
    742 
    743     ///Returns the shortest path to the given node from the root(s).
     740    ///The shortest path to a node.
     741
     742    ///Returns the shortest path to a node.
    744743    ///
    745744    ///\warning \c t should be reached from the root(s).
     
    749748    Path path(Node t) const { return Path(*G, *_pred, t); }
    750749
    751     ///The distance of the given node from the root(s).
    752 
    753     ///Returns the distance of the given node from the root(s).
     750    ///The distance of a node from the root(s).
     751
     752    ///Returns the distance of a node from the root(s).
    754753    ///
    755754    ///\warning If node \c v is not reached from the root(s), then
     
    760759    int dist(Node v) const { return (*_dist)[v]; }
    761760
    762     ///\brief Returns the 'previous arc' of the shortest path tree for
    763     ///the given node.
    764     ///
     761    ///Returns the 'previous arc' of the shortest path tree for a node.
     762
    765763    ///This function returns the 'previous arc' of the shortest path
    766764    ///tree for the node \c v, i.e. it returns the last arc of a
     
    769767    ///
    770768    ///The shortest path tree used here is equal to the shortest path
    771     ///tree used in \ref predNode() and \ref predMap().
     769    ///tree used in \ref predNode().
    772770    ///
    773771    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    775773    Arc predArc(Node v) const { return (*_pred)[v];}
    776774
    777     ///\brief Returns the 'previous node' of the shortest path tree for
    778     ///the given node.
    779     ///
     775    ///Returns the 'previous node' of the shortest path tree for a node.
     776
    780777    ///This function returns the 'previous node' of the shortest path
    781778    ///tree for the node \c v, i.e. it returns the last but one node
    782     ///of a shortest path from a root to \c v. It is \c INVALID
     779    ///from a shortest path from a root to \c v. It is \c INVALID
    783780    ///if \c v is not reached from the root(s) or if \c v is a root.
    784781    ///
    785782    ///The shortest path tree used here is equal to the shortest path
    786     ///tree used in \ref predArc() and \ref predMap().
     783    ///tree used in \ref predArc().
    787784    ///
    788785    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    805802    ///
    806803    ///Returns a const reference to the node map that stores the predecessor
    807     ///arcs, which form the shortest path tree (forest).
     804    ///arcs, which form the shortest path tree.
    808805    ///
    809806    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    811808    const PredMap &predMap() const { return *_pred;}
    812809
    813     ///Checks if the given node is reached from the root(s).
     810    ///Checks if a node is reached from the root(s).
    814811
    815812    ///Returns \c true if \c v is reached from the root(s).
     
    837834    ///The type of the map that stores the predecessor
    838835    ///arcs of the shortest paths.
    839     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     836    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    840837    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    841838    ///Instantiates a PredMap.
     
    852849
    853850    ///The type of the map that indicates which nodes are processed.
    854     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     851    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    855852    ///By default it is a NullMap.
    856853    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     
    872869
    873870    ///The type of the map that indicates which nodes are reached.
    874     ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     871    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    875872    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    876873    ///Instantiates a ReachedMap.
     
    887884
    888885    ///The type of the map that stores the distances of the nodes.
    889     ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     886    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    890887    typedef typename Digraph::template NodeMap<int> DistMap;
    891888    ///Instantiates a DistMap.
     
    902899
    903900    ///The type of the shortest paths.
    904     ///It must conform to the \ref concepts::Path "Path" concept.
     901    ///It must meet the \ref concepts::Path "Path" concept.
    905902    typedef lemon::Path<Digraph> Path;
    906903  };
     
    908905  /// Default traits class used by BfsWizard
    909906
    910   /// Default traits class used by BfsWizard.
    911   /// \tparam GR The type of the digraph.
     907  /// To make it easier to use Bfs algorithm
     908  /// we have created a wizard class.
     909  /// This \ref BfsWizard class needs default traits,
     910  /// as well as the \ref Bfs class.
     911  /// The \ref BfsWizardBase is a class to be the default traits of the
     912  /// \ref BfsWizard class.
    912913  template<class GR>
    913914  class BfsWizardBase : public BfsWizardDefaultTraits<GR>
     
    937938    /// Constructor.
    938939
    939     /// This constructor does not require parameters, it initiates
     940    /// This constructor does not require parameters, therefore it initiates
    940941    /// all of the attributes to \c 0.
    941942    BfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
     
    967968    typedef TR Base;
    968969
     970    ///The type of the digraph the algorithm runs on.
    969971    typedef typename TR::Digraph Digraph;
    970972
     
    974976    typedef typename Digraph::OutArcIt OutArcIt;
    975977
     978    ///\brief The type of the map that stores the predecessor
     979    ///arcs of the shortest paths.
    976980    typedef typename TR::PredMap PredMap;
     981    ///\brief The type of the map that stores the distances of the nodes.
    977982    typedef typename TR::DistMap DistMap;
     983    ///\brief The type of the map that indicates which nodes are reached.
    978984    typedef typename TR::ReachedMap ReachedMap;
     985    ///\brief The type of the map that indicates which nodes are processed.
    979986    typedef typename TR::ProcessedMap ProcessedMap;
     987    ///The type of the shortest paths
    980988    typedef typename TR::Path Path;
    981989
     
    10601068      SetPredMapBase(const TR &b) : TR(b) {}
    10611069    };
    1062 
    1063     ///\brief \ref named-templ-param "Named parameter" for setting
    1064     ///the predecessor map.
    1065     ///
    1066     ///\ref named-templ-param "Named parameter" function for setting
    1067     ///the map that stores the predecessor arcs of the nodes.
     1070    ///\brief \ref named-func-param "Named parameter"
     1071    ///for setting PredMap object.
     1072    ///
     1073    ///\ref named-func-param "Named parameter"
     1074    ///for setting PredMap object.
    10681075    template<class T>
    10691076    BfsWizard<SetPredMapBase<T> > predMap(const T &t)
     
    10791086      SetReachedMapBase(const TR &b) : TR(b) {}
    10801087    };
    1081 
    1082     ///\brief \ref named-templ-param "Named parameter" for setting
    1083     ///the reached map.
    1084     ///
    1085     ///\ref named-templ-param "Named parameter" function for setting
    1086     ///the map that indicates which nodes are reached.
     1088    ///\brief \ref named-func-param "Named parameter"
     1089    ///for setting ReachedMap object.
     1090    ///
     1091    /// \ref named-func-param "Named parameter"
     1092    ///for setting ReachedMap object.
    10871093    template<class T>
    10881094    BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
     
    10981104      SetDistMapBase(const TR &b) : TR(b) {}
    10991105    };
    1100 
    1101     ///\brief \ref named-templ-param "Named parameter" for setting
    1102     ///the distance map.
    1103     ///
    1104     ///\ref named-templ-param "Named parameter" function for setting
    1105     ///the map that stores the distances of the nodes calculated
    1106     ///by the algorithm.
     1106    ///\brief \ref named-func-param "Named parameter"
     1107    ///for setting DistMap object.
     1108    ///
     1109    /// \ref named-func-param "Named parameter"
     1110    ///for setting DistMap object.
    11071111    template<class T>
    11081112    BfsWizard<SetDistMapBase<T> > distMap(const T &t)
     
    11181122      SetProcessedMapBase(const TR &b) : TR(b) {}
    11191123    };
    1120 
    1121     ///\brief \ref named-func-param "Named parameter" for setting
    1122     ///the processed map.
    1123     ///
    1124     ///\ref named-templ-param "Named parameter" function for setting
    1125     ///the map that indicates which nodes are processed.
     1124    ///\brief \ref named-func-param "Named parameter"
     1125    ///for setting ProcessedMap object.
     1126    ///
     1127    /// \ref named-func-param "Named parameter"
     1128    ///for setting ProcessedMap object.
    11261129    template<class T>
    11271130    BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
     
    12621265    ///
    12631266    /// The type of the map that indicates which nodes are reached.
    1264     /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     1267    /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    12651268    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    12661269
     
    14231426    /// The simplest way to execute the BFS algorithm is to use one of the
    14241427    /// member functions called \ref run(Node) "run()".\n
    1425     /// If you need better control on the execution, you have to call
    1426     /// \ref init() first, then you can add several source nodes with
     1428    /// If you need more control on the execution, first you have to call
     1429    /// \ref init(), then you can add several source nodes with
    14271430    /// \ref addSource(). Finally the actual path computation can be
    14281431    /// performed with one of the \ref start() functions.
     
    17331736    ///@{
    17341737
    1735     /// \brief Checks if the given node is reached from the root(s).
     1738    /// \brief Checks if a node is reached from the root(s).
    17361739    ///
    17371740    /// Returns \c true if \c v is reached from the root(s).
Note: See TracChangeset for help on using the changeset viewer.