mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-01 09:36:49 +08:00
feat: Add Travelling Salesman Problem
This commit is contained in:
@@ -51,10 +51,10 @@ int TravellingSalesmanProblem(std::vector<std::vector<int>> *cities, int src,
|
||||
}
|
||||
|
||||
//// store minimum weight Hamiltonian Cycle.
|
||||
int min_path = INT_MAX;
|
||||
int32_t min_path = INT_MAX;
|
||||
do {
|
||||
//// store current Path weight(cost)
|
||||
int curr_weight = 0;
|
||||
int32_t curr_weight = 0;
|
||||
|
||||
//// compute current path weight
|
||||
int k = src;
|
||||
|
||||
Reference in New Issue
Block a user