Class to store a Tour of the TSP.
More...
#include <qbpp_tsp.hpp>
Class to store a Tour of the TSP.
Definition at line 143 of file qbpp_tsp.hpp.
◆ TSPSol()
Generates a solution of the Traveling Salesman Problem (TSP) from a QUBO model and its solution.
- Parameters
-
tsp_quad_model | The TSP QUBO expression |
sol | The Solution of the QUBO model |
Definition at line 163 of file qbpp_tsp.hpp.
◆ gen_tour()
std::vector< uint32_t > qbpp::tsp::TSPSol::gen_tour |
( |
const TSPQuadModel & |
tsp_quad_model, |
|
|
const Sol & |
sol |
|
) |
| |
|
inlinestaticprivate |
helper function to generate a tour from the solution.
- Parameters
-
tsp_quad_model | TSP QUBO expression |
sol | Solution of the QUBO model |
- Returns
- A vector of nodes representing the tour.
Definition at line 353 of file qbpp_tsp.hpp.
◆ operator[]()
uint32_t qbpp::tsp::TSPSol::operator[] |
( |
uint32_t |
index | ) |
const |
|
inline |
Get the node at index in the tour.
- Parameters
-
- Returns
- Node at index in the tour.
Definition at line 171 of file qbpp_tsp.hpp.
◆ node_count()
uint32_t qbpp::tsp::TSPSol::node_count |
( |
| ) |
const |
|
inline |
Get the number of nodes in the tour.
Definition at line 174 of file qbpp_tsp.hpp.
◆ print()
void qbpp::tsp::TSPSol::print |
( |
| ) |
const |
|
inline |
◆ print_matrix()
void qbpp::tsp::TSPSol::print_matrix |
( |
| ) |
const |
|
inline |
◆ tsp_quad_model
QUBO expression for the Traveling Salesman Problem (TSP).
Definition at line 145 of file qbpp_tsp.hpp.
◆ sol
const Sol qbpp::tsp::TSPSol::sol |
|
private |
◆ tour
const std::vector<uint32_t> qbpp::tsp::TSPSol::tour |
|
private |
A vector of nodes representing the tour.
Definition at line 149 of file qbpp_tsp.hpp.
The documentation for this class was generated from the following file: