COIN-OR::LEMON - Graph Library

Changeset 1202:ef200e268af2 in lemon for lemon/opt2_tsp.h


Ignore:
Timestamp:
01/09/11 00:56:52 (13 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Unifications and improvements in TSP algorithms (#386)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/opt2_tsp.h

    r1201 r1202  
    2222/// \ingroup tsp
    2323/// \file
    24 /// \brief 2-opt algorithm for symmetric TSP
     24/// \brief 2-opt algorithm for symmetric TSP.
    2525
    2626#include <vector>
     
    2929namespace lemon {
    3030
     31  /// \ingroup tsp
     32  ///
    3133  /// \brief 2-opt algorithm for symmetric TSP.
    3234  ///
     
    115117      }
    116118
    117       /// \brief Runs the algorithm from the given tour.
     119      /// \brief Runs the algorithm starting from the given tour.
    118120      ///
    119121      /// This function runs the algorithm starting from the given tour.
     
    157159      }
    158160
    159       /// \brief Runs the algorithm from the given tour.
    160       ///
    161       /// This function runs the algorithm starting from the given tour.
    162       ///
    163       /// \param tour The tour as a node sequence. It must be a standard
    164       /// sequence container storing all <tt>Node</tt>s in the desired order.
     161      /// \brief Runs the algorithm starting from the given tour.
     162      ///
     163      /// This function runs the algorithm starting from the given tour
     164      /// (node sequence).
     165      ///
     166      /// \param tour A vector that stores all <tt>Node</tt>s of the graph
     167      /// in the desired order.
    165168      ///
    166169      /// \return The total cost of the found tour.
    167       template <template <typename> class Container>
    168       Cost run(const Container<Node>& tour) {
     170      Cost run(const std::vector<Node>& tour) {
    169171        _path.clear();
    170172
     
    181183
    182184        _plist.resize(2*_gr.nodeNum());
    183         typename Container<Node>::const_iterator it = tour.begin();
     185        typename std::vector<Node>::const_iterator it = tour.begin();
    184186        int first = _gr.id(*it),
    185187            prev = first,
     
    218220      /// found tour.
    219221      ///
    220       /// This function returns a const reference to the internal structure
     222      /// This function returns a const reference to a vector
    221223      /// that stores the node sequence of the found tour.
    222224      ///
Note: See TracChangeset for help on using the changeset viewer.