mlx_graphs.utils.topology.is_undirected

Contents

mlx_graphs.utils.topology.is_undirected#

mlx_graphs.utils.topology.is_undirected(edge_index: mlx.core.array, edge_features: mlx.core.array | None = None) bool[source]#

Determines whether a graph is undirected based on the given edge index and optional edge features.

Parameters:
  • edge_index (array) – The edge index of the graph.

  • edge_features (Optional[array]) – Edge features associated with each edge. If provided, the function considers both edge indices and features for the check.

Return type:

bool

Returns:

True if the graph is undirected, False otherwise.