g = CompleteGraph(3)
w =Dict{Edge,Float64}()
w[Edge(1,2)] = 1
@test_throws ErrorException maximum_weight_matching(g,w)
This throws a MethodError before it reaches the ErrorException:
ERROR: MethodError: no method matching start(::LightGraphs.SimpleGraphs.SimpleEdge{Int64})
This is due to the iteration over a collection of edges as a collection of tuples which is not supported.
maximum_weight_matching.jl (line 31-36)
# put the edge weights in w in the right order to be compatible with edge_list
for (i,j) in keys(w)
if i >= j && !haskey(w, j=>i) # replace i=>j by j=>i if necessary.
w[Edge(j,i)] = w[Edge(i,j)]
end
end
How to reproduce the error:
edges = [LightGraphs.Edge(3,4), LightGraphs.Edge(4,3)]
for (i, j) in edges
println(i)
end
ERROR: MethodError: no method matching start(::LightGraphs.SimpleGraphs.SimpleEdge{Int64})
While running the tests for matching:
This throws a MethodError before it reaches the ErrorException:
This is due to the iteration over a collection of edges as a collection of tuples which is not supported.
maximum_weight_matching.jl (line 31-36)
How to reproduce the error: