#graph #dataflow #graph-node #derivation #flow #wolf #input

wolf-derivation-graph

Adds support for memoizing data flow graphs to wolf-graph

1 unstable release

0.1.0 Jan 16, 2025

#1708 in Data structures

Download history 94/week @ 2025-01-11 29/week @ 2025-01-18

123 downloads per month

MIT license

10KB
209 lines

wolf-derivation-graph

By Wolf McNally

MIT License

Status

A work in progress 🚧
Slender stem with fragile buds 🌱
Use at your own risk 🤷🏽‍♂️

Introduction

The wolf-derivation-graph crate provides a graph variant for basic on-demand derivation of values from other values.

It affords constructing a DAG (Directed Acyclic Graph) of values where each value is either set directly on specific input nodes, or derived from one or more other nodes connected by edges.

A graph node can be queried to obtain a value, and the graph will automatically derive the value by recursively evaluating the dependencies. Derived values are memoized, so that once a value is derived, it is stored and reused for subsequent queries.

Changing a value on a node will invalidate the derived values of all nodes that depend on it, causing them to be recomputed the next time they are queried.

Documentation

Currently the best documentation is the unit tests.

Dependencies

~1–1.5MB
~31K SLoC