mlx_graphs.utils.topology.is_directed

Contents

mlx_graphs.utils.topology.is_directed#

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

Determines whether a graph is directed 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 directed, False otherwise.