# Graph vertex and edge attributes

**URL:** <https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234>\
**Category:** Graphs\
**Tags:** graphs\
**Created:** [June 4, 2022, 1:01pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234 "2022-06-04T13:01:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CopyOfA](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@CopyOfA](https://discourse.julialang.org/u/CopyOfA)\
**Post date:** [June 4, 2022, 1:01pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234/1 "2022-06-04T13:01:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [June 4, 2022, 2:35pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234/2 "2022-06-04T14:35:03Z")

</div>

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](https://github.com/JuliaGraphs/MetaGraphsNext.jl), 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!

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [June 4, 2022, 5:37pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234/3 "2022-06-04T17:37:45Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 4, 2022, 5:39pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234/4 "2022-06-04T17:39:24Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [June 4, 2022, 7:06pm UTC](https://discourse.julialang.org/t/graph-vertex-and-edge-attributes/82234/5 "2022-06-04T19:06:29Z")

</div>

In [this post](https://discourse.julialang.org/t/retworkx-new-high-performance-python-graph-library/71109) I offered a specific example of what I mean by “rather poor”.

> [@Retworkx: new, high-performance Python graph library](https://discourse.julialang.org/t/retworkx-new-high-performance-python-graph-library/71109/1):
>
> I could even parse the weights and put them in an Array and be fast. I just could not put them in a graph structure without taking five times longer than (pure-Python) networkx.

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.
