lemon/nearest_neighbor_tsp.h
changeset 1045 4e8787627db3
parent 1036 dff32ce3db71
child 1074 97d978243703
equal deleted inserted replaced
3:919d5649587b 4:1f075975e2cf
   191       }
   191       }
   192 
   192 
   193       /// \brief Gives back the node sequence of the found tour.
   193       /// \brief Gives back the node sequence of the found tour.
   194       ///
   194       ///
   195       /// This function copies the node sequence of the found tour into
   195       /// This function copies the node sequence of the found tour into
   196       /// the given standard container.
   196       /// an STL container through the given output iterator. The
   197       ///
   197       /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
   198       /// \pre run() must be called before using this function.
   198       /// For example,
   199       template <typename Container>
   199       /// \code
   200       void tourNodes(Container &container) const {
   200       /// std::vector<FullGraph::Node> nodes(countNodes(graph));
   201         container.assign(_path.begin(), _path.end());
   201       /// tsp.tourNodes(nodes.begin());
       
   202       /// \endcode
       
   203       /// or
       
   204       /// \code
       
   205       /// std::list<FullGraph::Node> nodes;
       
   206       /// tsp.tourNodes(std::back_inserter(nodes));
       
   207       /// \endcode
       
   208       ///
       
   209       /// \pre run() must be called before using this function.
       
   210       template <typename Iterator>
       
   211       void tourNodes(Iterator out) const {
       
   212         std::copy(_path.begin(), _path.end(), out);
   202       }
   213       }
   203 
   214 
   204       /// \brief Gives back the found tour as a path.
   215       /// \brief Gives back the found tour as a path.
   205       ///
   216       ///
   206       /// This function copies the found tour as a list of arcs/edges into
   217       /// This function copies the found tour as a list of arcs/edges into