COIN-OR::LEMON - Graph Library

Changeset 1857:2e3a4481901e in lemon-0.x


Ignore:
Timestamp:
12/10/05 20:38:53 (18 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2425
Message:

belmann_ford:

  • run() with length limit
  • bugfix in processNextRound()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/belmann_ford.h

    r1816 r1857  
    431431      std::vector<Value> values(_process.size());
    432432      for (int i = 0; i < (int)_process.size(); ++i) {
    433         values[i] = _dist[_process[i]];
     433        values[i] = (*_dist)[_process[i]];
    434434      }
    435435      for (int i = 0; i < (int)_process.size(); ++i) {
     
    554554      addSource(s);
    555555      start();
     556    }
     557   
     558    /// \brief Runs %BelmannFord algorithm with limited path length
     559    /// from node \c s.
     560    ///   
     561    /// This method runs the %BelmannFord algorithm from a root node \c s
     562    /// in order to compute the shortest path with at most \c len edges
     563    /// to each node. The algorithm computes
     564    /// - The shortest path tree.
     565    /// - The distance of each node from the root.
     566    ///
     567    /// \note d.run(s, len) is just a shortcut of the following code.
     568    /// \code
     569    ///  d.init();
     570    ///  d.addSource(s);
     571    ///  d.limitedStart(len);
     572    /// \endcode
     573    void run(Node s, int len) {
     574      init();
     575      addSource(s);
     576      limitedStart(len);
    556577    }
    557578   
Note: See TracChangeset for help on using the changeset viewer.