PGROUTING
3.2
|
#include "pgr_tsp.hpp"
Public Member Functions | |
TSP (const MATRIX &_costs) | |
void | annealing (double initial_temperature, double final_temperature, double cooling_factor, int64_t tries_per_temperature, int64_t max_changes_per_temperature, int64_t max_consecutive_non_changes, bool randomize, double time_limit) |
std::string | get_log () const |
std::string | get_stats () const |
Tour | get_tour () const |
void | greedyInitial (size_t idx_start=0) |
Private Member Functions | |
size_t | find_closest_city (size_t current_city, const std::set< size_t > &inserted) const |
double | getDeltaReverse (size_t posA, size_t posC) const |
double | getDeltaSlide (size_t posP, size_t posF, size_t posL) const |
double | getDeltaSwap (size_t posA, size_t posC) const |
void | invariant () const |
void | swapClimb () |
void | update_if_best () |
Private Attributes | |
Tour | best_tour |
double | bestCost |
double | current_cost |
Tour | current_tour |
double | epsilon |
size_t | improve_count |
std::ostringstream | log |
size_t | n |
size_t | reverse_count |
size_t | slide_count |
size_t | swap_count |
int | updatecalls |
Definition at line 77 of file pgr_tsp.hpp.
|
inlineexplicit |
Definition at line 86 of file pgr_tsp.hpp.
References pgrouting::tsp::TSP< MATRIX >::best_tour, pgrouting::tsp::TSP< MATRIX >::bestCost, pgrouting::tsp::TSP< MATRIX >::current_cost, pgrouting::tsp::TSP< MATRIX >::current_tour, pgrouting::tsp::TSP< MATRIX >::n, and pgassert.
void pgrouting::tsp::TSP< MATRIX >::annealing | ( | double | initial_temperature, |
double | final_temperature, | ||
double | cooling_factor, | ||
int64_t | tries_per_temperature, | ||
int64_t | max_changes_per_temperature, | ||
int64_t | max_consecutive_non_changes, | ||
bool | randomize, | ||
double | time_limit | ||
) |
Definition at line 429 of file pgr_tsp.cpp.
References pgassert, rand(), and succ().
Referenced by do_pgr_euclideanTSP(), and do_pgr_tsp().
|
private |
|
inline |
Definition at line 115 of file pgr_tsp.hpp.
References pgrouting::tsp::TSP< MATRIX >::log.
Referenced by do_pgr_euclideanTSP(), and do_pgr_tsp().
|
inline |
Definition at line 106 of file pgr_tsp.hpp.
References pgrouting::tsp::TSP< MATRIX >::improve_count, pgrouting::tsp::TSP< MATRIX >::reverse_count, pgrouting::tsp::TSP< MATRIX >::slide_count, and pgrouting::tsp::TSP< MATRIX >::swap_count.
Referenced by do_pgr_euclideanTSP(), and do_pgr_tsp().
|
inline |
Definition at line 104 of file pgr_tsp.hpp.
References pgrouting::tsp::TSP< MATRIX >::best_tour.
Referenced by do_pgr_euclideanTSP(), and do_pgr_tsp().
|
private |
|
private |
Definition at line 224 of file pgr_tsp.cpp.
References pgrouting::tsp::Tour::cities, pgassertwm, pgrouting::tsp::Tour::slide(), and succ().
|
private |
void pgrouting::tsp::TSP< MATRIX >::greedyInitial | ( | size_t | idx_start = 0 | ) |
Definition at line 143 of file pgr_tsp.cpp.
References pgassert, and pgassertwm.
Referenced by do_pgr_euclideanTSP(), and do_pgr_tsp().
|
private |
|
private |
|
private |
Definition at line 84 of file pgr_tsp.cpp.
|
private |
Definition at line 132 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_tour(), and pgrouting::tsp::TSP< MATRIX >::TSP().
|
private |
Definition at line 133 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::TSP().
|
private |
Definition at line 134 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::TSP().
|
private |
Definition at line 131 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::TSP().
|
private |
Definition at line 135 of file pgr_tsp.hpp.
|
private |
Definition at line 144 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_stats().
|
private |
Definition at line 140 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_log().
|
private |
Definition at line 136 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::TSP().
|
private |
Definition at line 143 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_stats().
|
private |
Definition at line 142 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_stats().
|
private |
Definition at line 141 of file pgr_tsp.hpp.
Referenced by pgrouting::tsp::TSP< MATRIX >::get_stats().
|
private |
Definition at line 138 of file pgr_tsp.hpp.