I\'m trying to find minimum element in matrix row, but there are two conditions:
1) it must be > 0
2) and this point must be not visited(is_visited[k] is False)
I\'
If you want to avoid this ValueError in general, you can set a default argument to min(), that will be returned in case of an empty list. See described here.