# How do I store a data structure at the nodes of a graph from Graphs.jl?

**URL:** https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774
**Category:** Graphs
**Tags:** question, package, graphs
**Created:** [September 4, 2022, 9:16pm UTC](https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774 "2022-09-04T21:16:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cocoa1231](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cocoa1231/32/22215_2.png) [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)
#### Post date: [September 4, 2022, 9:16pm UTC](https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774/1 "2022-09-04T21:16:28Z")

</div>

Say I have a data structure with a “location” (`ComplexF64`) and a value (`Float64`) and I want to associate each node of a `SimpleGraph` from [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) to each node to keep track of connections between nodes. How should I go about this to ensure that methods from the library can act on it? That is to say, how do I implement the `Graphs.SimpleGraphs.AbstractSimpleGraph ` interface?

```julia
struct Node
    loc::ComplexF64
    val::Float64
end

```

---

<div class="post-metadata">

### Author: ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)
#### Post date: [September 4, 2022, 10:57pm UTC](https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774/2 "2022-09-04T22:57:02Z")

</div>

You might have luck with [MetaGraphs](https://github.com/sbromberger/MetaGraphs.jl) or [MetaGraphsNext](https://github.com/JuliaGraphs/MetaGraphsNext.jl) or [MetaDataGraphs](https://github.com/gdalle/MetaDataGraphs.jl)

---

<div class="post-metadata">

### Author: ![cocoa1231](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cocoa1231/32/22215_2.png) [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)
#### Post date: [September 5, 2022, 9:49am UTC](https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774/3 "2022-09-05T09:49:00Z")

</div>

MetaGraphs.jl seems perfect! Thank you so much! I did notice that the last commit on the project was on Nov 3, 2021. Should I be concerned that the project is going to be not maintained in the future and/or will encounter documented bugs that have not been addressed?

Edit: I noticed that MetaGraphsNext.jl is being actively developed. Apologies for the last message. Appreciate the help!

---

<div class="post-metadata">

### Author: ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)
#### Post date: [May 14, 2023, 11:52am UTC](https://discourse.julialang.org/t/how-do-i-store-a-data-structure-at-the-nodes-of-a-graph-from-graphs-jl/86774/4 "2023-05-14T11:52:15Z")

</div>

Note that [MetaDataGraphs](https://github.com/gdalle/MetaDataGraphs.jl) now has a deprecation notice directing users to [MetaGraphsNext.jl](https://github.com/JuliaGraphs/MetaGraphsNext.jl)
