sort_edge_index_and_features
¶
sort_edge_index_and_features(
edge_index: array, edge_features: array
) -> tuple[array, array]
Sorts the given edge_index and their corresponding features.
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 |
edge_features
|
array
|
An array representing edge features, where each row corresponds to an edge. |
required |
Returns:
| Type | Description |
|---|---|
array
|
A tuple containing the sorted edge index and the |
array
|
corresponding sorted edge features. |
Source code in mlx_graphs/utils/sorting.py
from mlx_graphs.utils.sorting import sort_edge_index_and_features · mlx_graphs/utils/sorting.py