Expand description

Persistent Graph & related items

A Graph (a well-known data structure!) consists of a set of nodes and a set of edges.

  • Every node is associated with some NodeData (also known as node weight) and has a NodeId
  • Every edge connects one node to another. It has EdgeData (edge weight) and an EdgeId

You get to choose what data you want to store in the NodeData and EdgeData!

Note:

  • The graph is directed. This means that an edge going from node a to node b is not the same as b to a
  • There may be multiple edges for the same from and to nodes.
  • There may be loops: edges which have the same from and to node.

Structs

Edge identifier

Mutable reference to an edge in a Graph

Reference to a directed edge in a Graph

Iterator over edges from a node

Iterator over edges to a node

A directed graph

Iterator over all edges in a Graph

Iterator over all nodes in a Graph

Error: the specified node was not found in the graph

Node identifier

Mutable reference to a node in a Graph

Reference to a node in a Graph