I have a class of computations that seems to naturally take a graph structure. The graph is far from linear, as there are multiple inputs as well as nodes that fan out and nodes that require the result of several other nodes. In all of these computations there are possibly several sinks, too. No cycles are ever present, though. Input nodes are updated (not necessarily one at a time) and I have their values flow through the (at this point purely conceptual) graph. Nodes retain state as inputs change, and the computations have to be running sequentially with respect to the inputs.
As I have to write such computations quite frequently and I am reluctant of writing ad-hoc code each time, I have tried writing a small library to make it easy to piece together such computations by writing classes for the various vertices. My code, however, is fairly inelegant and it does not take any advantage of the parallel structure of these computations. While each vertex is usually lightweight, computations can get quite complex and "wide". To make the problem even more complicated, the inputs for these computations are updated very frequently in a loop. Luckily the problems are of small-enough scale that I can handle them on a single node.
Has anyone ever dealt with anything similar? What ideas/approaches/tools would you recommend?