Petgraph: How to modify inner value of Node?

I'm using petgraph crate and I'm using Node struct. In my case, I'm using Node as a wrapper around a custom struct. How can I access the inner value of Node so I can modify it?

Am I missing something, or can you just directly manipulate the weight field?

1 Like

as i understood it, the weight field is just a string that serves as a description of the node, like a comment/tag, rather than giving you access to the actual data in the node

What "actual data"? There's no other data in the nodes, apart from the weight and the edge indexes.

oh! yeah i realize you're right. The weight is actually the inner value. Thanks! :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.