Graphs

Module

bonobo.structs.graphs

class Graph(*chain)[source]

Bases: object

Represents a directed graph of nodes.

add_chain(*nodes, _input=<Begin>, _output=None, _name=None)[source]

Add a chain in this graph.

add_node(c)[source]

Add a node without connections in this graph and returns its index.

copy()[source]
outputs_of(idx, create=False)[source]

Get a set of the outputs for a given node index.

property graphviz
name = ''
property topologically_sorted_indexes

Iterate in topological order, based on networkx’s topological_sort() function.

class GraphRange(graph, input, output)

Bases: tuple

Create new instance of GraphRange(graph, input, output)

property graph

Alias for field number 0

property input

Alias for field number 1

property output

Alias for field number 2