sbromberger / MetaGraphs.jl

I never metagraph I didn't like.
Other
94 stars 24 forks source link

How to create loop graph? #91

Closed zhaoli-IHEP closed 4 years ago

zhaoli-IHEP commented 4 years ago

For example, two edges connecting "same" two vertices, like --O--

g = Graph(4)
add_edge!(g,1,2) # this is okay
add_edge!(g,1,2) # but this will fail

I have checked also MetaGraph, but did not find any information about this.

simonschoelly commented 4 years ago

I think what you probably mean is a multigraph. Currently we do not have any muligraphs in the JuliaGraphs ecosystem.

zhaoli-IHEP commented 4 years ago

I think what you probably mean is a multigraph. Currently we do not have any muligraphs in the JuliaGraphs ecosystem.

Yes. So do I have some other choice in the Julia market? Thanks a lot!

sbromberger commented 4 years ago

So do I have some other choice in the Julia market?

I haven't looked closely, but Graphs.jl might be able to do this.

Failing that, you could always write your own data structure and implement the LightGraphs API for it (11 or so functions). Then all the LightGraphs functionality becomes available to your graph type.

If you go that route, publish it :)

zhaoli-IHEP commented 4 years ago

So do I have some other choice in the Julia market?

I haven't looked closely, but Graphs.jl might be able to do this.

Failing that, you could always write your own data structure and implement the LightGraphs API for it (11 or so functions). Then all the LightGraphs functionality becomes available to your graph type.

If you go that route, publish it :)

Thank you! This is exactly what we need.

sbromberger commented 4 years ago

Closing out since it looks like there's a solution. Thanks.