Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

gplot(::SimpleWeightedGraph) not working #45

Open
smldis opened this issue Feb 18, 2019 · 4 comments
Open

gplot(::SimpleWeightedGraph) not working #45

smldis opened this issue Feb 18, 2019 · 4 comments

Comments

@smldis
Copy link

smldis commented Feb 18, 2019

Hello, is plotting supposed to work?

julia> gplot(G)
ERROR: MethodError: no method matching _src_index(::SimpleWeightedEdge{Int64,Float64}, ::SimpleWeightedGraph{Int64,Float64})```
@caseykneale
Copy link

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

@sbromberger
Copy link
Owner

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
Copy link
Owner

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

@caseykneale
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants