timeflux.core.graph


timeflux.core.graph: handle graphs

graph

class timeflux.core.graph.Graph(graph)[source]

Graph helpers

Initialize graph.

Parameters

graph (dict) – The graph, which structure can be found in test.yaml. Must be an acyclic directed graph. Multiple edges between two nodes are allowed.

See also

build()

build(self)[source]

Build graph.

Returns

A graph object, suitable for computation.

Return type

MultiDiGraph

traverse(self)[source]

Sort nodes in a format suitable for traversal.

Returns

List of node ids and their predecessors.

Return type

list of dicts