JuliaGraphs / LightGraphsExtras.jl

Additional functionality for LightGraphs.jl
Other
21 stars 13 forks source link

Matching: function signature and type parameters #31

Closed matbesancon closed 6 years ago

matbesancon commented 6 years ago

Some function signatures make the tests of /matching fail.

ERROR: LoadError: LoadError: MethodError: no method matching dict_to_arr(::Int64, ::JuMP.JuMPArray{Float64,1,Tuple{Array{LightGraphs.SimpleGraphs.SimpleEdge{Int64},1}}})
Closest candidates are:
  dict_to_arr(::Int64, !Matched::JuMP.JuMPArray{T<:Real,1,Tuple{Array{LightGraphs.SimpleGraphs.SimpleEdge,1}}}) where T<:Real at /home/mbesancon/.julia/v0.6/LightGraphsExtras/test/../src/matching/maximum_weight_matching.jl:64

Same thing with blossom.jl

ERROR: LoadError: LoadError: MethodError: no method matching minimum_weight_perfect_matching(::LightGraphs.SimpleGraphs.SimpleGraph{Int64}, ::Dict{LightGraphs.SimpleGraphs.SimpleEdge{Int64},Int64})
Closest candidates are:
  minimum_weight_perfect_matching(::LightGraphs.SimpleGraphs.SimpleGraph, !Matched::Dict{LightGraphs.SimpleGraphs.SimpleEdge,T<:AbstractFloat}; tmaxscale) where T<:AbstractFloat at /home/mbesancon/.julia/v0.6/LightGraphsExtras/test/../src/matching/blossomv.jl:34
  minimum_weight_perfect_matching(::LightGraphs.SimpleGraphs.SimpleGraph, !Matched::Dict{LightGraphs.SimpleGraphs.SimpleEdge,T<:Integer}) where T<:Integer at /home/mbesancon/.julia/v0.6/LightGraphsExtras/test/../src/matching/blossomv.jl:54

While fixing this issue, the type parameter syntax could also be updated from f{T <: Number}(t::T) to f(t::T) where T<:Number which is the new official syntax

sbromberger commented 6 years ago

Ugh - ok. Please go ahead and fix this if you have a chance. :)

matbesancon commented 6 years ago

sure I'll give it a try. I guess another PR would make more sense for that, there might be heavy changes

matbesancon commented 6 years ago

Solved by PR #32

sbromberger commented 6 years ago

Thanks for your help with this, @mbesancon. Would you mind trying to split out the matching code into LightGraphsMatching.jl?

matbesancon commented 6 years ago

Yep just did: https://github.com/mbesancon/LightGraphsMatching.jl All tests were transferred and are passing, I guess you can bring it into JuliaGraphs

sbromberger commented 6 years ago

That's fantastic! If you want to move it over to JuliaGraphs and become the maintainer, we can do that.

matbesancon commented 6 years ago

Sure yes. I used the same license as in the other packages of the ecosystem, let me know if it needs modifications. Once it is in JuliaGraphs and all CI badges are modified, we can publish the first release

sbromberger commented 6 years ago

OK, awesome. If you want to initiate the transfer I'll accept and then work with you on permissions.