hrldcpr / pyLAPJV

Jonker-Volgenant / LAPJV algorithm for the linear assignment problem, in Python
51 stars 10 forks source link

Simple example fails. #5

Open Sciss opened 6 years ago

Sciss commented 6 years ago

I'm running the minimalist example from here:

import numpy
import LAPJV
a = numpy.array([[1, 1, 1, 2], [3, 2, 4, 1], [4, 4, 2, 4], [2, 3, 3, 3]])
print LAPJV.lap(a)[1]

This fails with this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: negative dimensions are not allowed

I have converted the C code to Scala, and there it runs, but it produces a sub-optimal cost of 10.0 instead of the expected 6.0. Is this "normal", or should J-V also give optimal cost?