Libraries for Computational Graphs

Hi,

I have functions that look something like this:

C(x) = A(x) + B(x)
B(x) = 2*A(x)
A(x) = exp(x)

where I’d like to calculate C(x) while only evaluating A(x) once. The actual situation is more complex, e.g. a naive implementation might calculate A(x) hundreds of times.

What libraries are good for this? Some options I’ve seen are Symbolics / ModelingToolKit, NaiveNASLib, or rolling my own (which I’d prefer to avoid) using LightGraphs.

3 Likes

Perhaps https://github.com/JuliaCollections/Memoize.jl

1 Like

Also GitHub - JuliaParallel/Dagger.jl: A framework for out-of-core and parallel execution

Edit: LightGraphs does not offer much help for the computation itself. If used just to keep the graph, one thing to look out for iirc is that it does not seem to order edges in to a vertex so non-commutative operations might fail unexpectedly.

1 Like