graph¶
Graph module.
-
class
InteractionNode
(type_name, number_of_ingoing_edges, number_of_outgoing_edges)[source]¶ Bases:
object
Struct-like definition of an interaction node.
-
class
StateTransitionGraph
[source]¶ Bases:
object
Graph class that contains edges and nodes.
Similar to feynman graphs. The graphs are directed, meaning the edges are ingoing and outgoing to specific nodes (since feynman graphs also have a time axis) This class can contain the full information of a state transition from a initial state to a final state. This information can be attached to the nodes and edges via properties.
-
add_node
(node_id)[source]¶ Adds a node with id node_id.
- Raises
ValueError – if node_id already exists
-
attach_edges_to_node_ingoing
(ingoing_edge_ids, node_id)[source]¶ Attach existing edges to nodes.
So that the are ingoing to these nodes.
- Parameters
- Raises
ValueError – if an edge not doesn’t exist.
ValueError – if an edge ID is already an ingoing node.
-