Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] don't treat cost matrix values as an integer
When we enter float value inside cost matrix, "print_matrix" function treats those values as integer, and only prints integral part of the values. For example, if cost matrix is: matrix = [[5.1, 9.6, 1.7], [10.2, 3.5, 2.8], [8.3, 7.4, 4.9]] Then output is as follows: Lowest cost through this matrix: [ 5, 9, 1] [ 10, 3, 2] [ 8, 7, 4] (0, 0) -> 5.1 (1, 1) -> 3.5 (2, 2) -> 4.9 total cost: 13.5 We can see printed cost matrix isn't same as original cost matrix. And it's not always the case, cost matrix would have all values in integral form, cost of the assignment could be a float value. Resolves: bmc#34
- Loading branch information