COIN-OR::LEMON - Graph Library

Changeset 781:d4d182ab75bd in lemon-0.x for src/hugo/bfs.h


Ignore:
Timestamp:
09/01/04 17:37:36 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1074
Message:

Changes in the doc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/bfs.h

    r780 r781  
    1717/// @{
    1818
    19   ///%Bfs algorithm class.
    20 
    21   ///This class provides an efficient implementation of %Bfs algorithm.
    22   ///The edge lengths are passed to the algorithm using a
    23   ///\ref ReadMapSkeleton "readable map",
    24   ///so it is easy to change it to any kind of length.
     19  ///%BFS algorithm class.
     20
     21  ///This class provides an efficient implementation of %BFS algorithm.
     22  ///\param GR The graph type the algorithm runs on.
     23  ///This class does the same as Dijkstra does with constant 1 edge length,
     24  ///but it is faster.
    2525  ///
    26   ///The type of the length is determined by the \c ValueType of the length map.
    27   ///
    28   ///It is also possible to change the underlying priority heap.
    29   ///
    30   ///\param GR The graph type the algorithm runs on.
    31   ///\param LM This read-only
    32   ///EdgeMap
    33   ///determines the
    34   ///lengths of the edges. It is read once for each edge, so the map
    35   ///may involve in relatively time consuming process to compute the edge
    36   ///length if it is necessary. The default map type is
    37   ///\ref GraphSkeleton::EdgeMap "Graph::EdgeMap<int>"
    38   ///\param Heap The heap type used by the %Bfs
    39   ///algorithm. The default
    40   ///is using \ref BinHeap "binary heap".
    41   ///
    42   ///\author Jacint Szabo and Alpar Juttner
    43   ///\todo We need a typedef-names should be standardized. (-:
    44   ///\todo Type of \c PredMap, \c PredNodeMap and \c DistMap
    45   ///should not be fixed. (Problematic to solve).
     26  ///\author Alpar Juttner
    4627
    4728#ifdef DOXYGEN
     
    8162
    8263
    83     ///Initialize maps.
    84    
    85     ///\todo Error if \c G or are \c NULL.
    86     ///\todo Better memory allocation (instead of new).
     64    ///Initializes the maps.
    8765    void init_maps()
    8866    {
    89 //       if(!length) {
    90 //      local_length = true;
    91 //      length = new LM(G);
    92 //       }
    9367      if(!predecessor) {
    9468        local_predecessor = true;
     
    11589    ~Bfs()
    11690    {
    117       //      if(local_length) delete length;
    11891      if(local_predecessor) delete predecessor;
    11992      if(local_pred_node) delete pred_node;
     
    12598    ///Sets the graph the algorithm will run on.
    12699    ///\return <tt> (*this) </tt>
     100    ///\bug What about maps?
     101    ///\todo It may be unnecessary
    127102    Bfs &setGraph(const Graph &_G)
    128103    {
     
    130105      return *this;
    131106    }
    132     ///Sets the length map.
    133 
    134107    ///Sets the map storing the predecessor edges.
    135108
     
    187160  ///This method runs the %BFS algorithm from a root node \c s
    188161  ///in order to
    189   ///compute the
     162  ///compute a
    190163  ///shortest path to each node. The algorithm computes
    191   ///- The shortest path tree.
     164  ///- The %BFS tree.
    192165  ///- The distance of each node from the root.
    193166 
     
    233206    int dist(Node v) const { return (*distance)[v]; }
    234207
    235     ///Returns the 'previous edge' of the shortest path tree.
    236 
    237     ///For a node \c v it returns the 'previous edge' of the shortest path tree,
    238     ///i.e. it returns the last edge from a shortest path from the root to \c
     208    ///Returns the 'previous edge' of the %BFS path tree.
     209
     210    ///For a node \c v it returns the 'previous edge' of the %BFS tree,
     211    ///i.e. it returns the last edge of a shortest path from the root to \c
    239212    ///v. It is \ref INVALID
    240213    ///if \c v is unreachable from the root or if \c v=s. The
    241     ///shortest path tree used here is equal to the shortest path tree used in
     214    ///%BFS tree used here is equal to the %BFS tree used in
    242215    ///\ref predNode(Node v).  \pre \ref run() must be called before using
    243216    ///this function.
    244217    Edge pred(Node v) const { return (*predecessor)[v]; }
    245218
    246     ///Returns the 'previous node' of the shortest path tree.
    247 
    248     ///For a node \c v it returns the 'previous node' of the shortest path tree,
     219    ///Returns the 'previous node' of the %BFS tree.
     220
     221    ///For a node \c v it returns the 'previous node' on the %BFS tree,
    249222    ///i.e. it returns the last but one node from a shortest path from the
    250223    ///root to \c /v. It is INVALID if \c v is unreachable from the root or if
    251     ///\c v=s. The shortest path tree used here is equal to the shortest path
     224    ///\c v=s. The shortest path tree used here is equal to the %BFS
    252225    ///tree used in \ref pred(Node v).  \pre \ref run() must be called before
    253226    ///using this function.
     
    260233    const DistMap &distMap() const { return *distance;}
    261234 
    262     ///Returns a reference to the shortest path tree map.
     235    ///Returns a reference to the %BFS tree map.
    263236
    264237    ///Returns a reference to the NodeMap of the edges of the
    265     ///shortest path tree.
     238    ///%BFS tree.
    266239    ///\pre \ref run() must be called before using this function.
    267240    const PredMap &predMap() const { return *predecessor;}
    268241 
    269     ///Returns a reference to the map of nodes of shortest paths.
    270 
    271     ///Returns a reference to the NodeMap of the last but one nodes of the
    272     ///shortest path tree.
     242    ///Returns a reference to the map of last but one nodes of shortest paths.
     243
     244    ///Returns a reference to the NodeMap of the last but one nodes on the
     245    ///%BFS tree.
    273246    ///\pre \ref run() must be called before using this function.
    274247    const PredNodeMap &predNodeMap() const { return *pred_node;}
     
    285258  };
    286259 
    287 
    288   // **********************************************************************
    289   //  IMPLEMENTATIONS
    290   // **********************************************************************
    291 
    292260/// @}
    293261 
Note: See TracChangeset for help on using the changeset viewer.