Module rs_graph::attributed
[−]
[src]
Extend a graph with attributes.
Sometimes one needs additional attributes associated with the nodes or edges of a graph.
The simplest way is to store them in a NodeVec
or EdgeVec
. If
these attributes are tightly related to the graph, it is convenient to store the graph
together with the attributes in a single struct, e.g.
use rs_graph::LinkedListGraph; struct MyGraph { graph: LinkedListGraph, balances: Vec<f64>, bounds: Vec<f64>, }
The problem is that MyGraph
itself does not implement the graph
traits Graph
, Digraph
and so on, and can therefore not used
directly for methods that need values of this type.
The struct Attributed
in this module can be used to automate the
tedious task of implementing the traits.
For a different approach, see the rs-graph-derive
crate.
Structs
Attributed |
Wrapper to attach attributes with a graph. |
AttributedAttrs |
The default implementation of attributes. |
AttributedBuilder |
Default builder for an attributes graph. |
GraphAttrs |
Accessor for graph attributes. |
Traits
AttributedGraph |
An attributed graph. |
AttributedNetwork |
An attributed network. |
Attributes |
This trait provides (mutable) access to the attributes of an attributed graph. |
NetworkAttributes |
This trait provides (mutable) access to the attributes of a network. |