DAG#
All basic causal graphs stem from the DAG
class, so feel free to refer to basic
graph operations based on the DAG
class. Other more complicated graph structures,
such as the CPDAG, ADMG, or PAG have the same API and structure, but add on
different types of edges.
Overview#
All causal graphs are subclassed from the following abstract classes. These are provided, so that users may extend the graph classes.
|
|
|
|
|
Copying#
|
Return a copy of the causal graph. |
Compute an adjacency undirected graph. |
Information about nodes and edges#
Name as a string identifier of the graph. |
|
|
Return an iterator over parents of node n. |
|
Return an iterator over children of node n. |
Return successors of node u. |
|
Return predecessors of node u. |
|
Directed edges. |
|
Return the nodes within the DAG. |
|
|
Check if there is any edge between u and v. |
|
Check if graph has edge (u, v). |
|
Check if graph has node 'n'. |
Return number of edges in graph. |
|
Return number of nodes in graph. |
|
|
Return the total number of edges possibly with weights. |
|
Compute the degree of the DiGraph. |
|
Compute the markov blanket of a node. |
Graph modification#
|
Add node to causal graph. |
|
Add nodes to causal graph. |
Remove node in causal graphs. |
|
|
Remove nodes from causal graph. |
|
Remove directed edge. |
|
Remove directed edges. |
|
Add an edge between u and v. |
|
Add directed edges. |
Remove all nodes and edges in graphs. |
|
Remove all edges from causal graph without removing nodes. |
Ordering#
Return the order of the DiGraph. |
Conversion to/from other formats#
|
Convert to 'dot' graph representation as a string. |
Converts causal graphs to networkx. |
|
Convert to a matrix representation. |
|
|