Compare commits
No commits in common. "47479936e07a1d99849c9dfeb57de6d811ffbdc4" and "bed5fb8f2217986fabe2369221a856a9eaa34de3" have entirely different histories.
47479936e0
...
bed5fb8f22
@ -54,20 +54,9 @@ void Graph::PrintGraph(void) {
|
||||
}
|
||||
|
||||
void PrintSolution(std::vector<Vertex*> solution) {
|
||||
int cost = 0;
|
||||
std::cout << "Path: ";
|
||||
Vertex* lastVertex = solution.front();
|
||||
for (Vertex* i : solution) {
|
||||
std::cout << i->nodeNumber << ' ';
|
||||
for (Edge j : lastVertex->edges) {
|
||||
if (j.destination->nodeNumber == i->nodeNumber) {
|
||||
cost += j.weight;
|
||||
}
|
||||
}
|
||||
lastVertex = i;
|
||||
}
|
||||
for (Vertex* i : solution) { std::cout << i->nodeNumber << ' '; }
|
||||
std::cout << std::endl;
|
||||
std::cout << "Cost: " << cost << std::endl;
|
||||
}
|
||||
|
||||
void UCBFS(Graph graph, int start) {
|
||||
|
Loading…
Reference in New Issue
Block a user