Details
Graph vertices can be thought of as named memory locations for both inputs and outputs.
Evaluation distinguishes inputs as the set of root vertices not pointed to by any directed edge (sources).
All other vertices reached by following directed edges are considered outputs.
A vertex vi and its edge vivj are both said to precede another vertex vj, if the graph indeed contains edge vivj.
Values (or weights) wi are assigned to vertices vi using rules of the form vi→wi.
Input rules should list vi→wi for all input vertices vi.
If input values are missing from rules, vertex names vi are assumed as values.
If rules includes a rule for an output vertex vi, the associated value is ignored and overwritten upon evaluation.
Function vfun accepts three arguments parallel over index i:
#1 | a list of values wi on all vertices vi preceeding vj |
#2 | a list of edge weights wij for each preceeding edge vivj |
#3 | a list of all preceeding edges vivj |
If
vfun is specified as a symbol
sym (such as
Times or
Plus), then
vfun=sym@@#1&.
Unless the option EdgeWeights is specified, #2=#3.
Optional specification of EdgeWeights → {(vivj)→wij,(vkvl)→wkl,…} may simplify some calculations.
Setting EdgeWeights as above then causes #2=#3/.{(vivj)→wij,(vkvl)→wkl,…}.
Association expr has a primary key "Graph", which should point to a directed acyclic graph.
"VertexWeights" | {} | a list of function values |
"VertexFunction" | Plus | determines how to fold over incoming values |
"EdgeWeights" | {} | weights or phases per graph edge |
The
Association expr is then effectively its own type of expression, which should have a definite evaluation.
Any expr that conforms to the schema outlined above should ultimately be easy to compile for optimized evaluation.
Ultimately,
MultiwayEvaluate returns a complete
Association listing all function values under key "VertexWeights".
The output
Association is certified in the sense that it is locally checkable on every graph vertex.