diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index c192589..3b09155 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -38,6 +38,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou do { double cost = 0; //Add up the cost of the current permutation. + std::cout <<"Rank: " << rank << " Current perm: "; for (int i = 0; i < myPerm.size(); i++) { std::cout << myPerm[i].GetName() << " "; cost += costMatrix[myPerm[i].GetName()][myPerm[i-1].GetName()]; @@ -47,7 +48,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou //Push permutation cost to the localCostVector. localCostVector.push_back(cost); counter++; - } while (std::next_permutation(myPerm.begin()+1, myPerm.end()) && myPerm != nextPerm); + } while (std::next_permutation(myPerm.begin(), myPerm.end()) && myPerm != nextPerm); // //find the lowest and add it to a lowest vector. // auto lowest = std::vector(1,localCostVector[0]);