contains_isolated_nodes
¶
Returns True if the graph given by edge_index contains isolated
nodes, i.e. nodes without any edge to another node (self-loops are
ignored).
PyG-named alias of
has_isolated_nodes(), where
num_nodes is optional.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_index
|
array
|
a [2, num_edges] array representing the source and target nodes of each edge |
required |
num_nodes
|
Optional[int]
|
Number of nodes in the graph. Inferred from |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether the graph has isolated nodes. |
Example:
Source code in mlx_graphs/utils/loop.py
from mlx_graphs.utils import contains_isolated_nodes · mlx_graphs/utils/loop.py