Graph vertex and edge attributes

I am a newbie to graph analytics in Julia and I am using Graphs.jl for graph analysis. In other libraries (e.g., R’s igraph or Python’s networkx) there is the ability to add attributes to the edges and vertices. However, this ability is apparently not available in Graphs.jl (please correct me if I am wrong). What is the preferred library for performing graph analytics in Julia with edge and vertex attributes? I looked at MetaGraphs.jl and it was last updated in Oct. 2021 to v0.7.1. Any suggestions?

Hi there, and welcome!

I’m not sure how I’d interpret:

“MetaGraphs.jl … was last updated in Oct. 2021 to v0.7.1”

It could be a good thing - the package might be stable and mostly bug-free, and needing only the occasional tweak to nudge it closer to perfection (or version 1.0, whichever is sooner). Or is it a bad thing - the package was abandoned last year, and will slowly bit-rot into disrepair?

I don’t know how I’d interpret commit frequency - is the code a seething morass of issues that require continual maintenance, or designed so well there’s little to be done?

In fact, I think this package is both usable and obsolescent. In my somewhat limited usage, it’s been working well enough. But, in Julia-land, “well enough” isn’t good enough, and there are active efforts in making a better version - MetaGraphsNext, a “type-stable replacement for MetaGraphs”.

The rate of progress in package development is mostly proportional to the number of enthusiastic contributors willing to put some time and effort into reporting issues, reviewing code, running tests, adding documentation, and so on. So I would suggest trying things out, and reporting on your progress!

It could be a good thing - the package might be stable and mostly bug-free,

My guess, also from limited (but still some) experience, is not that MetaGraphs.jl is more-or-less perfected. But, rather that the performance is rather poor. So further development is not worth the effort. That doesn’t mean that MetaGraphs.jl can’t be sufficient for some purposes.

Thanks @cormullion for your answer, which is the right one. As a maintainer of the JuliaGraphs ecosystem, I can confirm that you probably want to try MetaGraphsNext instead.
Unfortunately none of the maintainers have a lot of free time right now, which explains why package updates are slow. However, if you do find a bug, have an API suggestion or need a new feature, feel free to open an issue and we’ll do our best to take a look!

1 Like

In this post I offered a specific example of what I mean by “rather poor”.

For the particular problem I was working on, the more performant of of MetaGraphs and SimpleWeightedGraphs was five times slower than (the famoulsy slow) networkx at reading and building a graph. But, I did not try MetaGraphsNext, and IIUC one of the goals there is better performance. Also, I should reiterate that, 1) if you carry the metadata yourself in another structure, then Graphs.jl is very performant. 2) My experience is very limited, I tried only one problem of one size.