diff --git a/HW10/MakePermutationMatrix.cpp b/HW10/MakePermutationMatrix.cpp index 2b3eb31..c5f3961 100644 --- a/HW10/MakePermutationMatrix.cpp +++ b/HW10/MakePermutationMatrix.cpp @@ -36,7 +36,7 @@ std::vector MakePermutationMatrix::MakePermutation(std::vector sou } std::cout << std::endl; do { - double cost; + double cost = 0; //Add up the cost of the current permutation. for (int i = 1; i < myPerm.size(); i++) { cost += costMatrix[myPerm[i].GetName()][myPerm[i-1].GetName()];