Graph module#
Graph class container.
- class galaxy_graph.graph.Graph(is_directed: bool = True, nodes: set[Node] = <factory>, data: T | None = None)#
Set of nodes.
- add(node: Node[__annotationlib_name_1__]) Node[__annotationlib_name_2__]#
Add an offline Node to this Graph.
- connect(source: Node, connection: Connection[__annotationlib_name_1__], destination: Node) Connection[__annotationlib_name_2__]#
Add two node with a connection quickly.
The two created node and connection will be added to the graph. If the graph of the node is not directed, each node will have the same connection.
Parameters#
- source: Node
First node of the connection. If graph is directed, origin of the arrow
- connection: Connection
Connection linking the first and the second node. This connection must not have been already used in another link.
- destination: Node
Last node of the connection. If graph is directed, pointing of the arrow.