Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
math::TSPNode Struct Reference

Вершина дерева с соответствующей матрицей смежности More...

#include <tspgraph.h>

Collaboration diagram for math::TSPNode:

Public Member Functions

 TSPNode (const AdjacencyMatrix &m, std::optional< std::shared_ptr< TSPNode > > prev_node=std::nullopt, std::optional< Edge > new_edge=std::nullopt, std::optional< std::map< std::size_t, std::size_t > > graph_chains=std::nullopt)
 Создает новый экземпляр TSPNode.
 

Public Attributes

std::map< std::size_t, std::size_t > chains
 
double evaluation
 
AdjacencyMatrix matrix
 
std::vector< Edgepath
 
std::shared_ptr< TSPNodewith_edge = nullptr
 
std::shared_ptr< TSPNodewithout_edge = nullptr
 

Detailed Description

Вершина дерева с соответствующей матрицей смежности

Constructor & Destructor Documentation

◆ TSPNode()

math::TSPNode::TSPNode ( const AdjacencyMatrix & m,
std::optional< std::shared_ptr< TSPNode > > prev_node = std::nullopt,
std::optional< Edge > new_edge = std::nullopt,
std::optional< std::map< std::size_t, std::size_t > > graph_chains = std::nullopt )
inline

Создает новый экземпляр TSPNode.

Parameters
mматрица смежности
prev_nodeродитель вершины
new_edgeновое ребро маршрута
graph_chainsзавершенные цепи в уже существующем маршруте
40 if (prev_node) {
41 evaluation += (**prev_node).evaluation;
42 path = (**prev_node).path;
43 if (graph_chains)
44 chains = *graph_chains;
45 else
46 chains = (**prev_node).chains;
47 }
48 if (new_edge) path.push_back(*new_edge);
49 }
double GetBottomLineEvaluation() const
Definition adjacency_matrix.h:60
std::vector< Edge > path
Definition tspgraph.h:55
std::map< std::size_t, std::size_t > chains
Definition tspgraph.h:56
AdjacencyMatrix matrix
Definition tspgraph.h:53
double evaluation
Definition tspgraph.h:54

Member Data Documentation

◆ chains

std::map<std::size_t, std::size_t> math::TSPNode::chains

◆ evaluation

double math::TSPNode::evaluation

◆ matrix

AdjacencyMatrix math::TSPNode::matrix

◆ path

std::vector<Edge> math::TSPNode::path

◆ with_edge

std::shared_ptr<TSPNode> math::TSPNode::with_edge = nullptr

◆ without_edge

std::shared_ptr<TSPNode> math::TSPNode::without_edge = nullptr

The documentation for this struct was generated from the following file: