COIN-OR::LEMON - Graph Library

Changeset 1916:e7d4eb908e87 in lemon-0.x for lemon/johnson.h


Ignore:
Timestamp:
01/27/06 15:32:33 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2491
Message:

make public the shiftedStart inorder to compute just n dijkstra

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/johnson.h

    r1875 r1916  
    484484    }
    485485
    486   protected:
    487    
     486  public:   
     487
     488    ///\name Execution control
     489    /// The simplest way to execute the algorithm is to use
     490    /// one of the member functions called \c run(...).
     491    /// \n
     492    /// If you need more control on the execution,
     493    /// Finally \ref start() will perform the actual path
     494    /// computation.
     495
     496    ///@{
     497
     498    /// \brief Initializes the internal data structures.
     499    ///
     500    /// Initializes the internal data structures.
     501    void init() {
     502      create_maps();
     503    }
     504
     505    /// \brief Executes the algorithm with own potential map.
     506    ///
     507    /// This method runs the %Johnson algorithm in order to compute
     508    /// the shortest path to each node pairs. The potential map
     509    /// can be given for this algorithm which usually calculated
     510    /// by the Bellman-Ford algorithm. If the graph does not have
     511    /// negative length edge then this start function can be used
     512    /// with constMap<Node, int>(0) parameter to omit the running time of
     513    /// the Bellman-Ford.
     514    /// The algorithm computes
     515    /// - The shortest path tree for each node.
     516    /// - The distance between each node pairs.
    488517    template <typename PotentialMap>
    489     void shiftedRun(const PotentialMap& potential) {
    490      
     518    void shiftedStart(const PotentialMap& potential) {     
    491519      typename Graph::template EdgeMap<Value> shiftlen(*graph);
    492520      for (EdgeIt it(*graph);  it != INVALID; ++it) {
     
    517545    }
    518546
    519   public:   
    520 
    521     ///\name Execution control
    522     /// The simplest way to execute the algorithm is to use
    523     /// one of the member functions called \c run(...).
    524     /// \n
    525     /// If you need more control on the execution,
    526     /// Finally \ref start() will perform the actual path
    527     /// computation.
    528 
    529     ///@{
    530 
    531     /// \brief Initializes the internal data structures.
    532     ///
    533     /// Initializes the internal data structures.
    534     void init() {
    535       create_maps();
    536     }
    537 
    538547    /// \brief Executes the algorithm.
    539548    ///
     
    559568      bellmanford.start();
    560569
    561       shiftedRun(bellmanford.distMap());
     570      shiftedStart(bellmanford.distMap());
    562571    }
    563572
     
    586595      if (!bellmanford.checkedStart()) return false;
    587596
    588       shiftedRun(bellmanford.distMap());
     597      shiftedStart(bellmanford.distMap());
    589598      return true;
    590599    }
Note: See TracChangeset for help on using the changeset viewer.