feat: Add travelling salesman problem

This commit is contained in:
Mayank17M
2021-09-11 01:14:05 +05:30
parent 817aff36cd
commit 53cc871bbc

View File

@@ -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;