mlx_graphs.utils.sorting.sort_edge_index

mlx_graphs.utils.sorting.sort_edge_index#

mlx_graphs.utils.sorting.sort_edge_index(edge_index: mlx.core.array) tuple[mlx.core.array, mlx.core.array][source]#

Sort the edge index.

Parameters:

edge_index (array) – A [2, num_edges] array representing edge indices, where the first row contains source indices and the second row contains target indices.

Return type:

tuple[array, array]

Returns:

A tuple containing the sorted edge index and the corresponding sorting indices.