1.1 --- a/lemon/opt2_tsp.h Sat Jan 08 22:51:16 2011 +0100
1.2 +++ b/lemon/opt2_tsp.h Sun Jan 09 00:56:52 2011 +0100
1.3 @@ -21,13 +21,15 @@
1.4
1.5 /// \ingroup tsp
1.6 /// \file
1.7 -/// \brief 2-opt algorithm for symmetric TSP
1.8 +/// \brief 2-opt algorithm for symmetric TSP.
1.9
1.10 #include <vector>
1.11 #include <lemon/full_graph.h>
1.12
1.13 namespace lemon {
1.14
1.15 + /// \ingroup tsp
1.16 + ///
1.17 /// \brief 2-opt algorithm for symmetric TSP.
1.18 ///
1.19 /// Opt2Tsp implements the 2-opt heuristic for solving
1.20 @@ -114,7 +116,7 @@
1.21 return start();
1.22 }
1.23
1.24 - /// \brief Runs the algorithm from the given tour.
1.25 + /// \brief Runs the algorithm starting from the given tour.
1.26 ///
1.27 /// This function runs the algorithm starting from the given tour.
1.28 ///
1.29 @@ -156,16 +158,16 @@
1.30 return start();
1.31 }
1.32
1.33 - /// \brief Runs the algorithm from the given tour.
1.34 + /// \brief Runs the algorithm starting from the given tour.
1.35 ///
1.36 - /// This function runs the algorithm starting from the given tour.
1.37 + /// This function runs the algorithm starting from the given tour
1.38 + /// (node sequence).
1.39 ///
1.40 - /// \param tour The tour as a node sequence. It must be a standard
1.41 - /// sequence container storing all <tt>Node</tt>s in the desired order.
1.42 + /// \param tour A vector that stores all <tt>Node</tt>s of the graph
1.43 + /// in the desired order.
1.44 ///
1.45 /// \return The total cost of the found tour.
1.46 - template <template <typename> class Container>
1.47 - Cost run(const Container<Node>& tour) {
1.48 + Cost run(const std::vector<Node>& tour) {
1.49 _path.clear();
1.50
1.51 if (_gr.nodeNum() == 0) return _sum = 0;
1.52 @@ -180,7 +182,7 @@
1.53 }
1.54
1.55 _plist.resize(2*_gr.nodeNum());
1.56 - typename Container<Node>::const_iterator it = tour.begin();
1.57 + typename std::vector<Node>::const_iterator it = tour.begin();
1.58 int first = _gr.id(*it),
1.59 prev = first,
1.60 curr = _gr.id(*(++it)),
1.61 @@ -217,7 +219,7 @@
1.62 /// \brief Returns a const reference to the node sequence of the
1.63 /// found tour.
1.64 ///
1.65 - /// This function returns a const reference to the internal structure
1.66 + /// This function returns a const reference to a vector
1.67 /// that stores the node sequence of the found tour.
1.68 ///
1.69 /// \pre run() must be called before using this function.