COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dijkstra.h

    r631 r891  
    7171
    7272    ///The type of the map that stores the arc lengths.
    73     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     73    ///It must conform to the \ref concepts::ReadMap "ReadMap" concept.
    7474    typedef LEN LengthMap;
    75     ///The type of the length of the arcs.
     75    ///The type of the arc lengths.
    7676    typedef typename LEN::Value Value;
    7777
     
    117117    ///The type of the map that stores the predecessor
    118118    ///arcs of the shortest paths.
    119     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     119    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    120120    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    121121    ///Instantiates a \c PredMap.
     
    132132
    133133    ///The type of the map that indicates which nodes are processed.
    134     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    135     ///By default it is a NullMap.
     134    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     135    ///By default, it is a NullMap.
    136136    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    137137    ///Instantiates a \c ProcessedMap.
     
    152152
    153153    ///The type of the map that stores the distances of the nodes.
    154     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     154    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    155155    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    156156    ///Instantiates a \c DistMap.
     
    169169  /// \ingroup shortest_path
    170170  ///This class provides an efficient implementation of the %Dijkstra algorithm.
     171  ///
     172  ///The %Dijkstra algorithm solves the single-source shortest path problem
     173  ///when all arc lengths are non-negative. If there are negative lengths,
     174  ///the BellmanFord algorithm should be used instead.
    171175  ///
    172176  ///The arc lengths are passed to the algorithm using a
     
    189193  ///it is necessary. The default map type is \ref
    190194  ///concepts::Digraph::ArcMap "GR::ArcMap<int>".
     195  ///\tparam TR The traits class that defines various types used by the
     196  ///algorithm. By default, it is \ref DijkstraDefaultTraits
     197  ///"DijkstraDefaultTraits<GR, LEN>".
     198  ///In most cases, this parameter should not be set directly,
     199  ///consider to use the named template parameters instead.
    191200#ifdef DOXYGEN
    192201  template <typename GR, typename LEN, typename TR>
     
    202211    typedef typename TR::Digraph Digraph;
    203212
    204     ///The type of the length of the arcs.
    205     typedef typename TR::LengthMap::Value Value;
     213    ///The type of the arc lengths.
     214    typedef typename TR::Value Value;
    206215    ///The type of the map that stores the arc lengths.
    207216    typedef typename TR::LengthMap LengthMap;
     
    305314    ///\ref named-templ-param "Named parameter" for setting
    306315    ///\c PredMap type.
    307     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     316    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    308317    template <class T>
    309318    struct SetPredMap
     
    326335    ///\ref named-templ-param "Named parameter" for setting
    327336    ///\c DistMap type.
    328     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     337    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    329338    template <class T>
    330339    struct SetDistMap
     
    347356    ///\ref named-templ-param "Named parameter" for setting
    348357    ///\c ProcessedMap type.
    349     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     358    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    350359    template <class T>
    351360    struct SetProcessedMap
     
    423432    ///passed to the constructor of the cross reference and the cross
    424433    ///reference should be passed to the constructor of the heap).
    425     ///However external heap and cross reference objects could also be
     434    ///However, external heap and cross reference objects could also be
    426435    ///passed to the algorithm using the \ref heap() function before
    427436    ///calling \ref run(Node) "run()" or \ref init().
     
    444453    ///\ref named-templ-param "Named parameter" for setting
    445454    ///\c OperationTraits type.
     455    /// For more information, see \ref DijkstraDefaultOperationTraits.
    446456    template <class T>
    447457    struct SetOperationTraits
     
    585595    ///The simplest way to execute the %Dijkstra algorithm is to use
    586596    ///one of the member functions called \ref run(Node) "run()".\n
    587     ///If you need more control on the execution, first you have to call
    588     ///\ref init(), then you can add several source nodes with
     597    ///If you need better control on the execution, you have to call
     598    ///\ref init() first, then you can add several source nodes with
    589599    ///\ref addSource(). Finally the actual path computation can be
    590600    ///performed with one of the \ref start() functions.
     
    802812    ///The results of the %Dijkstra algorithm can be obtained using these
    803813    ///functions.\n
    804     ///Either \ref run(Node) "run()" or \ref start() should be called
     814    ///Either \ref run(Node) "run()" or \ref init() should be called
    805815    ///before using them.
    806816
    807817    ///@{
    808818
    809     ///The shortest path to a node.
    810 
    811     ///Returns the shortest path to a node.
     819    ///The shortest path to the given node.
     820
     821    ///Returns the shortest path to the given node from the root(s).
    812822    ///
    813823    ///\warning \c t should be reached from the root(s).
     
    817827    Path path(Node t) const { return Path(*G, *_pred, t); }
    818828
    819     ///The distance of a node from the root(s).
    820 
    821     ///Returns the distance of a node from the root(s).
     829    ///The distance of the given node from the root(s).
     830
     831    ///Returns the distance of the given node from the root(s).
    822832    ///
    823833    ///\warning If node \c v is not reached from the root(s), then
     
    828838    Value dist(Node v) const { return (*_dist)[v]; }
    829839
    830     ///Returns the 'previous arc' of the shortest path tree for a node.
    831 
     840    ///\brief Returns the 'previous arc' of the shortest path tree for
     841    ///the given node.
     842    ///
    832843    ///This function returns the 'previous arc' of the shortest path
    833844    ///tree for the node \c v, i.e. it returns the last arc of a
     
    836847    ///
    837848    ///The shortest path tree used here is equal to the shortest path
    838     ///tree used in \ref predNode().
     849    ///tree used in \ref predNode() and \ref predMap().
    839850    ///
    840851    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    842853    Arc predArc(Node v) const { return (*_pred)[v]; }
    843854
    844     ///Returns the 'previous node' of the shortest path tree for a node.
    845 
     855    ///\brief Returns the 'previous node' of the shortest path tree for
     856    ///the given node.
     857    ///
    846858    ///This function returns the 'previous node' of the shortest path
    847859    ///tree for the node \c v, i.e. it returns the last but one node
    848     ///from a shortest path from a root to \c v. It is \c INVALID
     860    ///of a shortest path from a root to \c v. It is \c INVALID
    849861    ///if \c v is not reached from the root(s) or if \c v is a root.
    850862    ///
    851863    ///The shortest path tree used here is equal to the shortest path
    852     ///tree used in \ref predArc().
     864    ///tree used in \ref predArc() and \ref predMap().
    853865    ///
    854866    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    871883    ///
    872884    ///Returns a const reference to the node map that stores the predecessor
    873     ///arcs, which form the shortest path tree.
     885    ///arcs, which form the shortest path tree (forest).
    874886    ///
    875887    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    877889    const PredMap &predMap() const { return *_pred;}
    878890
    879     ///Checks if a node is reached from the root(s).
     891    ///Checks if the given node is reached from the root(s).
    880892
    881893    ///Returns \c true if \c v is reached from the root(s).
     
    896908                                          Heap::POST_HEAP; }
    897909
    898     ///The current distance of a node from the root(s).
    899 
    900     ///Returns the current distance of a node from the root(s).
     910    ///The current distance of the given node from the root(s).
     911
     912    ///Returns the current distance of the given node from the root(s).
    901913    ///It may be decreased in the following processes.
    902914    ///
     
    925937
    926938    ///The type of the map that stores the arc lengths.
    927     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     939    ///It must conform to the \ref concepts::ReadMap "ReadMap" concept.
    928940    typedef LEN LengthMap;
    929     ///The type of the length of the arcs.
     941    ///The type of the arc lengths.
    930942    typedef typename LEN::Value Value;
    931943
     
    974986    ///The type of the map that stores the predecessor
    975987    ///arcs of the shortest paths.
    976     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     988    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    977989    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    978990    ///Instantiates a PredMap.
     
    9891001
    9901002    ///The type of the map that indicates which nodes are processed.
    991     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    992     ///By default it is a NullMap.
     1003    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     1004    ///By default, it is a NullMap.
    9931005    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    9941006    ///Instantiates a ProcessedMap.
     
    10091021
    10101022    ///The type of the map that stores the distances of the nodes.
    1011     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     1023    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    10121024    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    10131025    ///Instantiates a DistMap.
     
    10241036
    10251037    ///The type of the shortest paths.
    1026     ///It must meet the \ref concepts::Path "Path" concept.
     1038    ///It must conform to the \ref concepts::Path "Path" concept.
    10271039    typedef lemon::Path<Digraph> Path;
    10281040  };
     
    10301042  /// Default traits class used by DijkstraWizard
    10311043
    1032   /// To make it easier to use Dijkstra algorithm
    1033   /// we have created a wizard class.
    1034   /// This \ref DijkstraWizard class needs default traits,
    1035   /// as well as the \ref Dijkstra class.
    1036   /// The \ref DijkstraWizardBase is a class to be the default traits of the
    1037   /// \ref DijkstraWizard class.
     1044  /// Default traits class used by DijkstraWizard.
     1045  /// \tparam GR The type of the digraph.
     1046  /// \tparam LEN The type of the length map.
    10381047  template<typename GR, typename LEN>
    10391048  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN>
     
    10891098  /// This class should only be used through the \ref dijkstra() function,
    10901099  /// which makes it easier to use the algorithm.
     1100  ///
     1101  /// \tparam TR The traits class that defines various types used by the
     1102  /// algorithm.
    10911103  template<class TR>
    10921104  class DijkstraWizard : public TR
     
    10941106    typedef TR Base;
    10951107
    1096     ///The type of the digraph the algorithm runs on.
    10971108    typedef typename TR::Digraph Digraph;
    10981109
     
    11021113    typedef typename Digraph::OutArcIt OutArcIt;
    11031114
    1104     ///The type of the map that stores the arc lengths.
    11051115    typedef typename TR::LengthMap LengthMap;
    1106     ///The type of the length of the arcs.
    11071116    typedef typename LengthMap::Value Value;
    1108     ///\brief The type of the map that stores the predecessor
    1109     ///arcs of the shortest paths.
    11101117    typedef typename TR::PredMap PredMap;
    1111     ///The type of the map that stores the distances of the nodes.
    11121118    typedef typename TR::DistMap DistMap;
    1113     ///The type of the map that indicates which nodes are processed.
    11141119    typedef typename TR::ProcessedMap ProcessedMap;
    1115     ///The type of the shortest paths
    11161120    typedef typename TR::Path Path;
    1117     ///The heap type used by the dijkstra algorithm.
    11181121    typedef typename TR::Heap Heap;
    11191122
     
    11871190      SetPredMapBase(const TR &b) : TR(b) {}
    11881191    };
    1189     ///\brief \ref named-func-param "Named parameter"
    1190     ///for setting PredMap object.
    1191     ///
    1192     ///\ref named-func-param "Named parameter"
    1193     ///for setting PredMap object.
     1192
     1193    ///\brief \ref named-templ-param "Named parameter" for setting
     1194    ///the predecessor map.
     1195    ///
     1196    ///\ref named-templ-param "Named parameter" function for setting
     1197    ///the map that stores the predecessor arcs of the nodes.
    11941198    template<class T>
    11951199    DijkstraWizard<SetPredMapBase<T> > predMap(const T &t)
     
    12051209      SetDistMapBase(const TR &b) : TR(b) {}
    12061210    };
    1207     ///\brief \ref named-func-param "Named parameter"
    1208     ///for setting DistMap object.
    1209     ///
    1210     ///\ref named-func-param "Named parameter"
    1211     ///for setting DistMap object.
     1211
     1212    ///\brief \ref named-templ-param "Named parameter" for setting
     1213    ///the distance map.
     1214    ///
     1215    ///\ref named-templ-param "Named parameter" function for setting
     1216    ///the map that stores the distances of the nodes calculated
     1217    ///by the algorithm.
    12121218    template<class T>
    12131219    DijkstraWizard<SetDistMapBase<T> > distMap(const T &t)
     
    12231229      SetProcessedMapBase(const TR &b) : TR(b) {}
    12241230    };
    1225     ///\brief \ref named-func-param "Named parameter"
    1226     ///for setting ProcessedMap object.
    1227     ///
    1228     /// \ref named-func-param "Named parameter"
    1229     ///for setting ProcessedMap object.
     1231
     1232    ///\brief \ref named-func-param "Named parameter" for setting
     1233    ///the processed map.
     1234    ///
     1235    ///\ref named-templ-param "Named parameter" function for setting
     1236    ///the map that indicates which nodes are processed.
    12301237    template<class T>
    12311238    DijkstraWizard<SetProcessedMapBase<T> > processedMap(const T &t)
     
    12401247      SetPathBase(const TR &b) : TR(b) {}
    12411248    };
     1249
    12421250    ///\brief \ref named-func-param "Named parameter"
    12431251    ///for getting the shortest path to the target node.
Note: See TracChangeset for help on using the changeset viewer.