AbstractGraph
experimental.network_dynamics.graph.AbstractGraph()Abstract base class for network topology representations.
Defines the interface for network topology that can be used with dynamics. All graph types (dense, sparse, multilayer, etc.) should inherit from this class.
Note: Subclasses should store immutable properties (n_nodes, sparsity, symmetric) as private fields computed during initialization to avoid issues during pytree transformations where weights might not be available.
Attributes
| Name | Description |
|---|---|
| n_nodes | Number of nodes in the network. |
| region_labels | Labels for each node/region in the network. |
| sparsity | Calculate the sparsity of the graph (fraction of non-zero connections). |
| symmetric | Check if the graph is symmetric (undirected). |
| weights | Weight matrix [n_nodes, n_nodes]. |
Methods
| Name | Description |
|---|---|
| verify | Verify graph structure and properties. |
verify
experimental.network_dynamics.graph.AbstractGraph.verify(verbose=True)Verify graph structure and properties.
Args: verbose: Whether to print verification details
Returns: True if verification passes, False otherwise