[Snippets/interpolatable] scipy returns numpy arrays; convert them back to list
This commit is contained in:
parent
179b8b5794
commit
5d6995d317
@ -80,9 +80,8 @@ def min_cost_perfect_bipartite_matching(G):
|
||||
try:
|
||||
from scipy.optimize import linear_sum_assignment
|
||||
rows, cols = linear_sum_assignment(G)
|
||||
# This branch untested
|
||||
assert rows == list(range(n))
|
||||
return cols, _matching_cost(G, cols)
|
||||
assert (rows == list(range(n))).all()
|
||||
return list(cols), _matching_cost(G, cols)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user