I'm trying to solve a simple 4x4 assignment problem using lapjv,
import numpy as npfrom centrosome import lapjvsize=4matrix=np.random.random((size,size))assignment=lapjv.lapjv(size,size,matrix)
but keep getting an error message saying the dimensions of i,j don't match those of the cost matrix even though they do.
Traceback
(most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/centrosome/lapjv.py", line 42, in lapjv
assert len(i) == len(costs), "costs must be the same length as i"
AssertionError: costs must be the same length as i
I'm trying to solve a simple 4x4 assignment problem using lapjv,
import numpy as np
from centrosome import lapjv
size=4
matrix=np.random.random((size,size))
assignment=lapjv.lapjv(size,size,matrix)
but keep getting an error message saying the dimensions of i,j don't match those of the cost matrix even though they do.
What am I missing? I'm using
python 3.7.1 numpy-1.15.4 centrosome 1.1.6