LightGraphsFlows.jl icon indicating copy to clipboard operation
LightGraphsFlows.jl copied to clipboard

Bug introduced in BoykovKolmogorovAlgorithm

Open juliohm opened this issue 4 years ago • 10 comments
trafficstars

I've implemented this algorithm a long time ago in LightGraphs.jl and it was moved to this separate repository here after some discussion about heavy dependencies. This migration apparently didn't include the tests I had written for this algorithm specifically and now I am using this code in production with a major bug somewhere. Can you please point to the exact commit in LightGraphs.jl where you copied the code and tests?

I appreciate if you can help me fix this quickly, there are people trying to use downstream code as we speak.

juliohm avatar Feb 15 '21 13:02 juliohm

This file in the test suite for example was removed in the migration: https://github.com/JuliaGraphs/LightGraphs.jl/pull/815/files#diff-19895fa77080a2c9ef721245a44d805070debe3f6a94ddc071f5d827f7b4d8e1

juliohm avatar Feb 15 '21 14:02 juliohm

Git Blame shows a few commits on the file:

  1. https://github.com/JuliaGraphs/LightGraphsFlows.jl/commit/328688531ff05372f36a3881127701d61f9d7dc1 (by @matbesancon) which seems to be the original migration commit. @matbesancon can you please confirm that the code was copied from LG.jl without modifications?
  2. https://github.com/JuliaGraphs/LightGraphsFlows.jl/commit/eff807b2197fbf665bbb7178624ef4d4f64fb7d7 (by @simonschoelly) which introduces changes in a few places like replacing unshift! by pushfirst! and ctranspose by adjoint.

I appreciate if you can confirm these changes did not break the original tests in LG.jl

juliohm avatar Feb 15 '21 14:02 juliohm

Perhaps this has to do with the fact that I am using spzeros as the capacity matrix? I will try to investigate it further when I find some time. The adjoint should work fine with sparse matrices too I suppose.

juliohm avatar Feb 15 '21 15:02 juliohm

It looks like this test file: https://github.com/JuliaGraphs/LightGraphsFlows.jl/blob/master/test/boykov_kolmogorov.jl is still here, are you perhaps referring to some other tests?

Also, do you have a simple example where the code fails at the moment?

simonschoelly avatar Feb 19 '21 12:02 simonschoelly

Interesting. Thanks for sharing the test, it is indeed the same one we had in LG.jl. I should have added more tests with less trivial capacity matrices.

I will try to share a reproducible example soon.

juliohm avatar Feb 19 '21 16:02 juliohm

@simonschoelly can you please give me push access so that I can submit a PR directly in the repo without needing to fork?

I have added a couple more tests for the BoykovKolmogorov algorithm.

juliohm avatar Feb 21 '21 01:02 juliohm

I thin @matbesancon should do that, he also just made me admin a few days ago.

But what would be the problem with adding the tests in a fork and then making a pr?

simonschoelly avatar Feb 21 '21 13:02 simonschoelly

But what would be the problem with adding the tests in a fork and then making a pr?

It is just more inconvenient. And since I am a member of JuliaGraphs already and have written some of the algorithms here I think it makes sense to be a member in case I need to help fix something in the future.

juliohm avatar Feb 21 '21 13:02 juliohm

I just checked, I think somebody already made you admin here.

simonschoelly avatar Feb 21 '21 13:02 simonschoelly

just gave you access to make PRs

matbesancon avatar Feb 21 '21 13:02 matbesancon