|
PaGMO
1.1.5
|
Nearest Neighbor Algorithm (NN) More...
#include <nn_tsp.h>

Public Member Functions | |
| nn_tsp (int start_city=-1) | |
| Constructor. More... | |
| base_ptr | clone () const |
| Clone method. | |
| void | evolve (population &) const |
| Evolve implementation. More... | |
| std::string | get_name () const |
| Algorithm name. | |
Public Member Functions inherited from pagmo::algorithm::base | |
| base () | |
| Default constructor. More... | |
| virtual | ~base () |
| Trivial destructor. More... | |
| std::string | human_readable () const |
| Return human readable representation of the algorithm. More... | |
| virtual std::string | human_readable_extra () const |
| Extra information in human readable format. More... | |
| void | set_screen_output (const bool p) |
| Setter-Getter for protected m_screen_output data. More... | |
| bool | get_screen_output () const |
| Gets screen output. More... | |
| void | reset_rngs (const unsigned int) const |
| Resets the seed of the internal rngs using a user-provided seed. More... | |
Friends | |
| class | boost::serialization::access |
Additional Inherited Members | |
Protected Attributes inherited from pagmo::algorithm::base | |
| bool | m_screen_output |
| Indicates to the derived class whether to print stuff on screen. | |
| rng_double | m_drng |
| Random number generator for double-precision floating point values. | |
| rng_uint32 | m_urng |
| Random number generator for unsigned integer values. | |
| unsigned int | m_fevals |
| A counter for the number of function evaluations. | |
Nearest Neighbor Algorithm (NN)
The Nearest Neighbor algorithm generates a tour starting either from a single, in the input, specified vertex or loops over all possible initial vertices, computes the corresponding tours and returns the shortest tour.
| pagmo::algorithm::nn_tsp::nn_tsp | ( | int | start_city = -1 | ) |
Constructor.
Allows to specify in detail all the parameters of the algorithm.
| [in] | start_city | First City in the tour. |
Definition at line 43 of file nn_tsp.cpp.
|
virtual |
Evolve implementation.
Runs the NN_TSP algorithm.
| [in,out] | pop | input/output pagmo::population to be evolved. |
Implements pagmo::algorithm::base.
Definition at line 60 of file nn_tsp.cpp.
1.8.9.1