Repository: TheAlgorithms/C-Plus-Plus
File: bit_manipulation/travelling_salesman_using_bit_manipulation.cpp (C++)

Code before:
/**
 * @file
 * @brief Implementation to
 * [Travelling Salesman problem using bit-masking]
 * (https://www.geeksforgeeks.org/travelling-salesman-problem-set-1/)
 *
 * @details
 * Given the distance/cost(as and adjacency matrix) between each city/node to the other city/node ,
 * the problem is to find the shortest possible route that visits every city exactly once
 * and returns to the starting point or we can say the minimum cost of whole tour.
 *
 * Explanation:
 *  INPUT -> You are given with a adjacency matrix A = {} which contains the distance between two cities/node.
 *
 *  OUTPUT ->  Minimum cost of whole tour from starting point
 *
 * Worst Case Time Complexity: O(n^2 * 2^n)
 * Space complexity: O(n)
 * @author [Utkarsh Yadav](https://github.com/Rytnix)
 */
#include <algorithm>
#include <cassert>   /// for assert
#include <iostream>  /// for IO operations
#include <vector>   // for vector lib.
#include <limits>  // for min func.

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace travellingSalesman_bitmanipulation
 * @brief Functions for the [Travelling Salesman
 * Bitmask](https://www.geeksforgeeks.org/travelling-salesman-problem-set-1/)
 * implementation
 */
namespace travelling_salesman_using_bit_manipulation {
/**
 * @brief The function implements travellingSalesman using bitmanipulation
 * @param dist is the cost to reach between two cities/nodes
 * @param setOfCitites represents the city in bit form.\
 * @param city is taken to track the current city movement.
 * @param n is the no of citys .
 * @param dp vector is used to keep a record of state to avoid the recomputation.
 * @returns minimum cost of traversing whole nodes/cities from starting point back to starting point
 */
std::uint64_t travelling_salesman_using_bit_manipulation(std::vector<std::vector<uint32_t>> dist,  // dist is the adjacency matrix containing the distance.
        // setOfCities as a bit represent the cities/nodes. Ex: if setOfCities = 2 => 0010(in binary)
        // means representing the city/node B if city/nodes are represented as D->C->B->A.

Review comment (suggestion):
```suggestion
#include <cassert>   /// for assert
#include <iostream>  /// for IO operations
#include <vector>   /// for std::vector
#include <limits>  /// for std::min
```


Code after:
/**
 * @file
 * @brief Implementation to
 * [Travelling Salesman problem using bit-masking]
 * (https://www.geeksforgeeks.org/travelling-salesman-problem-set-1/)
 *
 * @details
 * Given the distance/cost(as and adjacency matrix) between each city/node to the other city/node ,
 * the problem is to find the shortest possible route that visits every city exactly once
 * and returns to the starting point or we can say the minimum cost of whole tour.
 *
 * Explanation:
 *  INPUT -> You are given with a adjacency matrix A = {} which contains the distance between two cities/node.
 *
 *  OUTPUT ->  Minimum cost of whole tour from starting point
 *
 * Worst Case Time Complexity: O(n^2 * 2^n)
 * Space complexity: O(n)
 * @author [Utkarsh Yadav](https://github.com/Rytnix)
 */
#include <algorithm>   /// for std::min
#include <cassert>    /// for assert
#include <iostream>  /// for IO operations
#include <vector>   /// for std::vector 
#include <limits>  /// for limits of integral types

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace travellingSalesman_bitmanipulation
 * @brief Functions for the [Travelling Salesman
 * Bitmask](https://www.geeksforgeeks.org/travelling-salesman-problem-set-1/)
 * implementation
 */
namespace travelling_salesman_using_bit_manipulation {
/**
 * @brief The function implements travellingSalesman using bitmanipulation
 * @param dist is the cost to reach between two cities/nodes
 * @param setOfCitites represents the city in bit form.\
 * @param city is taken to track the current city movement.
 * @param n is the no of citys .
 * @param dp vector is used to keep a record of state to avoid the recomputation.
 * @returns minimum cost of traversing whole nodes/cities from starting point back to starting point
 */
std::uint64_t travelling_salesman_using_bit_manipulation(std::vector<std::vector<uint32_t>> dist,  // dist is the adjacency matrix containing the distance.
        // setOfCities as a bit represent the cities/nodes. Ex: if setOfCities = 2 => 0010(in binary)
        // means representing the city/node B if city/nodes are represented as D->C->B->A.