Mixed Graph
- class pyagrum.MixedGraph(*args)
MixedGraph represents a graph with both arcs and edges.
- MixedGraph() -> MixedGraph
default constructor
- MixedGraph(src) -> MixedGraph
- Parameters:
src (
pyagrum.MixedGraph) –the MixedGraph to copy
Methods
Add an arc from n1 to n2. |
|
Insert a new edge into the graph. |
|
Add a node by choosing a new NodeId. |
|
Add n nodes. |
|
give the set of nodeid of ancestors of a node |
|
Returns the set of arcs in the graph. |
|
Boundary are neighbours (not oriented), children and parents |
|
Return the chain component containing a given node. |
|
Return the chain components of the graph. |
|
Remove all the nodes and edges from the graph. |
|
Returns the weakly connected components of the mixed graph (following both arcs and undirected edges in both directions). |
|
give the set of nodeid of descendants of a node |
|
Check if the graph is empty. |
|
Check if the graph doesn’t contains arcs. |
|
Check if the graph doesn’t contains edges. |
|
Erase the arc between n1 and n2. |
|
Erase the arcs heading through the node’s children. |
|
Erase the edge between n1 and n2. |
|
Erase all the edges adjacent to a given node. |
|
Erase the node and all the related arcs and edges. |
|
Erase the arcs coming to the node. |
|
Check if an arc exists between n1 and n2. |
|
Check if an edge exists between n1 and n2. |
|
Check if a node with a certain id exists in the graph. |
|
Check if there is an oriented path from node1 to node2 in the mixed graph (following arc directions). |
|
Save the graph as a .jgum (text) or .bgum (binary) file (its class, its nodes with their names, its arcs, edges and marks). |
|
Save the graph as a jgum string (see |
|
Methods inherited from UndiGraph
adjacency matrix from a graph/graphical models |
|
Create a complete undirected graph with n nodes. |
|
number of connected components |
|
connected components as a dict of sets |
|
Check whether a node has an explicitly assigned name. |
|
Checks whether the graph contains cycles. |
|
Check whether two nodes are connected by an undirected path. |
|
Return the id of the node with the given name, or None if no such name exists. |
|
The ids of nodes given by their names, in a container of the same type. |
|
Return the name of a node, or its id as a string if no name was set. |
|
The names of nodes given by their ids, in a container of the same type. |
|
Assign a name to a node. |
|
Return a shortest undirected path between two nodes, or None if no path exists. |
Methods inherited from DiGraph
Return a shortest directed path from node1 to node2, or None if no such path exists. |
|
Return a shortest path from node1 to node2 ignoring arc orientation, or None if no path exists. |
|
Return the family of a node: the node itself plus all its parents. |
|
Check if a directedpath exists between from and to. |
|