-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cost Problem #19
Comments
Hi, could you try to avoid negative costs? Just add 2500.00 or more to your
matrix and retry the computation.
…On Fri, Jan 10, 2020 at 7:33 AM Torres ***@***.***> wrote:
Thank you for your library, it is very fast. But when I calculate this
matrix the result seems like not true.
-625.000 2187.500 -156.25 1000000
-2500.000 1000000 -2500.00 -2500.0
-1015.625 - 1015.625 1000000 1000000
1000000 1000000 1000000 1000000
the answer is x = [2, 3, 1, 0] , y = [3, 2, 0, 1],
But the true result should be x = [0, 2, 1, 3].
The method I used is lapjv(extend_cost=False)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#19?email_source=notifications&email_token=AAAQ55RQ5BSQ2PZHPFWBPM3Q5AJCRA5CNFSM4KFDCXU2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFIFWCQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQ55X3JRSNI5MUX45XNQDQ5AJCRANCNFSM4KFDCXUQ>
.
|
maybe it is not the reason. Actually 1000000 is a large num used to fill np.inf in my case. [ 0.4 1.0 0.5 1000000 By the way, if I use np.inf directly, the result is also wrong. But if using 100,000 to fill np.inf, the result is true. |
It seems to be due to the constant Line 4 in c2b6309
I was able to make the test pass with this change: However, I didn't remove |
The issue here is that for the extension to a square matrix to work, costs are expected to be less than the constant You can preprocess the input cost as follows: from lap import LARGE
cost[np.inf(cost)] = LARGE-1 Ideally |
Thank you for your library, it is very fast. But when I calculate this matrix the result seems like not true.
-625.000 2187.500 -156.25 1000000
-2500.000 1000000 -2500.00 -2500.0
-1015.625 - 1015.625 1000000 1000000
1000000 1000000 1000000 1000000
the answer is x = [2, 3, 1, 0] , y = [3, 2, 0, 1],
But the true result should be x = [0, 2, 1, 3].
The method I used is lapjv(extend_cost=False)
The text was updated successfully, but these errors were encountered: