sort_edge_index
¶
sort_edge_index(edge_index: array) -> tuple[array, array]
Sort the edge index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
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. |
required |
Returns:
| Type | Description |
|---|---|
array
|
A tuple containing the sorted edge index and the |
array
|
corresponding sorting indices. |
Source code in mlx_graphs/utils/sorting.py
from mlx_graphs.utils.sorting import sort_edge_index · mlx_graphs/utils/sorting.py