mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-01 01:26:48 +08:00
feat: Add travelling salesman problem
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include <iostream> /// for IO operations
|
||||
#include <limits> /// for limits of integral types
|
||||
#include <vector> /// header for std::vector
|
||||
#define INT_MAX 2147483647 /// define INT_MAX
|
||||
#define max_int 2147483647 /// define INT_MAX
|
||||
|
||||
/**
|
||||
* @namespace graph
|
||||
@@ -50,7 +50,7 @@ int TravellingSalesmanProblem(std::vector<std::vector<int>> *cities, int src,
|
||||
}
|
||||
|
||||
//// store minimum weight Hamiltonian Cycle.
|
||||
int32_t min_path = INT_MAX;
|
||||
int32_t min_path = max_int;
|
||||
do {
|
||||
//// store current Path weight(cost)
|
||||
int32_t curr_weight = 0;
|
||||
|
||||
Reference in New Issue
Block a user