sbromberger / SimpleWeightedGraphs.jl

Simple weighted graphs. Requires LightGraphs.jl.
Other
49 stars 22 forks source link

gplot(::SimpleWeightedGraph) not working #45

Open smldis opened 5 years ago

smldis commented 5 years ago

Hello, is plotting supposed to work?


julia> gplot(G)
ERROR: MethodError: no method matching _src_index(::SimpleWeightedEdge{Int64,Float64}, ::SimpleWeightedGraph{Int64,Float64})```
caseykneale commented 4 years ago

Is there a way to convert a weighted graph to a simple graph?

sbromberger commented 4 years ago

Is there a way to convert a weighted graph to a simple graph?

Not sure whether this is related to the original issue, but:

julia> using LightGraphs, SimpleWeightedGraphs

julia> g = Graph(10,20)
{10, 20} undirected simple Int64 graph

julia> s = SimpleWeightedGraph(g, 4.0)
{10, 20} undirected simple Int64 graph with Float64 weights

julia> h = Graph(adjacency_matrix(s))
{10, 20} undirected simple Int64 graph

julia> g == h
true
sbromberger commented 4 years ago

Also, this is probably a better issue for GraphPlot, not for SimplerWeightedGraphs.

caseykneale commented 4 years ago

It's related in the sense that, I can plot the unweighted graph and not the weighted one. So this is a quick work around.

Thank you.